diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2010-09-17 16:24:22 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2010-09-17 16:24:22 +0000 |
commit | 10bdce85a0e7381d1b5db38e3640600c6fd3ec79 (patch) | |
tree | 5e6fd6a2e69e972ada31018cbe6761e5ec5c77a7 /libs/ardour/midi_region.cc | |
parent | e84c3fe5552bc5cf2ed23812c41e7e3b19fbdb84 (diff) |
megaopus commit: (1) add __STD_(LIMIT|FORMAT)_MACROS to command line flags for cc and c++ builds, remove them from source (2) add new Property::midi_data used by MidiRegion to signal that its (MIDI) contents have changed (3) massive switch from nframes_t to framepos_t/framecnt_t including removal of ARDOUR::max_frames (replaced by ARDOUR::max_frame{pos,cnt} (lots more to do but this set was driven by changes to the Diskstream API to use framepos_t
git-svn-id: svn://localhost/ardour2/branches/3.0@7791 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/midi_region.cc')
-rw-r--r-- | libs/ardour/midi_region.cc | 47 |
1 files changed, 40 insertions, 7 deletions
diff --git a/libs/ardour/midi_region.cc b/libs/ardour/midi_region.cc index ae93a77445..ffb5217137 100644 --- a/libs/ardour/midi_region.cc +++ b/libs/ardour/midi_region.cc @@ -47,10 +47,31 @@ using namespace std; using namespace ARDOUR; using namespace PBD; +namespace ARDOUR { + namespace Properties { + PBD::PropertyDescriptor<void*> midi_data; + } +} + +void +MidiRegion::make_property_quarks () +{ + Properties::midi_data.property_id = g_quark_from_static_string (X_("midi-data")); + DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for midi-data = %1\n", Properties::midi_data.property_id)); +} + +void +MidiRegion::register_properties () +{ + /* none yet, but its only a matter of time */ +} + /* Basic MidiRegion constructor (many channels) */ MidiRegion::MidiRegion (const SourceList& srcs) : Region (srcs) { + register_properties (); + // midi_source(0)->Switched.connect_same_thread (*this, boost::bind (&MidiRegion::switch_source, this, _1)); midi_source(0)->ModelChanged.connect_same_thread (_source_connection, boost::bind (&MidiRegion::model_changed, this)); model_changed (); @@ -62,6 +83,8 @@ MidiRegion::MidiRegion (const SourceList& srcs) MidiRegion::MidiRegion (boost::shared_ptr<const MidiRegion> other, frameoffset_t offset, bool offset_relative) : Region (other, offset, offset_relative) { + register_properties (); + assert(_name.val().find("/") == string::npos); // midi_source(0)->Switched.connect_same_thread (*this, boost::bind (&MidiRegion::switch_source, this, _1)); midi_source(0)->ModelChanged.connect_same_thread (_source_connection, boost::bind (&MidiRegion::model_changed, this)); @@ -155,13 +178,14 @@ MidiRegion::_read_at (const SourceList& /*srcs*/, Evoral::EventSink<nframes_t>& boost::shared_ptr<MidiSource> src = midi_source(chan_n); src->set_note_mode(mode); - - /*cerr << "MR read @ " << position << " * " << to_read - << " _position = " << _position - << " _start = " << _start - << " offset = " << output_buffer_position - << " intoffset = " << internal_offset - << endl;*/ + + /* + cerr << "MR read @ " << position << " * " << to_read + << " _position = " << _position + << " _start = " << _start + << " intoffset = " << internal_offset + << endl; + */ /* This call reads events from a source and writes them to `dst' timed in session frames */ @@ -281,6 +305,15 @@ MidiRegion::model_changed () midi_source()->AutomationStateChanged.connect_same_thread ( _model_connection, boost::bind (&MidiRegion::model_automation_state_changed, this, _1) ); + + model()->ContentsChanged.connect_same_thread ( + _model_contents_connection, boost::bind (&MidiRegion::model_contents_changed, this)); +} + +void +MidiRegion::model_contents_changed () +{ + send_change (PropertyChange (Properties::midi_data)); } void |