fix (or mostly fix) ctrl-drag (copy drag) for regions
[ardour.git] / gtk2_ardour / audio_clock.h
index d8083e1c7323000f2f3cceb5b70e44bd59591564..b9fc740543ef04427a9f6a159410d022db8f764c 100644 (file)
 #include <gtkmm/label.h>
 #include <gtkmm/frame.h>
 #include "ardour/ardour.h"
+#include "ardour/session_handle.h"
 
 namespace ARDOUR {
        class Session;
 }
 
-class AudioClock : public Gtk::HBox
+class AudioClock : public Gtk::HBox, public ARDOUR::SessionHandlePtr
 {
   public:
        enum Mode {
@@ -42,13 +43,15 @@ class AudioClock : public Gtk::HBox
                Off
        };
 
-       AudioClock (std::string clock_name, bool transient, std::string widget_name, bool editable, bool is_duration = false, bool with_info = false);
+       AudioClock (std::string, bool, std::string, bool, bool, bool duration = false, bool with_info = false);
 
        Mode mode() const { return _mode; }
 
        void focus ();
 
        void set (nframes_t, bool force = false, nframes_t offset = 0, char which = 0);
+       void set_from_playhead ();
+       void locate ();
        void set_mode (Mode);
        void set_bbt_reference (nframes64_t);
 
@@ -70,13 +73,14 @@ class AudioClock : public Gtk::HBox
        static bool has_focus() { return _has_focus; }
 
   private:
-       ARDOUR::Session  *session;
        Mode             _mode;
        uint32_t          key_entry_state;
        std::string      _name;
        bool              is_transient;
        bool              is_duration;
        bool              editable;
+       /** true if this clock follows the playhead, meaning that certain operations are redundant */
+       bool             _follows_playhead;
 
        Gtk::Menu  *ops_menu;
 
@@ -212,6 +216,7 @@ class AudioClock : public Gtk::HBox
        static const uint32_t field_length[(int)AudioFrames+1];
        static bool _has_focus;
 
+       void on_style_changed (const Glib::RefPtr<Gtk::Style>&);
 };
 
 #endif /* __audio_clock_h__ */