Use PBD::GlibSemaphore on windows to signal peak
[ardour.git] / gtk2_ardour / editor_ops.cc
index 206677c4cee45c61e5340b1cdde0e5d598ad0ab2..b70d0f06647ec4088b86be5c501061515b7091ad 100644 (file)
@@ -44,6 +44,7 @@
 #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"
@@ -1846,13 +1847,13 @@ Editor::jump_forward_to_mark ()
                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
@@ -1862,13 +1863,13 @@ Editor::jump_backward_to_mark ()
                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
@@ -2382,7 +2383,6 @@ Editor::rename_region ()
        d.add_button(Gtk::Stock::OK, Gtk::RESPONSE_OK);
 
        d.set_size_request (300, -1);
-       d.set_position (Gtk::WIN_POS_MOUSE);
 
        entry.set_text (rs.front()->region()->name());
        entry.select_region (0, -1);
@@ -3551,7 +3551,7 @@ Editor::bounce_range_selection (bool replace, bool enable_processing)
                        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"));
@@ -3736,7 +3736,7 @@ Editor::cut_copy (CutCopyOp op)
        /* 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()) {
@@ -5051,6 +5051,30 @@ Editor::toggle_region_lock ()
        _session->commit_reversible_command ();
 }
 
+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 ();
+}
+
 void
 Editor::toggle_region_lock_style ()
 {