From fa701b8c065251d242342b86a54d91826d2290a0 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Fri, 19 Feb 2010 18:09:08 +0000 Subject: change PropertyChange from a bitfield into a real object, with all the many widespread changes that causes git-svn-id: svn://localhost/ardour2/branches/3.0@6701 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/audio_region_editor.cc | 52 +++-- gtk2_ardour/audio_region_editor.h | 4 +- gtk2_ardour/audio_region_view.cc | 29 ++- gtk2_ardour/audio_region_view.h | 4 +- gtk2_ardour/automation_region_view.cc | 4 +- gtk2_ardour/automation_region_view.h | 2 +- gtk2_ardour/crossfade_edit.cc | 4 +- gtk2_ardour/crossfade_edit.h | 2 +- gtk2_ardour/crossfade_view.cc | 15 +- gtk2_ardour/crossfade_view.h | 6 +- gtk2_ardour/editor.cc | 7 +- gtk2_ardour/editor.h | 4 +- gtk2_ardour/editor_markers.cc | 2 +- gtk2_ardour/editor_mouse.cc | 12 +- gtk2_ardour/editor_ops.cc | 5 +- gtk2_ardour/editor_regions.cc | 12 +- gtk2_ardour/editor_regions.h | 2 +- gtk2_ardour/editor_routes.cc | 9 +- gtk2_ardour/editor_routes.h | 2 +- gtk2_ardour/editor_tempodisplay.cc | 4 +- gtk2_ardour/lineset.h | 2 +- gtk2_ardour/midi_region_view.cc | 6 +- gtk2_ardour/midi_region_view.h | 6 +- gtk2_ardour/mixer_strip.cc | 2 +- gtk2_ardour/mixer_ui.cc | 10 +- gtk2_ardour/mixer_ui.h | 2 +- gtk2_ardour/processor_box.cc | 18 +- gtk2_ardour/processor_box.h | 4 +- gtk2_ardour/region_view.cc | 28 ++- gtk2_ardour/region_view.h | 4 +- gtk2_ardour/route_params_ui.cc | 8 +- gtk2_ardour/route_params_ui.h | 2 +- gtk2_ardour/route_time_axis.cc | 8 +- gtk2_ardour/route_time_axis.h | 2 +- gtk2_ardour/route_ui.cc | 10 +- gtk2_ardour/route_ui.h | 2 +- libs/ardour/ardour/ardour.h | 9 +- libs/ardour/ardour/audioplaylist.h | 4 +- libs/ardour/ardour/audioregion.h | 24 +- libs/ardour/ardour/crossfade.h | 15 +- libs/ardour/ardour/diskstream.h | 2 +- libs/ardour/ardour/internal_send.h | 2 +- libs/ardour/ardour/location.h | 2 +- libs/ardour/ardour/midi_model.h | 10 +- libs/ardour/ardour/midi_playlist.h | 2 +- libs/ardour/ardour/midi_region.h | 3 - libs/ardour/ardour/playlist.h | 8 +- libs/ardour/ardour/region.h | 24 +- libs/ardour/ardour/route_group.h | 3 - libs/ardour/ardour/session.h | 4 +- libs/ardour/ardour/session_object.h | 8 +- libs/ardour/ardour/tempo.h | 2 - libs/ardour/audio_playlist.cc | 27 ++- libs/ardour/audioregion.cc | 124 +++-------- libs/ardour/crossfade.cc | 69 ++++-- libs/ardour/diskstream.cc | 2 +- libs/ardour/globals.cc | 51 ++++- libs/ardour/internal_send.cc | 8 +- libs/ardour/midi_model.cc | 10 +- libs/ardour/midi_playlist.cc | 13 +- libs/ardour/midi_region.cc | 36 +-- libs/ardour/playlist.cc | 42 ++-- libs/ardour/region.cc | 277 +++++++----------------- libs/ardour/region_factory.cc | 61 ++---- libs/ardour/route_group.cc | 21 +- libs/ardour/session.cc | 10 +- libs/ardour/session_object.cc | 18 +- libs/ardour/session_state.cc | 2 +- libs/ardour/tempo.cc | 28 +-- libs/evoral/evoral/midi_events.h | 4 +- libs/pbd/pbd/properties.h | 116 +++++++--- libs/pbd/pbd/stateful.h | 9 +- libs/pbd/property.cc | 19 -- libs/pbd/stateful.cc | 12 +- libs/pbd/wscript | 1 - libs/surfaces/mackie/mackie_control_protocol.cc | 6 +- libs/surfaces/mackie/mackie_control_protocol.h | 2 +- libs/surfaces/mackie/route_signal.cc | 5 +- 78 files changed, 644 insertions(+), 746 deletions(-) diff --git a/gtk2_ardour/audio_region_editor.cc b/gtk2_ardour/audio_region_editor.cc index 668ed8ed52..e246c04391 100644 --- a/gtk2_ardour/audio_region_editor.cc +++ b/gtk2_ardour/audio_region_editor.cc @@ -152,10 +152,19 @@ AudioRegionEditor::AudioRegionEditor (Session* s, boost::shared_ptr show_all(); name_changed (); - bounds_changed (PropertyChange (StartChanged|LengthChanged|PositionChanged|Region::SyncOffsetChanged)); + + PropertyChange change; + + change.add (ARDOUR::Properties::start); + change.add (ARDOUR::Properties::length); + change.add (ARDOUR::Properties::position); + change.add (ARDOUR::Properties::sync_position); + + bounds_changed (change); + gain_changed (); - _region->StateChanged.connect (state_connection, ui_bind (&AudioRegionEditor::region_changed, this, _1), gui_context()); + _region->PropertyChanged.connect (state_connection, ui_bind (&AudioRegionEditor::region_changed, this, _1), gui_context()); spin_arrow_grab = false; @@ -167,17 +176,24 @@ AudioRegionEditor::~AudioRegionEditor () } void -AudioRegionEditor::region_changed (PBD::PropertyChange what_changed) +AudioRegionEditor::region_changed (const PBD::PropertyChange& what_changed) { - if (what_changed & NameChanged) { + if (what_changed.contains (ARDOUR::Properties::name)) { name_changed (); } - if (what_changed & PropertyChange (BoundsChanged|StartChanged|Region::SyncOffsetChanged)) { + PropertyChange interesting_stuff; + + interesting_stuff.add (ARDOUR::Properties::position); + interesting_stuff.add (ARDOUR::Properties::length); + interesting_stuff.add (ARDOUR::Properties::start); + interesting_stuff.add (ARDOUR::Properties::sync_position); + + if (what_changed.contains (interesting_stuff)) { bounds_changed (what_changed); } - if (what_changed & AudioRegion::ScaleAmplitudeChanged) { + if (what_changed.contains (ARDOUR::Properties::scale_amplitude)) { gain_changed (); } } @@ -326,35 +342,35 @@ AudioRegionEditor::name_changed () } void -AudioRegionEditor::bounds_changed (PropertyChange what_changed) +AudioRegionEditor::bounds_changed (const PropertyChange& what_changed) { - if ((what_changed & PropertyChange (PositionChanged|LengthChanged)) == PropertyChange (PositionChanged|LengthChanged)) { + if (what_changed.contains (ARDOUR::Properties::position) && what_changed.contains (ARDOUR::Properties::length)) { position_clock.set (_region->position(), true); end_clock.set (_region->position() + _region->length() - 1, true); length_clock.set (_region->length(), true); - } else if (what_changed & PropertyChange (PositionChanged)) { + } else if (what_changed.contains (ARDOUR::Properties::position)) { position_clock.set (_region->position(), true); end_clock.set (_region->position() + _region->length() - 1, true); - } else if (what_changed & PropertyChange (LengthChanged)) { + } else if (what_changed.contains (ARDOUR::Properties::length)) { end_clock.set (_region->position() + _region->length() - 1, true); length_clock.set (_region->length(), true); } - if ((what_changed & Region::SyncOffsetChanged) || (what_changed & PositionChanged)) { + if (what_changed.contains (ARDOUR::Properties::sync_position) || what_changed.contains (ARDOUR::Properties::position)) { int dir; nframes_t off = _region->sync_offset (dir); if (dir == -1) { off = -off; } - if (what_changed & Region::SyncOffsetChanged) { + if (what_changed.contains (ARDOUR::Properties::sync_position)) { sync_offset_relative_clock.set (off, true); } sync_offset_absolute_clock.set (off + _region->position (), true); } - if (what_changed & StartChanged) { + if (what_changed.contains (ARDOUR::Properties::start)) { start_clock.set (_region->start(), true); } } @@ -412,6 +428,14 @@ AudioRegionEditor::sync_offset_relative_clock_changed () bool AudioRegionEditor::on_delete_event (GdkEventAny* ev) { - bounds_changed (PropertyChange (StartChanged|LengthChanged|PositionChanged|Region::SyncOffsetChanged)); + PropertyChange change; + + change.add (ARDOUR::Properties::start); + change.add (ARDOUR::Properties::length); + change.add (ARDOUR::Properties::position); + change.add (ARDOUR::Properties::sync_position); + + bounds_changed (change); + return RegionEditor::on_delete_event (ev); } diff --git a/gtk2_ardour/audio_region_editor.h b/gtk2_ardour/audio_region_editor.h index e33caadba6..a382f9e6a9 100644 --- a/gtk2_ardour/audio_region_editor.h +++ b/gtk2_ardour/audio_region_editor.h @@ -98,8 +98,8 @@ class AudioRegionEditor : public RegionEditor PBD::ScopedConnection state_connection; PBD::ScopedConnection audition_connection; - void region_changed (PBD::PropertyChange); - void bounds_changed (PBD::PropertyChange); + void region_changed (const PBD::PropertyChange&); + void bounds_changed (const PBD::PropertyChange&); void name_changed (); void gain_changed (); diff --git a/gtk2_ardour/audio_region_view.cc b/gtk2_ardour/audio_region_view.cc index 4d783956d7..438867c9dc 100644 --- a/gtk2_ardour/audio_region_view.cc +++ b/gtk2_ardour/audio_region_view.cc @@ -222,7 +222,8 @@ AudioRegionView::init (Gdk::Color const & basic_color, bool wfd) region_muted (); region_sync_changed (); - region_resized (BoundsChanged); + + region_resized (ARDOUR::bounds_change); set_waveview_data_src(); region_locked (); envelope_active_changed (); @@ -264,29 +265,29 @@ AudioRegionView::audio_region() const } void -AudioRegionView::region_changed (PropertyChange what_changed) +AudioRegionView::region_changed (const PropertyChange& what_changed) { ENSURE_GUI_THREAD (*this, &AudioRegionView::region_changed, what_changed) //cerr << "AudioRegionView::region_changed() called" << endl; - RegionView::region_changed(what_changed); + RegionView::region_changed (what_changed); - if (what_changed & AudioRegion::ScaleAmplitudeChanged) { + if (what_changed.contains (ARDOUR::Properties::scale_amplitude)) { region_scale_amplitude_changed (); } - if (what_changed & AudioRegion::FadeInChanged) { - fade_in_changed (); + if (what_changed.contains (ARDOUR::Properties::fade_in)) { + fade_in_changed (); } - if (what_changed & AudioRegion::FadeOutChanged) { + if (what_changed.contains (ARDOUR::Properties::fade_out)) { fade_out_changed (); } - if (what_changed & AudioRegion::FadeInActiveChanged) { + if (what_changed.contains (ARDOUR::Properties::fade_in_active)) { fade_in_active_changed (); } - if (what_changed & AudioRegion::FadeOutActiveChanged) { + if (what_changed.contains (ARDOUR::Properties::fade_out_active)) { fade_out_active_changed (); } - if (what_changed & AudioRegion::EnvelopeActiveChanged) { + if (what_changed.contains (ARDOUR::Properties::envelope_active)) { envelope_active_changed (); } } @@ -372,13 +373,17 @@ AudioRegionView::region_renamed () } void -AudioRegionView::region_resized (PropertyChange what_changed) +AudioRegionView::region_resized (const PropertyChange& what_changed) { AudioGhostRegion* agr; RegionView::region_resized(what_changed); + PropertyChange interesting_stuff; + + interesting_stuff.add (ARDOUR::Properties::start); + interesting_stuff.add (ARDOUR::Properties::length); - if (what_changed & PropertyChange (StartChanged|LengthChanged)) { + if (what_changed.contains (interesting_stuff)) { for (uint32_t n = 0; n < waves.size(); ++n) { waves[n]->property_region_start() = _region->start(); diff --git a/gtk2_ardour/audio_region_view.h b/gtk2_ardour/audio_region_view.h index 767a66faed..b5fc89d0a9 100644 --- a/gtk2_ardour/audio_region_view.h +++ b/gtk2_ardour/audio_region_view.h @@ -98,7 +98,7 @@ class AudioRegionView : public RegionView AudioRegionGainLine* get_gain_line() const { return gain_line; } - void region_changed (PBD::PropertyChange); + void region_changed (const PBD::PropertyChange&); void envelope_active_changed (); GhostRegion* add_ghost (TimeAxisView&); @@ -150,7 +150,7 @@ class AudioRegionView : public RegionView void fade_in_active_changed (); void fade_out_active_changed (); - void region_resized (PBD::PropertyChange); + void region_resized (const PBD::PropertyChange&); void region_muted (); void region_scale_amplitude_changed (); void region_renamed (); diff --git a/gtk2_ardour/automation_region_view.cc b/gtk2_ardour/automation_region_view.cc index a796d4d7cd..b86cb2191e 100644 --- a/gtk2_ardour/automation_region_view.cc +++ b/gtk2_ardour/automation_region_view.cc @@ -61,7 +61,7 @@ AutomationRegionView::init (Gdk::Color const & basic_color, bool /*wfd*/) set_height (trackview.current_height()); - _region->StateChanged.connect (*this, ui_bind (&RegionView::region_changed, this, _1), gui_context()); + _region->PropertyChanged.connect (*this, ui_bind (&RegionView::region_changed, this, _1), gui_context()); set_colors (); @@ -158,7 +158,7 @@ AutomationRegionView::reset_width_dependent_items (double pixel_width) void -AutomationRegionView::region_resized (PBD::PropertyChange what_changed) +AutomationRegionView::region_resized (const PBD::PropertyChange& what_changed) { RegionView::region_resized(what_changed); diff --git a/gtk2_ardour/automation_region_view.h b/gtk2_ardour/automation_region_view.h index 0a1978c963..6d3a00d4b6 100644 --- a/gtk2_ardour/automation_region_view.h +++ b/gtk2_ardour/automation_region_view.h @@ -66,7 +66,7 @@ public: protected: void create_line(boost::shared_ptr list); bool set_position(nframes64_t pos, void* src, double* ignored); - void region_resized (PBD::PropertyChange what_changed); + void region_resized (const PBD::PropertyChange&); bool canvas_event(GdkEvent* ev); void add_automation_event (GdkEvent* event, nframes_t when, double y); void entered(); diff --git a/gtk2_ardour/crossfade_edit.cc b/gtk2_ardour/crossfade_edit.cc index c5d7b8d1b5..c1201f2f9a 100644 --- a/gtk2_ardour/crossfade_edit.cc +++ b/gtk2_ardour/crossfade_edit.cc @@ -291,7 +291,7 @@ CrossfadeEditor::CrossfadeEditor (Session* s, boost::shared_ptr xf, d curve_select_clicked (In); - xfade->StateChanged.connect (state_connection, ui_bind (&CrossfadeEditor::xfade_changed, this, _1), gui_context()); + xfade->PropertyChanged.connect (state_connection, ui_bind (&CrossfadeEditor::xfade_changed, this, _1), gui_context()); _session->AuditionActive.connect (_session_connections, ui_bind (&CrossfadeEditor::audition_state_changed, this, _1), gui_context()); show_all_children(); @@ -624,7 +624,7 @@ CrossfadeEditor::canvas_allocation (Gtk::Allocation& /*alloc*/) void -CrossfadeEditor::xfade_changed (PropertyChange) +CrossfadeEditor::xfade_changed (const PropertyChange&) { set (xfade->fade_in(), In); set (xfade->fade_out(), Out); diff --git a/gtk2_ardour/crossfade_edit.h b/gtk2_ardour/crossfade_edit.h index a05bb093f0..936ead3895 100644 --- a/gtk2_ardour/crossfade_edit.h +++ b/gtk2_ardour/crossfade_edit.h @@ -213,7 +213,7 @@ class CrossfadeEditor : public ArdourDialog void audition_right_dry (); void audition_right (); - void xfade_changed (PBD::PropertyChange); + void xfade_changed (const PBD::PropertyChange&); void dump (); }; diff --git a/gtk2_ardour/crossfade_view.cc b/gtk2_ardour/crossfade_view.cc index ca333e67a6..a861ba8e9e 100644 --- a/gtk2_ardour/crossfade_view.cc +++ b/gtk2_ardour/crossfade_view.cc @@ -82,9 +82,12 @@ CrossfadeView::CrossfadeView (ArdourCanvas::Group *parent, group->signal_event().connect (sigc::bind (sigc::mem_fun (tv.editor(), &PublicEditor::canvas_crossfade_view_event), group, this)); - crossfade_changed (PropertyChange (~0)); + PropertyChange all_crossfade_properties; + all_crossfade_properties.add (ARDOUR::Properties::active); + all_crossfade_properties.add (ARDOUR::Properties::follow_overlap); + crossfade_changed (all_crossfade_properties); - crossfade->StateChanged.connect (*this, ui_bind (&CrossfadeView::crossfade_changed, this, _1), gui_context()); + crossfade->PropertyChanged.connect (*this, ui_bind (&CrossfadeView::crossfade_changed, this, _1), gui_context()); ColorsChanged.connect (sigc::mem_fun (*this, &CrossfadeView::color_handler)); } @@ -123,11 +126,11 @@ CrossfadeView::set_height (double height) } void -CrossfadeView::crossfade_changed (PropertyChange what_changed) +CrossfadeView::crossfade_changed (const PropertyChange& what_changed) { bool need_redraw_curves = false; - if (what_changed & BoundsChanged) { + if (what_changed.contains (ARDOUR::bounds_change)) { set_position (crossfade->position(), this); set_duration (crossfade->length(), this); @@ -136,11 +139,11 @@ CrossfadeView::crossfade_changed (PropertyChange what_changed) need_redraw_curves = false; } - if (what_changed & Crossfade::FollowOverlapChanged) { + if (what_changed.contains (ARDOUR::Properties::follow_overlap)) { need_redraw_curves = true; } - if (what_changed & Crossfade::ActiveChanged) { + if (what_changed.contains (ARDOUR::Properties::active)) { /* calls redraw_curves */ active_changed (); } else if (need_redraw_curves) { diff --git a/gtk2_ardour/crossfade_view.h b/gtk2_ardour/crossfade_view.h index 3e550e4788..610fa92e0e 100644 --- a/gtk2_ardour/crossfade_view.h +++ b/gtk2_ardour/crossfade_view.h @@ -75,10 +75,10 @@ struct CrossfadeView : public TimeAxisViewItem ArdourCanvas::Line *fade_out; ArdourCanvas::Item *active_button; - void crossfade_changed (PBD::PropertyChange); + void crossfade_changed (const PBD::PropertyChange&); void active_changed (); - void redraw_curves (); - void color_handler (); + void redraw_curves (); + void color_handler (); }; #endif /* __gtk_ardour_crossfade_view_h__ */ diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index 8053851f11..88b7586888 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -1073,7 +1073,7 @@ Editor::set_session (Session *t) _session->DurationChanged.connect (_session_connections, boost::bind (&Editor::handle_new_duration, this), gui_context()); _session->DirtyChanged.connect (_session_connections, boost::bind (&Editor::update_title, this), gui_context()); _session->TimecodeOffsetChanged.connect (_session_connections, boost::bind (&Editor::update_just_timecode, this), gui_context()); - _session->tempo_map().StateChanged.connect (_session_connections, ui_bind (&Editor::tempo_map_changed, this, _1), gui_context()); + _session->tempo_map().PropertyChanged.connect (_session_connections, ui_bind (&Editor::tempo_map_changed, this, _1), gui_context()); _session->Located.connect (_session_connections, boost::bind (&Editor::located, this), gui_context()); _session->config.ParameterChanged.connect (_session_connections, ui_bind (&Editor::parameter_changed, this, _1), gui_context()); _session->StateSaved.connect (_session_connections, ui_bind (&Editor::session_state_saved, this, _1), gui_context()); @@ -3736,7 +3736,10 @@ Editor::edit_xfade (boost::weak_ptr wxfade) } cew.apply (); - xfade->StateChanged (PropertyChange (~0)); + PropertyChange all_crossfade_properties; + all_crossfade_properties.add (ARDOUR::Properties::active); + all_crossfade_properties.add (ARDOUR::Properties::follow_overlap); + xfade->PropertyChanged (all_crossfade_properties); } PlaylistSelector& diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h index 6b79f7d3a6..9088312924 100644 --- a/gtk2_ardour/editor.h +++ b/gtk2_ardour/editor.h @@ -520,7 +520,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void location_changed (ARDOUR::Location *); void location_flags_changed (ARDOUR::Location *, void *); void refresh_location_display (); - void refresh_location_display_s (PBD::PropertyChange); + void refresh_location_display_s (const PBD::PropertyChange&); void refresh_location_display_internal (ARDOUR::Locations::LocationList&); void add_new_location (ARDOUR::Location *); void location_gone (ARDOUR::Location *); @@ -1475,7 +1475,7 @@ public: void draw_metric_marks (const ARDOUR::Metrics& metrics); void compute_current_bbt_points (nframes_t left, nframes_t right); - void tempo_map_changed (PBD::PropertyChange); + void tempo_map_changed (const PBD::PropertyChange&); void redisplay_tempo (bool immediate_redraw); void snap_to (nframes64_t& first, int32_t direction = 0, bool for_mark = false); diff --git a/gtk2_ardour/editor_markers.cc b/gtk2_ardour/editor_markers.cc index 33e0962596..7a2f4f7870 100644 --- a/gtk2_ardour/editor_markers.cc +++ b/gtk2_ardour/editor_markers.cc @@ -339,7 +339,7 @@ Editor::refresh_location_display () } void -Editor::refresh_location_display_s (PropertyChange) +Editor::refresh_location_display_s (const PropertyChange&) { ENSURE_GUI_THREAD (*this, &Editor::refresh_location_display_s, ignored) diff --git a/gtk2_ardour/editor_mouse.cc b/gtk2_ardour/editor_mouse.cc index fa641dd9b8..13bdf7af5c 100644 --- a/gtk2_ardour/editor_mouse.cc +++ b/gtk2_ardour/editor_mouse.cc @@ -2151,7 +2151,7 @@ Editor::single_contents_trim (RegionView& rv, nframes64_t frame_delta, bool left snap_to (new_bound); } region->trim_start ((nframes64_t) (new_bound * speed), this); - rv.region_changed (StartChanged); + rv.region_changed (PropertyChange (ARDOUR::Properties::start)); } void @@ -2206,7 +2206,7 @@ Editor::single_start_trim (RegionView& rv, nframes64_t frame_delta, bool left_di } } - rv.region_changed (PropertyChange (LengthChanged|PositionChanged|StartChanged)); + rv.region_changed (ARDOUR::bounds_change); } void @@ -2260,10 +2260,10 @@ Editor::single_end_trim (RegionView& rv, nframes64_t frame_delta, bool left_dire region_right->trim_front(region->last_frame() + 1, this); } - rv.region_changed (PropertyChange (LengthChanged|PositionChanged|StartChanged)); - } - else { - rv.region_changed (LengthChanged); + rv.region_changed (ARDOUR::bounds_change); + + } else { + rv.region_changed (PropertyChange (ARDOUR::Properties::length)); } } diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc index a1000b7077..2bb91fe229 100644 --- a/gtk2_ardour/editor_ops.cc +++ b/gtk2_ardour/editor_ops.cc @@ -3616,7 +3616,7 @@ Editor::trim_to_region(bool forward) } region->trim_end((nframes64_t) (next_region->first_frame() * speed), this); - arv->region_changed (PropertyChange (LengthChanged)); + arv->region_changed (PropertyChange (ARDOUR::Properties::length)); } else { @@ -3627,7 +3627,8 @@ Editor::trim_to_region(bool forward) } region->trim_front((nframes64_t) ((next_region->last_frame() + 1) * speed), this); - arv->region_changed (PropertyChange (LengthChanged|PositionChanged|StartChanged)); + + arv->region_changed (ARDOUR::bounds_change); } XMLNode &after = playlist->get_state(); diff --git a/gtk2_ardour/editor_regions.cc b/gtk2_ardour/editor_regions.cc index b3ca136bcf..39e8b84c1b 100644 --- a/gtk2_ardour/editor_regions.cc +++ b/gtk2_ardour/editor_regions.cc @@ -347,7 +347,7 @@ EditorRegions::add_region (boost::shared_ptr region) void -EditorRegions::region_changed (PropertyChange what_changed, boost::weak_ptr region) +EditorRegions::region_changed (const PropertyChange& what_changed, boost::weak_ptr region) { ENSURE_GUI_THREAD (*this, &EditorRegions::region_changed, what_changed, region) @@ -357,7 +357,7 @@ EditorRegions::region_changed (PropertyChange what_changed, boost::weak_ptrchildren (); TreeModel::iterator i = rows.begin (); @@ -762,10 +762,10 @@ EditorRegions::populate_row (boost::shared_ptr region, TreeModel::Row co break; case AudioClock::Frames: - snprintf (start_str, sizeof (start_str), "%u", region->position()); - snprintf (end_str, sizeof (end_str), "%u", (region->position() + region->length() - 1)); - snprintf (length_str, sizeof (length_str), "%u", region->length()); - snprintf (sync_str, sizeof (sync_str), "%u", region->sync_position() + region->position()); + snprintf (start_str, sizeof (start_str), "%" PRId64, region->position()); + snprintf (end_str, sizeof (end_str), "%" PRId64, (region->position() + region->length() - 1)); + snprintf (length_str, sizeof (length_str), "%" PRId64, region->length()); + snprintf (sync_str, sizeof (sync_str), "%" PRId64, region->sync_position() + region->position()); if (audioRegion && !fades_in_seconds) { snprintf (fadein_str, sizeof (fadein_str), "%u", uint (audioRegion->fade_in()->back()->when)); diff --git a/gtk2_ardour/editor_regions.h b/gtk2_ardour/editor_regions.h index 92adb72621..33e077261c 100644 --- a/gtk2_ardour/editor_regions.h +++ b/gtk2_ardour/editor_regions.h @@ -104,7 +104,7 @@ private: Columns _columns; - void region_changed (PBD::PropertyChange, boost::weak_ptr); + void region_changed (const PBD::PropertyChange&, boost::weak_ptr); void selection_changed (); sigc::connection _change_connection; bool set_selected_in_subrow (boost::shared_ptr, Gtk::TreeModel::Row const &, int); diff --git a/gtk2_ardour/editor_routes.cc b/gtk2_ardour/editor_routes.cc index 01da390f4b..1798c45864 100644 --- a/gtk2_ardour/editor_routes.cc +++ b/gtk2_ardour/editor_routes.cc @@ -424,7 +424,7 @@ EditorRoutes::routes_added (list routes) boost::weak_ptr wr ((*x)->route()); (*x)->route()->gui_changed.connect (*this, ui_bind (&EditorRoutes::handle_gui_changes, this, _1, _2), gui_context()); - (*x)->route()->NameChanged.connect (*this, boost::bind (&EditorRoutes::route_name_changed, this, wr), gui_context()); + (*x)->route()->PropertyChanged.connect (*this, ui_bind (&EditorRoutes::route_property_changed, this, _1, wr), gui_context()); if ((*x)->is_track()) { boost::shared_ptr t = boost::dynamic_pointer_cast ((*x)->route()); @@ -487,11 +487,16 @@ EditorRoutes::route_removed (TimeAxisView *tv) } void -EditorRoutes::route_name_changed (boost::weak_ptr r) +EditorRoutes::route_property_changed (const PropertyChange& what_changed, boost::weak_ptr r) { + if (!what_changed.contains (ARDOUR::Properties::name)) { + return; + } + ENSURE_GUI_THREAD (*this, &EditorRoutes::route_name_changed, r) boost::shared_ptr route = r.lock (); + if (!route) { return; } diff --git a/gtk2_ardour/editor_routes.h b/gtk2_ardour/editor_routes.h index a872e49012..7489cbf7d8 100644 --- a/gtk2_ardour/editor_routes.h +++ b/gtk2_ardour/editor_routes.h @@ -69,7 +69,7 @@ private: void visible_changed (Glib::ustring const &); void reordered (Gtk::TreeModel::Path const &, Gtk::TreeModel::iterator const &, int *); bool button_press (GdkEventButton *); - void route_name_changed (boost::weak_ptr); + void route_property_changed (const PBD::PropertyChange&, boost::weak_ptr); void handle_gui_changes (std::string const &, void *); void update_rec_display (); void update_mute_display (); diff --git a/gtk2_ardour/editor_tempodisplay.cc b/gtk2_ardour/editor_tempodisplay.cc index 1c3f018095..fd598b8c81 100644 --- a/gtk2_ardour/editor_tempodisplay.cc +++ b/gtk2_ardour/editor_tempodisplay.cc @@ -93,13 +93,13 @@ Editor::draw_metric_marks (const Metrics& metrics) } void -Editor::tempo_map_changed (PropertyChange ignored) +Editor::tempo_map_changed (const PropertyChange& ignored) { if (!_session) { return; } - ENSURE_GUI_THREAD (*this, &Editor::tempo_map_changed ignored); + ENSURE_GUI_THREAD (*this, &Editor::tempo_map_changed, ignored); if (tempo_lines) { tempo_lines->tempo_map_changed(); diff --git a/gtk2_ardour/lineset.h b/gtk2_ardour/lineset.h index 66b4806439..e4f836717f 100644 --- a/gtk2_ardour/lineset.h +++ b/gtk2_ardour/lineset.h @@ -65,7 +65,7 @@ public: */ void change_line_width(double coord, double width); - /** PropertyChange the color of a line. + /** Change the color of a line. */ void change_line_color(double coord, uint32_t color); diff --git a/gtk2_ardour/midi_region_view.cc b/gtk2_ardour/midi_region_view.cc index 576abafc1b..4ea7aba4fa 100644 --- a/gtk2_ardour/midi_region_view.cc +++ b/gtk2_ardour/midi_region_view.cc @@ -193,7 +193,7 @@ MidiRegionView::init (Gdk::Color const & basic_color, bool wfd) region_muted (); region_sync_changed (); - region_resized (BoundsChanged); + region_resized (ARDOUR::bounds_change); region_locked (); reset_width_dependent_items (_pixel_width); @@ -963,11 +963,11 @@ MidiRegionView::~MidiRegionView () } void -MidiRegionView::region_resized (PropertyChange what_changed) +MidiRegionView::region_resized (const PropertyChange& what_changed) { RegionView::region_resized(what_changed); - if (what_changed & ARDOUR::PositionChanged) { + if (what_changed.contains (ARDOUR::Properties::position)) { set_duration(_region->length(), 0); if (_enable_display) { redisplay_model(); diff --git a/gtk2_ardour/midi_region_view.h b/gtk2_ardour/midi_region_view.h index a08ef7c98d..d6dd213e72 100644 --- a/gtk2_ardour/midi_region_view.h +++ b/gtk2_ardour/midi_region_view.h @@ -136,7 +136,7 @@ class MidiRegionView : public RegionView */ void get_patch_key_at(double time, uint8_t channel, MIDI::Name::PatchPrimaryKey& key); - /** PropertyChange the 'automation' data of old_program to new values which correspond to new_patch. + /** Change the 'automation' data of old_program to new values which correspond to new_patch. * @param old_program the program change event which is to be altered * @param new_patch the new lsb, msb and program number which are to be set */ @@ -239,7 +239,7 @@ class MidiRegionView : public RegionView */ void change_velocity(ArdourCanvas::CanvasNoteEvent* ev, int8_t velocity, bool relative=false); - /** PropertyChange the channel of the selection. + /** Change the channel of the selection. * @param channel - the channel number of the new channel, zero-based */ void change_channel(uint8_t channel); @@ -305,7 +305,7 @@ class MidiRegionView : public RegionView Gdk::Color& basic_color, TimeAxisViewItem::Visibility); - void region_resized (PBD::PropertyChange); + void region_resized (const PBD::PropertyChange&); void set_flags (XMLNode *); void store_flags (); diff --git a/gtk2_ardour/mixer_strip.cc b/gtk2_ardour/mixer_strip.cc index 5be6ec9f5a..05a7f4628b 100644 --- a/gtk2_ardour/mixer_strip.cc +++ b/gtk2_ardour/mixer_strip.cc @@ -1442,7 +1442,7 @@ MixerStrip::name_changed () { switch (_width) { case Wide: - RouteUI::name_changed (); + RouteUI::property_changed (PropertyChange (ARDOUR::Properties::name)); break; case Narrow: name_label.set_text (PBD::short_version (_route->name(), 5)); diff --git a/gtk2_ardour/mixer_ui.cc b/gtk2_ardour/mixer_ui.cc index 03b1dd7d69..4b4a5b41b1 100644 --- a/gtk2_ardour/mixer_ui.cc +++ b/gtk2_ardour/mixer_ui.cc @@ -337,7 +337,7 @@ Mixer_UI::add_strip (RouteList& routes) route->set_order_key (N_("signal"), track_model->children().size()-1); } - route->NameChanged.connect (*this, boost::bind (&Mixer_UI::strip_name_changed, this, strip), gui_context()); + route->PropertyChanged.connect (*this, ui_bind (&Mixer_UI::strip_property_changed, this, _1, strip), gui_context()); strip->WidthChanged.connect (sigc::mem_fun(*this, &Mixer_UI::strip_width_changed)); strip->signal_button_release_event().connect (sigc::bind (sigc::mem_fun(*this, &Mixer_UI::strip_button_release_event), strip)); @@ -1005,9 +1005,13 @@ Mixer_UI::build_track_menu () } void -Mixer_UI::strip_name_changed (MixerStrip* mx) +Mixer_UI::strip_property_changed (const PropertyChange& what_changed, MixerStrip* mx) { - ENSURE_GUI_THREAD (*this, &Mixer_UI::strip_name_changed, mx) + if (!what_changed.contains (ARDOUR::Properties::name)) { + return; + } + + ENSURE_GUI_THREAD (*this, &Mixer_UI::strip_name_changed, what_changed, mx) TreeModel::Children rows = track_model->children(); TreeModel::Children::iterator i; diff --git a/gtk2_ardour/mixer_ui.h b/gtk2_ardour/mixer_ui.h index eeda3c4062..e03d2efebd 100644 --- a/gtk2_ardour/mixer_ui.h +++ b/gtk2_ardour/mixer_ui.h @@ -196,7 +196,7 @@ class Mixer_UI : public Gtk::Window, public PBD::ScopedConnectionList, public AR PluginSelector *_plugin_selector; - void strip_name_changed (MixerStrip *); + void strip_property_changed (const PBD::PropertyChange&, MixerStrip *); void group_flags_changed (void *src, ARDOUR::RouteGroup *); diff --git a/gtk2_ardour/processor_box.cc b/gtk2_ardour/processor_box.cc index 86a90fa9c5..c4d01e4458 100644 --- a/gtk2_ardour/processor_box.cc +++ b/gtk2_ardour/processor_box.cc @@ -107,7 +107,7 @@ ProcessorEntry::ProcessorEntry (boost::shared_ptr p, Width w) _active.signal_toggled().connect (sigc::mem_fun (*this, &ProcessorEntry::active_toggled)); _processor->ActiveChanged.connect (active_connection, boost::bind (&ProcessorEntry::processor_active_changed, this), gui_context()); - _processor->NameChanged.connect (name_connection, boost::bind (&ProcessorEntry::processor_name_changed, this), gui_context()); + _processor->PropertyChanged.connect (name_connection, ui_bind (&ProcessorEntry::processor_property_changed, this, _1), gui_context()); } EventBox& @@ -163,9 +163,11 @@ ProcessorEntry::processor_active_changed () } void -ProcessorEntry::processor_name_changed () +ProcessorEntry::processor_property_changed (const PropertyChange& what_changed) { - _name.set_text (name ()); + if (what_changed.contains (ARDOUR::Properties::name)) { + _name.set_text (name ()); + } } string @@ -328,7 +330,7 @@ ProcessorBox::set_route (boost::shared_ptr r) _route->processors_changed.connect (connections, ui_bind (&ProcessorBox::route_processors_changed, this, _1), gui_context()); _route->DropReferences.connect (connections, boost::bind (&ProcessorBox::route_going_away, this), gui_context()); - _route->NameChanged.connect (connections, boost::bind (&ProcessorBox::route_name_changed, this), gui_context()); + _route->PropertyChanged.connect (connections, ui_bind (&ProcessorBox::route_property_changed, this, _1), gui_context()); redisplay_processors (); } @@ -1764,9 +1766,13 @@ ProcessorBox::rb_edit () } void -ProcessorBox::route_name_changed () +ProcessorBox::route_property_changed (const PropertyChange& what_changed) { - ENSURE_GUI_THREAD (*this, &ProcessorBox::route_name_changed) + if (!what_changed.contains (ARDOUR::Properties::name)) { + return; + } + + ENSURE_GUI_THREAD (*this, &ProcessorBox::route_property_changed, what_changed); boost::shared_ptr processor; boost::shared_ptr plugin_insert; diff --git a/gtk2_ardour/processor_box.h b/gtk2_ardour/processor_box.h index a80dce00fe..d5e4572659 100644 --- a/gtk2_ardour/processor_box.h +++ b/gtk2_ardour/processor_box.h @@ -91,7 +91,7 @@ private: void active_toggled (); void processor_active_changed (); - void processor_name_changed (); + void processor_property_changed (const PBD::PropertyChange&); std::string name () const; Gtk::EventBox _event_box; @@ -275,7 +275,7 @@ class ProcessorBox : public Gtk::HBox, public PluginInterestedObject, public ARD static void rb_ab_plugins (); static void rb_edit (); - void route_name_changed (); + void route_property_changed (const PBD::PropertyChange&); std::string generate_processor_title (boost::shared_ptr pi); }; diff --git a/gtk2_ardour/region_view.cc b/gtk2_ardour/region_view.cc index 575ecbb5e2..8e45b7ace0 100644 --- a/gtk2_ardour/region_view.cc +++ b/gtk2_ardour/region_view.cc @@ -181,7 +181,7 @@ RegionView::init (Gdk::Color const & basic_color, bool wfd) set_height (trackview.current_height()); - _region->StateChanged.connect (*this, ui_bind (&RegionView::region_changed, this, _1), gui_context()); + _region->PropertyChanged.connect (*this, ui_bind (&RegionView::region_changed, this, _1), gui_context()); group->signal_event().connect (sigc::bind (sigc::mem_fun (PublicEditor::instance(), &PublicEditor::canvas_region_view_event), group, this)); @@ -228,27 +228,27 @@ RegionView::lock_toggle () } void -RegionView::region_changed (PropertyChange what_changed) +RegionView::region_changed (const PropertyChange& what_changed) { - ENSURE_GUI_THREAD (*this, &RegionView::region_changed, what_changed) + ENSURE_GUI_THREAD (*this, &RegionView::region_changed, what_changed); - if (what_changed & BoundsChanged) { + if (what_changed.contains (ARDOUR::bounds_change)) { region_resized (what_changed); region_sync_changed (); } - if (what_changed & Region::MuteChanged) { + if (what_changed.contains (ARDOUR::Properties::muted)) { region_muted (); } - if (what_changed & Region::OpacityChanged) { + if (what_changed.contains (ARDOUR::Properties::opaque)) { region_opacity (); } - if (what_changed & ARDOUR::NameChanged) { + if (what_changed.contains (ARDOUR::Properties::name)) { region_renamed (); } - if (what_changed & Region::SyncOffsetChanged) { + if (what_changed.contains (ARDOUR::Properties::sync_position)) { region_sync_changed (); } - if (what_changed & Region::LockChanged) { + if (what_changed.contains (ARDOUR::Properties::locked)) { region_locked (); } } @@ -261,16 +261,20 @@ RegionView::region_locked () } void -RegionView::region_resized (PropertyChange what_changed) +RegionView::region_resized (const PropertyChange& what_changed) { double unit_length; - if (what_changed & ARDOUR::PositionChanged) { + if (what_changed.contains (ARDOUR::Properties::position)) { set_position (_region->position(), 0); _time_converter.set_origin(_region->position()); } - if (what_changed & PropertyChange (StartChanged|LengthChanged)) { + PropertyChange s_and_l; + s_and_l.add (ARDOUR::Properties::start); + s_and_l.add (ARDOUR::Properties::length); + + if (what_changed.contains (s_and_l)) { set_duration (_region->length(), 0); diff --git a/gtk2_ardour/region_view.h b/gtk2_ardour/region_view.h index d9ffc83c50..43d8a00f17 100644 --- a/gtk2_ardour/region_view.h +++ b/gtk2_ardour/region_view.h @@ -75,7 +75,7 @@ class RegionView : public TimeAxisViewItem virtual void show_region_editor () {} virtual void hide_region_editor(); - virtual void region_changed (PBD::PropertyChange); + virtual void region_changed (const PBD::PropertyChange&); virtual GhostRegion* add_ghost (TimeAxisView&) = 0; void remove_ghost_in (TimeAxisView&); @@ -104,7 +104,7 @@ class RegionView : public TimeAxisViewItem bool recording, TimeAxisViewItem::Visibility); - virtual void region_resized (PBD::PropertyChange); + virtual void region_resized (const PBD::PropertyChange&); virtual void region_muted (); void region_locked (); void region_opacity (); diff --git a/gtk2_ardour/route_params_ui.cc b/gtk2_ardour/route_params_ui.cc index fbd7af9f7c..5e0cc0f0a5 100644 --- a/gtk2_ardour/route_params_ui.cc +++ b/gtk2_ardour/route_params_ui.cc @@ -181,15 +181,19 @@ RouteParams_UI::add_routes (RouteList& routes) //route_select_list.rows().back().select (); - route->NameChanged.connect (*this, boost::bind (&RouteParams_UI::route_name_changed, this, boost::weak_ptr(route)), gui_context()); + route->PropertyChanged.connect (*this, ui_bind (&RouteParams_UI::route_property_changed, this, _1, boost::weak_ptr(route)), gui_context()); route->DropReferences.connect (*this, boost::bind (&RouteParams_UI::route_removed, this, boost::weak_ptr(route)), gui_context()); } } void -RouteParams_UI::route_name_changed (boost::weak_ptr wr) +RouteParams_UI::route_property_changed (const PropertyChange& what_changed, boost::weak_ptr wr) { + if (!what_changed.contains (ARDOUR::Properties::name)) { + return; + } + boost::shared_ptr route (wr.lock()); if (!route) { diff --git a/gtk2_ardour/route_params_ui.h b/gtk2_ardour/route_params_ui.h index c09d3c65cd..e99b9050fe 100644 --- a/gtk2_ardour/route_params_ui.h +++ b/gtk2_ardour/route_params_ui.h @@ -161,7 +161,7 @@ class RouteParams_UI : public ArdourDialog, public PBD::ScopedConnectionList void add_routes (ARDOUR::RouteList&); - void route_name_changed (boost::weak_ptr route); + void route_property_changed (const PBD::PropertyChange&, boost::weak_ptr route); void route_removed (boost::weak_ptr route); diff --git a/gtk2_ardour/route_time_axis.cc b/gtk2_ardour/route_time_axis.cc index 0b5cf8b085..39bb1847a1 100644 --- a/gtk2_ardour/route_time_axis.cc +++ b/gtk2_ardour/route_time_axis.cc @@ -231,7 +231,7 @@ RouteTimeAxisView::RouteTimeAxisView (PublicEditor& ed, Session* sess, boost::sh _y_position = -1; _route->processors_changed.connect (*this, ui_bind (&RouteTimeAxisView::processors_changed, this, _1), gui_context()); - _route->NameChanged.connect (*this, boost::bind (&RouteTimeAxisView::route_name_changed, this), gui_context()); + _route->PropertyChanged.connect (*this, ui_bind (&RouteTimeAxisView::route_property_changed, this, _1), gui_context()); if (is_track()) { @@ -347,9 +347,11 @@ RouteTimeAxisView::label_view () } void -RouteTimeAxisView::route_name_changed () +RouteTimeAxisView::route_property_changed (const PropertyChange& what_changed) { - label_view (); + if (what_changed.contains (ARDOUR::Properties::name)) { + label_view (); + } } void diff --git a/gtk2_ardour/route_time_axis.h b/gtk2_ardour/route_time_axis.h index ac3429cb82..39d65cd499 100644 --- a/gtk2_ardour/route_time_axis.h +++ b/gtk2_ardour/route_time_axis.h @@ -218,7 +218,7 @@ protected: void reset_processor_automation_curves (); void take_name_changed (void *src); - void route_name_changed (); + void route_property_changed (const PBD::PropertyChange&); void name_entry_changed (); void update_rec_display (); diff --git a/gtk2_ardour/route_ui.cc b/gtk2_ardour/route_ui.cc index 926be943fa..1a75132e4c 100644 --- a/gtk2_ardour/route_ui.cc +++ b/gtk2_ardour/route_ui.cc @@ -205,7 +205,7 @@ RouteUI::set_route (boost::shared_ptr rp) _route->solo_changed.connect (route_connections, ui_bind (&RouteUI::solo_changed, this, _1), gui_context()); _route->listen_changed.connect (route_connections, ui_bind (&RouteUI::listen_changed, this, _1), gui_context()); _route->solo_isolated_changed.connect (route_connections, ui_bind (&RouteUI::solo_changed, this, _1), gui_context()); - _route->NameChanged.connect (route_connections, boost::bind (&RouteUI::name_changed, this), gui_context()); + _route->PropertyChanged.connect (route_connections, ui_bind (&RouteUI::property_changed, this, _1), gui_context()); if (_session->writable() && is_track()) { boost::shared_ptr t = boost::dynamic_pointer_cast(_route); @@ -1164,11 +1164,11 @@ RouteUI::route_rename () } void -RouteUI::name_changed () +RouteUI::property_changed (const PropertyChange& what_changed) { - ENSURE_GUI_THREAD (*this, &RouteUI::name_changed); - - name_label.set_text (_route->name()); + if (what_changed.contains (ARDOUR::Properties::name)) { + name_label.set_text (_route->name()); + } } void diff --git a/gtk2_ardour/route_ui.h b/gtk2_ardour/route_ui.h index 5dce9ee4b4..458910bd69 100644 --- a/gtk2_ardour/route_ui.h +++ b/gtk2_ardour/route_ui.h @@ -164,7 +164,7 @@ class RouteUI : public virtual AxisView void route_rename(); - virtual void name_changed (); + virtual void property_changed (const PBD::PropertyChange&); void route_removed (); Gtk::CheckMenuItem *route_active_menu_item; diff --git a/libs/ardour/ardour/ardour.h b/libs/ardour/ardour/ardour.h index f608db5b7e..2b1f7bbb04 100644 --- a/libs/ardour/ardour/ardour.h +++ b/libs/ardour/ardour/ardour.h @@ -53,6 +53,9 @@ namespace ARDOUR { void init_post_engine (); int cleanup (); bool no_auto_connect (); + void make_property_quarks (); + + extern PBD::PropertyChange bounds_change; std::string get_ardour_revision (); extern const char* const ardour_config_info; @@ -65,12 +68,6 @@ namespace ARDOUR { return (microseconds_t) jack_get_time(); } - extern PBD::PropertyChange StartChanged; - extern PBD::PropertyChange LengthChanged; - extern PBD::PropertyChange PositionChanged; - extern PBD::PropertyChange NameChanged; - extern PBD::PropertyChange BoundsChanged; - static const double SHUTTLE_FRACT_SPEED1=0.48412291827; /* derived from A1,A2 */ void setup_fpu (); diff --git a/libs/ardour/ardour/audioplaylist.h b/libs/ardour/ardour/audioplaylist.h index b5df4cfabb..b53f3c1f73 100644 --- a/libs/ardour/ardour/audioplaylist.h +++ b/libs/ardour/ardour/audioplaylist.h @@ -79,8 +79,8 @@ class AudioPlaylist : public ARDOUR::Playlist XMLNode& state (bool full_state); void dump () const; - bool region_changed (PBD::PropertyChange, boost::shared_ptr); - void crossfade_changed (PBD::PropertyChange); + bool region_changed (const PBD::PropertyChange&, boost::shared_ptr); + void crossfade_changed (const PBD::PropertyChange&); void add_crossfade (boost::shared_ptr); void source_offset_changed (boost::shared_ptr region); diff --git a/libs/ardour/ardour/audioregion.h b/libs/ardour/ardour/audioregion.h index 711c8030bd..ec9a64002f 100644 --- a/libs/ardour/ardour/audioregion.h +++ b/libs/ardour/ardour/audioregion.h @@ -44,6 +44,17 @@ namespace Properties { extern PBD::PropertyDescriptor fade_in_active; extern PBD::PropertyDescriptor fade_out_active; extern PBD::PropertyDescriptor scale_amplitude; + extern PBD::PropertyDescriptor scale_amplitude; + + /* the envelope and fades are not scalar items and so + currently (2010/02) are not stored using Property. + However, these descriptors enable us to notify + about changes to them via PropertyChange. + */ + + extern PBD::PropertyDescriptor envelope; + extern PBD::PropertyDescriptor fade_in; + extern PBD::PropertyDescriptor fade_out; } class Route; @@ -58,14 +69,6 @@ class AudioRegion : public Region public: static void make_property_quarks (); - static PBD::PropertyChange FadeInChanged; - static PBD::PropertyChange FadeOutChanged; - static PBD::PropertyChange FadeInActiveChanged; - static PBD::PropertyChange FadeOutActiveChanged; - static PBD::PropertyChange EnvelopeActiveChanged; - static PBD::PropertyChange ScaleAmplitudeChanged; - static PBD::PropertyChange EnvelopeChanged; - ~AudioRegion(); void copy_settings (boost::shared_ptr); @@ -185,8 +188,7 @@ class AudioRegion : public Region AudioRegion (const SourceList &); AudioRegion (boost::shared_ptr, frameoffset_t offset = 0, bool offset_relative = true); AudioRegion (boost::shared_ptr, const SourceList&); - AudioRegion (boost::shared_ptr, const XMLNode&); - AudioRegion (SourceList &, const XMLNode&); + AudioRegion (SourceList &); private: PBD::Property _envelope_active; @@ -197,7 +199,7 @@ class AudioRegion : public Region PBD::Property _scale_amplitude; void register_properties (); - PBD::PropertyChange set_property (const PBD::PropertyBase& prop); + bool set_property (const PBD::PropertyBase& prop); void post_set (); void init (); diff --git a/libs/ardour/ardour/crossfade.h b/libs/ardour/ardour/crossfade.h index 15b9b3d2a7..7b5ac28379 100644 --- a/libs/ardour/ardour/crossfade.h +++ b/libs/ardour/ardour/crossfade.h @@ -34,6 +34,11 @@ #include "evoral/Curve.hpp" namespace ARDOUR { + namespace Properties { + /* "active" is defined elsewhere but we use it with crossfade also */ + extern PBD::PropertyDescriptor active; + extern PBD::PropertyDescriptor follow_overlap; + } class AudioRegion; class Playlist; @@ -71,6 +76,8 @@ class Crossfade : public ARDOUR::AudioRegion Crossfade (const Playlist&, XMLNode&); virtual ~Crossfade(); + static void make_property_quarks (); + bool operator== (const ARDOUR::Crossfade&); XMLNode& get_state (void); @@ -106,7 +113,6 @@ class Crossfade : public ARDOUR::AudioRegion framecnt_t overlap_length() const; PBD::Signal1 > Invalidated; - PBD::Signal1 StateChanged; bool covers (framecnt_t frame) const { return _position <= frame && frame < _position + _length; @@ -136,9 +142,6 @@ class Crossfade : public ARDOUR::AudioRegion static framecnt_t short_xfade_length() { return _short_xfade_length; } static void set_short_xfade_length (framecnt_t n); - static PBD::PropertyChange ActiveChanged; - static PBD::PropertyChange FollowOverlapChanged; - private: friend struct CrossfadeComparePtr; friend class AudioPlaylist; @@ -147,11 +150,11 @@ class Crossfade : public ARDOUR::AudioRegion boost::shared_ptr _in; boost::shared_ptr _out; - bool _active; + PBD::Property _active; + PBD::Property _follow_overlap; bool _in_update; OverlapType overlap_type; AnchorPoint _anchor_point; - bool _follow_overlap; bool _fixed; int32_t layer_relation; diff --git a/libs/ardour/ardour/diskstream.h b/libs/ardour/ardour/diskstream.h index 90bcf4067a..48a9c2776b 100644 --- a/libs/ardour/ardour/diskstream.h +++ b/libs/ardour/ardour/diskstream.h @@ -206,7 +206,7 @@ class Diskstream : public SessionObject /* XXX fix this redundancy ... */ - virtual void playlist_changed (PBD::PropertyChange); + virtual void playlist_changed (const PBD::PropertyChange&); virtual void playlist_deleted (boost::weak_ptr); virtual void playlist_ranges_moved (std::list< Evoral::RangeMove > const &); diff --git a/libs/ardour/ardour/internal_send.h b/libs/ardour/ardour/internal_send.h index 2171462ab7..243106fb54 100644 --- a/libs/ardour/ardour/internal_send.h +++ b/libs/ardour/ardour/internal_send.h @@ -56,7 +56,7 @@ class InternalSend : public Send PBD::ScopedConnection connect_c; void send_to_going_away (); - void send_to_name_changed (); + void send_to_property_changed (const PBD::PropertyChange&); int connect_when_legal (); int set_our_state (XMLNode const &, int); }; diff --git a/libs/ardour/ardour/location.h b/libs/ardour/ardour/location.h index d93ffeec4a..938177b102 100644 --- a/libs/ardour/ardour/location.h +++ b/libs/ardour/ardour/location.h @@ -179,7 +179,7 @@ class Locations : public PBD::StatefulDestructible PBD::Signal0 changed; PBD::Signal1 added; PBD::Signal1 removed; - PBD::Signal1 StateChanged; + PBD::Signal1 StateChanged; template void apply (T& obj, void (T::*method)(LocationList&)) { Glib::Mutex::Lock lm (lock); diff --git a/libs/ardour/ardour/midi_model.h b/libs/ardour/ardour/midi_model.h index 77f5798898..fcd285f98c 100644 --- a/libs/ardour/ardour/midi_model.h +++ b/libs/ardour/ardour/midi_model.h @@ -90,7 +90,7 @@ public: }; - /** PropertyChange note properties. + /** Change note properties. * More efficient than DeltaCommand and has the important property that * it leaves the objects in the MidiModel (Notes) the same, thus * enabling selection and other state to persist across command @@ -126,7 +126,7 @@ public: boost::shared_ptr _model; const std::string _name; - struct NotePropertyChange { + struct NoteChange { DiffCommand::Property property; boost::shared_ptr< Evoral::Note > note; union { @@ -139,11 +139,11 @@ public: }; }; - typedef std::list ChangeList; + typedef std::list ChangeList; ChangeList _changes; - XMLNode &marshal_change(const NotePropertyChange&); - NotePropertyChange unmarshal_change(XMLNode *xml_note); + XMLNode &marshal_change(const NoteChange&); + NoteChange unmarshal_change(XMLNode *xml_note); }; MidiModel::DeltaCommand* new_delta_command(const std::string name="midi edit"); diff --git a/libs/ardour/ardour/midi_playlist.h b/libs/ardour/ardour/midi_playlist.h index 46aea9f0b4..ccadb39e92 100644 --- a/libs/ardour/ardour/midi_playlist.h +++ b/libs/ardour/ardour/midi_playlist.h @@ -74,7 +74,7 @@ protected: private: void dump () const; - bool region_changed (PBD::PropertyChange, boost::shared_ptr); + bool region_changed (const PBD::PropertyChange&, boost::shared_ptr); NoteMode _note_mode; diff --git a/libs/ardour/ardour/midi_region.h b/libs/ardour/ardour/midi_region.h index d892e5837f..671e4fca43 100644 --- a/libs/ardour/ardour/midi_region.h +++ b/libs/ardour/ardour/midi_region.h @@ -96,11 +96,8 @@ class MidiRegion : public Region private: friend class RegionFactory; - MidiRegion (boost::shared_ptr); MidiRegion (const SourceList&); MidiRegion (boost::shared_ptr, frameoffset_t offset = 0, bool offset_relative = true); - MidiRegion (boost::shared_ptr, const XMLNode&); - MidiRegion (const SourceList &, const XMLNode&); private: framecnt_t _read_at (const SourceList&, Evoral::EventSink& dst, diff --git a/libs/ardour/ardour/playlist.h b/libs/ardour/ardour/playlist.h index 9cd02dec1e..7213c99397 100644 --- a/libs/ardour/ardour/playlist.h +++ b/libs/ardour/ardour/playlist.h @@ -249,15 +249,15 @@ class Playlist : public SessionObject void notify_length_changed (); void notify_layering_changed (); void notify_contents_changed (); - void notify_state_changed (PBD::PropertyChange); + void notify_state_changed (const PBD::PropertyChange&); void notify_region_moved (boost::shared_ptr); void mark_session_dirty(); - void region_changed_proxy (PBD::PropertyChange, boost::weak_ptr); - virtual bool region_changed (PBD::PropertyChange, boost::shared_ptr); + void region_changed_proxy (const PBD::PropertyChange&, boost::weak_ptr); + virtual bool region_changed (const PBD::PropertyChange&, boost::shared_ptr); - void region_bounds_changed (PBD::PropertyChange, boost::shared_ptr); + void region_bounds_changed (const PBD::PropertyChange&, boost::shared_ptr); void region_deleted (boost::shared_ptr); void sort_regions (); diff --git a/libs/ardour/ardour/region.h b/libs/ardour/ardour/region.h index 60ccf66984..fb827e308d 100644 --- a/libs/ardour/ardour/region.h +++ b/libs/ardour/ardour/region.h @@ -89,16 +89,7 @@ class Region MusicTime }; - static PBD::PropertyChange FadeChanged; - static PBD::PropertyChange SyncOffsetChanged; - static PBD::PropertyChange MuteChanged; - static PBD::PropertyChange OpacityChanged; - static PBD::PropertyChange LockChanged; - static PBD::PropertyChange LayerChanged; - static PBD::PropertyChange HiddenChanged; - - PBD::Signal1 StateChanged; - static PBD::Signal1 > RegionPropertyChanged; + static PBD::Signal2, const PBD::PropertyChange&> RegionPropertyChanged; void unlock_property_changes () { _no_property_changes = false; } void block_property_changes () { _no_property_changes = true; } @@ -281,8 +272,6 @@ class Region protected: friend class RegionFactory; - /** Construct a region from a single source */ - Region (boost::shared_ptr src); /** Construct a region from multiple sources*/ Region (const SourceList& srcs); /** Construct a region from another region, at an offset within that region */ @@ -292,16 +281,11 @@ class Region /** normal Region copy constructor */ Region (boost::shared_ptr); - /** Construct a region from 1 source and XML state */ - Region (boost::shared_ptr src, const XMLNode&); - /** Construct a region from multiple sources and XML state */ - Region (const SourceList& srcs, const XMLNode&); - /** Constructor for derived types only */ Region (Session& s, framepos_t start, framecnt_t length, const std::string& name, DataType); protected: - void send_change (PBD::PropertyChange); + void send_change (const PBD::PropertyChange&); void trim_to_internal (framepos_t position, framecnt_t length, void *src); virtual void set_position_internal (framepos_t pos, bool allow_bbt_recompute); @@ -351,7 +335,7 @@ class Region AnalysisFeatureList _transients; bool _valid_transients; mutable uint64_t _read_data_count; ///< modified in read() - PBD::PropertyChange _pending_changed; + PBD::PropertyChange _pending_changed; uint64_t _last_layer_op; ///< timestamp Glib::Mutex _lock; SourceList _sources; @@ -365,7 +349,7 @@ class Region virtual int _set_state (const XMLNode&, int version, PBD::PropertyChange& what_changed, bool send_signal); - PBD::PropertyChange set_property (const PBD::PropertyBase&); + bool set_property (const PBD::PropertyBase&); void register_properties (); private: diff --git a/libs/ardour/ardour/route_group.h b/libs/ardour/ardour/route_group.h index 820295b54a..f3109a707d 100644 --- a/libs/ardour/ardour/route_group.h +++ b/libs/ardour/ardour/route_group.h @@ -131,9 +131,6 @@ class RouteGroup : public SessionObject PBD::Signal0 changed; PBD::Signal1 FlagsChanged; - static PBD::PropertyChange FlagsChange; - static PBD::PropertyChange PropertiesChange; - XMLNode& get_state (); int set_state (const XMLNode&, int version); diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h index 154c5d0078..9294d56fcc 100644 --- a/libs/ardour/ardour/session.h +++ b/libs/ardour/ardour/session.h @@ -1210,7 +1210,7 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi void xrun_recovery (); TempoMap *_tempo_map; - void tempo_map_changed (PBD::PropertyChange); + void tempo_map_changed (const PBD::PropertyChange&); /* edit/mix groups */ @@ -1257,7 +1257,7 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi RegionList regions; void add_region (boost::shared_ptr); - void region_changed (PBD::PropertyChange, boost::weak_ptr); + void region_changed (const PBD::PropertyChange&, boost::weak_ptr); void remove_region (boost::weak_ptr); int load_regions (const XMLNode& node); diff --git a/libs/ardour/ardour/session_object.h b/libs/ardour/ardour/session_object.h index 1f81cf6fd2..d18a1f9d41 100644 --- a/libs/ardour/ardour/session_object.h +++ b/libs/ardour/ardour/session_object.h @@ -48,7 +48,7 @@ class SessionObject : public SessionHandleRef, public PBD::StatefulDestructible SessionObject (Session& session, const std::string& name) : SessionHandleRef (session) - , _name (Properties::name, PBD::PropertyChange (0), name) + , _name (Properties::name, name) { add_property (_name); } @@ -56,18 +56,16 @@ class SessionObject : public SessionHandleRef, public PBD::StatefulDestructible Session& session() const { return _session; } std::string name() const { return _name; } - PBD::PropertyChange set_property (const PBD::PropertyBase& prop); + bool set_property (const PBD::PropertyBase& prop); virtual bool set_name (const std::string& str) { if (_name != str) { _name = str; - NameChanged(); + PropertyChanged (PBD::PropertyChange (Properties::name)); } return true; } - PBD::Signal0 NameChanged; - protected: PBD::Property _name; }; diff --git a/libs/ardour/ardour/tempo.h b/libs/ardour/ardour/tempo.h index 5c2d3d6918..596444173f 100644 --- a/libs/ardour/ardour/tempo.h +++ b/libs/ardour/ardour/tempo.h @@ -258,8 +258,6 @@ class TempoMap : public PBD::StatefulDestructible nframes_t frame_rate () const { return _frame_rate; } - PBD::Signal1 StateChanged; - private: static Tempo _default_tempo; static Meter _default_meter; diff --git a/libs/ardour/audio_playlist.cc b/libs/ardour/audio_playlist.cc index 60c7d4bdc3..6e8b35a072 100644 --- a/libs/ardour/audio_playlist.cc +++ b/libs/ardour/audio_playlist.cc @@ -525,7 +525,7 @@ AudioPlaylist::add_crossfade (boost::shared_ptr xfade) _crossfades.push_back (xfade); xfade->Invalidated.connect_same_thread (*this, boost::bind (&AudioPlaylist::crossfade_invalidated, this, _1)); - xfade->StateChanged.connect_same_thread (*this, boost::bind (&AudioPlaylist::crossfade_changed, this, _1)); + xfade->PropertyChanged.connect_same_thread (*this, boost::bind (&AudioPlaylist::crossfade_changed, this, _1)); notify_crossfade_added (xfade); } @@ -581,7 +581,7 @@ AudioPlaylist::set_state (const XMLNode& node, int version) boost::shared_ptr xfade = boost::shared_ptr (new Crossfade (*((const Playlist *)this), *child)); _crossfades.push_back (xfade); xfade->Invalidated.connect_same_thread (*this, boost::bind (&AudioPlaylist::crossfade_invalidated, this, _1)); - xfade->StateChanged.connect_same_thread (*this, boost::bind (&AudioPlaylist::crossfade_changed, this, _1)); + xfade->PropertyChanged.connect_same_thread (*this, boost::bind (&AudioPlaylist::crossfade_changed, this, _1)); NewCrossfade(xfade); } @@ -726,7 +726,7 @@ AudioPlaylist::destroy_region (boost::shared_ptr region) } void -AudioPlaylist::crossfade_changed (PropertyChange) +AudioPlaylist::crossfade_changed (const PropertyChange&) { if (in_flush || in_set_state) { return; @@ -742,24 +742,27 @@ AudioPlaylist::crossfade_changed (PropertyChange) } bool -AudioPlaylist::region_changed (PropertyChange what_changed, boost::shared_ptr region) +AudioPlaylist::region_changed (const PropertyChange& what_changed, boost::shared_ptr region) { if (in_flush || in_set_state) { return false; } - PropertyChange our_interests = PropertyChange (AudioRegion::FadeInChanged| - AudioRegion::FadeOutChanged| - AudioRegion::FadeInActiveChanged| - AudioRegion::FadeOutActiveChanged| - AudioRegion::EnvelopeActiveChanged| - AudioRegion::ScaleAmplitudeChanged| - AudioRegion::EnvelopeChanged); + PropertyChange our_interests; + + our_interests.add (Properties::fade_in_active); + our_interests.add (Properties::fade_out_active); + our_interests.add (Properties::scale_amplitude); + our_interests.add (Properties::envelope_active); + our_interests.add (Properties::envelope); + our_interests.add (Properties::fade_in); + our_interests.add (Properties::fade_out); + bool parent_wants_notify; parent_wants_notify = Playlist::region_changed (what_changed, region); - if ((parent_wants_notify || (what_changed & our_interests))) { + if (parent_wants_notify || (what_changed.contains (our_interests))) { notify_contents_changed (); } diff --git a/libs/ardour/audioregion.cc b/libs/ardour/audioregion.cc index f1af3b6fab..21fda237cb 100644 --- a/libs/ardour/audioregion.cc +++ b/libs/ardour/audioregion.cc @@ -89,12 +89,12 @@ AudioRegion::register_properties () } #define AUDIOREGION_STATE_DEFAULT \ - _envelope_active (Properties::envelope_active, EnvelopeActiveChanged, false) \ - , _default_fade_in (Properties::default_fade_in, FadeInChanged, true) \ - , _default_fade_out (Properties::default_fade_out, FadeOutChanged, true) \ - , _fade_in_active (Properties::fade_in_active, FadeInActiveChanged, true) \ - , _fade_out_active (Properties::fade_out_active, FadeOutActiveChanged, true) \ - , _scale_amplitude (Properties::scale_amplitude, ScaleAmplitudeChanged, 1.0) + _envelope_active (Properties::envelope_active, false) \ + , _default_fade_in (Properties::default_fade_in, true) \ + , _default_fade_out (Properties::default_fade_out, true) \ + , _fade_in_active (Properties::fade_in_active, true) \ + , _fade_out_active (Properties::fade_out_active, true) \ + , _scale_amplitude (Properties::scale_amplitude, 0.0) #define AUDIOREGION_COPY_STATE(other) \ _envelope_active (other->_envelope_active) \ @@ -104,14 +104,6 @@ AudioRegion::register_properties () , _fade_out_active (other->_fade_out_active) \ , _scale_amplitude (other->_scale_amplitude) -PropertyChange AudioRegion::FadeInChanged = PBD::new_change(); -PropertyChange AudioRegion::FadeOutChanged = PBD::new_change(); -PropertyChange AudioRegion::FadeInActiveChanged = PBD::new_change(); -PropertyChange AudioRegion::FadeOutActiveChanged = PBD::new_change(); -PropertyChange AudioRegion::EnvelopeActiveChanged = PBD::new_change(); -PropertyChange AudioRegion::ScaleAmplitudeChanged = PBD::new_change(); -PropertyChange AudioRegion::EnvelopeChanged = PBD::new_change(); - /* a Session will reset these to its chosen defaults by calling AudioRegion::set_default_fade() */ void @@ -142,26 +134,7 @@ AudioRegion::AudioRegion (Session& s, framepos_t start, framecnt_t len, std::str assert (_sources.size() == _master_sources.size()); } -/** Basic AudioRegion constructor (one channel) */ -AudioRegion::AudioRegion (boost::shared_ptr src) - : Region (boost::static_pointer_cast(src)) - , AUDIOREGION_STATE_DEFAULT - , _automatable(src->session()) - , _fade_in (new AutomationList(Evoral::Parameter(FadeInAutomation))) - , _fade_out (new AutomationList(Evoral::Parameter(FadeOutAutomation))) - , _envelope (new AutomationList(Evoral::Parameter(EnvelopeAutomation))) - , _fade_in_suspended (0) - , _fade_out_suspended (0) -{ - init (); - - /* XXX why is this set here ? - set in a property list given to RegionFactory */ - _external = true; - - assert (_sources.size() == _master_sources.size()); -} - -/** Basic AudioRegion constructor (many channels) */ +/** Basic AudioRegion constructor */ AudioRegion::AudioRegion (const SourceList& srcs) : Region (srcs) , AUDIOREGION_STATE_DEFAULT @@ -219,26 +192,8 @@ AudioRegion::AudioRegion (boost::shared_ptr other, const Sour assert (_sources.size() == _master_sources.size()); } -AudioRegion::AudioRegion (boost::shared_ptr src, const XMLNode& node) - : Region (src, node) - , AUDIOREGION_STATE_DEFAULT - , _automatable(src->session()) - , _fade_in (new AutomationList(Evoral::Parameter(FadeInAutomation))) - , _fade_out (new AutomationList(Evoral::Parameter(FadeOutAutomation))) - , _envelope (new AutomationList(Evoral::Parameter(EnvelopeAutomation))) -{ - init (); - - if (set_state (node, Stateful::loading_state_version)) { - throw failed_constructor(); - } - - assert(_type == DataType::AUDIO); - assert (_sources.size() == _master_sources.size()); -} - -AudioRegion::AudioRegion (SourceList& srcs, const XMLNode& node) - : Region (srcs, node) +AudioRegion::AudioRegion (SourceList& srcs) + : Region (srcs) , AUDIOREGION_STATE_DEFAULT , _automatable(srcs[0]->session()) , _fade_in (new AutomationList(Evoral::Parameter(FadeInAutomation))) @@ -249,12 +204,7 @@ AudioRegion::AudioRegion (SourceList& srcs, const XMLNode& node) { init (); - if (set_state (node, Stateful::loading_state_version)) { - throw failed_constructor(); - } - assert(_type == DataType::AUDIO); - connect_to_analysis_changed (); assert (_sources.size() == _master_sources.size()); } @@ -327,7 +277,7 @@ AudioRegion::set_envelope_active (bool yn) { if (envelope_active() != yn) { _envelope_active = yn; - send_change (EnvelopeActiveChanged); + send_change (PropertyChange (Properties::envelope_active)); } } @@ -650,8 +600,7 @@ AudioRegion::_set_state (const XMLNode& node, int version, PropertyChange& what_ float a = atof (prop->value().c_str()); if (a != _scale_amplitude) { _scale_amplitude = a; - what_changed = PropertyChange (what_changed|ScaleAmplitudeChanged); - cerr << _name << " amp changed\n"; + what_changed.add (Properties::scale_amplitude); } } @@ -730,7 +679,6 @@ AudioRegion::_set_state (const XMLNode& node, int version, PropertyChange& what_ thaw (); if (send) { - cerr << _name << ": audio final change: " << hex << what_changed << dec << endl; send_change (what_changed); } @@ -741,54 +689,52 @@ AudioRegion::_set_state (const XMLNode& node, int version, PropertyChange& what_ return 0; } -PropertyChange +bool AudioRegion::set_property (const PropertyBase& prop) { - PropertyChange c = PropertyChange (0); - DEBUG_TRACE (DEBUG::Properties, string_compose ("audio region %1 set property %2\n", _name.val(), prop.property_name())); if (prop == Properties::envelope_active.id) { bool val = dynamic_cast*>(&prop)->val(); if (val != _envelope_active) { _envelope_active = val; - c = EnvelopeActiveChanged; + return true; } } else if (prop == Properties::default_fade_in.id) { bool val = dynamic_cast*>(&prop)->val(); if (val != _default_fade_in) { _default_fade_in = val; - c = FadeInChanged; + return true; } } else if (prop == Properties::default_fade_out.id) { bool val = dynamic_cast*>(&prop)->val(); if (val != _default_fade_out) { _default_fade_out = val; - c = FadeOutChanged; + return true; } } else if (prop == Properties::fade_in_active.id) { bool val = dynamic_cast*>(&prop)->val(); if (val != _fade_in_active) { _fade_in_active = val; - c = FadeInActiveChanged; + return true; } } else if (prop == Properties::fade_out_active.id) { bool val = dynamic_cast*>(&prop)->val(); if (val != _fade_out_active) { _fade_out_active = val; - c = FadeOutChanged; + return true; } } else if (prop == Properties::scale_amplitude.id) { gain_t val = dynamic_cast*>(&prop)->val(); if (val != _scale_amplitude) { _scale_amplitude = val; - c = ScaleAmplitudeChanged; + return true; } } else { return Region::set_property (prop); } - - return c; + + return false; } int @@ -817,7 +763,7 @@ AudioRegion::set_fade_in (boost::shared_ptr f) *_fade_in = *f; _fade_in->thaw (); - send_change (FadeInChanged); + send_change (PropertyChange (Properties::fade_in)); } void @@ -884,7 +830,7 @@ AudioRegion::set_fade_out (boost::shared_ptr f) *_fade_out = *f; _fade_out->thaw (); - send_change (FadeInChanged); + send_change (PropertyChange (Properties::fade_in)); } void @@ -953,7 +899,7 @@ AudioRegion::set_fade_in_length (framecnt_t len) if (changed) { _default_fade_in = false; - send_change (FadeInChanged); + send_change (PropertyChange (Properties::fade_in)); } } @@ -968,7 +914,7 @@ AudioRegion::set_fade_out_length (framecnt_t len) if (changed) { _default_fade_out = false; - send_change (FadeOutChanged); + send_change (PropertyChange (Properties::fade_out)); } } @@ -980,7 +926,7 @@ AudioRegion::set_fade_in_active (bool yn) } _fade_in_active = yn; - send_change (FadeInActiveChanged); + send_change (PropertyChange (Properties::fade_in_active)); } void @@ -990,7 +936,7 @@ AudioRegion::set_fade_out_active (bool yn) return; } _fade_out_active = yn; - send_change (FadeOutActiveChanged); + send_change (PropertyChange (Properties::fade_out_active)); } bool @@ -1050,12 +996,12 @@ AudioRegion::recompute_at_end () if (_fade_in->back()->when > _length) { _fade_in->extend_to (_length); - send_change (FadeInChanged); + send_change (PropertyChange (Properties::fade_in)); } if (_fade_out->back()->when > _length) { _fade_out->extend_to (_length); - send_change (FadeOutChanged); + send_change (PropertyChange (Properties::fade_out)); } } @@ -1068,12 +1014,12 @@ AudioRegion::recompute_at_start () if (_fade_in->back()->when > _length) { _fade_in->extend_to (_length); - send_change (FadeInChanged); + send_change (PropertyChange (Properties::fade_in)); } if (_fade_out->back()->when > _length) { _fade_out->extend_to (_length); - send_change (FadeOutChanged); + send_change (PropertyChange (Properties::fade_out)); } } @@ -1212,7 +1158,7 @@ AudioRegion::set_scale_amplitude (gain_t g) /* tell everybody else */ - send_change (ScaleAmplitudeChanged); + send_change (PropertyChange (Properties::scale_amplitude)); } void @@ -1282,25 +1228,25 @@ AudioRegion::normalize_to (float target_dB) /* tell everybody else */ - send_change (ScaleAmplitudeChanged); + send_change (PropertyChange (Properties::scale_amplitude)); } void AudioRegion::fade_in_changed () { - send_change (FadeInChanged); + send_change (PropertyChange (Properties::fade_in)); } void AudioRegion::fade_out_changed () { - send_change (FadeOutChanged); + send_change (PropertyChange (Properties::fade_out)); } void AudioRegion::envelope_changed () { - send_change (EnvelopeChanged); + send_change (PropertyChange (Properties::envelope)); } void diff --git a/libs/ardour/crossfade.cc b/libs/ardour/crossfade.cc index dc84352f4e..8275876fe8 100644 --- a/libs/ardour/crossfade.cc +++ b/libs/ardour/crossfade.cc @@ -37,8 +37,6 @@ using namespace ARDOUR; using namespace PBD; framecnt_t Crossfade::_short_xfade_length = 0; -PropertyChange Crossfade::ActiveChanged = new_change(); -PropertyChange Crossfade::FollowOverlapChanged = new_change(); /* XXX if and when we ever implement parallel processing of the process() callback, these will need to be handled on a per-thread basis. @@ -47,6 +45,24 @@ PropertyChange Crossfade::FollowOverlapChanged = new_change(); Sample* Crossfade::crossfade_buffer_out = 0; Sample* Crossfade::crossfade_buffer_in = 0; + +#define CROSSFADE_DEFAULT_PROPERTIES \ + _active (Properties::active, _session.config.get_xfades_active ()) \ + , _follow_overlap (Properties::follow_overlap, false) + + +namespace ARDOUR { + namespace Properties { + PropertyDescriptor follow_overlap; + } +} + +void +Crossfade::make_property_quarks () +{ + Properties::follow_overlap.id = g_quark_from_static_string (X_("follow-overlap")); +} + void Crossfade::set_buffer_size (framecnt_t sz) { @@ -72,26 +88,25 @@ Crossfade::Crossfade (boost::shared_ptr in, boost::shared_ptr