}
boost::shared_ptr<Region>
-Editor::select_region_for_operation (int dir, TimeAxisView **tv)
+Editor::select_region_for_operation (int /*dir*/, TimeAxisView **tv)
{
RegionView* rv;
boost::shared_ptr<Region> region;
}
void
-Editor::temporal_zoom_by_frame (nframes64_t start, nframes64_t end, const string & op)
+Editor::temporal_zoom_by_frame (nframes64_t start, nframes64_t end, const string & /*op*/)
{
if (!session) return;
nframes64_t start = selection->time[clicked_selection].start;
nframes64_t end = selection->time[clicked_selection].end;
+ TrackSelection tracks = get_tracks_for_range_action ();
+
nframes64_t selection_cnt = end - start + 1;
- for (TrackSelection::iterator i = selection->tracks.begin(); i != selection->tracks.end(); ++i) {
+ for (TrackSelection::iterator i = tracks.begin(); i != tracks.end(); ++i) {
boost::shared_ptr<Region> current;
boost::shared_ptr<Playlist> pl;
nframes64_t internal_start;
}
}
-void
-Editor::separate_regions_between (const TimeSelection& ts)
+/** Return either:
+ * - selected tracks, or if there are none...
+ * - tracks containing selected regions, or if there are none...
+ * - all tracks
+ * @return tracks.
+ */
+TrackSelection
+Editor::get_tracks_for_range_action () const
{
- bool in_command = false;
- boost::shared_ptr<Playlist> playlist;
- RegionSelection new_selection;
- TrackSelection tmptracks;
-
+ TrackSelection t;
+
if (selection->tracks.empty()) {
/* use tracks with selected regions */
- RegionSelection rs;
-
- get_regions_for_action (rs);
+ RegionSelection rs = selection->regions;
for (RegionSelection::iterator i = rs.begin(); i != rs.end(); ++i) {
TimeAxisView* tv = &(*i)->get_time_axis_view();
- if (find (tmptracks.begin(), tmptracks.end(), tv) == tmptracks.end()) {
- tmptracks.push_back (tv);
+ if (!t.contains (tv)) {
+ t.push_back (tv);
}
}
- if (tmptracks.empty()) {
- /* no regions selected: do nothing */
- return;
+ if (t.empty()) {
+ /* no regions and no tracks: use all tracks */
+ t = track_views;
}
} else {
- tmptracks = selection->tracks;
-
+ t = selection->tracks;
}
+ return t;
+}
+
+void
+Editor::separate_regions_between (const TimeSelection& ts)
+{
+ bool in_command = false;
+ boost::shared_ptr<Playlist> playlist;
+ RegionSelection new_selection;
+
+ TrackSelection tmptracks = get_tracks_for_range_action ();
sort_track_selection (&tmptracks);
for (TrackSelection::iterator i = tmptracks.begin(); i != tmptracks.end(); ++i) {
}
}
+/** Take tracks from get_tracks_for_range_action and cut any regions
+ * on those tracks so that the tracks are empty over the time
+ * selection.
+ */
void
Editor::separate_region_from_selection ()
{
}
gint
-Editor::freeze_progress_timeout (void *arg)
+Editor::freeze_progress_timeout (void */*arg*/)
{
interthread_progress_bar.set_fraction (current_interthread_info->progress);
return !(current_interthread_info->done || current_interthread_info->cancel);