summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2010-02-19 18:09:08 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2010-02-19 18:09:08 +0000
commitfa701b8c065251d242342b86a54d91826d2290a0 (patch)
tree106865e709c61a1d3af045a26a757b22ba423c3e /gtk2_ardour
parent728bedf9b917287ea76b98860dec04e72472230c (diff)
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
Diffstat (limited to 'gtk2_ardour')
-rw-r--r--gtk2_ardour/audio_region_editor.cc52
-rw-r--r--gtk2_ardour/audio_region_editor.h4
-rw-r--r--gtk2_ardour/audio_region_view.cc29
-rw-r--r--gtk2_ardour/audio_region_view.h4
-rw-r--r--gtk2_ardour/automation_region_view.cc4
-rw-r--r--gtk2_ardour/automation_region_view.h2
-rw-r--r--gtk2_ardour/crossfade_edit.cc4
-rw-r--r--gtk2_ardour/crossfade_edit.h2
-rw-r--r--gtk2_ardour/crossfade_view.cc15
-rw-r--r--gtk2_ardour/crossfade_view.h6
-rw-r--r--gtk2_ardour/editor.cc7
-rw-r--r--gtk2_ardour/editor.h4
-rw-r--r--gtk2_ardour/editor_markers.cc2
-rw-r--r--gtk2_ardour/editor_mouse.cc12
-rw-r--r--gtk2_ardour/editor_ops.cc5
-rw-r--r--gtk2_ardour/editor_regions.cc12
-rw-r--r--gtk2_ardour/editor_regions.h2
-rw-r--r--gtk2_ardour/editor_routes.cc9
-rw-r--r--gtk2_ardour/editor_routes.h2
-rw-r--r--gtk2_ardour/editor_tempodisplay.cc4
-rw-r--r--gtk2_ardour/lineset.h2
-rw-r--r--gtk2_ardour/midi_region_view.cc6
-rw-r--r--gtk2_ardour/midi_region_view.h6
-rw-r--r--gtk2_ardour/mixer_strip.cc2
-rw-r--r--gtk2_ardour/mixer_ui.cc10
-rw-r--r--gtk2_ardour/mixer_ui.h2
-rw-r--r--gtk2_ardour/processor_box.cc18
-rw-r--r--gtk2_ardour/processor_box.h4
-rw-r--r--gtk2_ardour/region_view.cc28
-rw-r--r--gtk2_ardour/region_view.h4
-rw-r--r--gtk2_ardour/route_params_ui.cc8
-rw-r--r--gtk2_ardour/route_params_ui.h2
-rw-r--r--gtk2_ardour/route_time_axis.cc8
-rw-r--r--gtk2_ardour/route_time_axis.h2
-rw-r--r--gtk2_ardour/route_ui.cc10
-rw-r--r--gtk2_ardour/route_ui.h2
36 files changed, 178 insertions, 117 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<AudioRegion>
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<ARDOUR::AutomationList> 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<Crossfade> 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<Crossfade> 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> region)
void
-EditorRegions::region_changed (PropertyChange what_changed, boost::weak_ptr<Region> region)
+EditorRegions::region_changed (const PropertyChange& what_changed, boost::weak_ptr<Region> region)
{
ENSURE_GUI_THREAD (*this, &EditorRegions::region_changed, what_changed, region)
@@ -357,7 +357,7 @@ EditorRegions::region_changed (PropertyChange what_changed, boost::weak_ptr<Regi
return;
}
- if (what_changed & ARDOUR::NameChanged) {
+ if (what_changed.contains (ARDOUR::Properties::name)) {
/* find the region in our model and change its name */
TreeModel::Children rows = _model->children ();
TreeModel::iterator i = rows.begin ();
@@ -762,10 +762,10 @@ EditorRegions::populate_row (boost::shared_ptr<Region> 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<ARDOUR::Region>);
+ void region_changed (const PBD::PropertyChange&, boost::weak_ptr<ARDOUR::Region>);
void selection_changed ();
sigc::connection _change_connection;
bool set_selected_in_subrow (boost::shared_ptr<ARDOUR::Region>, 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<RouteTimeAxisView*> routes)
boost::weak_ptr<Route> 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<Track> t = boost::dynamic_pointer_cast<Track> ((*x)->route());
@@ -487,11 +487,16 @@ EditorRoutes::route_removed (TimeAxisView *tv)
}
void
-EditorRoutes::route_name_changed (boost::weak_ptr<Route> r)
+EditorRoutes::route_property_changed (const PropertyChange& what_changed, boost::weak_ptr<Route> r)
{
+ if (!what_changed.contains (ARDOUR::Properties::name)) {
+ return;
+ }
+
ENSURE_GUI_THREAD (*this, &EditorRoutes::route_name_changed, r)
boost::shared_ptr<Route> 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<ARDOUR::Route>);
+ void route_property_changed (const PBD::PropertyChange&, boost::weak_ptr<ARDOUR::Route>);
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<Processor> 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<Route> 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> processor;
boost::shared_ptr<PluginInsert> 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<ARDOUR::PluginInsert> 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>(route)), gui_context());
+ route->PropertyChanged.connect (*this, ui_bind (&RouteParams_UI::route_property_changed, this, _1, boost::weak_ptr<Route>(route)), gui_context());
route->DropReferences.connect (*this, boost::bind (&RouteParams_UI::route_removed, this, boost::weak_ptr<Route>(route)), gui_context());
}
}
void
-RouteParams_UI::route_name_changed (boost::weak_ptr<Route> wr)
+RouteParams_UI::route_property_changed (const PropertyChange& what_changed, boost::weak_ptr<Route> wr)
{
+ if (!what_changed.contains (ARDOUR::Properties::name)) {
+ return;
+ }
+
boost::shared_ptr<Route> 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<ARDOUR::Route> route);
+ void route_property_changed (const PBD::PropertyChange&, boost::weak_ptr<ARDOUR::Route> route);
void route_removed (boost::weak_ptr<ARDOUR::Route> 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<Route> 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<Track> t = boost::dynamic_pointer_cast<Track>(_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;