Convert some error output to debug output in PortaudioBackend
[ardour.git] / libs / surfaces / control_protocol / basic_ui.cc
index 2c514f188efebdc3b47244a16dcf5de327e5c508..bf6bb25f2cac17fd7900078299c0e8bef08dde75 100644 (file)
@@ -79,6 +79,20 @@ BasicUI::loop_toggle ()
        }
 }
 
+void
+BasicUI::loop_location (framepos_t start, framepos_t end)
+{
+       Location* tll;
+       if ((tll = session->locations()->auto_loop_location()) == 0) {
+               Location* loc = new Location (*session, start, end, _("Loop"),  Location::IsAutoLoop);
+               session->locations()->add (loc, true);
+               session->set_auto_loop_location (loc);
+       } else {
+               tll->set_hidden (false, this);
+               tll->set (start, end);
+       }
+}
+
 void
 BasicUI::goto_start ()
 {
@@ -107,7 +121,6 @@ BasicUI::add_marker (const std::string& markername)
 void
 BasicUI::rewind ()
 {
-       std::cerr << "request transport speed of " << session->transport_speed() - 1.5 << std::endl;
        session->request_transport_speed (session->transport_speed() - 1.5);
 }
 
@@ -172,10 +185,10 @@ BasicUI::save_state ()
 void
 BasicUI::prev_marker ()
 {
-       Location *location = session->locations()->first_location_before (session->transport_frame());
+       framepos_t pos = session->locations()->first_mark_before (session->transport_frame());
        
-       if (location) {
-               session->request_locate (location->start(), session->transport_rolling());
+       if (pos >= 0) {
+               session->request_locate (pos, session->transport_rolling());
        } else {
                session->goto_start ();
        }
@@ -184,12 +197,12 @@ BasicUI::prev_marker ()
 void
 BasicUI::next_marker ()
 {
-       Location *location = session->locations()->first_location_after (session->transport_frame());
+       framepos_t pos = session->locations()->first_mark_after (session->transport_frame());
 
-       if (location) {
-               session->request_locate (location->start(), session->transport_rolling());
+       if (pos >= 0) {
+               session->request_locate (pos, session->transport_rolling());
        } else {
-               session->request_locate (session->current_end_frame());
+               session->goto_end();
        }
 }