return;
}
+
if (cursor == playhead_cursor) {
session->request_locate (target);
} else {
}
void
-Editor::edit_point_to_region_point (RegionPoint point, int32_t dir)
+Editor::selected_marker_to_region_boundary (int32_t dir)
+{
+ nframes64_t target;
+ Location* loc;
+ bool ignored;
+
+ if (!session) {
+ return;
+ }
+
+ if (selection->markers.empty()) {
+ nframes64_t mouse;
+ bool ignored;
+
+ if (!mouse_frame (mouse, ignored)) {
+ return;
+ }
+
+ add_location_mark (mouse);
+ }
+
+ if ((loc = find_location_from_marker (selection->markers.front(), ignored)) == 0) {
+ return;
+ }
+
+ nframes64_t pos = loc->start();
+
+ // so we don't find the current region again..
+ if (dir > 0 || pos > 0) {
+ pos += dir;
+ }
+
+ if (!selection->tracks.empty()) {
+
+ target = find_next_region_boundary (pos, dir, selection->tracks);
+
+ } else {
+
+ target = find_next_region_boundary (pos, dir, track_views);
+ }
+
+ if (target < 0) {
+ return;
+ }
+
+ loc->move_to (target);
+}
+
+void
+Editor::selected_marker_to_next_region_boundary ()
+{
+ selected_marker_to_region_boundary (1);
+}
+
+void
+Editor::selected_marker_to_previous_region_boundary ()
+{
+ selected_marker_to_region_boundary (-1);
+}
+
+void
+Editor::selected_marker_to_region_point (RegionPoint point, int32_t dir)
{
boost::shared_ptr<Region> r;
nframes_t pos;
}
void
-Editor::edit_point_to_next_region_point (RegionPoint point)
+Editor::selected_marker_to_next_region_point (RegionPoint point)
{
- edit_point_to_region_point (point, 1);
+ selected_marker_to_region_point (point, 1);
}
void
-Editor::edit_point_to_previous_region_point (RegionPoint point)
+Editor::selected_marker_to_previous_region_point (RegionPoint point)
{
- edit_point_to_region_point (point, -1);
+ selected_marker_to_region_point (point, -1);
}
void
-Editor::edit_point_to_selection_start ()
+Editor::selected_marker_to_selection_start ()
{
nframes_t pos = 0;
Location* loc;
}
void
-Editor::edit_point_to_selection_end ()
+Editor::selected_marker_to_selection_end ()
{
nframes_t pos = 0;
Location* loc;
}
void
-Editor::add_location_from_playhead_cursor ()
+Editor::add_location_mark (nframes64_t where)
{
string markername;
- nframes_t where = session->audible_frame();
-
select_new_marker = true;
session->locations()->next_available_name(markername,"mark");
session->commit_reversible_command ();
}
+void
+Editor::add_location_from_playhead_cursor ()
+{
+ add_location_mark (session->audible_frame());
+}
+
void
Editor::add_location_from_audio_region ()
{
cerr << "no edit op range" << endl;
return;
}
- selection->set (0, start, end);
+ selection->set ((TimeAxisView*) 0, start, end);
}
begin_reversible_command (opname + _(" range"));
}
}
}
+
+void
+Editor::set_loop_from_selection (bool play)
+{
+ if (session == 0 || selection->time.empty()) {
+ return;
+ }
+
+ nframes_t start = selection->time[clicked_selection].start;
+ nframes_t end = selection->time[clicked_selection].end;
+
+ set_loop_range (start, end, _("set loop range from selection"));
+
+ if (play) {
+ session->request_play_loop (true);
+ session->request_locate (start, true);
+ }
+}
+
+void
+Editor::set_loop_from_edit_range (bool play)
+{
+ if (session == 0) {
+ return;
+ }
+
+ nframes64_t start;
+ nframes64_t end;
+
+ if (!get_edit_op_range (start, end)) {
+ return;
+ }
+
+ set_loop_range (start, end, _("set loop range from edit range"));
+
+ if (play) {
+ session->request_play_loop (true);
+ session->request_locate (start, true);
+ }
+}
+
+void
+Editor::set_punch_from_selection ()
+{
+ if (session == 0 || selection->time.empty()) {
+ return;
+ }
+
+ nframes_t start = selection->time[clicked_selection].start;
+ nframes_t end = selection->time[clicked_selection].end;
+
+ set_punch_range (start, end, _("set punch range from selection"));
+}
+
+void
+Editor::set_punch_from_edit_range ()
+{
+ if (session == 0) {
+ return;
+ }
+
+ nframes64_t start;
+ nframes64_t end;
+
+ if (!get_edit_op_range (start, end)) {
+ return;
+ }
+
+ set_punch_range (start, end, _("set punch range from edit range"));
+}
+