add new properties for musical mode & root
This commit is contained in:
parent
4648785935
commit
1793c9a61a
|
@ -30,6 +30,11 @@
|
|||
namespace ARDOUR
|
||||
{
|
||||
|
||||
namespace Properties {
|
||||
LIBARDOUR_API extern PBD::PropertyDescriptor<MusicalKey::Type> musical_mode;
|
||||
LIBARDOUR_API extern PBD::PropertyDescriptor<int> musical_root;
|
||||
}
|
||||
|
||||
class InterThreadInfo;
|
||||
class MidiPlaylist;
|
||||
class RouteGroup;
|
||||
|
@ -44,6 +49,8 @@ public:
|
|||
|
||||
int init ();
|
||||
|
||||
static void make_property_quarks ();
|
||||
|
||||
void realtime_locate (bool);
|
||||
void non_realtime_locate (samplepos_t);
|
||||
|
||||
|
|
|
@ -108,6 +108,7 @@
|
|||
#include "ardour/filesystem_paths.h"
|
||||
#include "ardour/midi_patch_manager.h"
|
||||
#include "ardour/midi_region.h"
|
||||
#include "ardour/midi_track.h"
|
||||
#include "ardour/midi_ui.h"
|
||||
#include "ardour/midiport_manager.h"
|
||||
#include "ardour/mix.h"
|
||||
|
@ -563,6 +564,7 @@ ARDOUR::init (bool try_optimization, const char* localedir, bool with_gui)
|
|||
PresentationInfo::make_property_quarks ();
|
||||
TransportMaster::make_property_quarks ();
|
||||
Trigger::make_property_quarks ();
|
||||
MidiTrack::make_property_quarks ();
|
||||
|
||||
/* this is a useful ready to use PropertyChange that many
|
||||
things need to check. This avoids having to compose
|
||||
|
|
|
@ -72,12 +72,27 @@ class InterThreadInfo;
|
|||
class MidiSource;
|
||||
class Region;
|
||||
class SMFSource;
|
||||
|
||||
|
||||
namespace Properties {
|
||||
PBD::PropertyDescriptor<MusicalMode::Type> musical_mode;
|
||||
PBD::PropertyDescriptor<int> musical_root;
|
||||
}
|
||||
}
|
||||
|
||||
using namespace std;
|
||||
using namespace ARDOUR;
|
||||
using namespace PBD;
|
||||
|
||||
void
|
||||
MidiTrack::make_property_quarks ()
|
||||
{
|
||||
Properties::musical_mode.property_id = g_quark_from_static_string (X_("musical-mode"));
|
||||
DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for musical-mode = %1\n", Properties::musical_mode.property_id));
|
||||
Properties::musical_root.property_id = g_quark_from_static_string (X_("musical-root"));
|
||||
DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for musical-root = %1\n", Properties::musical_root.property_id));
|
||||
}
|
||||
|
||||
MidiTrack::MidiTrack (Session& sess, string name, TrackMode mode)
|
||||
: Track (sess, name, PresentationInfo::MidiTrack, mode, DataType::MIDI)
|
||||
, _immediate_events(6096) // FIXME: size?
|
||||
|
@ -138,6 +153,13 @@ void
|
|||
MidiTrack::set_key (MusicalKey const & k)
|
||||
{
|
||||
_key = k;
|
||||
|
||||
PropertyChange pc;
|
||||
|
||||
pc.add (Properties::musical_mode);
|
||||
pc.add (Properties::musical_root);
|
||||
|
||||
PropertyChanged (pc); /* EMIT SIGNAL */
|
||||
}
|
||||
|
||||
void
|
||||
|
|
Loading…
Reference in New Issue