bring back full mute control (pre/post/control/main) via mute button context click
[ardour.git] / gtk2_ardour / editor_hscroller.cc
index 049f19b85fa91d2596a45e317a69e52702240569..802d635b2ab860f37384484eea026b067f7a2654 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2002 Paul Davis 
+    Copyright (C) 2002 Paul Davis
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-    $Id$
 */
 
 #include "editor.h"
 
-#include <ardour/session.h>
+#include "ardour/session.h"
 
 using namespace std;
 using namespace ARDOUR;
+using namespace PBD;
 
 void
-Editor::hscrollbar_allocate (Gtk::Allocation &alloc)
+Editor::hscrollbar_allocate (Gtk::Allocation &)
 {
-       if (session) {
-               horizontal_adjustment.set_upper (session->current_end_frame() / frames_per_unit);
-       }
-
 }
 
 bool
-Editor::hscrollbar_button_press (GdkEventButton *ev)
+Editor::hscrollbar_button_press (GdkEventButton *)
 {
-       edit_hscroll_dragging = true;
-       return true;
+       _dragging_hscrollbar = true;
+       return false;
 }
 
 bool
-Editor::hscrollbar_button_release (GdkEventButton *ev)
+Editor::hscrollbar_button_release (GdkEventButton *)
 {
+       _dragging_hscrollbar = false;
+
        if (session) {
-               if (edit_hscroll_dragging) {
-                       // lets do a tempo redisplay only on button release, because it is dog slow
-                       tempo_map_changed (Change (0));
-                       edit_hscroll_dragging = false;
-               }
+
        }
 
-       return true;
+       return false;
 }
 
+void
+Editor::reset_hscrollbar_stepping ()
+{
+       horizontal_adjustment.set_step_increment ((current_page_frames() / 5)/frames_per_unit); /* 5 clicks to scroll the entire page */
+       horizontal_adjustment.set_page_increment (current_page_frames()/frames_per_unit);
+}