}
}
-void
-MidiRegionView::switch_source(boost::shared_ptr<Source> src)
-{
- boost::shared_ptr<MidiSource> msrc = boost::dynamic_pointer_cast<MidiSource>(src);
- if (msrc)
- display_model(msrc->model());
-}
-
void
MidiRegionView::set_frame_color()
{
bool play_midi_note_off(boost::shared_ptr<NoteType> note);
void clear_events();
- void switch_source(boost::shared_ptr<ARDOUR::Source> src);
bool canvas_event(GdkEvent* ev);
bool note_canvas_event(GdkEvent* ev);
void set_position_internal (framepos_t pos, bool allow_bbt_recompute);
- void switch_source(boost::shared_ptr<Source> source);
void model_changed ();
void model_automation_state_changed (Evoral::Parameter const &);
void model_contents_changed ();
virtual bool length_mutable() const { return false; }
static PBD::Signal1<void,Source*> SourceCreated;
- PBD::Signal1<void,boost::shared_ptr<Source> > Switched;
bool has_been_analysed() const;
virtual bool can_be_analysed() const { return false; }
{
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 ();
assert(_name.val().find("/") == string::npos);
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));
model_changed ();
}
return boost::dynamic_pointer_cast<MidiSource>(source(n));
}
-
-void
-MidiRegion::switch_source(boost::shared_ptr<Source> src)
-{
- _source_connection.disconnect ();
-
- boost::shared_ptr<MidiSource> msrc = boost::dynamic_pointer_cast<MidiSource>(src);
- if (!msrc) {
- return;
- }
-
- // MIDI regions have only one source
- SourceList srcs;
- srcs.push_back (msrc);
-
- drop_sources ();
- use_sources (srcs);
-
- set_name (msrc->name());
-
- msrc->ModelChanged.connect_same_thread (_source_connection, boost::bind (&MidiRegion::model_changed, this));
-}
-
void
MidiRegion::model_changed ()
{