Skip to content

Commit

Permalink
libsigc++ forces C++11 support, fixed some valgrind issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
ahlstromcj committed Oct 3, 2015
1 parent fd5e287 commit 30ae284
Show file tree
Hide file tree
Showing 12 changed files with 138 additions and 79 deletions.
9 changes: 7 additions & 2 deletions configure.ac
Expand Up @@ -6,7 +6,7 @@ dnl \file configure.ac
dnl \library sequencer64
dnl \author Chris Ahlstrom
dnl \date 2015-09-11
dnl \update 2015-09-20
dnl \update 2015-10-02
dnl \version $Revision$
dnl \license $XPC_SUITE_GPL_LICENSE$
dnl
Expand Down Expand Up @@ -454,9 +454,14 @@ WARNINGS_DISABLED="-Wno-unused-parameter -Wno-non-virtual-dtor"

dnl We added -std=c++11 for g++ 4.8, and -Wno-deprecated-declarations to
dnl stop g++ 5.2 from griping about usage of std::auto_ptr<>.
dnl
dnl 2015-10-02: After a Debian Sid update, the configfile module wouldn't
dnl compile because, we think, the sigc++ now required C++11 support.
dnl So we put that requiremet back, and had to fix some issues with
dnl conditional compilation.

CFLAGS="$CFLAGS $COMMONFLAGS"
CXXFLAGS="$CFLAGS -Wno-variadic-macros -Wno-deprecated-declarations"
CXXFLAGS="$CFLAGS -std=c++11 -Wno-variadic-macros -Wno-deprecated-declarations"

AC_CONFIG_FILES([
Makefile
Expand Down
Binary file modified doc/reference_manual.pdf
Binary file not shown.
66 changes: 33 additions & 33 deletions libseq64/include/keys_perform.hpp
Expand Up @@ -28,10 +28,9 @@
* \library sequencer64 application
* \author Chris Ahlstrom
* \date 2015-09-13
* \updates 2015-09-19
* \updates 2015-10-02
* \license GNU GPLv2 or above
*
* This class has way too many members.
*/

#include <map> // std::map
Expand All @@ -46,22 +45,22 @@ namespace seq64

struct keys_perform_transfer
{
unsigned int kpt_bpm_up;
unsigned int kpt_bpm_dn;
unsigned int kpt_screenset_up;
unsigned int kpt_screenset_dn;
unsigned int kpt_set_playing_screenset;
unsigned int kpt_group_on;
unsigned int kpt_group_off;
unsigned int kpt_group_learn;
unsigned int kpt_replace;
unsigned int kpt_queue;
unsigned int kpt_keep_queue;
unsigned int kpt_snapshot_1;
unsigned int kpt_snapshot_2;
bool kpt_show_ui_sequence_key;
unsigned int kpt_start;
unsigned int kpt_stop;
unsigned int kpt_bpm_up;
unsigned int kpt_bpm_dn;
unsigned int kpt_screenset_up;
unsigned int kpt_screenset_dn;
unsigned int kpt_set_playing_screenset;
unsigned int kpt_group_on;
unsigned int kpt_group_off;
unsigned int kpt_group_learn;
unsigned int kpt_replace;
unsigned int kpt_queue;
unsigned int kpt_keep_queue;
unsigned int kpt_snapshot_1;
unsigned int kpt_snapshot_2;
unsigned int kpt_start;
unsigned int kpt_stop;
bool kpt_show_ui_sequence_key;
};

/**
Expand Down Expand Up @@ -131,6 +130,7 @@ class keys_perform
unsigned int m_key_group_learn;
unsigned int m_key_start;
unsigned int m_key_stop;
bool m_key_show_ui_sequence_key;

public:

Expand Down Expand Up @@ -275,6 +275,21 @@ class keys_perform
m_key_stop = x;
}

/**
* \accessor m_key_show_ui_sequency_key
*
* Used in mainwid, options, optionsfile, userfile, and perform.
*/

bool show_ui_sequence_key () const
{
return m_key_show_ui_sequence_key;
}
void show_ui_sequence_key (bool flag)
{
m_key_show_ui_sequence_key = flag;
}

SlotMap & get_key_events ()
{
return m_key_events;
Expand All @@ -293,21 +308,6 @@ class keys_perform
return m_key_groups_rev;
}

/**
* \accessor m_show_ui_sequency_key
*
* Used in mainwid, options, optionsfile, userfile, and perform.
*/

bool show_ui_sequence_key () const
{
return m_show_ui_sequence_key;
}
void show_ui_sequence_key (bool flag)
{
m_show_ui_sequence_key = flag;
}

/*
* Getters of keyboard mapping for sequence and groups.
* If not found, returns something "safe" [so use get_key()->count()
Expand Down
12 changes: 9 additions & 3 deletions libseq64/include/perform.hpp
Expand Up @@ -65,6 +65,12 @@
#define PREFKEY(x) perf().keys().x()
#define PREFKEY_ADDR(x) perf().keys().at_##x()

/**
* Used in the options module to indicate a "key-labels-on-sequence" setting.
*/

#define PERFORM_KEY_LABELS_ON_SEQUENCE 9999

namespace seq64
{

Expand Down Expand Up @@ -96,8 +102,6 @@ class midi_control
*
* I think the reason for that value is to perhaps handle two sets or
* something like that. Will figure it out later.
*
* These values would be better off in an enumeration.
*/

const int c_midi_track_ctrl = c_seqs_in_set * 2;
Expand Down Expand Up @@ -257,6 +261,7 @@ class perform
int m_offset;
int m_control_status;
int m_screen_set;
int m_sequence_max;

condition_var m_condition_var;

Expand Down Expand Up @@ -749,7 +754,8 @@ class perform
return result;
}

void sequence_key (int seq); // encapsulation
void sequence_key (int seq); // encapsulation
void set_input_bus (int bus, bool input_active); // used in options
bool do_key_event (const keystroke & k);

private:
Expand Down
6 changes: 5 additions & 1 deletion libseq64/src/event_list.cpp
Expand Up @@ -25,7 +25,7 @@
* \library sequencer64 application
* \author Seq24 team; modifications by Chris Ahlstrom
* \date 2015-09-19
* \updates 2015-09-20
* \updates 2015-10-02
* \license GNU GPLv2 or above
*
*/
Expand Down Expand Up @@ -159,7 +159,11 @@ event_list::add (const event & e, bool postsort)

#ifdef USE_EVENT_MAP
event_key key(e);
#if __cplusplus >= 201103L
EventsPair p = std::make_pair(key, e);
#else
EventsPair p = std::make_pair<event_key, event>(key, e);
#endif
m_events.insert(p);
#else
m_events.push_front(e);
Expand Down
5 changes: 4 additions & 1 deletion libseq64/src/keys_perform.cpp
Expand Up @@ -61,7 +61,8 @@ keys_perform::keys_perform ()
m_key_group_off (GDK_KEY_apostrophe), // a repeat
m_key_group_learn (GDK_KEY_Insert),
m_key_start (GDK_KEY_space),
m_key_stop (GDK_KEY_Escape)
m_key_stop (GDK_KEY_Escape),
m_key_show_ui_sequence_key (false)
{
// set_all_key_events();
// set_all_key_groups();
Expand Down Expand Up @@ -100,6 +101,7 @@ keys_perform::set_keys (const keys_perform_transfer & kpt)
m_key_group_learn = kpt.kpt_group_learn;
m_key_start = kpt.kpt_start;
m_key_stop = kpt.kpt_stop;
m_key_show_ui_sequence_key = kpt.kpt_show_ui_sequence_key;
}

/**
Expand All @@ -124,6 +126,7 @@ keys_perform::get_keys (keys_perform_transfer & kpt)
kpt.kpt_group_learn = m_key_group_learn;
kpt.kpt_start = m_key_start;
kpt.kpt_stop = m_key_stop;
kpt.kpt_show_ui_sequence_key = m_key_show_ui_sequence_key;
}

/**
Expand Down
15 changes: 12 additions & 3 deletions libseq64/src/mastermidibus.cpp
Expand Up @@ -85,10 +85,14 @@ mastermidibus::mastermidibus ()
}

#ifdef SEQ64_HAVE_LIBASOUND
/* open the sequencer client */

int result = snd_seq_open(&m_alsa_seq, "default", SND_SEQ_OPEN_DUPLEX, 0);
if (result < 0)
/*
* Open the sequencer client. This line of code results in a loss of
* 4 bytes somewhere in snd_seq_open(), as discovered via valgrind.
*/

int result = snd_seq_open(&m_alsa_seq, "default", SND_SEQ_OPEN_DUPLEX, 0);
if (result < 0)
{
errprint("snd_seq_open() error");
exit(1);
Expand Down Expand Up @@ -130,6 +134,11 @@ mastermidibus::~mastermidibus ()
snd_seq_free_queue(m_alsa_seq, m_queue);
snd_seq_close(m_alsa_seq); /* close client */
#endif
if (not_nullptr(m_poll_descriptors))
{
delete [] m_poll_descriptors;
m_poll_descriptors = nullptr;
}
}

/**
Expand Down
2 changes: 1 addition & 1 deletion libseq64/src/optionsfile.cpp
Expand Up @@ -27,7 +27,7 @@
* \library sequencer64 application
* \author Seq24 team; modifications by Chris Ahlstrom
* \date 2015-07-24
* \updates 2015-09-28
* \updates 2015-10-02
* \license GNU GPLv2 or above
*
* The <tt> ~/.seq24rc </tt>
Expand Down

0 comments on commit 30ae284

Please sign in to comment.