From d357eca668044badcb4bab318e2e74cfffa9a0b0 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 19 Sep 2008 00:47:49 +0000 Subject: Factor out sequencing related things into an independant new library: "evoral". Anything related to the storage of events/values over a range of time lives in evoral. This includes MidiModel (Evoral::Sequence) and automation data (AutomationList (Evoral::ControlList), Automatable (Evoral::ControlSet), etc). libs/evoral synced with http://svn.drobilla.net/lad/trunk/evoral r1511. git-svn-id: svn://localhost/ardour2/branches/3.0@3754 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/SConscript | 1 + gtk2_ardour/audio_time_axis.cc | 2 +- gtk2_ardour/automation_controller.cc | 17 ++++++++++------- gtk2_ardour/automation_controller.h | 2 +- gtk2_ardour/automation_line.cc | 4 ++-- gtk2_ardour/automation_line.h | 2 +- gtk2_ardour/automation_region_view.cc | 2 +- gtk2_ardour/automation_selection.h | 2 +- gtk2_ardour/automation_streamview.cc | 6 ++++-- gtk2_ardour/automation_time_axis.cc | 28 ++++++++++++---------------- gtk2_ardour/canvas-hit.h | 2 +- gtk2_ardour/canvas-note-event.cc | 2 +- gtk2_ardour/canvas-note-event.h | 6 +++--- gtk2_ardour/canvas-note.cc | 2 +- gtk2_ardour/canvas-note.h | 2 +- gtk2_ardour/canvas-program-change.cc | 2 +- gtk2_ardour/canvas-program-change.h | 4 ++-- gtk2_ardour/crossfade_edit.cc | 14 +++++++------- gtk2_ardour/curvetest.cc | 3 ++- gtk2_ardour/gain_meter.cc | 21 +++++++++++---------- gtk2_ardour/generic_pluginui.cc | 12 ++++++++---- gtk2_ardour/midi_region_view.cc | 23 ++++++++++++----------- gtk2_ardour/midi_region_view.h | 8 ++++---- gtk2_ardour/midi_streamview.cc | 2 +- gtk2_ardour/midi_time_axis.cc | 10 +++++----- gtk2_ardour/mixer_strip.cc | 6 +++--- gtk2_ardour/panner_ui.cc | 4 ++-- gtk2_ardour/route_time_axis.cc | 7 ++++--- gtk2_ardour/route_ui.cc | 4 ++-- gtk2_ardour/selection.cc | 19 +++++++++++++------ gtk2_ardour/selection.h | 10 +++++++--- 31 files changed, 125 insertions(+), 104 deletions(-) (limited to 'gtk2_ardour') diff --git a/gtk2_ardour/SConscript b/gtk2_ardour/SConscript index bffb28e66a..009b2f6702 100644 --- a/gtk2_ardour/SConscript +++ b/gtk2_ardour/SConscript @@ -48,6 +48,7 @@ gtkardour.Merge ([ libraries['libgnomecanvasmm'], libraries['lrdf'], libraries['midi++2'], + libraries['evoral'], libraries['pangomm'], libraries['pbd'], libraries['samplerate'], diff --git a/gtk2_ardour/audio_time_axis.cc b/gtk2_ardour/audio_time_axis.cc index 124c639367..8c77da3443 100644 --- a/gtk2_ardour/audio_time_axis.cc +++ b/gtk2_ardour/audio_time_axis.cc @@ -345,7 +345,7 @@ AudioTimeAxisView::create_automation_child (Parameter param, bool show) update_pans (show); } else { - error << "AudioTimeAxisView: unknown automation child " << param.to_string() << endmsg; + error << "AudioTimeAxisView: unknown automation child " << param.symbol() << endmsg; } } diff --git a/gtk2_ardour/automation_controller.cc b/gtk2_ardour/automation_controller.cc index 0bf1482224..dc9b8bb2c4 100644 --- a/gtk2_ardour/automation_controller.cc +++ b/gtk2_ardour/automation_controller.cc @@ -61,12 +61,15 @@ AutomationController::~AutomationController() } boost::shared_ptr -AutomationController::create(boost::shared_ptr parent, boost::shared_ptr al, boost::shared_ptr ac) +AutomationController::create( + boost::shared_ptr parent, + boost::shared_ptr cl, + boost::shared_ptr ac) { - Gtk::Adjustment* adjustment = manage(new Gtk::Adjustment(al->default_value(), al->get_min_y(), al->get_max_y())); + Gtk::Adjustment* adjustment = manage(new Gtk::Adjustment(cl->default_value(), cl->get_min_y(), cl->get_max_y())); if (!ac) { - PBD::warning << "Creating AutomationController for " << al->parameter().to_string() << endmsg; - ac = parent->control_factory(al); + PBD::warning << "Creating AutomationController for " << cl->parameter().symbol() << endmsg; + ac = boost::dynamic_pointer_cast(parent->control_factory(cl)); } return boost::shared_ptr(new AutomationController(ac, adjustment)); } @@ -109,13 +112,13 @@ AutomationController::value_adjusted() void AutomationController::start_touch() { - _controllable->list()->start_touch(); + _controllable->start_touch(); } void AutomationController::end_touch() { - _controllable->list()->stop_touch(); + _controllable->stop_touch(); } void @@ -123,7 +126,7 @@ AutomationController::automation_state_changed () { ENSURE_GUI_THREAD(mem_fun(*this, &AutomationController::automation_state_changed)); - bool x = (_controllable->list()->automation_state() != Off); + bool x = (_controllable->automation_state() != Off); /* start watching automation so that things move */ diff --git a/gtk2_ardour/automation_controller.h b/gtk2_ardour/automation_controller.h index 8a244113c4..0da24b3588 100644 --- a/gtk2_ardour/automation_controller.h +++ b/gtk2_ardour/automation_controller.h @@ -37,7 +37,7 @@ class AutomationController : public Gtkmm2ext::BarController { public: static boost::shared_ptr create( boost::shared_ptr parent, - boost::shared_ptr al, + boost::shared_ptr cl, boost::shared_ptr ac); ~AutomationController(); diff --git a/gtk2_ardour/automation_line.cc b/gtk2_ardour/automation_line.cc index b112a9481e..de3e2d9873 100644 --- a/gtk2_ardour/automation_line.cc +++ b/gtk2_ardour/automation_line.cc @@ -1048,7 +1048,7 @@ AutomationLine::list_changed () } void -AutomationLine::reset_callback (const AutomationList& events) +AutomationLine::reset_callback (const Evoral::ControlList& events) { ALPoints tmp_points; uint32_t npoints = events.size(); @@ -1064,7 +1064,7 @@ AutomationLine::reset_callback (const AutomationList& events) AutomationList::const_iterator ai; - for (ai = events.const_begin(); ai != events.const_end(); ++ai) { + for (ai = events.begin(); ai != events.end(); ++ai) { double translated_y = (*ai)->value; model_to_view_y (translated_y); diff --git a/gtk2_ardour/automation_line.h b/gtk2_ardour/automation_line.h index 9e35903671..ace2145ff3 100644 --- a/gtk2_ardour/automation_line.h +++ b/gtk2_ardour/automation_line.h @@ -165,7 +165,7 @@ class AutomationLine : public sigc::trackable, public PBD::StatefulThingWithGoin virtual void change_model (ARDOUR::AutomationList::iterator, double x, double y); virtual void change_model_range (ARDOUR::AutomationList::iterator,ARDOUR::AutomationList::iterator, double delta, float ydelta); - void reset_callback (const ARDOUR::AutomationList&); + void reset_callback (const Evoral::ControlList&); void list_changed (); virtual bool event_handler (GdkEvent*); diff --git a/gtk2_ardour/automation_region_view.cc b/gtk2_ardour/automation_region_view.cc index 0ba14398e6..00cb8be5c4 100644 --- a/gtk2_ardour/automation_region_view.cc +++ b/gtk2_ardour/automation_region_view.cc @@ -33,7 +33,7 @@ AutomationRegionView::AutomationRegionView(ArdourCanvas::Group* { if (list) { _line = boost::shared_ptr(new AutomationLine( - list->parameter().to_string(), time_axis, *group, list)); + list->parameter().symbol(), time_axis, *group, list)); _line->set_colors(); _line->show(); _line->show_all_control_points(); diff --git a/gtk2_ardour/automation_selection.h b/gtk2_ardour/automation_selection.h index 05063e144e..fb19c0b5e0 100644 --- a/gtk2_ardour/automation_selection.h +++ b/gtk2_ardour/automation_selection.h @@ -26,6 +26,6 @@ namespace ARDOUR { class AutomationList; } -struct AutomationSelection : list {}; +struct AutomationSelection : list< boost::shared_ptr > {}; #endif /* __ardour_gtk_automation_selection_h__ */ diff --git a/gtk2_ardour/automation_streamview.cc b/gtk2_ardour/automation_streamview.cc index 5803d283dc..68da972ba0 100644 --- a/gtk2_ardour/automation_streamview.cc +++ b/gtk2_ardour/automation_streamview.cc @@ -83,11 +83,13 @@ AutomationStreamView::add_region_view_internal (boost::shared_ptr region mr->midi_source()->load_model(); } - const boost::shared_ptr control = region->control(_controller->controllable()->parameter()); + const boost::shared_ptr control + = boost::dynamic_pointer_cast( + region->control(_controller->controllable()->parameter())); boost::shared_ptr list; if (control) - list = control->list(); + list = boost::dynamic_pointer_cast(control->list()); AutomationRegionView *region_view; std::list::iterator i; diff --git a/gtk2_ardour/automation_time_axis.cc b/gtk2_ardour/automation_time_axis.cc index bc371a5826..07a47f274e 100644 --- a/gtk2_ardour/automation_time_axis.cc +++ b/gtk2_ardour/automation_time_axis.cc @@ -208,10 +208,10 @@ AutomationTimeAxisView::AutomationTimeAxisView (Session& s, boost::shared_ptr line(new AutomationLine ( - _control->parameter().to_string(), + _control->parameter().symbol(), *this, *canvas_display, - _control->list())); + _control->alist())); line->set_line_color (ARDOUR_UI::config()->canvasvar_ProcessorAutomationLine.get()); line->queue_reset (); @@ -261,7 +261,7 @@ AutomationTimeAxisView::set_automation_state (AutoState state) state); } - _control->list()->set_automation_state(state); + _control->alist()->set_automation_state(state); } } @@ -276,7 +276,7 @@ AutomationTimeAxisView::automation_state_changed () if (!_line) { state = Off; } else { - state = _control->list()->automation_state (); + state = _control->alist()->automation_state (); } switch (state & (Off|Play|Touch|Write)) { @@ -578,12 +578,12 @@ AutomationTimeAxisView::add_automation_event (ArdourCanvas::Item* item, GdkEvent _line->view_to_model_y (y); _session.begin_reversible_command (_("add automation event")); - XMLNode& before = _control->list()->get_state(); + XMLNode& before = _control->alist()->get_state(); - _control->list()->add (when, y); + _control->alist()->add (when, y); - XMLNode& after = _control->list()->get_state(); - _session.commit_reversible_command (new MementoCommand(*_control->list().get(), &before, &after)); + XMLNode& after = _control->alist()->get_state(); + _session.commit_reversible_command (new MementoCommand(*_control->alist(), &before, &after)); _session.set_dirty (); } @@ -598,7 +598,7 @@ AutomationTimeAxisView::cut_copy_clear (Selection& selection, CutCopyOp op) bool AutomationTimeAxisView::cut_copy_clear_one (AutomationLine& line, Selection& selection, CutCopyOp op) { - AutomationList* what_we_got = 0; + boost::shared_ptr what_we_got; boost::shared_ptr alist (line.the_list()); bool ret = false; @@ -621,8 +621,6 @@ AutomationTimeAxisView::cut_copy_clear_one (AutomationLine& line, Selection& sel case Clear: if ((what_we_got = alist->cut (selection.time.front().start, selection.time.front().end)) != 0) { _session.add_command(new MementoCommand(*alist.get(), &before, &alist->get_state())); - delete what_we_got; - what_we_got = 0; ret = true; } break; @@ -671,7 +669,7 @@ AutomationTimeAxisView::cut_copy_clear_objects (PointSelection& selection, CutCo bool AutomationTimeAxisView::cut_copy_clear_objects_one (AutomationLine& line, PointSelection& selection, CutCopyOp op) { - AutomationList* what_we_got = 0; + boost::shared_ptr what_we_got; boost::shared_ptr alist(line.the_list()); bool ret = false; @@ -700,8 +698,6 @@ AutomationTimeAxisView::cut_copy_clear_objects_one (AutomationLine& line, PointS case Clear: if ((what_we_got = alist->cut ((*i).start, (*i).end)) != 0) { _session.add_command (new MementoCommand(*alist.get(), new XMLNode (before), &alist->get_state())); - delete what_we_got; - what_we_got = 0; ret = true; } break; @@ -822,7 +818,7 @@ AutomationTimeAxisView::add_line (boost::shared_ptr line) assert(!_line); assert(line->the_list() == _control->list()); - automation_connection = _control->list()->automation_state_changed.connect + automation_connection = _control->alist()->automation_state_changed.connect (mem_fun(*this, &AutomationTimeAxisView::automation_state_changed)); _line = line; @@ -884,7 +880,7 @@ AutomationTimeAxisView::set_state (const XMLNode& node) if ((*iter)->name() == state_node_name) { XMLProperty* type = (*iter)->property("automation-id"); - if (type && type->value() == _control->parameter().to_string()) { + if (type && type->value() == _control->parameter().symbol()) { XMLProperty *shown = (*iter)->property("shown_editor"); if (shown && shown->value() == "yes") { diff --git a/gtk2_ardour/canvas-hit.h b/gtk2_ardour/canvas-hit.h index e77ef37380..fa90075a0c 100644 --- a/gtk2_ardour/canvas-hit.h +++ b/gtk2_ardour/canvas-hit.h @@ -33,7 +33,7 @@ public: MidiRegionView& region, Group& group, double size, - const boost::shared_ptr note = boost::shared_ptr()) + const boost::shared_ptr note = boost::shared_ptr()) : Diamond(group, size), CanvasNoteEvent(region, this, note) { diff --git a/gtk2_ardour/canvas-note-event.cc b/gtk2_ardour/canvas-note-event.cc index c370530cfc..1d01554883 100644 --- a/gtk2_ardour/canvas-note-event.cc +++ b/gtk2_ardour/canvas-note-event.cc @@ -32,7 +32,7 @@ namespace Canvas { CanvasNoteEvent::CanvasNoteEvent(MidiRegionView& region, Item* item, - const boost::shared_ptr note) + const boost::shared_ptr note) : _region(region) , _item(item) , _text(0) diff --git a/gtk2_ardour/canvas-note-event.h b/gtk2_ardour/canvas-note-event.h index 776d89160d..9e48db8c24 100644 --- a/gtk2_ardour/canvas-note-event.h +++ b/gtk2_ardour/canvas-note-event.h @@ -49,7 +49,7 @@ public: CanvasNoteEvent( MidiRegionView& region, Item* item, - const boost::shared_ptr note = boost::shared_ptr()); + const boost::shared_ptr note = boost::shared_ptr()); virtual ~CanvasNoteEvent(); @@ -81,7 +81,7 @@ public: virtual double x2() = 0; virtual double y2() = 0; - const boost::shared_ptr note() const { return _note; } + const boost::shared_ptr note() const { return _note; } protected: enum State { None, Pressed, Dragging }; @@ -91,7 +91,7 @@ protected: Text* _text; Widget* _channel_selector_widget; State _state; - const boost::shared_ptr _note; + const boost::shared_ptr _note; bool _own_note; bool _selected; }; diff --git a/gtk2_ardour/canvas-note.cc b/gtk2_ardour/canvas-note.cc index 30b1e3807b..89916dbf4a 100644 --- a/gtk2_ardour/canvas-note.cc +++ b/gtk2_ardour/canvas-note.cc @@ -1,7 +1,7 @@ #include "canvas-note.h" #include "midi_region_view.h" #include "public_editor.h" -#include "ardour/note.h" +#include "evoral/Note.hpp" using namespace ARDOUR; diff --git a/gtk2_ardour/canvas-note.h b/gtk2_ardour/canvas-note.h index 97739b4207..30cbad6c25 100644 --- a/gtk2_ardour/canvas-note.h +++ b/gtk2_ardour/canvas-note.h @@ -55,7 +55,7 @@ public: CanvasNote( MidiRegionView& region, Group& group, - const boost::shared_ptr note = boost::shared_ptr()) + const boost::shared_ptr note = boost::shared_ptr()) : SimpleRect(group), CanvasNoteEvent(region, this, note), _note_state(None) { diff --git a/gtk2_ardour/canvas-program-change.cc b/gtk2_ardour/canvas-program-change.cc index 6f7182e2cd..e5a7768f34 100644 --- a/gtk2_ardour/canvas-program-change.cc +++ b/gtk2_ardour/canvas-program-change.cc @@ -8,7 +8,7 @@ using namespace std; CanvasProgramChange::CanvasProgramChange( MidiRegionView& region, Group& parent, - boost::shared_ptr event, + boost::shared_ptr event, double height, double x, double y) diff --git a/gtk2_ardour/canvas-program-change.h b/gtk2_ardour/canvas-program-change.h index 3ac9b10383..f2a912d506 100644 --- a/gtk2_ardour/canvas-program-change.h +++ b/gtk2_ardour/canvas-program-change.h @@ -19,7 +19,7 @@ public: CanvasProgramChange( MidiRegionView& region, Group& parent, - boost::shared_ptr event, + boost::shared_ptr event, double height, double x = 0.0, double y = 0.0 @@ -29,7 +29,7 @@ public: private: MidiRegionView& _region; - boost::shared_ptr _event; + boost::shared_ptr _event; Text* _text; SimpleLine* _line; SimpleRect* _rect; diff --git a/gtk2_ardour/crossfade_edit.cc b/gtk2_ardour/crossfade_edit.cc index 82869af396..80b6224bd3 100644 --- a/gtk2_ardour/crossfade_edit.cc +++ b/gtk2_ardour/crossfade_edit.cc @@ -65,8 +65,8 @@ CrossfadeEditor::Presets* CrossfadeEditor::fade_out_presets = 0; CrossfadeEditor::Half::Half () : line (0), - normative_curve (Parameter(GainAutomation), 0.0, 1.0, 1.0), // FIXME: GainAutomation? - gain_curve (Parameter(GainAutomation), 0.0, 2.0, 1.0) + normative_curve (Parameter(GainAutomation, 0.0, 1.0, 1.0)), // FIXME: GainAutomation? + gain_curve (Parameter(GainAutomation)) { } @@ -343,13 +343,13 @@ CrossfadeEditor::set (const ARDOUR::AutomationList& curve, WhichFade which) goto out; } - the_end = curve.const_end(); + the_end = curve.end(); --the_end; - firstx = (*curve.const_begin())->when; + firstx = (*curve.begin())->when; endx = (*the_end)->when; - for (ARDOUR::AutomationList::const_iterator i = curve.const_begin(); i != curve.const_end(); ++i) { + for (ARDOUR::AutomationList::const_iterator i = curve.begin(); i != curve.end(); ++i) { double xfract = ((*i)->when - firstx) / (endx - firstx); double yfract = ((*i)->value - miny) / (maxy - miny); @@ -771,7 +771,7 @@ CrossfadeEditor::_apply_to (boost::shared_ptr xf) /* IN */ - ARDOUR::AutomationList::const_iterator the_end = in.const_end(); + ARDOUR::AutomationList::const_iterator the_end = in.end(); --the_end; double firstx = (*in.begin())->when; @@ -791,7 +791,7 @@ CrossfadeEditor::_apply_to (boost::shared_ptr xf) /* OUT */ - the_end = out.const_end(); + the_end = out.end(); --the_end; firstx = (*out.begin())->when; diff --git a/gtk2_ardour/curvetest.cc b/gtk2_ardour/curvetest.cc index 48650c0353..ec552848d2 100644 --- a/gtk2_ardour/curvetest.cc +++ b/gtk2_ardour/curvetest.cc @@ -33,7 +33,8 @@ curvetest (string filename) { ifstream in (filename.c_str()); stringstream line; - AutomationList al (Parameter(), -1.0, +1.0, 0); + Parameter param(GainAutomation, -1.0, +1.0, 0.0); + AutomationList al (param); double minx = DBL_MAX; double maxx = DBL_MIN; diff --git a/gtk2_ardour/gain_meter.cc b/gtk2_ardour/gain_meter.cc index 107b0eedfc..182cf2d89d 100644 --- a/gtk2_ardour/gain_meter.cc +++ b/gtk2_ardour/gain_meter.cc @@ -168,8 +168,8 @@ GainMeterBase::GainMeterBase (boost::shared_ptr io, Session& s, gain_automation_style_button.signal_button_press_event().connect (mem_fun(*this, &GainMeterBase::gain_automation_style_button_event), false); gain_automation_state_button.signal_button_press_event().connect (mem_fun(*this, &GainMeterBase::gain_automation_state_button_event), false); - r->gain_control()->list()->automation_state_changed.connect (mem_fun(*this, &GainMeter::gain_automation_state_changed)); - r->gain_control()->list()->automation_style_changed.connect (mem_fun(*this, &GainMeter::gain_automation_style_changed)); + r->gain_control()->alist()->automation_state_changed.connect (mem_fun(*this, &GainMeter::gain_automation_state_changed)); + r->gain_control()->alist()->automation_style_changed.connect (mem_fun(*this, &GainMeter::gain_automation_style_changed)); gain_automation_state_changed (); } @@ -408,7 +408,8 @@ GainMeterBase::set_fader_name (const char * name) void GainMeterBase::update_gain_sensitive () { - static_cast(gain_slider)->set_sensitive (!(_io->gain_control()->list()->automation_state() & Play)); + static_cast(gain_slider)->set_sensitive ( + !(_io->gain_control()->alist()->automation_state() & Play)); } @@ -556,14 +557,14 @@ GainMeterBase::meter_point_clicked () gint GainMeterBase::start_gain_touch (GdkEventButton* ev) { - _io->gain_control()->list()->start_touch (); + _io->gain_control()->alist()->start_touch (); return FALSE; } gint GainMeterBase::end_gain_touch (GdkEventButton* ev) { - _io->gain_control()->list()->stop_touch (); + _io->gain_control()->alist()->stop_touch (); return FALSE; } @@ -666,10 +667,10 @@ GainMeterBase::gain_automation_style_changed () { switch (_width) { case Wide: - gain_automation_style_button.set_label (astyle_string(_io->gain_control()->list()->automation_style())); + gain_automation_style_button.set_label (astyle_string(_io->gain_control()->alist()->automation_style())); break; case Narrow: - gain_automation_style_button.set_label (short_astyle_string(_io->gain_control()->list()->automation_style())); + gain_automation_style_button.set_label (short_astyle_string(_io->gain_control()->alist()->automation_style())); break; } } @@ -683,14 +684,14 @@ GainMeterBase::gain_automation_state_changed () switch (_width) { case Wide: - gain_automation_state_button.set_label (astate_string(_io->gain_control()->list()->automation_state())); + gain_automation_state_button.set_label (astate_string(_io->gain_control()->alist()->automation_state())); break; case Narrow: - gain_automation_state_button.set_label (short_astate_string(_io->gain_control()->list()->automation_state())); + gain_automation_state_button.set_label (short_astate_string(_io->gain_control()->alist()->automation_state())); break; } - x = (_io->gain_control()->list()->automation_state() != Off); + x = (_io->gain_control()->alist()->automation_state() != Off); if (gain_automation_state_button.get_active() != x) { ignore_toggle = true; diff --git a/gtk2_ardour/generic_pluginui.cc b/gtk2_ardour/generic_pluginui.cc index 4b64098dc0..34ab571c8c 100644 --- a/gtk2_ardour/generic_pluginui.cc +++ b/gtk2_ardour/generic_pluginui.cc @@ -209,7 +209,11 @@ GenericPluginUI::build () } } - if ((cui = build_control_ui (i, insert->control(Parameter(PluginAutomation, i)))) == 0) { + boost::shared_ptr c + = boost::dynamic_pointer_cast( + insert->control(Parameter(PluginAutomation, i))); + + if ((cui = build_control_ui (i, c)) == 0) { error << string_compose(_("Plugin Editor: could not build control element for port %1"), i) << endmsg; continue; } @@ -526,7 +530,7 @@ GenericPluginUI::build_control_ui (guint32 port_index, boost::shared_ptrChanged.connect (bind (mem_fun (*this, &GenericPluginUI::parameter_changed), control_ui)); - mcontrol->list()->automation_state_changed.connect + mcontrol->alist()->automation_state_changed.connect (bind (mem_fun(*this, &GenericPluginUI::automation_state_changed), control_ui)); } else if (plugin->parameter_is_output (port_index)) { @@ -584,13 +588,13 @@ GenericPluginUI::build_control_ui (guint32 port_index, boost::shared_ptrcontrol->list()->start_touch (); + cui->control->start_touch (); } void GenericPluginUI::stop_touch (GenericPluginUI::ControlUI* cui) { - cui->control->list()->stop_touch (); + cui->control->stop_touch (); } void diff --git a/gtk2_ardour/midi_region_view.cc b/gtk2_ardour/midi_region_view.cc index 49e5e0fb5d..63117beee2 100644 --- a/gtk2_ardour/midi_region_view.cc +++ b/gtk2_ardour/midi_region_view.cc @@ -397,7 +397,8 @@ MidiRegionView::create_note_at(double x, double y, double duration) new_note_duration = snap_to_frame(new_note_time_position_relative + new_note_duration) + _region->start() - new_note_time; - const boost::shared_ptr new_note(new Note(0, new_note_time, new_note_duration, (uint8_t)note, 0x40)); + const boost::shared_ptr new_note(new Evoral::Note( + 0, new_note_time, new_note_duration, (uint8_t)note, 0x40)); view->update_bounds(new_note->note()); MidiModel::DeltaCommand* cmd = _model->new_delta_command("add note"); @@ -444,7 +445,7 @@ MidiRegionView::start_delta_command(string name) } void -MidiRegionView::command_add_note(const boost::shared_ptr note, bool selected) +MidiRegionView::command_add_note(const boost::shared_ptr note, bool selected) { if (_delta_command) _delta_command->add(note); @@ -524,8 +525,8 @@ MidiRegionView::redisplay_model() for (AutomationList::const_iterator event = control->second->list()->begin(); event != control->second->list()->end(); ++event) { - MidiControlIterator iter(control->second->list(), (*event)->when, (*event)->value); - boost::shared_ptr event(new MIDI::Event()); + Evoral::ControlIterator iter(control->second->list(), (*event)->when, (*event)->value); + boost::shared_ptr event(new Evoral::Event()); _model->control_to_midi_event(event, iter); add_pgm_change(event); } @@ -774,7 +775,7 @@ MidiRegionView::extend_active_notes() * event arrives, to properly display the note. */ void -MidiRegionView::add_note(const boost::shared_ptr note) +MidiRegionView::add_note(const boost::shared_ptr note) { assert(note->time() >= 0); assert(midi_view()->note_mode() == Sustained || midi_view()->note_mode() == Percussive); @@ -816,7 +817,7 @@ MidiRegionView::add_note(const boost::shared_ptr note) // finish the old note rectangle if (_active_notes[note->note()]) { CanvasNote* const old_rect = _active_notes[note->note()]; - boost::shared_ptr old_note = old_rect->note(); + boost::shared_ptr old_note = old_rect->note(); cerr << "MidiModel: WARNING: Note has duration 0: chan " << old_note->channel() << "note " << (int)old_note->note() << " @ " << old_note->time() << endl; /* FIXME: How large to make it? Make it a diamond? */ @@ -870,7 +871,7 @@ MidiRegionView::add_note(const boost::shared_ptr note) } void -MidiRegionView::add_pgm_change(boost::shared_ptr event) +MidiRegionView::add_pgm_change(boost::shared_ptr event) { assert(event->time() >= 0); @@ -1061,7 +1062,7 @@ MidiRegionView::note_dropped(CanvasNoteEvent* ev, double dt, uint8_t dnote) Selection::iterator next = i; ++next; - const boost::shared_ptr copy(new Note(*(*i)->note().get())); + const boost::shared_ptr copy(new Evoral::Note(*(*i)->note().get())); // we need to snap here again in nframes64_t in order to be sample accurate double new_note_time = (*i)->note()->time(); @@ -1253,7 +1254,7 @@ MidiRegionView::commit_resizing(CanvasNote::NoteEnd note_end, double event_x, bo // transform to region start relative current_frame += _region->start(); - const boost::shared_ptr copy(new Note(*(canvas_note->note().get()))); + const boost::shared_ptr copy(new Evoral::Note(*(canvas_note->note().get()))); // resize beginning of note if (note_end == CanvasNote::NOTE_ON && current_frame < copy->end_time()) { @@ -1286,7 +1287,7 @@ MidiRegionView::change_velocity(uint8_t velocity, bool relative) ++next; CanvasNoteEvent *event = *i; - const boost::shared_ptr copy(new Note(*(event->note().get()))); + const boost::shared_ptr copy(new Evoral::Note(*(event->note().get()))); if (relative) { uint8_t new_velocity = copy->velocity() + velocity; @@ -1315,7 +1316,7 @@ MidiRegionView::change_channel(uint8_t channel) ++next; CanvasNoteEvent *event = *i; - const boost::shared_ptr copy(new Note(*(event->note().get()))); + const boost::shared_ptr copy(new Evoral::Note(*(event->note().get()))); copy->set_channel(channel); diff --git a/gtk2_ardour/midi_region_view.h b/gtk2_ardour/midi_region_view.h index 50cac66d77..1bdccd4986 100644 --- a/gtk2_ardour/midi_region_view.h +++ b/gtk2_ardour/midi_region_view.h @@ -79,10 +79,10 @@ class MidiRegionView : public RegionView GhostRegion* add_ghost (TimeAxisView&); - void add_note(const boost::shared_ptr note); + void add_note(const boost::shared_ptr note); void resolve_note(uint8_t note_num, double end_time); - void add_pgm_change(boost::shared_ptr event); + void add_pgm_change(boost::shared_ptr event); void begin_write(); void end_write(); @@ -93,7 +93,7 @@ class MidiRegionView : public RegionView void display_model(boost::shared_ptr model); void start_delta_command(string name = "midi edit"); - void command_add_note(const boost::shared_ptr note, bool selected); + void command_add_note(const boost::shared_ptr note, bool selected); void command_remove_note(ArdourCanvas::CanvasNoteEvent* ev); void apply_command(); @@ -240,7 +240,7 @@ class MidiRegionView : public RegionView /** New notes (created in the current command) which should be selected * when they appear after the command is applied. */ - std::set< boost::shared_ptr > _marked_for_selection; + std::set< boost::shared_ptr > _marked_for_selection; std::vector _resize_data; }; diff --git a/gtk2_ardour/midi_streamview.cc b/gtk2_ardour/midi_streamview.cc index d53150fd91..2266ddd064 100644 --- a/gtk2_ardour/midi_streamview.cc +++ b/gtk2_ardour/midi_streamview.cc @@ -554,7 +554,7 @@ MidiStreamView::update_rec_regions (boost::shared_ptr data, nframes_t // FIXME: slooooooooow! - const boost::shared_ptr note = data->note_at(i); + const boost::shared_ptr note = data->note_at(i); if (note->duration() > 0 && note->end_time() + region->position() > start) mrv->resolve_note(note->note(), note->end_time()); diff --git a/gtk2_ardour/midi_time_axis.cc b/gtk2_ardour/midi_time_axis.cc index 5802cc7e20..53da98d829 100644 --- a/gtk2_ardour/midi_time_axis.cc +++ b/gtk2_ardour/midi_time_axis.cc @@ -334,12 +334,12 @@ MidiTimeAxisView::create_automation_child (Parameter param, bool show) /* FIXME: don't create AutomationList for track itself * (not actually needed or used, since the automation is region-ey) */ - boost::shared_ptr c = _route->control(param); + boost::shared_ptr c + = boost::dynamic_pointer_cast(_route->control(param)); if (!c) { - boost::shared_ptr al(new ARDOUR::AutomationList(param, - param.min(), param.max(), (param.max() - param.min() / 2))); - c = boost::shared_ptr(_route->control_factory(al)); + boost::shared_ptr al(new ARDOUR::AutomationList(param)); + c = boost::dynamic_pointer_cast(_route->control_factory(al)); _route->add_control(c); } @@ -358,7 +358,7 @@ MidiTimeAxisView::create_automation_child (Parameter param, bool show) add_automation_child(param, track, show); } else { - error << "MidiTimeAxisView: unknown automation child " << param.to_string() << endmsg; + error << "MidiTimeAxisView: unknown automation child " << param.symbol() << endmsg; } } diff --git a/gtk2_ardour/mixer_strip.cc b/gtk2_ardour/mixer_strip.cc index 1a8949d1b8..2459ac57a8 100644 --- a/gtk2_ardour/mixer_strip.cc +++ b/gtk2_ardour/mixer_strip.cc @@ -450,7 +450,7 @@ MixerStrip::set_width (Width w, void* owner) pre_processor_box.set_width (w); post_processor_box.set_width (w); - boost::shared_ptr gain_automation = _route->gain_control()->list(); + boost::shared_ptr gain_automation = _route->gain_control()->alist(); _width_owner = owner; @@ -748,8 +748,8 @@ MixerStrip::connect_to_pan () if (!_route->panner().empty()) { StreamPanner* sp = _route->panner().front(); - panstate_connection = sp->pan_control()->list()->automation_state_changed.connect (mem_fun(panners, &PannerUI::pan_automation_state_changed)); - panstyle_connection = sp->pan_control()->list()->automation_style_changed.connect (mem_fun(panners, &PannerUI::pan_automation_style_changed)); + panstate_connection = sp->pan_control()->alist()->automation_state_changed.connect (mem_fun(panners, &PannerUI::pan_automation_state_changed)); + panstyle_connection = sp->pan_control()->alist()->automation_style_changed.connect (mem_fun(panners, &PannerUI::pan_automation_style_changed)); } panners.pan_changed (this); diff --git a/gtk2_ardour/panner_ui.cc b/gtk2_ardour/panner_ui.cc index 3fe43850a3..fec4cbf464 100644 --- a/gtk2_ardour/panner_ui.cc +++ b/gtk2_ardour/panner_ui.cc @@ -593,7 +593,7 @@ PannerUI::update_pan_bars (bool only_if_aplay) float xpos, val; if (only_if_aplay) { - boost::shared_ptr alist (_io->panner()[n]->pan_control()->list()); + boost::shared_ptr alist (_io->panner()[n]->pan_control()->alist()); if (!alist->automation_playback()) { continue; @@ -727,7 +727,7 @@ PannerUI::pan_automation_state_changed () return; } - x = (_io->panner().front()->pan_control()->list()->automation_state() != Off); + x = (_io->panner().front()->pan_control()->alist()->automation_state() != Off); if (pan_automation_state_button.get_active() != x) { ignore_toggle = true; diff --git a/gtk2_ardour/route_time_axis.cc b/gtk2_ardour/route_time_axis.cc index b3a988fd92..61c87d01de 100644 --- a/gtk2_ardour/route_time_axis.cc +++ b/gtk2_ardour/route_time_axis.cc @@ -1741,7 +1741,8 @@ RouteTimeAxisView::add_processor_automation_curve (boost::shared_ptr char state_name[256]; snprintf (state_name, sizeof (state_name), "Redirect-%s-%" PRIu32, legalize_for_xml_node (processor->name()).c_str(), what.id()); - boost::shared_ptr control = processor->control(what, true); + boost::shared_ptr control + = boost::dynamic_pointer_cast(processor->control(what, true)); pan->view = boost::shared_ptr( new AutomationTimeAxisView (_session, _route, processor, control, @@ -1782,7 +1783,7 @@ RouteTimeAxisView::add_existing_processor_automation_curves (boost::shared_ptr

s; boost::shared_ptr al; - processor->what_has_visible_automation (s); + processor->what_has_visible_data (s); for (set::iterator i = s.begin(); i != s.end(); ++i) { @@ -1843,7 +1844,7 @@ RouteTimeAxisView::add_processor_to_subplugin_menu (boost::shared_ptr const std::set& automatable = processor->what_can_be_automated (); std::set has_visible_automation; - processor->what_has_visible_automation(has_visible_automation); + processor->what_has_visible_data(has_visible_automation); if (automatable.empty()) { return; diff --git a/gtk2_ardour/route_ui.cc b/gtk2_ardour/route_ui.cc index 4d1d92ac5a..c02c4109b1 100644 --- a/gtk2_ardour/route_ui.cc +++ b/gtk2_ardour/route_ui.cc @@ -776,14 +776,14 @@ RouteUI::get_automation_child_xml_node (Parameter param) for (iter = kids.begin(); iter != kids.end(); ++iter) { if ((*iter)->name() == AutomationTimeAxisView::state_node_name) { XMLProperty* type = (*iter)->property("automation-id"); - if (type && type->value() == param.to_string()) + if (type && type->value() == param.symbol()) return *iter; } } // Didn't find it, make a new one XMLNode* child = new XMLNode (AutomationTimeAxisView::state_node_name); - child->add_property("automation-id", param.to_string()); + child->add_property("automation-id", param.symbol()); xml_node->add_child_nocopy (*child); return child; diff --git a/gtk2_ardour/selection.cc b/gtk2_ardour/selection.cc index 910cebc7fe..2f9601fcec 100644 --- a/gtk2_ardour/selection.cc +++ b/gtk2_ardour/selection.cc @@ -389,10 +389,17 @@ Selection::replace (uint32_t sid, nframes_t start, nframes_t end) } void -Selection::add (AutomationList* ac) +Selection::add (boost::shared_ptr cl) { - if (find (lines.begin(), lines.end(), ac) == lines.end()) { - lines.push_back (ac); + boost::shared_ptr al + = boost::dynamic_pointer_cast(cl); + if (!al) { + warning << "Programming error: Selected list is not an ARDOUR::AutomationList" << endmsg; + return; + return; + } + if (find (lines.begin(), lines.end(), al) == lines.end()) { + lines.push_back (al); LinesChanged(); } } @@ -493,9 +500,9 @@ Selection::remove (nframes_t start, nframes_t end) } void -Selection::remove (AutomationList *ac) +Selection::remove (boost::shared_ptr ac) { - list::iterator i; + AutomationSelection::iterator i; if ((i = find (lines.begin(), lines.end(), ac)) != lines.end()) { lines.erase (i); LinesChanged(); @@ -595,7 +602,7 @@ Selection::set (TimeAxisView* track, nframes_t start, nframes_t end) } void -Selection::set (AutomationList *ac) +Selection::set (boost::shared_ptr ac) { lines.clear(); add (ac); diff --git a/gtk2_ardour/selection.h b/gtk2_ardour/selection.h index 17862e127b..c6923e663c 100644 --- a/gtk2_ardour/selection.h +++ b/gtk2_ardour/selection.h @@ -47,6 +47,10 @@ namespace ARDOUR { class AutomationList; } +namespace Evoral { + class ControlList; +} + /// Lists of selected things /** The Selection class holds lists of selected items (tracks, regions, etc. etc.). */ @@ -105,7 +109,7 @@ class Selection : public sigc::trackable void set (RegionView*, bool also_clear_tracks = true); void set (std::vector&); long set (TimeAxisView*, nframes_t, nframes_t); - void set (ARDOUR::AutomationList*); + void set (boost::shared_ptr); void set (boost::shared_ptr); void set (const std::list >&); void set (AutomationSelectable*); @@ -128,7 +132,7 @@ class Selection : public sigc::trackable void add (RegionView*); void add (std::vector&); long add (nframes_t, nframes_t); - void add (ARDOUR::AutomationList*); + void add (boost::shared_ptr); void add (boost::shared_ptr); void add (const std::list >&); void add (Marker*); @@ -139,7 +143,7 @@ class Selection : public sigc::trackable void remove (RegionView*); void remove (uint32_t selection_id); void remove (nframes_t, nframes_t); - void remove (ARDOUR::AutomationList*); + void remove (boost::shared_ptr); void remove (boost::shared_ptr); void remove (const std::list >&); void remove (const list&); -- cgit v1.2.3