/*
- Copyright (C) 2004 Paul Davis
+ Copyright (C) 2004 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
#include <gtkmm/button.h>
-#include <ardour/session_playlist.h>
-#include <ardour/audio_diskstream.h>
-#include <ardour/playlist.h>
-#include <ardour/audio_track.h>
-#include <ardour/audioplaylist.h>
-#include <ardour/configuration.h>
+#include "ardour/session_playlist.h"
+#include "ardour/audio_diskstream.h"
+#include "ardour/playlist.h"
+#include "ardour/audio_track.h"
+#include "ardour/audioplaylist.h"
+#include "ardour/configuration.h"
#include <gtkmm2ext/gtk_ui.h>
#include <gtkmm2ext/window_title.h>
: ArdourDialog ("playlist selector")
{
rui = 0;
-
+
set_position (WIN_POS_MOUSE);
set_name ("PlaylistSelectorWindow");
set_modal(true);
select_connection.disconnect ();
model->clear ();
-
+
session->foreach_playlist (this, &PlaylistSelector::add_playlist_to_map);
this_ds = rui->get_diskstream();
others[columns.text] = _("Other tracks");
boost::shared_ptr<Playlist> proxy = others[columns.playlist];
proxy.reset ();
-
+
for (DSPL_Map::iterator x = dspl_map.begin(); x != dspl_map.end(); ++x) {
boost::shared_ptr<Diskstream> ds = session->diskstream_by_id (x->first);
} else {
nodename = ds->name().c_str();
}
-
+
TreeModel::Row row;
TreeModel::Row* selected_row = 0;
TreePath this_path;
}
/* Now insert all the playlists for this diskstream/track in a subtree */
-
+
list<boost::shared_ptr<Playlist> > *pls = x->second;
-
+
for (list<boost::shared_ptr<Playlist> >::iterator p = pls->begin(); p != pls->end(); ++p) {
TreeModel::Row child_row;
if (*p == this_ds->playlist()) {
selected_row = &child_row;
- }
+ }
}
-
+
if (selected_row != 0) {
tree.get_selection()->select (*selected_row);
}
if (pl->frozen()) {
return;
}
-
+
if ((apl = boost::dynamic_pointer_cast<AudioPlaylist> (pl)) == 0) {
return;
}
if ((x = dspl_map.find (apl->get_orig_diskstream_id())) == dspl_map.end()) {
pair<PBD::ID,list<boost::shared_ptr<Playlist> >*> newp (apl->get_orig_diskstream_id(), new list<boost::shared_ptr<Playlist> >);
-
+
x = dspl_map.insert (dspl_map.end(), newp);
}
}
if ((playlist = ((*iter)[columns.playlist])) != 0) {
-
+
boost::shared_ptr<AudioTrack> at;
boost::shared_ptr<AudioPlaylist> apl;
-
+
if ((at = rui->audio_track()) == 0) {
/* eh? */
return;
}
-
+
if ((apl = boost::dynamic_pointer_cast<AudioPlaylist> (playlist)) == 0) {
/* eh? */
return;
}
-
+
at->diskstream()->use_playlist (apl);
hide ();
}
}
-
+