mirror of
https://github.com/Ardour/ardour.git
synced 2026-01-07 14:15:46 +01:00
Backport fix from trunk for selection of regions that are in edit groups.
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@2527 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
4940fa348d
commit
9e9c7a8536
5 changed files with 81 additions and 37 deletions
|
|
@ -3715,27 +3715,47 @@ Editor::restore_editing_space ()
|
|||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Make new playlists for a given track and also any others that belong
|
||||
* to the same active edit group.
|
||||
* @param v Track.
|
||||
*/
|
||||
|
||||
void
|
||||
Editor::new_playlists ()
|
||||
Editor::new_playlists (TimeAxisView* v)
|
||||
{
|
||||
begin_reversible_command (_("new playlists"));
|
||||
mapover_audio_tracks (mem_fun (*this, &Editor::mapped_use_new_playlist));
|
||||
mapover_audio_tracks (mem_fun (*this, &Editor::mapped_use_new_playlist), v);
|
||||
commit_reversible_command ();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Use a copy of the current playlist for a given track and also any others that belong
|
||||
* to the same active edit group.
|
||||
* @param v Track.
|
||||
*/
|
||||
|
||||
void
|
||||
Editor::copy_playlists ()
|
||||
Editor::copy_playlists (TimeAxisView* v)
|
||||
{
|
||||
begin_reversible_command (_("copy playlists"));
|
||||
mapover_audio_tracks (mem_fun (*this, &Editor::mapped_use_copy_playlist));
|
||||
mapover_audio_tracks (mem_fun (*this, &Editor::mapped_use_copy_playlist), v);
|
||||
commit_reversible_command ();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Clear the current playlist for a given track and also any others that belong
|
||||
* to the same active edit group.
|
||||
* @param v Track.
|
||||
*/
|
||||
|
||||
void
|
||||
Editor::clear_playlists ()
|
||||
Editor::clear_playlists (TimeAxisView* v)
|
||||
{
|
||||
begin_reversible_command (_("clear playlists"));
|
||||
mapover_audio_tracks (mem_fun (*this, &Editor::mapped_clear_playlist));
|
||||
mapover_audio_tracks (mem_fun (*this, &Editor::mapped_clear_playlist), v);
|
||||
commit_reversible_command ();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -262,9 +262,9 @@ class Editor : public PublicEditor
|
|||
nframes_t leftmost_frame;
|
||||
void clear_playlist (boost::shared_ptr<ARDOUR::Playlist>);
|
||||
|
||||
void new_playlists ();
|
||||
void copy_playlists ();
|
||||
void clear_playlists ();
|
||||
void new_playlists (TimeAxisView*);
|
||||
void copy_playlists (TimeAxisView*);
|
||||
void clear_playlists (TimeAxisView*);
|
||||
|
||||
TrackViewList* get_valid_views (TimeAxisView*, ARDOUR::RouteGroup* grp = 0);
|
||||
|
||||
|
|
@ -433,7 +433,7 @@ class Editor : public PublicEditor
|
|||
|
||||
void get_relevant_audio_tracks (std::set<AudioTimeAxisView*>& relevant_tracks);
|
||||
void get_equivalent_regions (RegionView* rv, std::vector<RegionView*>&);
|
||||
void mapover_audio_tracks (sigc::slot<void,AudioTimeAxisView&,uint32_t> sl);
|
||||
void mapover_audio_tracks (sigc::slot<void,AudioTimeAxisView&,uint32_t> sl, TimeAxisView*);
|
||||
|
||||
/* functions to be passed to mapover_audio_tracks(), possibly with sigc::bind()-supplied arguments */
|
||||
|
||||
|
|
|
|||
|
|
@ -284,18 +284,47 @@ Editor::get_relevant_audio_tracks (set<AudioTimeAxisView*>& relevant_tracks)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Call a slot for a given `basis' track and also for any track that is in the same
|
||||
* active edit group.
|
||||
* @param sl Slot to call.
|
||||
* @param basis Basis track.
|
||||
*/
|
||||
|
||||
void
|
||||
Editor::mapover_audio_tracks (slot<void,AudioTimeAxisView&,uint32_t> sl)
|
||||
Editor::mapover_audio_tracks (slot<void,AudioTimeAxisView&,uint32_t> sl, TimeAxisView* basis)
|
||||
{
|
||||
set<AudioTimeAxisView*> relevant_tracks;
|
||||
|
||||
get_relevant_audio_tracks (relevant_tracks);
|
||||
|
||||
uint32_t sz = relevant_tracks.size();
|
||||
|
||||
for (set<AudioTimeAxisView*>::iterator ati = relevant_tracks.begin(); ati != relevant_tracks.end(); ++ati) {
|
||||
sl (**ati, sz);
|
||||
AudioTimeAxisView* audio_basis = dynamic_cast<AudioTimeAxisView*> (basis);
|
||||
if (audio_basis == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* work out the tracks that we will call the slot for; use
|
||||
a set here as it will disallow possible duplicates of the
|
||||
basis track */
|
||||
set<AudioTimeAxisView*> tracks;
|
||||
|
||||
/* always call for the basis */
|
||||
tracks.insert (audio_basis);
|
||||
|
||||
RouteGroup* group = audio_basis->route()->edit_group();
|
||||
if (group && group->is_active()) {
|
||||
|
||||
/* the basis is a member of an active edit group; find other members */
|
||||
for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) {
|
||||
AudioTimeAxisView* v = dynamic_cast<AudioTimeAxisView*> (*i);
|
||||
if (v && v->route()->edit_group() == group) {
|
||||
tracks.insert (v);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* call the slots */
|
||||
uint32_t const sz = tracks.size ();
|
||||
for (set<AudioTimeAxisView*>::iterator i = tracks.begin(); i != tracks.end(); ++i) {
|
||||
sl (**i, sz);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -330,7 +359,7 @@ Editor::mapped_get_equivalent_regions (RouteTimeAxisView& tv, uint32_t ignored,
|
|||
void
|
||||
Editor::get_equivalent_regions (RegionView* basis, vector<RegionView*>& equivalent_regions)
|
||||
{
|
||||
mapover_audio_tracks (bind (mem_fun (*this, &Editor::mapped_get_equivalent_regions), basis, &equivalent_regions));
|
||||
mapover_audio_tracks (bind (mem_fun (*this, &Editor::mapped_get_equivalent_regions), basis, &equivalent_regions), &basis->get_trackview());
|
||||
|
||||
/* add clicked regionview since we skipped all other regions in the same track as the one it was in */
|
||||
|
||||
|
|
@ -387,11 +416,11 @@ Editor::set_selected_regionview_from_click (bool press, Selection::Operation op,
|
|||
|
||||
if (press) {
|
||||
|
||||
if (selection->selected (clicked_audio_trackview)) {
|
||||
get_equivalent_regions (clicked_regionview, all_equivalent_regions);
|
||||
} else {
|
||||
all_equivalent_regions.push_back (clicked_regionview);
|
||||
}
|
||||
if (selection->selected (clicked_audio_trackview)) {
|
||||
get_equivalent_regions (clicked_regionview, all_equivalent_regions);
|
||||
} else {
|
||||
all_equivalent_regions.push_back (clicked_regionview);
|
||||
}
|
||||
|
||||
/* add all the equivalent regions, but only on button press */
|
||||
|
||||
|
|
@ -409,12 +438,7 @@ Editor::set_selected_regionview_from_click (bool press, Selection::Operation op,
|
|||
case Selection::Set:
|
||||
if (!clicked_regionview->get_selected()) {
|
||||
|
||||
if (selection->selected (clicked_audio_trackview)) {
|
||||
get_equivalent_regions (clicked_regionview, all_equivalent_regions);
|
||||
} else {
|
||||
all_equivalent_regions.push_back (clicked_regionview);
|
||||
}
|
||||
|
||||
get_equivalent_regions (clicked_regionview, all_equivalent_regions);
|
||||
selection->set (all_equivalent_regions);
|
||||
commit = true;
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -129,9 +129,9 @@ class PublicEditor : public Gtk::Window, public PBD::StatefulThingWithGoingAway
|
|||
virtual PlaylistSelector& playlist_selector() const = 0;
|
||||
virtual void route_name_changed (TimeAxisView *) = 0;
|
||||
virtual void clear_playlist (boost::shared_ptr<ARDOUR::Playlist>) = 0;
|
||||
virtual void new_playlists () = 0;
|
||||
virtual void copy_playlists () = 0;
|
||||
virtual void clear_playlists () = 0;
|
||||
virtual void new_playlists (TimeAxisView*) = 0;
|
||||
virtual void copy_playlists (TimeAxisView*) = 0;
|
||||
virtual void clear_playlists (TimeAxisView*) = 0;
|
||||
virtual void select_all_tracks () = 0;
|
||||
virtual bool set_selected_track (TimeAxisView&, Selection::Operation op = Selection::Set, bool no_remove = false) = 0;
|
||||
virtual void set_selected_mixer_strip (TimeAxisView&) = 0;
|
||||
|
|
|
|||
|
|
@ -1304,10 +1304,10 @@ RouteTimeAxisView::build_playlist_menu (Gtk::Menu * menu)
|
|||
playlist_items.push_back (MenuElem (_("Rename"), mem_fun(*this, &RouteTimeAxisView::rename_current_playlist)));
|
||||
playlist_items.push_back (SeparatorElem());
|
||||
|
||||
playlist_items.push_back (MenuElem (_("New"), mem_fun(editor, &PublicEditor::new_playlists)));
|
||||
playlist_items.push_back (MenuElem (_("New Copy"), mem_fun(editor, &PublicEditor::copy_playlists)));
|
||||
playlist_items.push_back (MenuElem (_("New"), bind(mem_fun(editor, &PublicEditor::new_playlists), this)));
|
||||
playlist_items.push_back (MenuElem (_("New Copy"), bind(mem_fun(editor, &PublicEditor::copy_playlists), this)));
|
||||
playlist_items.push_back (SeparatorElem());
|
||||
playlist_items.push_back (MenuElem (_("Clear Current"), mem_fun(editor, &PublicEditor::clear_playlists)));
|
||||
playlist_items.push_back (MenuElem (_("Clear Current"), bind(mem_fun(editor, &PublicEditor::clear_playlists), this)));
|
||||
playlist_items.push_back (SeparatorElem());
|
||||
|
||||
playlist_items.push_back (MenuElem(_("Select from all ..."), mem_fun(*this, &RouteTimeAxisView::show_playlist_selector)));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue