code readability change I forgot to add before committing, and removal of debug output
authorDoug McLain <doug@nostar.net>
Mon, 14 May 2007 05:09:04 +0000 (05:09 +0000)
committerDoug McLain <doug@nostar.net>
Mon, 14 May 2007 05:09:04 +0000 (05:09 +0000)
git-svn-id: svn://localhost/ardour2/trunk@1839 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/ardour_ui.cc
gtk2_ardour/ardour_ui2.cc
gtk2_ardour/audio_clock.cc
gtk2_ardour/audio_clock.h

index e3c476a854708caf585950357345d5d68a567b0b..3b33fc18e1fe9b8e75ec8ab69b4994c92ac49df2 100644 (file)
@@ -2655,13 +2655,13 @@ void
 ARDOUR_UI::update_transport_clocks (nframes_t pos)
 {
        if (Config->get_primary_clock_delta_edit_cursor()) {
-               primary_clock.set (pos, false, editor->edit_cursor_position(false), 1);
+               primary_clock.set (pos, false, editor->edit_cursor_position(false), 'p');
        } else {
                primary_clock.set (pos, 0, true);
        }
 
        if (Config->get_secondary_clock_delta_edit_cursor()) {
-               secondary_clock.set (pos, false, editor->edit_cursor_position(false), 2);
+               secondary_clock.set (pos, false, editor->edit_cursor_position(false), 's');
        } else {
                secondary_clock.set (pos);
        }
index 806ee8999e7ebde2fc2a9c1f6241217f36d2810d..04f2f030738063036a58a686c3980ca1d2301fd2 100644 (file)
@@ -271,8 +271,8 @@ ARDOUR_UI::setup_transport ()
 
        /* clocks, etc. */
 
-       ARDOUR_UI::Clock.connect (bind (mem_fun (primary_clock, &AudioClock::set), 1));
-       ARDOUR_UI::Clock.connect (bind (mem_fun (secondary_clock, &AudioClock::set), 2));
+       ARDOUR_UI::Clock.connect (bind (mem_fun (primary_clock, &AudioClock::set), 'p'));
+       ARDOUR_UI::Clock.connect (bind (mem_fun (secondary_clock, &AudioClock::set), 's'));
 
        primary_clock.ValueChanged.connect (mem_fun(*this, &ARDOUR_UI::primary_clock_value_changed));
        secondary_clock.ValueChanged.connect (mem_fun(*this, &ARDOUR_UI::secondary_clock_value_changed));
index a86b51d1fbc8401c8e30af22ae28820f1d432846..8c24f429984e87ee89a637d9518fccb4cb2f8d70 100644 (file)
@@ -385,7 +385,7 @@ AudioClock::on_realize ()
 }
 
 void
-AudioClock::set (nframes_t when, bool force, nframes_t offset, int which)
+AudioClock::set (nframes_t when, bool force, nframes_t offset, char which)
 {
 
        if ((!force && !is_visible()) || session == 0) {
@@ -399,23 +399,22 @@ AudioClock::set (nframes_t when, bool force, nframes_t offset, int which)
        bool pdelta = Config->get_primary_clock_delta_edit_cursor();
        bool sdelta = Config->get_secondary_clock_delta_edit_cursor();
 
-       if (offset && which == 1 && pdelta) {
+       if (offset && which == 'p' && pdelta) {
                when = (when > offset) ? when - offset : offset - when;
-       } else if (offset && which == 2 && sdelta) {
+       } else if (offset && which == 's' && sdelta) {
                when = (when > offset) ? when - offset : offset - when;
        }
 
-       if (which == 1 && pdelta && !last_pdelta) {
-               cout << "set_widget_name() called" << endl;
+       if (which == 'p' && pdelta && !last_pdelta) {
                set_widget_name("TransportClockDisplayDelta");
                last_pdelta = true;
-       } else if (which == 1 && !pdelta && last_pdelta) {
+       } else if (which == 'p' && !pdelta && last_pdelta) {
                set_widget_name("TransportClockDisplay");
                last_pdelta = false;
-       } else if (which == 2  && sdelta && !last_sdelta) {
+       } else if (which == 's'  && sdelta && !last_sdelta) {
                set_widget_name("SecondaryClockDisplayDelta");
                last_sdelta = true;
-       } else if (which == 2 && !sdelta && last_sdelta) {
+       } else if (which == 's' && !sdelta && last_sdelta) {
                set_widget_name("SecondaryClockDisplay");
                last_sdelta = false;
        }
index d0c5afb658a957e3269459c261b65a81e94615d9..27b36d7b3e07d65618345b43ed227cbc2ad961d9 100644 (file)
@@ -46,7 +46,7 @@ class AudioClock : public Gtk::HBox
 
        Mode mode() const { return _mode; }
        
-       void set (nframes_t, bool force = false, nframes_t offset = 0, int which = 0);
+       void set (nframes_t, bool force = false, nframes_t offset = 0, char which = 0);
        void set_mode (Mode);
        
        void set_widget_name (std::string);