diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h index 2941005f41..11f04cb5fa 100644 --- a/gtk2_ardour/editor.h +++ b/gtk2_ardour/editor.h @@ -1677,7 +1677,7 @@ private: void fade_range (); - std::set > motion_frozen_playlists; + ARDOUR::PlaylistSet motion_frozen_playlists; bool _dragging_playhead; diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc index d70f2f068a..ea258253bf 100644 --- a/gtk2_ardour/editor_drag.cc +++ b/gtk2_ardour/editor_drag.cc @@ -2055,7 +2055,7 @@ RegionMoveDrag::finished_no_copy ( } } - for (set >::iterator p = frozen_playlists.begin(); p != frozen_playlists.end(); ++p) { + for (PlaylistSet::iterator p = frozen_playlists.begin(); p != frozen_playlists.end(); ++p) { (*p)->thaw(); } @@ -2101,7 +2101,7 @@ RegionMoveDrag::remove_region_from_playlist ( PlaylistSet& modified_playlists ) { - pair >::iterator, bool> r = modified_playlists.insert (playlist); + pair r = modified_playlists.insert (playlist); if (r.second) { playlist->clear_changes (); @@ -2771,7 +2771,7 @@ TrimDrag::motion (GdkEvent* event, bool first_move) { RegionView* rv = _primary; - pair >::iterator,bool> insert_result; + pair insert_result; timecnt_t delta; timepos_t adj_time = adjusted_time (_drags->current_pointer_time () + snap_delta (event->button.state), event, true); timecnt_t dt = raw_grab_time().distance (adj_time) + _pointer_offset - snap_delta (event->button.state); @@ -2979,7 +2979,7 @@ TrimDrag::finished (GdkEvent* event, bool movement_occurred) } } - for (set >::iterator p = _editor->motion_frozen_playlists.begin(); p != _editor->motion_frozen_playlists.end(); ++p) { + for (PlaylistSet::iterator p = _editor->motion_frozen_playlists.begin(); p != _editor->motion_frozen_playlists.end(); ++p) { /* Trimming one region may affect others on the playlist, so we need to get undo Commands from the whole playlist rather than just the region. Use motion_frozen_playlists (a set) to make sure we don't diff --git a/gtk2_ardour/editor_drag.h b/gtk2_ardour/editor_drag.h index ef546da9e8..976828f6b7 100644 --- a/gtk2_ardour/editor_drag.h +++ b/gtk2_ardour/editor_drag.h @@ -393,8 +393,7 @@ protected: friend class DraggingView; protected: - typedef std::set > PlaylistSet; - void add_stateful_diff_commands_for_playlists (PlaylistSet const &); + void add_stateful_diff_commands_for_playlists (ARDOUR::PlaylistSet const &); private: @@ -515,13 +514,13 @@ private: RouteTimeAxisView*, ARDOUR::layer_t, Temporal::timepos_t const &, - PlaylistSet& + ARDOUR::PlaylistSet& ); void remove_region_from_playlist ( std::shared_ptr, std::shared_ptr, - PlaylistSet& modified_playlists + ARDOUR::PlaylistSet& modified_playlists ); diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc index d03943fffa..a61a8bdbfe 100644 --- a/gtk2_ardour/editor_ops.cc +++ b/gtk2_ardour/editor_ops.cc @@ -2957,8 +2957,8 @@ Editor::do_layer_operation (LayerOperation op) break; } - set > playlists = selection->regions.playlists (); - for (set >::iterator i = playlists.begin(); i != playlists.end(); ++i) { + PlaylistSet playlists = selection->regions.playlists (); + for (PlaylistSet::iterator i = playlists.begin(); i != playlists.end(); ++i) { (*i)->clear_owned_changes (); } @@ -2979,7 +2979,7 @@ Editor::do_layer_operation (LayerOperation op) } } - for (set >::iterator i = playlists.begin(); i != playlists.end(); ++i) { + for (PlaylistSet::iterator i = playlists.begin(); i != playlists.end(); ++i) { vector cmds; (*i)->rdiff (cmds); _session->add_commands (cmds); @@ -4900,7 +4900,7 @@ Editor::cut_copy_regions (CutCopyOp op, RegionSelection& rs) std::shared_ptr pl = (*x)->region()->playlist(); if (pl) { - FreezeList::iterator fl; + PlaylistSet::iterator fl; // only take state if this is a new playlist. for (fl = freezelist.begin(); fl != freezelist.end(); ++fl) { @@ -5034,7 +5034,7 @@ Editor::cut_copy_regions (CutCopyOp op, RegionSelection& rs) } } - for (FreezeList::iterator pl = freezelist.begin(); pl != freezelist.end(); ++pl) { + for (PlaylistSet::iterator pl = freezelist.begin(); pl != freezelist.end(); ++pl) { (*pl)->thaw (); /* We might have removed regions, which alters other regions' layering_index, @@ -5270,7 +5270,7 @@ Editor::duplicate_some_regions (RegionSelection& regions, float times) } std::shared_ptr playlist; - std::set > playlists; // list of unique playlists affected by duplication + PlaylistSet playlists; // list of unique playlists affected by duplication RegionSelection sel = regions; // clear (below) may clear the argument list if its the current region selection RegionSelection foo; @@ -5300,7 +5300,7 @@ Editor::duplicate_some_regions (RegionSelection& regions, float times) } } - for (set >::iterator p = playlists.begin(); p != playlists.end(); ++p) { + for (PlaylistSet::iterator p = playlists.begin(); p != playlists.end(); ++p) { do_ripple ((*p), start_time, span.scale (times), &exclude, false); } } @@ -5347,7 +5347,7 @@ Editor::duplicate_some_regions (RegionSelection& regions, float times) foo.insert (foo.end(), latest_regionviews.begin(), latest_regionviews.end()); } - for (set >::iterator p = playlists.begin(); p != playlists.end(); ++p) { + for (PlaylistSet::iterator p = playlists.begin(); p != playlists.end(); ++p) { (*p)->rdiff_and_add_command (_session); } @@ -5973,7 +5973,7 @@ Editor::fork_regions_from_unselected () sources_list.insert(mrv->midi_region()->midi_source()); } - std::set > affected_playlists; + PlaylistSet affected_playlists; for (auto r : rs) { const MidiRegionView* const mrv = dynamic_cast(r); if (mrv && sources_list.find(mrv->midi_region()->midi_source()) != sources_list.end()) { @@ -8391,7 +8391,7 @@ Editor::insert_time ( * than 1 track using playlists "from" a given track. */ - set > pl; + PlaylistSet pl; if (all_playlists) { RouteTimeAxisView* rtav = dynamic_cast (*x); @@ -8407,7 +8407,7 @@ Editor::insert_time ( } } - for (set >::iterator i = pl.begin(); i != pl.end(); ++i) { + for (PlaylistSet::iterator i = pl.begin(); i != pl.end(); ++i) { (*i)->clear_changes (); (*i)->clear_owned_changes (); @@ -9544,7 +9544,7 @@ Editor::remove_gaps (timecnt_t const & gap_threshold, timecnt_t const & leave_ga locations_before = &_session->locations()->get_state(); } - set > pl; + PlaylistSet pl; /* it will not be possible to infer this from the set<>, so keep track * of it explicitly @@ -9567,7 +9567,7 @@ Editor::remove_gaps (timecnt_t const & gap_threshold, timecnt_t const & leave_ga } } - for (set >::iterator i = pl.begin(); i != pl.end(); ++i) { + for (PlaylistSet::iterator i = pl.begin(); i != pl.end(); ++i) { (*i)->clear_changes (); (*i)->clear_owned_changes (); @@ -9649,8 +9649,7 @@ Editor::do_ripple (std::shared_ptr target_playlist, timepos_t void Editor::do_ripple (std::shared_ptr target_playlist, timepos_t const & at, timecnt_t const & distance, RegionList* exclude, bool add_to_command) { - typedef std::set > UniquePlaylists; - UniquePlaylists playlists; + PlaylistSet playlists; playlists.insert (target_playlist); @@ -9668,18 +9667,17 @@ Editor::do_ripple (std::shared_ptr target_playlist, timepos_t const & } if (add_to_command) { - for (UniquePlaylists::iterator p = playlists.begin(); p != playlists.end(); ++p) { - - (*p)->clear_changes (); - (*p)->clear_owned_changes (); + for (auto const& p : playlists) { + p->clear_changes (); + p->clear_owned_changes (); } } - for (UniquePlaylists::iterator p = playlists.begin(); p != playlists.end(); ++p) { - (*p)->freeze (); + for (auto const& p : playlists) { + p->freeze (); } - for (UniquePlaylists::iterator p = playlists.begin(); p != playlists.end(); ++p) { + for (PlaylistSet::iterator p = playlists.begin(); p != playlists.end(); ++p) { /* exclude list is only for the target */ @@ -9708,7 +9706,7 @@ Editor::do_ripple (std::shared_ptr target_playlist, timepos_t const & } - for (UniquePlaylists::iterator p = playlists.begin(); p != playlists.end(); ++p) { + for (PlaylistSet::iterator p = playlists.begin(); p != playlists.end(); ++p) { (*p)->thaw (); } diff --git a/gtk2_ardour/editor_selection.cc b/gtk2_ardour/editor_selection.cc index 7e96dba56a..424c79932e 100644 --- a/gtk2_ardour/editor_selection.cc +++ b/gtk2_ardour/editor_selection.cc @@ -492,7 +492,7 @@ void Editor::mapover_tracks_with_unique_playlists (sigc::slot sl, TimeAxisView* basis, PBD::PropertyID prop) const { RouteTimeAxisView* route_basis = dynamic_cast (basis); - set > playlists; + PlaylistSet playlists; if (route_basis == 0) { return; @@ -540,7 +540,7 @@ Editor::mapover_tracks_with_unique_playlists (sigc::slot sl) const { - set > playlists; + PlaylistSet playlists; set tracks; diff --git a/gtk2_ardour/editor_timefx.cc b/gtk2_ardour/editor_timefx.cc index 5c970dff3c..cd529725e9 100644 --- a/gtk2_ardour/editor_timefx.cc +++ b/gtk2_ardour/editor_timefx.cc @@ -87,7 +87,7 @@ Editor::time_stretch (RegionSelection& regions, Temporal::ratio_t const & ratio) return aret; } - set > midi_playlists_affected; + PlaylistSet midi_playlists_affected; for (RegionList::iterator i = midi.begin(); i != midi.end(); ++i) { std::shared_ptr playlist = (*i)->playlist(); @@ -116,7 +116,7 @@ Editor::time_stretch (RegionSelection& regions, Temporal::ratio_t const & ratio) midi_playlists_affected.insert (playlist); } - for (set >::iterator p = midi_playlists_affected.begin(); p != midi_playlists_affected.end(); ++p) { + for (PlaylistSet::iterator p = midi_playlists_affected.begin(); p != midi_playlists_affected.end(); ++p) { PBD::StatefulDiffCommand* cmd = new StatefulDiffCommand (*p); _session->add_command (cmd); if (!cmd->empty ()) { diff --git a/gtk2_ardour/region_selection.cc b/gtk2_ardour/region_selection.cc index 8d9c93f5b3..10e708ed72 100644 --- a/gtk2_ardour/region_selection.cc +++ b/gtk2_ardour/region_selection.cc @@ -323,10 +323,10 @@ RegionSelection::end_time () const } /** @return the playlists that the regions in the selection are on */ -set > +PlaylistSet RegionSelection::playlists () const { - set > pl; + PlaylistSet pl; for (RegionSelection::const_iterator i = begin(); i != end(); ++i) { pl.insert ((*i)->region()->playlist ()); } diff --git a/gtk2_ardour/region_selection.h b/gtk2_ardour/region_selection.h index 9f73d9413c..2ace12432f 100644 --- a/gtk2_ardour/region_selection.h +++ b/gtk2_ardour/region_selection.h @@ -66,7 +66,7 @@ public: size_t n_midi_regions() const; - std::set > playlists () const; + ARDOUR::PlaylistSet playlists () const; std::list pending; ARDOUR::RegionList regionlist () const; diff --git a/gtk2_ardour/time_axis_view.cc b/gtk2_ardour/time_axis_view.cc index a9350d45fe..1e33237e84 100644 --- a/gtk2_ardour/time_axis_view.cc +++ b/gtk2_ardour/time_axis_view.cc @@ -1395,7 +1395,7 @@ TimeAxisView::reset_visual_state () TrackViewList TrackViewList::filter_to_unique_playlists () { - std::set > playlists; + PlaylistSet playlists; TrackViewList ts; for (iterator i = begin(); i != end(); ++i) { diff --git a/gtk2_ardour/time_info_box.cc b/gtk2_ardour/time_info_box.cc index f86562ffc3..9cf770bbf9 100644 --- a/gtk2_ardour/time_info_box.cc +++ b/gtk2_ardour/time_info_box.cc @@ -297,14 +297,14 @@ TimeInfoBox::selection_changed () } } else { /* this is more efficient than tracking changes per region in large selections */ - std::set > playlists; + PlaylistSet playlists; for (RegionSelection::iterator s = selection.regions.begin(); s != selection.regions.end(); ++s) { std::shared_ptr pl = (*s)->region()->playlist(); if (pl) { playlists.insert (pl); } } - for (std::set >::iterator ps = playlists.begin(); ps != playlists.end(); ++ps) { + for (PlaylistSet::iterator ps = playlists.begin(); ps != playlists.end(); ++ps) { (*ps)->ContentsChanged.connect (region_property_connections, invalidator (*this), boost::bind (&TimeInfoBox::region_selection_changed, this), gui_context()); }