#include "ardour/dB.h"
#include "ardour/location.h"
#include "ardour/midi_region.h"
+#include "ardour/midi_track.h"
#include "ardour/operations.h"
#include "ardour/playlist_factory.h"
#include "ardour/quantize.h"
return;
}
- Location *location = _session->locations()->first_location_after (playhead_cursor->current_frame);
+ framepos_t pos = _session->locations()->first_mark_after (playhead_cursor->current_frame);
- if (location) {
- _session->request_locate (location->start(), _session->transport_rolling());
- } else {
- _session->request_locate (_session->current_end_frame());
+ if (pos < 0) {
+ return;
}
+
+ _session->request_locate (pos, _session->transport_rolling());
}
void
return;
}
- Location *location = _session->locations()->first_location_before (playhead_cursor->current_frame);
+ framepos_t pos = _session->locations()->first_mark_before (playhead_cursor->current_frame);
- if (location) {
- _session->request_locate (location->start(), _session->transport_rolling());
- } else {
- _session->goto_start ();
+ if (pos < 0) {
+ return;
}
+
+ _session->request_locate (pos, _session->transport_rolling());
}
void
returns a single range.
*/
- if (mouse_mode == MouseRange && !selection->time.empty()) {
+ if (!selection->time.empty()) {
separate_regions_between (selection->time);
if (rtv && rtv->track() && replace && enable_processing && !rtv->track()->bounceable (rtv->track()->main_outs(), false)) {
MessageDialog d (
_("You can't perform this operation because the processing of the signal "
- "will cause one or more of the tracks will end up with a region with more channels than this track has inputs.\n\n"
+ "will cause one or more of the tracks to end up with a region with more channels than this track has inputs.\n\n"
"You can do this without processing, which is a different operation.")
);
d.set_title (_("Cannot bounce"));
/* we only want to cut regions if some are selected */
if (!selection->regions.empty()) {
- rs = get_regions_from_selection ();
+ rs = selection->regions;
}
switch (effective_mouse_mode()) {
_session->commit_reversible_command ();
}
+#ifdef WITH_VIDEOTIMELINE
+void
+Editor::toggle_region_video_lock ()
+{
+ if (_ignore_region_action) {
+ return;
+ }
+
+ RegionSelection rs = get_regions_from_selection_and_entered ();
+
+ if (!_session || rs.empty()) {
+ return;
+ }
+
+ _session->begin_reversible_command (_("Toggle Video Lock"));
+
+ for (RegionSelection::iterator i = rs.begin(); i != rs.end(); ++i) {
+ (*i)->region()->clear_changes ();
+ (*i)->region()->set_video_locked (!(*i)->region()->video_locked());
+ _session->add_command (new StatefulDiffCommand ((*i)->region()));
+ }
+
+ _session->commit_reversible_command ();
+}
+#endif
+
+
void
Editor::toggle_region_lock_style ()
{
} else if (t.frame() == start) {
_session->tempo_map().change_existing_tempo_at (start, beats_per_minute, t.note_type());
} else {
- _session->tempo_map().add_tempo (Tempo (beats_per_minute, t.note_type()), start);
+ Timecode::BBT_Time bbt;
+ _session->tempo_map().bbt_time (start, bbt);
+ _session->tempo_map().add_tempo (Tempo (beats_per_minute, t.note_type()), bbt);
}
XMLNode& after (_session->tempo_map().get_state());