return false;
}
+void
+Editor::scroll_left_step ()
+{
+ framepos_t xdelta = (current_page_samples() / 8);
+
+ if (leftmost_frame > xdelta) {
+ reset_x_origin (leftmost_frame - xdelta);
+ } else {
+ reset_x_origin (0);
+ }
+}
+
+
+void
+Editor::scroll_right_step ()
+{
+ framepos_t xdelta = (current_page_samples() / 8);
+
+ if (max_framepos - xdelta > leftmost_frame) {
+ reset_x_origin (leftmost_frame + xdelta);
+ } else {
+ reset_x_origin (max_framepos - current_page_samples());
+ }
+}
+
+void
+Editor::scroll_left_half_page ()
+{
+ framepos_t xdelta = (current_page_samples() / 2);
+ if (leftmost_frame > xdelta) {
+ reset_x_origin (leftmost_frame - xdelta);
+ } else {
+ reset_x_origin (0);
+ }
+}
+
+void
+Editor::scroll_right_half_page ()
+{
+ framepos_t xdelta = (current_page_samples() / 2);
+ if (max_framepos - xdelta > leftmost_frame) {
+ reset_x_origin (leftmost_frame + xdelta);
+ } else {
+ reset_x_origin (max_framepos - current_page_samples());
+ }
+}
+
/* ZOOM */
void
}
}
+void
+Editor::temporal_zoom_step_mouse_focus (bool coarser)
+{
+ Editing::ZoomFocus temp_focus = zoom_focus;
+ zoom_focus = Editing::ZoomFocusMouse;
+ temporal_zoom_step (coarser);
+ zoom_focus = temp_focus;
+}
void
Editor::temporal_zoom_step (bool coarser)
commit_reversible_command ();
}
-void
-Editor::region_fill_selection ()
-{
- if (clicked_routeview == 0 || !clicked_routeview->is_audio_track()) {
- return;
- }
-
- if (selection->time.empty()) {
- return;
- }
-
- boost::shared_ptr<Region> region = _regions->get_single_selection ();
- if (region == 0) {
- return;
- }
-
- framepos_t start = selection->time[clicked_selection].start;
- framepos_t end = selection->time[clicked_selection].end;
-
- boost::shared_ptr<Playlist> playlist;
-
- if (selection->tracks.empty()) {
- return;
- }
-
- framepos_t selection_length = end - start;
- float times = (float)selection_length / region->length();
- bool in_command = false;
-
- TrackViewList ts = selection->tracks.filter_to_unique_playlists ();
- RegionSelection foo;
-
- for (TrackViewList::iterator i = ts.begin(); i != ts.end(); ++i) {
-
- if ((playlist = (*i)->playlist()) == 0) {
- continue;
- }
-
- if (!in_command) {
- begin_reversible_command (Operations::fill_selection);
- in_command = true;
- }
- RouteTimeAxisView* rtv = dynamic_cast<RouteTimeAxisView*> (*i);
- latest_regionviews.clear ();
- sigc::connection c = rtv->view()->RegionViewAdded.connect (sigc::mem_fun(*this, &Editor::collect_new_region_view));
-
- playlist->clear_changes ();
- playlist->add_region (RegionFactory::create (region, true), start, times);
- _session->add_command (new StatefulDiffCommand (playlist));
- c.disconnect ();
- foo.insert (foo.end(), latest_regionviews.begin(), latest_regionviews.end());
- }
-
- if (in_command) {
- if (!foo.empty()) {
- selection->set (foo);
- }
- commit_reversible_command ();
- }
-}
-
void
Editor::set_region_sync_position ()
{
Location* loc = find_location_from_marker (entered_marker, ignored);
if (_session && loc) {
+ entered_marker = NULL;
Glib::signal_idle().connect (sigc::bind (sigc::mem_fun(*this, &Editor::really_remove_marker), loc));
}
list<boost::shared_ptr<Playlist> > foo;
- /* the pmap is in the same order as the tracks in which selected regions occured */
+ /* the pmap is in the same order as the tracks in which selected regions occurred */
for (vector<PlaylistMapping>::iterator i = pmap.begin(); i != pmap.end(); ++i) {
if ((*i).pl) {
}
boost::shared_ptr<Playlist> playlist;
- vector<boost::shared_ptr<Region> > new_regions;
- vector<boost::shared_ptr<Region> >::iterator ri;
-
- create_region_from_selection (new_regions);
-
- if (new_regions.empty()) {
- return;
- }
-
- ri = new_regions.begin();
TrackViewList ts = selection->tracks.filter_to_unique_playlists ();
+
bool in_command = false;
for (TrackViewList::iterator i = ts.begin(); i != ts.end(); ++i) {
continue;
}
playlist->clear_changes ();
- framepos_t end;
+
if (clicked_selection) {
- end = selection->time[clicked_selection].end;
+ playlist->duplicate_range (selection->time[clicked_selection], times);
} else {
- end = selection->time.end_frame();
+ playlist->duplicate_ranges (selection->time, times);
}
- playlist->duplicate (*ri, end + 1, times);
if (!in_command) {
- begin_reversible_command (_("duplicate selection"));
+ begin_reversible_command (_("duplicate range selection"));
in_command = true;
}
_session->add_command (new StatefulDiffCommand (playlist));
- ++ri;
- if (ri == new_regions.end()) {
- --ri;
- }
}
if (in_command) {
+ // now "move" range selection to after the current range selection
+ framecnt_t distance = 0;
+
+ if (clicked_selection) {
+ distance = selection->time[clicked_selection].end -
+ selection->time[clicked_selection].start;
+ } else {
+ distance = selection->time.end_frame() - selection->time.start();
+ }
+
+ selection->move_time (distance);
+
commit_reversible_command ();
}
}
first = false;
}
- rtav->track()->set_record_enabled (new_state, this);
+ rtav->track()->set_record_enabled (new_state, Controllable::UseGroup);
}
}
rl->push_back (rtav->route());
}
- _session->set_solo (rl, new_state, Session::rt_cleanup, true);
+ _session->set_solo (rl, new_state, Session::rt_cleanup, Controllable::UseGroup);
}
void
rl->push_back (rtav->route());
}
- _session->set_mute (rl, new_state, Session::rt_cleanup, true);
+ _session->set_mute (rl, new_state, Session::rt_cleanup, Controllable::UseGroup);
}
void
return;
}
- InsertTimeOption opt = d.intersected_region_action ();
-
insert_time (
- get_preferred_edit_position(),
+ get_preferred_edit_position (EDIT_IGNORE_MOUSE),
d.distance(),
- opt,
+ d.intersected_region_action (),
d.all_playlists(),
d.move_glued(),
d.move_markers(),
pl->shift (pos, -frames, true, ignore_music_glue);
if (!in_command) {
- begin_reversible_command (_("cut time"));
+ begin_reversible_command (_("remove time"));
in_command = true;
}
XMLNode &after = pl->get_state();
RouteTimeAxisView* rtav = dynamic_cast<RouteTimeAxisView*> (*x);
if (rtav) {
if (!in_command) {
- begin_reversible_command (_("cut time"));
+ begin_reversible_command (_("remove time"));
in_command = true;
}
rtav->route ()->shift (pos, -frames);
if (moved) {
if (!in_command) {
- begin_reversible_command (_("cut time"));
+ begin_reversible_command (_("remove time"));
in_command = true;
}
XMLNode& after (_session->locations()->get_state());