void fork_region ();
void do_insert_time ();
- void insert_time (framepos_t, framecnt_t, Editing::InsertTimeOption, bool, bool, bool, bool, bool);
+ void insert_time (framepos_t, framecnt_t, Editing::InsertTimeOption, bool, bool, bool, bool, bool, bool);
void tab_to_transient (bool forward);
#include "ardour/strip_silence.h"
#include "ardour/route_group.h"
#include "ardour/operations.h"
+#include "ardour/session_playlists.h"
#include "ardour_ui.h"
#include "debug.h"
get_preferred_edit_position(),
d.distance(),
opt,
+ d.all_playlists(),
d.move_glued(),
d.move_markers(),
d.move_glued_markers(),
}
void
-Editor::insert_time (framepos_t pos, framecnt_t frames, InsertTimeOption opt,
- bool ignore_music_glue, bool markers_too, bool glued_markers_too, bool locked_markers_too, bool tempo_too)
+Editor::insert_time (
+ framepos_t pos, framecnt_t frames, InsertTimeOption opt,
+ bool all_playlists, bool ignore_music_glue, bool markers_too, bool glued_markers_too, bool locked_markers_too, bool tempo_too
+ )
{
bool commit = false;
begin_reversible_command (_("insert time"));
for (TrackSelection::iterator x = selection->tracks.begin(); x != selection->tracks.end(); ++x) {
+
/* regions */
- boost::shared_ptr<Playlist> pl = (*x)->playlist();
- if (pl) {
+ vector<boost::shared_ptr<Playlist> > pl;
+ if (all_playlists) {
+ RouteTimeAxisView* rtav = dynamic_cast<RouteTimeAxisView*> (*x);
+ if (rtav) {
+ pl = _session->playlists->playlists_for_track (rtav->track ());
+ }
+ } else {
+ if ((*x)->playlist ()) {
+ pl.push_back ((*x)->playlist ());
+ }
+ }
- pl->clear_changes ();
- pl->clear_owned_changes ();
+ for (vector<boost::shared_ptr<Playlist> >::iterator i = pl.begin(); i != pl.end(); ++i) {
+
+ (*i)->clear_changes ();
+ (*i)->clear_owned_changes ();
if (opt == SplitIntersected) {
- pl->split (pos);
+ (*i)->split (pos);
}
- pl->shift (pos, frames, (opt == MoveIntersected), ignore_music_glue);
+ (*i)->shift (pos, frames, (opt == MoveIntersected), ignore_music_glue);
vector<Command*> cmds;
- pl->rdiff (cmds);
+ (*i)->rdiff (cmds);
_session->add_commands (cmds);
- _session->add_command (new StatefulDiffCommand (pl));
+ _session->add_command (new StatefulDiffCommand (*i));
commit = true;
}
get_vbox()->pack_start (*table);
+ _all_playlists.set_label (_("Insert time on all the track's playlists"));
+ get_vbox()->pack_start (_all_playlists);
+
_move_glued.set_label (_("Move glued regions"));
get_vbox()->pack_start (_move_glued);
_move_markers.set_label (_("Move markers"));
return opt;
}
+bool
+InsertTimeDialog::all_playlists () const
+{
+ return _all_playlists.get_active ();
+}
+
bool
InsertTimeDialog::move_glued () const
{
InsertTimeDialog (PublicEditor &);
Editing::InsertTimeOption intersected_region_action ();
+ bool all_playlists () const;
bool move_glued () const;
bool move_markers () const;
bool move_glued_markers () const;
PublicEditor& _editor;
Gtk::ComboBoxText _intersected_combo;
+ Gtk::CheckButton _all_playlists;
Gtk::CheckButton _move_glued;
Gtk::CheckButton _move_markers;
Gtk::CheckButton _move_glued_markers;
playlist_action_menu->set_name ("ArdourContextMenu");
playlist_items.clear();
- vector<boost::shared_ptr<Playlist> > playlists, playlists_tr;
- boost::shared_ptr<Track> tr = track();
RadioMenuItem::Group playlist_group;
+ boost::shared_ptr<Track> tr = track ();
- _session->playlists->get (playlists);
-
- /* find the playlists for this diskstream */
- for (vector<boost::shared_ptr<Playlist> >::iterator i = playlists.begin(); i != playlists.end(); ++i) {
- if (((*i)->get_orig_diskstream_id() == tr->diskstream_id()) || (tr->playlist()->id() == (*i)->id())) {
- playlists_tr.push_back(*i);
- }
- }
+ vector<boost::shared_ptr<Playlist> > playlists_tr = _session->playlists->playlists_for_track (tr);
/* sort the playlists */
PlaylistSorter cmp;
class Source;
class Session;
class Crossfade;
+class Track;
class SessionPlaylists : public PBD::ScopedConnectionList
{
uint32_t source_use_count (boost::shared_ptr<const Source> src) const;
uint32_t region_use_count (boost::shared_ptr<Region> region) const;
template<class T> void foreach (T *obj, void (T::*func)(boost::shared_ptr<Playlist>));
- void get (std::vector<boost::shared_ptr<Playlist> >&);
+ void get (std::vector<boost::shared_ptr<Playlist> >&) const;
void unassigned (std::list<boost::shared_ptr<Playlist> > & list);
void destroy_region (boost::shared_ptr<Region>);
boost::shared_ptr<Crossfade> find_crossfade (const PBD::ID &);
void sync_all_regions_with_regions ();
+ std::vector<boost::shared_ptr<Playlist> > playlists_for_track (boost::shared_ptr<Track>) const;
private:
friend class Session;
#include "ardour/playlist_factory.h"
#include "ardour/session.h"
#include "ardour/source.h"
+#include "ardour/track.h"
#include "i18n.h"
using namespace std;
}
void
-SessionPlaylists::get (vector<boost::shared_ptr<Playlist> >& s)
+SessionPlaylists::get (vector<boost::shared_ptr<Playlist> >& s) const
{
Glib::Mutex::Lock lm (lock);
return cnt;
}
+
+/** @return list of Playlists that are associated with a track */
+vector<boost::shared_ptr<Playlist> >
+SessionPlaylists::playlists_for_track (boost::shared_ptr<Track> tr) const
+{
+ vector<boost::shared_ptr<Playlist> > pl;
+ get (pl);
+
+ vector<boost::shared_ptr<Playlist> > pl_tr;
+
+ for (vector<boost::shared_ptr<Playlist> >::iterator i = pl.begin(); i != pl.end(); ++i) {
+ if (((*i)->get_orig_diskstream_id() == tr->diskstream_id()) || (tr->playlist()->id() == (*i)->id())) {
+ pl_tr.push_back (*i);
+ }
+ }
+
+ return pl_tr;
+}