diff options
author | Carl Hetherington <carl@carlh.net> | 2009-12-03 21:52:10 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2009-12-03 21:52:10 +0000 |
commit | ee9455af40adaaf48010784330f457f471b2546e (patch) | |
tree | 187facb02c3a19b350ae9e3c3308d532331dfbd3 /gtk2_ardour | |
parent | 03c74e45a871f2e09fb1ee855f830c94d1cdb163 (diff) |
Move some (most) playlist-related code and data into a separate object
(SessionPlaylists). Main point being to ensure that, when a Session
is destroyed (especially as a result of its constructor throwing an
exception) SessionPlaylists::track is disconnected from its signal
at the same time as the list of playlists is destroyed. Otherwise
problems abound.
git-svn-id: svn://localhost/ardour2/branches/3.0@6270 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour')
-rw-r--r-- | gtk2_ardour/editor.cc | 6 | ||||
-rw-r--r-- | gtk2_ardour/playlist_selector.cc | 4 | ||||
-rw-r--r-- | gtk2_ardour/route_time_axis.cc | 8 |
3 files changed, 9 insertions, 9 deletions
diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index 445044f65c..b7dd21f535 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -4026,7 +4026,7 @@ Editor::new_playlists (TimeAxisView* v) { begin_reversible_command (_("new playlists")); vector<boost::shared_ptr<ARDOUR::Playlist> > playlists; - session->get_playlists(playlists); + session->playlists.get (playlists); mapover_tracks (bind (mem_fun (*this, &Editor::mapped_use_new_playlist), playlists), v, RouteGroup::Edit); commit_reversible_command (); } @@ -4042,7 +4042,7 @@ Editor::copy_playlists (TimeAxisView* v) { begin_reversible_command (_("copy playlists")); vector<boost::shared_ptr<ARDOUR::Playlist> > playlists; - session->get_playlists(playlists); + session->playlists.get (playlists); mapover_tracks (bind (mem_fun (*this, &Editor::mapped_use_copy_playlist), playlists), v, RouteGroup::Edit); commit_reversible_command (); } @@ -4057,7 +4057,7 @@ Editor::clear_playlists (TimeAxisView* v) { begin_reversible_command (_("clear playlists")); vector<boost::shared_ptr<ARDOUR::Playlist> > playlists; - session->get_playlists(playlists); + session->playlists.get (playlists); mapover_tracks (mem_fun (*this, &Editor::mapped_clear_playlist), v, RouteGroup::Edit); commit_reversible_command (); } diff --git a/gtk2_ardour/playlist_selector.cc b/gtk2_ardour/playlist_selector.cc index ca40951e8b..82541cd7fb 100644 --- a/gtk2_ardour/playlist_selector.cc +++ b/gtk2_ardour/playlist_selector.cc @@ -112,7 +112,7 @@ PlaylistSelector::show_for (RouteUI* ruix) model->clear (); - session->foreach_playlist (this, &PlaylistSelector::add_playlist_to_map); + session->playlists.foreach (this, &PlaylistSelector::add_playlist_to_map); this_ds = rui->get_diskstream(); @@ -180,7 +180,7 @@ PlaylistSelector::show_for (RouteUI* ruix) // Add unassigned (imported) playlists to the list list<boost::shared_ptr<Playlist> > unassigned; - session->unassigned_playlists (unassigned); + session->playlists.unassigned (unassigned); TreeModel::Row row; TreeModel::Row* selected_row = 0; diff --git a/gtk2_ardour/route_time_axis.cc b/gtk2_ardour/route_time_axis.cc index 08e9ac11ce..a644ef5e9e 100644 --- a/gtk2_ardour/route_time_axis.cc +++ b/gtk2_ardour/route_time_axis.cc @@ -1037,7 +1037,7 @@ RouteTimeAxisView::use_copy_playlist (bool prompt, vector<boost::shared_ptr<Play name = resolve_new_group_playlist_name(name, playlists_before_op); } - while (_session.playlist_by_name(name)) { + while (_session.playlists.by_name(name)) { name = Playlist::bump_name (name, _session); } @@ -1089,7 +1089,7 @@ RouteTimeAxisView::use_new_playlist (bool prompt, vector<boost::shared_ptr<Playl name = resolve_new_group_playlist_name(name,playlists_before_op); } - while (_session.playlist_by_name(name)) { + while (_session.playlists.by_name(name)) { name = Playlist::bump_name (name, _session); } @@ -1497,7 +1497,7 @@ RouteTimeAxisView::build_playlist_menu (Gtk::Menu * menu) boost::shared_ptr<Diskstream> ds = get_diskstream(); RadioMenuItem::Group playlist_group; - _session.get_playlists (playlists); + _session.playlists.get (playlists); for (vector<boost::shared_ptr<Playlist> >::iterator i = playlists.begin(); i != playlists.end(); ++i) { @@ -1585,7 +1585,7 @@ RouteTimeAxisView::use_playlist (boost::weak_ptr<Playlist> wpl) continue; } - boost::shared_ptr<Playlist> ipl = session().playlist_by_name(playlist_name); + boost::shared_ptr<Playlist> ipl = session().playlists.by_name(playlist_name); if (!ipl) { // No playlist for this track for this take yet, make it track->diskstream()->use_new_playlist(); |