diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2010-02-18 13:59:49 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2010-02-18 13:59:49 +0000 |
commit | ce7a5e1c9fa3edf2d9cc66875505e402a0aaa6f6 (patch) | |
tree | 8a798270cd892823c7eeef99c2f3cdd4bf657bb3 /gtk2_ardour | |
parent | cdcc4d3720d8168a158f6a5a5f23e9ce981bc68c (diff) |
the Properties & 64bit region commit
git-svn-id: svn://localhost/ardour2/branches/3.0@6695 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour')
46 files changed, 357 insertions, 203 deletions
diff --git a/gtk2_ardour/add_route_dialog.cc b/gtk2_ardour/add_route_dialog.cc index 47eeb94320..18792bb654 100644 --- a/gtk2_ardour/add_route_dialog.cc +++ b/gtk2_ardour/add_route_dialog.cc @@ -414,7 +414,11 @@ void AddRouteDialog::group_changed () { if (_session && route_group_combo.get_active_text () == _("New group...")) { - RouteGroup* g = new RouteGroup (*_session, "", RouteGroup::Active); + RouteGroup* g = new RouteGroup (*_session, ""); + + PropertyList plist; + plist.add (Properties::active, true); + g->set_properties (plist); RouteGroupDialog d (g, Gtk::Stock::NEW); int const r = d.do_run (); diff --git a/gtk2_ardour/audio_region_editor.cc b/gtk2_ardour/audio_region_editor.cc index 3d29ed6b47..668ed8ed52 100644 --- a/gtk2_ardour/audio_region_editor.cc +++ b/gtk2_ardour/audio_region_editor.cc @@ -152,7 +152,7 @@ AudioRegionEditor::AudioRegionEditor (Session* s, boost::shared_ptr<AudioRegion> show_all(); name_changed (); - bounds_changed (Change (StartChanged|LengthChanged|PositionChanged|Region::SyncOffsetChanged)); + bounds_changed (PropertyChange (StartChanged|LengthChanged|PositionChanged|Region::SyncOffsetChanged)); gain_changed (); _region->StateChanged.connect (state_connection, ui_bind (&AudioRegionEditor::region_changed, this, _1), gui_context()); @@ -167,13 +167,13 @@ AudioRegionEditor::~AudioRegionEditor () } void -AudioRegionEditor::region_changed (PBD::Change what_changed) +AudioRegionEditor::region_changed (PBD::PropertyChange what_changed) { if (what_changed & NameChanged) { name_changed (); } - if (what_changed & Change (BoundsChanged|StartChanged|Region::SyncOffsetChanged)) { + if (what_changed & PropertyChange (BoundsChanged|StartChanged|Region::SyncOffsetChanged)) { bounds_changed (what_changed); } @@ -326,16 +326,16 @@ AudioRegionEditor::name_changed () } void -AudioRegionEditor::bounds_changed (Change what_changed) +AudioRegionEditor::bounds_changed (PropertyChange what_changed) { - if ((what_changed & Change (PositionChanged|LengthChanged)) == Change (PositionChanged|LengthChanged)) { + if ((what_changed & PropertyChange (PositionChanged|LengthChanged)) == PropertyChange (PositionChanged|LengthChanged)) { 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 & Change (PositionChanged)) { + } else if (what_changed & PropertyChange (PositionChanged)) { position_clock.set (_region->position(), true); end_clock.set (_region->position() + _region->length() - 1, true); - } else if (what_changed & Change (LengthChanged)) { + } else if (what_changed & PropertyChange (LengthChanged)) { end_clock.set (_region->position() + _region->length() - 1, true); length_clock.set (_region->length(), true); } @@ -412,6 +412,6 @@ AudioRegionEditor::sync_offset_relative_clock_changed () bool AudioRegionEditor::on_delete_event (GdkEventAny* ev) { - bounds_changed (Change (StartChanged|LengthChanged|PositionChanged|Region::SyncOffsetChanged)); + bounds_changed (PropertyChange (StartChanged|LengthChanged|PositionChanged|Region::SyncOffsetChanged)); return RegionEditor::on_delete_event (ev); } diff --git a/gtk2_ardour/audio_region_editor.h b/gtk2_ardour/audio_region_editor.h index af9d1b057b..e33caadba6 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::Change); - void bounds_changed (PBD::Change); + void region_changed (PBD::PropertyChange); + void bounds_changed (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 54be60bc9d..4d783956d7 100644 --- a/gtk2_ardour/audio_region_view.cc +++ b/gtk2_ardour/audio_region_view.cc @@ -264,7 +264,7 @@ AudioRegionView::audio_region() const } void -AudioRegionView::region_changed (Change what_changed) +AudioRegionView::region_changed (PropertyChange what_changed) { ENSURE_GUI_THREAD (*this, &AudioRegionView::region_changed, what_changed) //cerr << "AudioRegionView::region_changed() called" << endl; @@ -372,13 +372,13 @@ AudioRegionView::region_renamed () } void -AudioRegionView::region_resized (Change what_changed) +AudioRegionView::region_resized (PropertyChange what_changed) { AudioGhostRegion* agr; RegionView::region_resized(what_changed); - if (what_changed & Change (StartChanged|LengthChanged)) { + if (what_changed & PropertyChange (StartChanged|LengthChanged)) { 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 87e5d23327..767a66faed 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::Change); + void region_changed (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::Change); + void region_resized (PBD::PropertyChange); void region_muted (); void region_scale_amplitude_changed (); void region_renamed (); diff --git a/gtk2_ardour/audio_streamview.cc b/gtk2_ardour/audio_streamview.cc index 8c427f2621..6b1aed6268 100644 --- a/gtk2_ardour/audio_streamview.cc +++ b/gtk2_ardour/audio_streamview.cc @@ -483,8 +483,16 @@ AudioStreamView::setup_rec_box () + _trackview.get_diskstream()->get_captured_frames(rec_regions.size()-1); } - boost::shared_ptr<AudioRegion> region (boost::dynamic_pointer_cast<AudioRegion>( - RegionFactory::create (sources, start, 1, "", 0, Region::DefaultFlags, false))); + PropertyList plist; + + plist.add (Properties::start, start); + plist.add (Properties::length, 1); + plist.add (Properties::name, string()); + plist.add (Properties::layer, 0); + + boost::shared_ptr<AudioRegion> region ( + boost::dynamic_pointer_cast<AudioRegion>(RegionFactory::create (sources, plist, false))); + assert(region); region->block_property_changes (); region->set_position (_trackview.session()->transport_frame(), this); diff --git a/gtk2_ardour/automation_region_view.cc b/gtk2_ardour/automation_region_view.cc index f1000d7159..a796d4d7cd 100644 --- a/gtk2_ardour/automation_region_view.cc +++ b/gtk2_ardour/automation_region_view.cc @@ -158,7 +158,7 @@ AutomationRegionView::reset_width_dependent_items (double pixel_width) void -AutomationRegionView::region_resized (PBD::Change what_changed) +AutomationRegionView::region_resized (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 b4f53b5921..0a1978c963 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::Change what_changed); + void region_resized (PBD::PropertyChange what_changed); bool canvas_event(GdkEvent* ev); void add_automation_event (GdkEvent* event, nframes_t when, double y); void entered(); diff --git a/gtk2_ardour/canvas-waveview.c b/gtk2_ardour/canvas-waveview.c index cafc47b61f..f3a3117622 100644 --- a/gtk2_ardour/canvas-waveview.c +++ b/gtk2_ardour/canvas-waveview.c @@ -763,23 +763,27 @@ gnome_canvas_waveview_set_property (GObject *object, break; case PROP_LENGTH_FUNCTION: - waveview->length_function = g_value_get_pointer(value); + waveview->length_function = (gulong (*)(void*)) g_value_get_pointer(value); redraw = TRUE; break; case PROP_SOURCEFILE_LENGTH_FUNCTION: - waveview->sourcefile_length_function = g_value_get_pointer(value); + waveview->sourcefile_length_function = (gulong (*)(void*,double)) g_value_get_pointer(value); redraw = TRUE; break; case PROP_PEAK_FUNCTION: - waveview->peak_function = g_value_get_pointer(value); + waveview->peak_function = + (void (*)(void*,gulong,gulong,gulong,gpointer,guint32,double)) + g_value_get_pointer(value); redraw = TRUE; break; case PROP_GAIN_FUNCTION: - waveview->gain_curve_function = g_value_get_pointer(value); - redraw = TRUE; + waveview->gain_curve_function = + (void (*)(void *arg, double start, double end, float* vector, gint64 veclen)) + g_value_get_pointer(value); + redraw = TRUE; break; case PROP_GAIN_SRC: @@ -946,19 +950,19 @@ gnome_canvas_waveview_get_property ( break; case PROP_LENGTH_FUNCTION: - g_value_set_pointer(value, waveview->length_function); + g_value_set_pointer(value, (void*) waveview->length_function); break; case PROP_SOURCEFILE_LENGTH_FUNCTION: - g_value_set_pointer(value, waveview->sourcefile_length_function); + g_value_set_pointer(value, (void*) waveview->sourcefile_length_function); break; case PROP_PEAK_FUNCTION: - g_value_set_pointer(value, waveview->peak_function); + g_value_set_pointer(value, (void*) waveview->peak_function); break; case PROP_GAIN_FUNCTION: - g_value_set_pointer(value, waveview->gain_curve_function); + g_value_set_pointer(value, (void*) waveview->gain_curve_function); break; case PROP_GAIN_SRC: diff --git a/gtk2_ardour/crossfade_edit.cc b/gtk2_ardour/crossfade_edit.cc index fd651599ea..c5d7b8d1b5 100644 --- a/gtk2_ardour/crossfade_edit.cc +++ b/gtk2_ardour/crossfade_edit.cc @@ -624,7 +624,7 @@ CrossfadeEditor::canvas_allocation (Gtk::Allocation& /*alloc*/) void -CrossfadeEditor::xfade_changed (Change) +CrossfadeEditor::xfade_changed (PropertyChange) { set (xfade->fade_in(), In); set (xfade->fade_out(), Out); @@ -1220,26 +1220,42 @@ CrossfadeEditor::audition (Audition which) right_length = xfade->in()->length(); } - boost::shared_ptr<AudioRegion> left (boost::dynamic_pointer_cast<AudioRegion> (RegionFactory::create (xfade->out(), left_start_offset, left_length, "xfade out", - 0, Region::DefaultFlags, false))); - boost::shared_ptr<AudioRegion> right (boost::dynamic_pointer_cast<AudioRegion> (RegionFactory::create (xfade->in(), 0, right_length, "xfade in", - 0, Region::DefaultFlags, false))); - - //apply a 20ms declicking fade at the start and end of auditioning - left->set_fade_in_active(true); - left->set_fade_in_length(_session->frame_rate() / 50); - right->set_fade_out_active(true); - right->set_fade_out_length(_session->frame_rate() / 50); - - pl.add_region (left, 0); - pl.add_region (right, 1 + preroll); + PropertyList left_plist; + PropertyList right_plist; + + + left_plist.add (ARDOUR::Properties::start, left_start_offset); + left_plist.add (ARDOUR::Properties::length, left_length); + left_plist.add (ARDOUR::Properties::name, string ("xfade out")); + left_plist.add (ARDOUR::Properties::layer, 0); + left_plist.add (ARDOUR::Properties::fade_in_active, true); + + right_plist.add (ARDOUR::Properties::start, 0); + right_plist.add (ARDOUR::Properties::length, right_length); + right_plist.add (ARDOUR::Properties::name, string("xfade in")); + right_plist.add (ARDOUR::Properties::layer, 0); + right_plist.add (ARDOUR::Properties::fade_out_active, true); if (which == Left) { - right->set_scale_amplitude (0.0); + right_plist.add (ARDOUR::Properties::scale_amplitude, 0.0f); } else if (which == Right) { - left->set_scale_amplitude (0.0); + left_plist.add (ARDOUR::Properties::scale_amplitude, 0.0f); } + boost::shared_ptr<AudioRegion> left (boost::dynamic_pointer_cast<AudioRegion> + (RegionFactory::create (xfade->out(), left_plist, false))); + boost::shared_ptr<AudioRegion> right (boost::dynamic_pointer_cast<AudioRegion> + (RegionFactory::create (xfade->in(), right_plist, false))); + + // apply a 20ms declicking fade at the start and end of auditioning + // XXX this should really be a property + + left->set_fade_in_length (_session->frame_rate() / 50); + right->set_fade_out_length (_session->frame_rate() / 50); + + pl.add_region (left, 0); + pl.add_region (right, 1 + preroll); + /* there is only one ... */ pl.foreach_crossfade (sigc::mem_fun (*this, &CrossfadeEditor::setup)); @@ -1255,8 +1271,15 @@ CrossfadeEditor::audition_both () void CrossfadeEditor::audition_left_dry () { - boost::shared_ptr<AudioRegion> left (boost::dynamic_pointer_cast<AudioRegion> (RegionFactory::create (xfade->out(), xfade->out()->length() - xfade->length(), xfade->length(), "xfade left", - 0, Region::DefaultFlags, false))); + PropertyList plist; + + plist.add (ARDOUR::Properties::start, xfade->out()->length() - xfade->length()); + plist.add (ARDOUR::Properties::length, xfade->length()); + plist.add (ARDOUR::Properties::name, string("xfade left")); + plist.add (ARDOUR::Properties::layer, 0); + + boost::shared_ptr<AudioRegion> left (boost::dynamic_pointer_cast<AudioRegion> + (RegionFactory::create (xfade->out(), plist, false))); _session->audition_region (left); } @@ -1270,8 +1293,16 @@ CrossfadeEditor::audition_left () void CrossfadeEditor::audition_right_dry () { - boost::shared_ptr<AudioRegion> right (boost::dynamic_pointer_cast<AudioRegion> (RegionFactory::create (xfade->in(), 0, xfade->length(), "xfade in", - 0, Region::DefaultFlags, false))); + PropertyList plist; + + plist.add (ARDOUR::Properties::start, 0); + plist.add (ARDOUR::Properties::length, xfade->length()); + plist.add (ARDOUR::Properties::name, string ("xfade right")); + plist.add (ARDOUR::Properties::layer, 0); + + boost::shared_ptr<AudioRegion> right (boost::dynamic_pointer_cast<AudioRegion> + (RegionFactory::create (xfade->in(), plist, false))); + _session->audition_region (right); } diff --git a/gtk2_ardour/crossfade_edit.h b/gtk2_ardour/crossfade_edit.h index d92288e650..a05bb093f0 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::Change); + void xfade_changed (PBD::PropertyChange); void dump (); }; diff --git a/gtk2_ardour/crossfade_view.cc b/gtk2_ardour/crossfade_view.cc index 514daa4f3e..ca333e67a6 100644 --- a/gtk2_ardour/crossfade_view.cc +++ b/gtk2_ardour/crossfade_view.cc @@ -82,7 +82,7 @@ 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 (Change (~0)); + crossfade_changed (PropertyChange (~0)); crossfade->StateChanged.connect (*this, ui_bind (&CrossfadeView::crossfade_changed, this, _1), gui_context()); ColorsChanged.connect (sigc::mem_fun (*this, &CrossfadeView::color_handler)); @@ -123,7 +123,7 @@ CrossfadeView::set_height (double height) } void -CrossfadeView::crossfade_changed (Change what_changed) +CrossfadeView::crossfade_changed (PropertyChange what_changed) { bool need_redraw_curves = false; diff --git a/gtk2_ardour/crossfade_view.h b/gtk2_ardour/crossfade_view.h index e141a30cb1..3e550e4788 100644 --- a/gtk2_ardour/crossfade_view.h +++ b/gtk2_ardour/crossfade_view.h @@ -75,7 +75,7 @@ struct CrossfadeView : public TimeAxisViewItem ArdourCanvas::Line *fade_out; ArdourCanvas::Item *active_button; - void crossfade_changed (PBD::Change); + void crossfade_changed (PBD::PropertyChange); void active_changed (); void redraw_curves (); void color_handler (); diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index 4f44164d37..075a9399f3 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -1133,7 +1133,7 @@ Editor::set_session (Session *t) handle_new_duration (); restore_ruler_visibility (); - //tempo_map_changed (Change (0)); + //tempo_map_changed (PropertyChange (0)); _session->tempo_map().apply_with_metrics (*this, &Editor::draw_metric_marks); for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) { @@ -3737,7 +3737,7 @@ Editor::edit_xfade (boost::weak_ptr<Crossfade> wxfade) } cew.apply (); - xfade->StateChanged (Change (~0)); + xfade->StateChanged (PropertyChange (~0)); } PlaylistSelector& @@ -3993,7 +3993,7 @@ Editor::new_playlists (TimeAxisView* v) begin_reversible_command (_("new playlists")); vector<boost::shared_ptr<ARDOUR::Playlist> > playlists; _session->playlists->get (playlists); - mapover_tracks (sigc::bind (sigc::mem_fun (*this, &Editor::mapped_use_new_playlist), playlists), v, RouteGroup::Edit); + mapover_tracks (sigc::bind (sigc::mem_fun (*this, &Editor::mapped_use_new_playlist), playlists), v, ARDOUR::Properties::edit.id); commit_reversible_command (); } @@ -4009,7 +4009,7 @@ Editor::copy_playlists (TimeAxisView* v) begin_reversible_command (_("copy playlists")); vector<boost::shared_ptr<ARDOUR::Playlist> > playlists; _session->playlists->get (playlists); - mapover_tracks (sigc::bind (sigc::mem_fun (*this, &Editor::mapped_use_copy_playlist), playlists), v, RouteGroup::Edit); + mapover_tracks (sigc::bind (sigc::mem_fun (*this, &Editor::mapped_use_copy_playlist), playlists), v, ARDOUR::Properties::edit.id); commit_reversible_command (); } @@ -4024,7 +4024,7 @@ Editor::clear_playlists (TimeAxisView* v) begin_reversible_command (_("clear playlists")); vector<boost::shared_ptr<ARDOUR::Playlist> > playlists; _session->playlists->get (playlists); - mapover_tracks (sigc::mem_fun (*this, &Editor::mapped_clear_playlist), v, RouteGroup::Edit); + mapover_tracks (sigc::mem_fun (*this, &Editor::mapped_clear_playlist), v, ARDOUR::Properties::edit.id); commit_reversible_command (); } @@ -4562,7 +4562,7 @@ Editor::get_regions_for_action (RegionSelection& rs, bool allow_entered, bool al for (RegionSelection::iterator i = rs.begin (); i != rs.end(); ++i) { RouteGroup* g = (*i)->get_time_axis_view().route_group (); - if (g && g->active_property (RouteGroup::Edit)) { + if (g && g->is_active() && g->is_edit()) { tracks.add (axis_views_from_routes (g->route_list())); } diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h index 49742c6f45..6b79f7d3a6 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::Change); + void refresh_location_display_s (PBD::PropertyChange); void refresh_location_display_internal (ARDOUR::Locations::LocationList&); void add_new_location (ARDOUR::Location *); void location_gone (ARDOUR::Location *); @@ -578,9 +578,9 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void sort_track_selection (TrackViewList* sel = 0); - void get_equivalent_regions (RegionView* rv, std::vector<RegionView*> &, ARDOUR::RouteGroup::Property) const; - RegionSelection get_equivalent_regions (RegionSelection &, ARDOUR::RouteGroup::Property) const; - void mapover_tracks (sigc::slot<void,RouteTimeAxisView&,uint32_t> sl, TimeAxisView*, ARDOUR::RouteGroup::Property) const; + void get_equivalent_regions (RegionView* rv, std::vector<RegionView*> &, PBD::PropertyID) const; + RegionSelection get_equivalent_regions (RegionSelection &, PBD::PropertyID) const; + void mapover_tracks (sigc::slot<void,RouteTimeAxisView&,uint32_t> sl, TimeAxisView*, PBD::PropertyID) const; /* functions to be passed to mapover_tracks(), possibly with sigc::bind()-supplied arguments */ @@ -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::Change); + void tempo_map_changed (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_actions.cc b/gtk2_ardour/editor_actions.cc index b46b44b3eb..d137ed6351 100644 --- a/gtk2_ardour/editor_actions.cc +++ b/gtk2_ardour/editor_actions.cc @@ -673,8 +673,8 @@ Editor::register_actions () ActionManager::register_radio_action (editor_actions, edit_point_group, X_("edit-at-mouse"), _("Mouse"), (sigc::bind (sigc::mem_fun(*this, &Editor::edit_point_chosen), Editing::EditAtPlayhead))); ActionManager::register_radio_action (editor_actions, edit_point_group, X_("edit-at-selected-marker"), _("Marker"), (sigc::bind (sigc::mem_fun(*this, &Editor::edit_point_chosen), Editing::EditAtPlayhead))); - ActionManager::register_action (editor_actions, "cycle-edit-point", _("Change Edit Point"), sigc::bind (sigc::mem_fun (*this, &Editor::cycle_edit_point), false)); - ActionManager::register_action (editor_actions, "cycle-edit-point-with-marker", _("Change Edit Point Including Marker"), sigc::bind (sigc::mem_fun (*this, &Editor::cycle_edit_point), true)); + ActionManager::register_action (editor_actions, "cycle-edit-point", _("PropertyChange Edit Point"), sigc::bind (sigc::mem_fun (*this, &Editor::cycle_edit_point), false)); + ActionManager::register_action (editor_actions, "cycle-edit-point-with-marker", _("PropertyChange Edit Point Including Marker"), sigc::bind (sigc::mem_fun (*this, &Editor::cycle_edit_point), true)); if (!Profile->get_sae()) { ActionManager::register_action (editor_actions, "set-edit-splice", _("Splice"), sigc::bind (sigc::mem_fun (*this, &Editor::set_edit_mode), Splice)); } diff --git a/gtk2_ardour/editor_audio_import.cc b/gtk2_ardour/editor_audio_import.cc index de275f8738..c70832182a 100644 --- a/gtk2_ardour/editor_audio_import.cc +++ b/gtk2_ardour/editor_audio_import.cc @@ -720,8 +720,16 @@ Editor::add_sources (vector<Glib::ustring> paths, SourceList& sources, nframes64 region_name = region_name_from_path (paths.front(), (sources.size() > 1), false); - boost::shared_ptr<Region> r = RegionFactory::create (sources, 0, sources[0]->length(pos), region_name, 0, - Region::Flag (Region::DefaultFlags|Region::WholeFile|Region::External)); + PropertyList plist; + + plist.add (ARDOUR::Properties::start, 0); + plist.add (ARDOUR::Properties::length, sources[0]->length (pos)); + plist.add (ARDOUR::Properties::name, region_name); + plist.add (ARDOUR::Properties::layer, 0); + plist.add (ARDOUR::Properties::whole_file, true); + plist.add (ARDOUR::Properties::external, true); + + boost::shared_ptr<Region> r = RegionFactory::create (sources, plist); if (use_timestamp && boost::dynamic_pointer_cast<AudioRegion>(r)) { boost::dynamic_pointer_cast<AudioRegion>(r)->special_set_position(sources[0]->natural_position()); @@ -745,8 +753,16 @@ Editor::add_sources (vector<Glib::ustring> paths, SourceList& sources, nframes64 region_name = region_name_from_path ((*x)->path(), false, false, sources.size(), n); - boost::shared_ptr<Region> r = RegionFactory::create (just_one, 0, (*x)->length(pos), region_name, 0, - Region::Flag (Region::DefaultFlags|Region::WholeFile|Region::External)); + PropertyList plist; + + plist.add (ARDOUR::Properties::start, 0); + plist.add (ARDOUR::Properties::length, (*x)->length (pos)); + plist.add (ARDOUR::Properties::name, region_name); + plist.add (ARDOUR::Properties::layer, 0); + plist.add (ARDOUR::Properties::whole_file, true); + plist.add (ARDOUR::Properties::external, true); + + boost::shared_ptr<Region> r = RegionFactory::create (just_one, plist); if (use_timestamp && boost::dynamic_pointer_cast<AudioRegion>(r)) { boost::dynamic_pointer_cast<AudioRegion>(r)->special_set_position((*x)->natural_position()); diff --git a/gtk2_ardour/editor_markers.cc b/gtk2_ardour/editor_markers.cc index d23afbf14c..33e0962596 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 (Change) +Editor::refresh_location_display_s (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 3119729bab..fa641dd9b8 100644 --- a/gtk2_ardour/editor_mouse.cc +++ b/gtk2_ardour/editor_mouse.cc @@ -687,14 +687,14 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT switch (item_type) { case FadeInHandleItem: { - RegionSelection s = get_equivalent_regions (selection->regions, RouteGroup::Edit); + RegionSelection s = get_equivalent_regions (selection->regions, Properties::edit.id); _drags->set (new FadeInDrag (this, item, reinterpret_cast<RegionView*> (item->get_data("regionview")), s), event); return true; } case FadeOutHandleItem: { - RegionSelection s = get_equivalent_regions (selection->regions, RouteGroup::Edit); + RegionSelection s = get_equivalent_regions (selection->regions, Properties::edit.id); _drags->set (new FadeOutDrag (this, item, reinterpret_cast<RegionView*> (item->get_data("regionview")), s), event); return true; } @@ -717,7 +717,7 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT case RegionViewNameHighlight: { - RegionSelection s = get_equivalent_regions (selection->regions, RouteGroup::Edit); + RegionSelection s = get_equivalent_regions (selection->regions, Properties::edit.id); _drags->set (new TrimDrag (this, item, clicked_regionview, s.by_layer()), event); return true; break; @@ -726,7 +726,7 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT case RegionViewName: { /* rename happens on edit clicks */ - RegionSelection s = get_equivalent_regions (selection->regions, RouteGroup::Edit); + RegionSelection s = get_equivalent_regions (selection->regions, Properties::edit.id); _drags->set (new TrimDrag (this, clicked_regionview->get_name_highlight(), clicked_regionview, s.by_layer()), event); return true; break; @@ -2206,7 +2206,7 @@ Editor::single_start_trim (RegionView& rv, nframes64_t frame_delta, bool left_di } } - rv.region_changed (Change (LengthChanged|PositionChanged|StartChanged)); + rv.region_changed (PropertyChange (LengthChanged|PositionChanged|StartChanged)); } void @@ -2260,7 +2260,7 @@ 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 (Change (LengthChanged|PositionChanged|StartChanged)); + rv.region_changed (PropertyChange (LengthChanged|PositionChanged|StartChanged)); } else { rv.region_changed (LengthChanged); @@ -2484,7 +2484,7 @@ Editor::add_region_drag (ArdourCanvas::Item* item, GdkEvent* event, RegionView* if (Config->get_edit_mode() == Splice) { _drags->add (new RegionSpliceDrag (this, item, region_view, selection->regions.by_layer())); } else { - RegionSelection s = get_equivalent_regions (selection->regions, RouteGroup::Edit); + RegionSelection s = get_equivalent_regions (selection->regions, ARDOUR::Properties::edit.id); _drags->add (new RegionMoveDrag (this, item, region_view, s.by_layer(), false, false)); } @@ -2499,7 +2499,7 @@ Editor::add_region_copy_drag (ArdourCanvas::Item* item, GdkEvent* event, RegionV _region_motion_group->raise_to_top (); - RegionSelection s = get_equivalent_regions (selection->regions, RouteGroup::Edit); + RegionSelection s = get_equivalent_regions (selection->regions, ARDOUR::Properties::edit.id); _drags->add (new RegionMoveDrag (this, item, region_view, s.by_layer(), false, true)); } @@ -2512,7 +2512,7 @@ Editor::add_region_brush_drag (ArdourCanvas::Item* item, GdkEvent* event, Region return; } - RegionSelection s = get_equivalent_regions (selection->regions, RouteGroup::Edit); + RegionSelection s = get_equivalent_regions (selection->regions, ARDOUR::Properties::edit.id); _drags->add (new RegionMoveDrag (this, item, region_view, s.by_layer(), true, false)); begin_reversible_command (_("Drag region brush")); diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc index 16773f269d..a1000b7077 100644 --- a/gtk2_ardour/editor_ops.cc +++ b/gtk2_ardour/editor_ops.cc @@ -2668,8 +2668,15 @@ Editor::region_from_selection () internal_start = start - current->position(); _session->region_name (new_name, current->name(), true); - boost::shared_ptr<Region> region (RegionFactory::create (current, - internal_start, selection_cnt, new_name)); + + PropertyList plist; + + plist.add (ARDOUR::Properties::start, internal_start); + plist.add (ARDOUR::Properties::length, selection_cnt); + plist.add (ARDOUR::Properties::name, new_name); + plist.add (ARDOUR::Properties::layer, 0); + + boost::shared_ptr<Region> region (RegionFactory::create (current, plist)); } } @@ -2702,8 +2709,13 @@ Editor::create_region_from_selection (vector<boost::shared_ptr<Region> >& new_re internal_start = start - current->position(); _session->region_name (new_name, current->name(), true); - new_regions.push_back (RegionFactory::create (current, - internal_start, end - start + 1, new_name)); + PropertyList plist; + + plist.add (ARDOUR::Properties::start, internal_start); + plist.add (ARDOUR::Properties::length, end - start + 1); + plist.add (ARDOUR::Properties::name, new_name); + + new_regions.push_back (RegionFactory::create (current, plist)); } } @@ -3604,7 +3616,7 @@ Editor::trim_to_region(bool forward) } region->trim_end((nframes64_t) (next_region->first_frame() * speed), this); - arv->region_changed (Change (LengthChanged)); + arv->region_changed (PropertyChange (LengthChanged)); } else { @@ -3615,7 +3627,7 @@ Editor::trim_to_region(bool forward) } region->trim_front((nframes64_t) ((next_region->last_frame() + 1) * speed), this); - arv->region_changed (Change (LengthChanged|PositionChanged|StartChanged)); + arv->region_changed (PropertyChange (LengthChanged|PositionChanged|StartChanged)); } XMLNode &after = playlist->get_state(); @@ -4870,7 +4882,7 @@ Editor::brush (nframes64_t pos) void Editor::reset_region_gain_envelopes () { - RegionSelection rs = get_equivalent_regions (selection->regions, RouteGroup::Edit); + RegionSelection rs = get_equivalent_regions (selection->regions, ARDOUR::Properties::edit.id); if (!_session || rs.empty()) { return; @@ -4895,7 +4907,7 @@ Editor::reset_region_gain_envelopes () void Editor::toggle_gain_envelope_visibility () { - RegionSelection rs = get_equivalent_regions (selection->regions, RouteGroup::Edit); + RegionSelection rs = get_equivalent_regions (selection->regions, ARDOUR::Properties::edit.id); if (!_session || rs.empty()) { return; @@ -4919,7 +4931,7 @@ Editor::toggle_gain_envelope_visibility () void Editor::toggle_gain_envelope_active () { - RegionSelection rs = get_equivalent_regions (selection->regions, RouteGroup::Edit); + RegionSelection rs = get_equivalent_regions (selection->regions, ARDOUR::Properties::edit.id); if (!_session || rs.empty()) { return; @@ -4942,7 +4954,7 @@ Editor::toggle_gain_envelope_active () void Editor::toggle_region_lock () { - RegionSelection rs = get_equivalent_regions (selection->regions, RouteGroup::Edit); + RegionSelection rs = get_equivalent_regions (selection->regions, ARDOUR::Properties::edit.id); if (!_session || rs.empty()) { return; @@ -4962,7 +4974,7 @@ Editor::toggle_region_lock () void Editor::set_region_lock_style (Region::PositionLockStyle ps) { - RegionSelection rs = get_equivalent_regions (selection->regions, RouteGroup::Edit); + RegionSelection rs = get_equivalent_regions (selection->regions, ARDOUR::Properties::edit.id); if (!_session || rs.empty()) { return; @@ -4984,7 +4996,7 @@ Editor::set_region_lock_style (Region::PositionLockStyle ps) void Editor::toggle_region_mute () { - RegionSelection rs = get_equivalent_regions (selection->regions, RouteGroup::Edit); + RegionSelection rs = get_equivalent_regions (selection->regions, ARDOUR::Properties::edit.id); if (!_session || rs.empty()) { return; @@ -5004,7 +5016,7 @@ Editor::toggle_region_mute () void Editor::toggle_region_opaque () { - RegionSelection rs = get_equivalent_regions (selection->regions, RouteGroup::Edit); + RegionSelection rs = get_equivalent_regions (selection->regions, ARDOUR::Properties::edit.id); if (!_session || rs.empty()) { return; @@ -5959,7 +5971,14 @@ Editor::split_region_at_points (boost::shared_ptr<Region> r, AnalysisFeatureList /* do NOT announce new regions 1 by one, just wait till they are all done */ - boost::shared_ptr<Region> nr = RegionFactory::create (r->sources(), file_start, len, new_name, 0, Region::DefaultFlags, false); + PropertyList plist; + + plist.add (ARDOUR::Properties::start, file_start); + plist.add (ARDOUR::Properties::length, len); + plist.add (ARDOUR::Properties::name, new_name); + plist.add (ARDOUR::Properties::layer, 0); + + boost::shared_ptr<Region> nr = RegionFactory::create (r->sources(), plist, false); pl->add_region (nr, pos); pos += len; @@ -5972,7 +5991,14 @@ Editor::split_region_at_points (boost::shared_ptr<Region> r, AnalysisFeatureList file_start = r->start() + (pos - r->position()); len = r->last_frame() - pos; - nr = RegionFactory::create (r->sources(), file_start, len, new_name, 0, Region::DefaultFlags); + PropertyList plist2; + + plist2.add (ARDOUR::Properties::start, file_start); + plist2.add (ARDOUR::Properties::length, len); + plist2.add (ARDOUR::Properties::name, new_name); + plist2.add (ARDOUR::Properties::layer, 0); + + nr = RegionFactory::create (r->sources(), plist2); pl->add_region (nr, pos); break; diff --git a/gtk2_ardour/editor_regions.cc b/gtk2_ardour/editor_regions.cc index 58a0a5d7e7..b3ca136bcf 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 (Change what_changed, boost::weak_ptr<Region> region) +EditorRegions::region_changed (PropertyChange what_changed, boost::weak_ptr<Region> region) { ENSURE_GUI_THREAD (*this, &EditorRegions::region_changed, what_changed, region) diff --git a/gtk2_ardour/editor_regions.h b/gtk2_ardour/editor_regions.h index 5a31eb2fd2..92adb72621 100644 --- a/gtk2_ardour/editor_regions.h +++ b/gtk2_ardour/editor_regions.h @@ -104,7 +104,7 @@ private: Columns _columns; - void region_changed (PBD::Change, boost::weak_ptr<ARDOUR::Region>); + void region_changed (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_route_groups.cc b/gtk2_ardour/editor_route_groups.cc index 9cd845ca08..c6ee08fae6 100644 --- a/gtk2_ardour/editor_route_groups.cc +++ b/gtk2_ardour/editor_route_groups.cc @@ -234,12 +234,16 @@ EditorRouteGroups::set_activation (RouteGroup* g, bool a) ARDOUR::RouteGroup * EditorRouteGroups::new_route_group () const { - RouteGroup* g = new RouteGroup ( - *_session, - "", - RouteGroup::Active, - (RouteGroup::Property) (RouteGroup::Mute | RouteGroup::Solo | RouteGroup::Edit) - ); + PropertyList plist; + + plist.add (Properties::active, true); + plist.add (Properties::mute, true); + plist.add (Properties::solo, true); + plist.add (Properties::edit, true); + + RouteGroup* g = new RouteGroup (*_session, ""); + + g->set_properties (plist); RouteGroupDialog d (g, Gtk::Stock::NEW); int const r = d.do_run (); @@ -255,12 +259,16 @@ EditorRouteGroups::new_route_group () const void EditorRouteGroups::run_new_group_dialog (const RouteList& rl) { - RouteGroup* g = new RouteGroup ( - *_session, - "", - RouteGroup::Active, - (RouteGroup::Property) (RouteGroup::Mute | RouteGroup::Solo | RouteGroup::Edit | RouteGroup::RecEnable) - ); + PropertyList plist; + + plist.add (Properties::active, true); + plist.add (Properties::mute, true); + plist.add (Properties::solo, true); + plist.add (Properties::recenable, true); + plist.add (Properties::edit, true); + + RouteGroup* g = new RouteGroup (*_session, ""); + g->set_properties (plist); RouteGroupDialog d (g, Gtk::Stock::NEW); int const r = d.do_run (); @@ -533,18 +541,22 @@ EditorRouteGroups::row_change (const Gtk::TreeModel::Path&, const Gtk::TreeModel } } - group->set_property (RouteGroup::Gain, (*iter)[_columns.gain]); - group->set_property (RouteGroup::RecEnable, (*iter)[_columns.record]); - group->set_property (RouteGroup::Mute, (*iter)[_columns.mute]); - group->set_property (RouteGroup::Solo, (*iter)[_columns.solo]); - group->set_property (RouteGroup::Select, (*iter)[_columns.select]); - group->set_property (RouteGroup::Edit, (*iter)[_columns.edits]); - - string name = (*iter)[_columns.text]; - - if (name != group->name()) { - group->set_name (name); - } + PropertyList plist; + bool val = (*iter)[_columns.gain]; + plist.add (Properties::gain, val); + val = (*iter)[_columns.record]; + plist.add (Properties::recenable, val); + val = (*iter)[_columns.mute]; + plist.add (Properties::mute, val); + val = (*iter)[_columns.solo]; + plist.add (Properties::solo, val); + val = (*iter)[_columns.select]; + plist.add (Properties::select, val); + val = (*iter)[_columns.edits]; + plist.add (Properties::edit, val); + plist.add (Properties::name, string ((*iter)[_columns.text])); + + group->set_properties (plist); } void @@ -556,12 +568,12 @@ EditorRouteGroups::add (RouteGroup* group) TreeModel::Row row = *(_model->append()); row[_columns.is_visible] = !group->is_hidden(); - row[_columns.gain] = group->property(RouteGroup::Gain); - row[_columns.record] = group->property(RouteGroup::RecEnable); - row[_columns.mute] = group->property(RouteGroup::Mute); - row[_columns.solo] = group->property(RouteGroup::Solo); - row[_columns.select] = group->property(RouteGroup::Select); - row[_columns.edits] = group->property(RouteGroup::Edit); + row[_columns.gain] = group->is_gain (); + row[_columns.record] = group->is_recenable(); + row[_columns.mute] = group->is_mute (); + row[_columns.solo] = group->is_solo (); + row[_columns.select] = group->is_select (); + row[_columns.edits] = group->is_edit (); _in_row_change = true; @@ -622,12 +634,12 @@ EditorRouteGroups::flags_changed (void*, RouteGroup* group) if (group == (*iter)[_columns.routegroup]) { (*iter)[_columns.is_visible] = !group->is_hidden(); (*iter)[_columns.text] = group->name(); - (*iter)[_columns.gain] = group->property(RouteGroup::Gain); - (*iter)[_columns.record] = group->property(RouteGroup::RecEnable); - (*iter)[_columns.mute] = group->property(RouteGroup::Mute); - (*iter)[_columns.solo] = group->property(RouteGroup::Solo); - (*iter)[_columns.select] = group->property(RouteGroup::Select); - (*iter)[_columns.edits] = group->property(RouteGroup::Edit); + (*iter)[_columns.gain] = group->is_gain (); + (*iter)[_columns.record] = group->is_recenable (); + (*iter)[_columns.mute] = group->is_mute (); + (*iter)[_columns.solo] = group->is_solo (); + (*iter)[_columns.select] = group->is_select (); + (*iter)[_columns.edits] = group->is_edit (); } } diff --git a/gtk2_ardour/editor_selection.cc b/gtk2_ardour/editor_selection.cc index 2b94a05619..3e5b412c85 100644 --- a/gtk2_ardour/editor_selection.cc +++ b/gtk2_ardour/editor_selection.cc @@ -292,7 +292,7 @@ Editor::get_onscreen_tracks (TrackViewList& tvl) */ void -Editor::mapover_tracks (sigc::slot<void, RouteTimeAxisView&, uint32_t> sl, TimeAxisView* basis, RouteGroup::Property prop) const +Editor::mapover_tracks (sigc::slot<void, RouteTimeAxisView&, uint32_t> sl, TimeAxisView* basis, PBD::PropertyID prop) const { RouteTimeAxisView* route_basis = dynamic_cast<RouteTimeAxisView*> (basis); if (route_basis == 0) { @@ -303,7 +303,7 @@ Editor::mapover_tracks (sigc::slot<void, RouteTimeAxisView&, uint32_t> sl, TimeA tracks.insert (route_basis); RouteGroup* group = route_basis->route()->route_group(); - if (group && group->active_property (prop)) { + if (group && group->enabled_property (prop)) { /* the basis is a member of an active route group, with the appropriate properties; find other members */ @@ -353,9 +353,9 @@ Editor::mapped_get_equivalent_regions (RouteTimeAxisView& tv, uint32_t, RegionVi } void -Editor::get_equivalent_regions (RegionView* basis, vector<RegionView*>& equivalent_regions, RouteGroup::Property prop) const +Editor::get_equivalent_regions (RegionView* basis, vector<RegionView*>& equivalent_regions, PBD::PropertyID property) const { - mapover_tracks (sigc::bind (sigc::mem_fun (*this, &Editor::mapped_get_equivalent_regions), basis, &equivalent_regions), &basis->get_trackview(), prop); + mapover_tracks (sigc::bind (sigc::mem_fun (*this, &Editor::mapped_get_equivalent_regions), basis, &equivalent_regions), &basis->get_trackview(), property); /* add clicked regionview since we skipped all other regions in the same track as the one it was in */ @@ -363,7 +363,7 @@ Editor::get_equivalent_regions (RegionView* basis, vector<RegionView*>& equivale } RegionSelection -Editor::get_equivalent_regions (RegionSelection & basis, RouteGroup::Property prop) const +Editor::get_equivalent_regions (RegionSelection & basis, PBD::PropertyID prop) const { RegionSelection equivalent; @@ -476,7 +476,7 @@ Editor::set_selected_regionview_from_click (bool press, Selection::Operation op, if (press) { if (selection->selected (clicked_routeview)) { - get_equivalent_regions (clicked_regionview, all_equivalent_regions, RouteGroup::Select); + get_equivalent_regions (clicked_regionview, all_equivalent_regions, ARDOUR::Properties::select.id); } else { all_equivalent_regions.push_back (clicked_regionview); } @@ -494,7 +494,7 @@ Editor::set_selected_regionview_from_click (bool press, Selection::Operation op, case Selection::Set: if (!selection->selected (clicked_regionview)) { - get_equivalent_regions (clicked_regionview, all_equivalent_regions, RouteGroup::Select); + get_equivalent_regions (clicked_regionview, all_equivalent_regions, ARDOUR::Properties::select.id); selection->set (all_equivalent_regions); commit = true; } else { diff --git a/gtk2_ardour/editor_tempodisplay.cc b/gtk2_ardour/editor_tempodisplay.cc index 9995c50a71..1c3f018095 100644 --- a/gtk2_ardour/editor_tempodisplay.cc +++ b/gtk2_ardour/editor_tempodisplay.cc @@ -93,7 +93,7 @@ Editor::draw_metric_marks (const Metrics& metrics) } void -Editor::tempo_map_changed (Change ignored) +Editor::tempo_map_changed (PropertyChange ignored) { if (!_session) { return; diff --git a/gtk2_ardour/lineset.h b/gtk2_ardour/lineset.h index e4f836717f..66b4806439 100644 --- a/gtk2_ardour/lineset.h +++ b/gtk2_ardour/lineset.h @@ -65,7 +65,7 @@ public: */ void change_line_width(double coord, double width); - /** Change the color of a line. + /** PropertyChange 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 681be7520e..576abafc1b 100644 --- a/gtk2_ardour/midi_region_view.cc +++ b/gtk2_ardour/midi_region_view.cc @@ -963,7 +963,7 @@ MidiRegionView::~MidiRegionView () } void -MidiRegionView::region_resized (Change what_changed) +MidiRegionView::region_resized (PropertyChange what_changed) { RegionView::region_resized(what_changed); diff --git a/gtk2_ardour/midi_region_view.h b/gtk2_ardour/midi_region_view.h index bc34416a03..a08ef7c98d 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); - /** Change the 'automation' data of old_program to new values which correspond to new_patch. + /** PropertyChange 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); - /** Change the channel of the selection. + /** PropertyChange 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::Change); + void region_resized (PBD::PropertyChange); void set_flags (XMLNode *); void store_flags (); diff --git a/gtk2_ardour/midi_streamview.cc b/gtk2_ardour/midi_streamview.cc index 2982772a62..19c1a53b39 100644 --- a/gtk2_ardour/midi_streamview.cc +++ b/gtk2_ardour/midi_streamview.cc @@ -413,9 +413,16 @@ MidiStreamView::setup_rec_box () start = rec_regions.back().first->start() + _trackview.get_diskstream()->get_captured_frames(rec_regions.size()-1); } + + PropertyList plist; + + plist.add (ARDOUR::Properties::start, start); + plist.add (ARDOUR::Properties::length, 1); + plist.add (ARDOUR::Properties::name, string()); + plist.add (ARDOUR::Properties::layer, 0); boost::shared_ptr<MidiRegion> region (boost::dynamic_pointer_cast<MidiRegion> - (RegionFactory::create (sources, start, 1 , "", 0, Region::DefaultFlags, false))); + (RegionFactory::create (sources, plist, false))); assert(region); region->block_property_changes (); diff --git a/gtk2_ardour/midi_time_axis.cc b/gtk2_ardour/midi_time_axis.cc index d1a60ce04a..b1adb7c67e 100644 --- a/gtk2_ardour/midi_time_axis.cc +++ b/gtk2_ardour/midi_time_axis.cc @@ -395,7 +395,7 @@ MidiTimeAxisView::build_automation_action_menu () something about MIDI (!) would not expect to find them there. */ - add_channel_command_menu_item (automation_items, _("Program Change"), MidiPgmChangeAutomation, MIDI_CMD_PGM_CHANGE); + add_channel_command_menu_item (automation_items, _("Program PropertyChange"), MidiPgmChangeAutomation, MIDI_CMD_PGM_CHANGE); add_channel_command_menu_item (automation_items, _("Bender"), MidiPitchBenderAutomation, MIDI_CMD_BENDER); add_channel_command_menu_item (automation_items, _("Pressure"), MidiChannelPressureAutomation, MIDI_CMD_CHANNEL_PRESSURE); @@ -968,7 +968,7 @@ MidiTimeAxisView::add_region (nframes64_t pos) real_editor->begin_reversible_command (_("create region")); XMLNode &before = playlist()->get_state(); - nframes64_t start = pos; + framepos_t start = pos; real_editor->snap_to (start, -1); const Meter& m = _session->tempo_map().meter_at(start); const Tempo& t = _session->tempo_map().tempo_at(start); @@ -979,8 +979,13 @@ MidiTimeAxisView::add_region (nframes64_t pos) boost::shared_ptr<Source> src = _session->create_midi_source_for_session (*diskstream.get()); - boost::shared_ptr<Region> region = (RegionFactory::create (src, 0, (nframes_t) length, - PBD::basename_nosuffix(src->name()))); + PropertyList plist; + + plist.add (ARDOUR::Properties::start, 0); + plist.add (ARDOUR::Properties::length, length); + plist.add (ARDOUR::Properties::name, PBD::basename_nosuffix(src->name())); + + boost::shared_ptr<Region> region = (RegionFactory::create (src, plist)); playlist()->add_region (region, start); XMLNode &after = playlist()->get_state(); diff --git a/gtk2_ardour/midi_tracer.cc b/gtk2_ardour/midi_tracer.cc index c757ea3fff..08e1af68e1 100644 --- a/gtk2_ardour/midi_tracer.cc +++ b/gtk2_ardour/midi_tracer.cc @@ -143,9 +143,9 @@ MidiTracer::tracer (Parser&, byte* msg, size_t len) case program: if (show_hex) { - s += snprintf (&buf[s], bufsize, "%16s chn %2d %02x\n", "Program Change", (msg[0]&0xf)+1, (int) msg[1]); + s += snprintf (&buf[s], bufsize, "%16s chn %2d %02x\n", "Program PropertyChange", (msg[0]&0xf)+1, (int) msg[1]); } else { - s += snprintf (&buf[s], bufsize, "%16s chn %2d %-3d\n", "Program Change", (msg[0]&0xf)+1, (int) msg[1]); + s += snprintf (&buf[s], bufsize, "%16s chn %2d %-3d\n", "Program PropertyChange", (msg[0]&0xf)+1, (int) msg[1]); } break; diff --git a/gtk2_ardour/mixer_group_tabs.cc b/gtk2_ardour/mixer_group_tabs.cc index 861a4fd2da..2563adb1d6 100644 --- a/gtk2_ardour/mixer_group_tabs.cc +++ b/gtk2_ardour/mixer_group_tabs.cc @@ -29,6 +29,7 @@ using namespace std; using namespace Gtk; using namespace ARDOUR; +using namespace PBD; MixerGroupTabs::MixerGroupTabs (Mixer_UI* m) : GroupTabs (0), @@ -200,12 +201,16 @@ MixerGroupTabs::destroy_subgroup (RouteGroup* g) ARDOUR::RouteGroup * MixerGroupTabs::new_route_group () const { - RouteGroup* g = new RouteGroup ( - *_session, - "", - RouteGroup::Active, - (RouteGroup::Property) (RouteGroup::Gain | RouteGroup::Mute | RouteGroup::Solo | RouteGroup::RecEnable) - ); + PropertyList plist; + + plist.add (Properties::active, true); + plist.add (Properties::mute, true); + plist.add (Properties::solo, true); + plist.add (Properties::gain, true); + plist.add (Properties::recenable, true); + + RouteGroup* g = new RouteGroup (*_session, ""); + g->set_properties (plist); RouteGroupDialog d (g, Gtk::Stock::NEW); int const r = d.do_run (); diff --git a/gtk2_ardour/mixer_strip.cc b/gtk2_ardour/mixer_strip.cc index 94c876cfcd..5be6ec9f5a 100644 --- a/gtk2_ardour/mixer_strip.cc +++ b/gtk2_ardour/mixer_strip.cc @@ -1295,11 +1295,13 @@ MixerStrip::select_route_group (GdkEventButton *ev) if (group_menu == 0) { - group_menu = new RouteGroupMenu ( - _session, - (RouteGroup::Property) (RouteGroup::Gain | RouteGroup::Mute | RouteGroup::Solo) - ); + PropertyList* plist = new PropertyList(); + plist->add (Properties::gain, true); + plist->add (Properties::mute, true); + plist->add (Properties::solo, true); + + group_menu = new RouteGroupMenu (_session, plist); group_menu->GroupSelected.connect (sigc::mem_fun (*this, &MixerStrip::set_route_group)); } diff --git a/gtk2_ardour/mixer_ui.cc b/gtk2_ardour/mixer_ui.cc index 10aa98995d..03b1dd7d69 100644 --- a/gtk2_ardour/mixer_ui.cc +++ b/gtk2_ardour/mixer_ui.cc @@ -1131,7 +1131,17 @@ Mixer_UI::route_groups_changed () void Mixer_UI::new_route_group () { - _session->add_route_group (new RouteGroup (*_session, "", RouteGroup::Active, (RouteGroup::Property) (RouteGroup::Gain |RouteGroup::Mute | RouteGroup::Solo))); + PropertyList plist; + + plist.add (Properties::active, true); + plist.add (Properties::gain, true); + plist.add (Properties::mute, true); + plist.add (Properties::solo, true); + + RouteGroup* g = new RouteGroup (*_session, ""); + g->set_properties (plist); + + _session->add_route_group (g); } void diff --git a/gtk2_ardour/public_editor.h b/gtk2_ardour/public_editor.h index 9b41977f6f..24a62e5113 100644 --- a/gtk2_ardour/public_editor.h +++ b/gtk2_ardour/public_editor.h @@ -275,7 +275,7 @@ class PublicEditor : public Gtk::Window, public PBD::StatefulDestructible { virtual RouteTimeAxisView* get_route_view_by_id (PBD::ID& id) = 0; - virtual void get_equivalent_regions (RegionView* rv, std::vector<RegionView*>&, ARDOUR::RouteGroup::Property) const = 0; + virtual void get_equivalent_regions (RegionView* rv, std::vector<RegionView*>&, PBD::PropertyID) const = 0; sigc::signal<void> ZoomFocusChanged; sigc::signal<void> ZoomChanged; diff --git a/gtk2_ardour/quantize_dialog.cc b/gtk2_ardour/quantize_dialog.cc index f8a6d3a516..727f2b0db9 100644 --- a/gtk2_ardour/quantize_dialog.cc +++ b/gtk2_ardour/quantize_dialog.cc @@ -20,6 +20,7 @@ #include <gtkmm/stock.h> #include "gtkmm2ext/utils.h" +#include "pbd/convert.h" #include "quantize_dialog.h" #include "public_editor.h" diff --git a/gtk2_ardour/region_view.cc b/gtk2_ardour/region_view.cc index e9b3da554d..575ecbb5e2 100644 --- a/gtk2_ardour/region_view.cc +++ b/gtk2_ardour/region_view.cc @@ -228,7 +228,7 @@ RegionView::lock_toggle () } void -RegionView::region_changed (Change what_changed) +RegionView::region_changed (PropertyChange what_changed) { ENSURE_GUI_THREAD (*this, &RegionView::region_changed, what_changed) @@ -261,7 +261,7 @@ RegionView::region_locked () } void -RegionView::region_resized (Change what_changed) +RegionView::region_resized (PropertyChange what_changed) { double unit_length; @@ -270,7 +270,7 @@ RegionView::region_resized (Change what_changed) _time_converter.set_origin(_region->position()); } - if (what_changed & Change (StartChanged|LengthChanged)) { + if (what_changed & PropertyChange (StartChanged|LengthChanged)) { set_duration (_region->length(), 0); diff --git a/gtk2_ardour/region_view.h b/gtk2_ardour/region_view.h index 172405d132..d9ffc83c50 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::Change); + virtual void region_changed (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::Change); + virtual void region_resized (PBD::PropertyChange); virtual void region_muted (); void region_locked (); void region_opacity (); diff --git a/gtk2_ardour/route_group_dialog.cc b/gtk2_ardour/route_group_dialog.cc index 94caef9286..7b802ac6ec 100644 --- a/gtk2_ardour/route_group_dialog.cc +++ b/gtk2_ardour/route_group_dialog.cc @@ -27,6 +27,7 @@ using namespace Gtk; using namespace ARDOUR; using namespace std; +using namespace PBD; RouteGroupDialog::RouteGroupDialog (RouteGroup* g, StockID const & s) : ArdourDialog (_("route group dialog")), @@ -77,13 +78,13 @@ RouteGroupDialog::RouteGroupDialog (RouteGroup* g, StockID const & s) _name.signal_activate ().connect (sigc::bind (sigc::mem_fun (*this, &Dialog::response), RESPONSE_OK)); - _gain.set_active (_group->property (RouteGroup::Gain)); + _gain.set_active (_group->is_gain()); _relative.set_active (_group->is_relative()); - _mute.set_active (_group->property (RouteGroup::Mute)); - _solo.set_active (_group->property (RouteGroup::Solo)); - _rec_enable.set_active (_group->property (RouteGroup::RecEnable)); - _select.set_active (_group->property (RouteGroup::Select)); - _edit.set_active (_group->property (RouteGroup::Edit)); + _mute.set_active (_group->is_mute()); + _solo.set_active (_group->is_solo()); + _rec_enable.set_active (_group->is_recenable()); + _select.set_active (_group->is_select()); + _edit.set_active (_group->is_edit()); gain_toggled (); @@ -128,15 +129,20 @@ RouteGroupDialog::do_run () int const r = run (); if (r == Gtk::RESPONSE_OK || r == Gtk::RESPONSE_ACCEPT) { - _group->set_property (RouteGroup::Gain, _gain.get_active ()); - _group->set_property (RouteGroup::Mute, _mute.get_active ()); - _group->set_property (RouteGroup::Solo, _solo.get_active ()); - _group->set_property (RouteGroup::RecEnable, _rec_enable.get_active ()); - _group->set_property (RouteGroup::Select, _select.get_active ()); - _group->set_property (RouteGroup::Edit, _edit.get_active ()); - _group->set_name (_name.get_text ()); // This emits changed signal - _group->set_active (_active.get_active (), this); - _group->set_relative (_relative.get_active(), this); + + PropertyList plist; + + plist.add (Properties::gain, _gain.get_active()); + plist.add (Properties::recenable, _rec_enable.get_active()); + plist.add (Properties::mute, _mute.get_active()); + plist.add (Properties::solo, _solo.get_active ()); + plist.add (Properties::select, _select.get_active()); + plist.add (Properties::edit, _edit.get_active()); + plist.add (Properties::relative, _relative.get_active()); + plist.add (Properties::active, _active.get_active()); + plist.add (Properties::name, string (_name.get_text())); + + _group->set_properties (plist); } return r; diff --git a/gtk2_ardour/route_group_menu.cc b/gtk2_ardour/route_group_menu.cc index c8ef0a260b..baf383be5d 100644 --- a/gtk2_ardour/route_group_menu.cc +++ b/gtk2_ardour/route_group_menu.cc @@ -27,16 +27,22 @@ using namespace Gtk; using namespace ARDOUR; +using namespace PBD; -RouteGroupMenu::RouteGroupMenu (Session* s, RouteGroup::Property p) +RouteGroupMenu::RouteGroupMenu (Session* s, PropertyList* plist) : SessionHandlePtr (s) - , _default_properties (p) + , _default_properties (plist) , _inhibit_group_selected (false) , _selected_route_group (0) { rebuild (0); } +RouteGroupMenu::~RouteGroupMenu() +{ + delete _default_properties; +} + void RouteGroupMenu::rebuild (RouteGroup* curr) { @@ -101,7 +107,8 @@ RouteGroupMenu::new_group () return; } - RouteGroup* g = new RouteGroup (*_session, "", RouteGroup::Active, _default_properties); + RouteGroup* g = new RouteGroup (*_session, ""); + g->set_properties (*_default_properties); RouteGroupDialog d (g, Gtk::Stock::NEW); int const r = d.do_run (); diff --git a/gtk2_ardour/route_group_menu.h b/gtk2_ardour/route_group_menu.h index 1fbbbcf7b3..b588be7838 100644 --- a/gtk2_ardour/route_group_menu.h +++ b/gtk2_ardour/route_group_menu.h @@ -27,7 +27,8 @@ class RouteGroupMenu : public Gtk::Menu, public ARDOUR::SessionHandlePtr { public: - RouteGroupMenu (ARDOUR::Session*, ARDOUR::RouteGroup::Property); + RouteGroupMenu (ARDOUR::Session*, PBD::PropertyList*); + ~RouteGroupMenu(); void rebuild (ARDOUR::RouteGroup *); @@ -38,7 +39,7 @@ public: void new_group (); void set_group (ARDOUR::RouteGroup *); - ARDOUR::RouteGroup::Property _default_properties; + PBD::PropertyList* _default_properties; bool _inhibit_group_selected; ARDOUR::RouteGroup* _selected_route_group; }; diff --git a/gtk2_ardour/route_time_axis.cc b/gtk2_ardour/route_time_axis.cc index 8de2f6b141..0b5cf8b085 100644 --- a/gtk2_ardour/route_time_axis.cc +++ b/gtk2_ardour/route_time_axis.cc @@ -248,11 +248,13 @@ RouteTimeAxisView::RouteTimeAxisView (PublicEditor& ed, Session* sess, boost::sh _editor.ZoomChanged.connect (sigc::mem_fun(*this, &RouteTimeAxisView::reset_samples_per_unit)); ColorsChanged.connect (sigc::mem_fun (*this, &RouteTimeAxisView::color_handler)); - route_group_menu = new RouteGroupMenu ( - _session, - (RouteGroup::Property) (RouteGroup::Mute | RouteGroup::Solo | RouteGroup::Edit) - ); - + PropertyList* plist = new PropertyList(); + + plist->add (ARDOUR::Properties::edit, true); + plist->add (ARDOUR::Properties::mute, true); + plist->add (ARDOUR::Properties::solo, true); + + route_group_menu = new RouteGroupMenu (_session, plist); route_group_menu->GroupSelected.connect (sigc::mem_fun (*this, &RouteTimeAxisView::set_route_group_from_menu)); gm.get_gain_slider().signal_scroll_event().connect(sigc::mem_fun(*this, &RouteTimeAxisView::controls_ebox_scroll), false); diff --git a/gtk2_ardour/route_ui.h b/gtk2_ardour/route_ui.h index 12a1cde703..5dce9ee4b4 100644 --- a/gtk2_ardour/route_ui.h +++ b/gtk2_ardour/route_ui.h @@ -205,7 +205,6 @@ class RouteUI : public virtual AxisView void init (); void reset (); - void queue_route_group_op (ARDOUR::RouteGroup::Property prop, void (ARDOUR::Session::*session_method)(boost::shared_ptr<ARDOUR::RouteList>, bool), bool yn); void self_delete (); private: diff --git a/gtk2_ardour/sfdb_ui.cc b/gtk2_ardour/sfdb_ui.cc index 6919be9f62..65ae061e5c 100644 --- a/gtk2_ardour/sfdb_ui.cc +++ b/gtk2_ardour/sfdb_ui.cc @@ -347,9 +347,15 @@ SoundFileBox::audition () afs = boost::dynamic_pointer_cast<AudioFileSource> (srclist[0]); string rname = region_name_from_path (afs->path(), false); - r = boost::dynamic_pointer_cast<AudioRegion> (RegionFactory::create (srclist, 0, - srclist[0]->length(srclist[0]->timeline_position()), - rname, 0, Region::DefaultFlags, false)); + + PropertyList plist; + + plist.add (ARDOUR::Properties::start, 0); + plist.add (ARDOUR::Properties::length, srclist[0]->length(srclist[0]->timeline_position())); + plist.add (ARDOUR::Properties::name, rname); + plist.add (ARDOUR::Properties::layer, 0); + + r = boost::dynamic_pointer_cast<AudioRegion> (RegionFactory::create (srclist, plist, false)); _session->audition_region(r); } diff --git a/gtk2_ardour/strip_silence_dialog.cc b/gtk2_ardour/strip_silence_dialog.cc index 3592668cf8..2be04f7fcb 100644 --- a/gtk2_ardour/strip_silence_dialog.cc +++ b/gtk2_ardour/strip_silence_dialog.cc @@ -33,6 +33,8 @@ #include "rgb_macros.h" #include "i18n.h" +using namespace ARDOUR; + /** Construct Strip silence dialog box */ StripSilenceDialog::StripSilenceDialog (std::list<boost::shared_ptr<ARDOUR::AudioRegion> > const & regions) : ArdourDialog (_("Strip Silence")), _wave_width (640), _wave_height (64) @@ -183,10 +185,10 @@ StripSilenceDialog::update_silence_rects () i->silence_rects.clear (); - std::list<std::pair<nframes_t, nframes_t> > const silence = + std::list<std::pair<frameoffset_t, framecnt_t> > const silence = i->region->find_silence (dB_to_coefficient (threshold ()), minimum_length ()); - - for (std::list<std::pair<nframes_t, nframes_t> >::const_iterator j = silence.begin(); j != silence.end(); ++j) { + + for (std::list<std::pair<frameoffset_t, framecnt_t> >::const_iterator j = silence.begin(); j != silence.end(); ++j) { ArdourCanvas::SimpleRect* r = new ArdourCanvas::SimpleRect (*(_canvas->root())); r->property_x1() = j->first / i->samples_per_unit; diff --git a/gtk2_ardour/track_selection.cc b/gtk2_ardour/track_selection.cc index 9aa29bdb6d..95ca1253b8 100755 --- a/gtk2_ardour/track_selection.cc +++ b/gtk2_ardour/track_selection.cc @@ -41,7 +41,7 @@ TrackSelection::add (TrackViewList const & t) /* select anything in the same select-enabled route group */ ARDOUR::RouteGroup* rg = (*i)->route_group (); - if (rg && rg->property (ARDOUR::RouteGroup::Select)) { + if (rg && rg->is_active() && rg->is_select ()) { TrackViewList tr = _editor->axis_views_from_routes (rg->route_list ()); for (TrackViewList::iterator j = tr.begin(); j != tr.end(); ++j) { if (!contains (*j)) { |