ActionManager::get_all_actions() no longer includes <Actions> in the paths it returns...
[ardour.git] / libs / surfaces / faderport8 / fp8_strip.h
index 9c8c16c2a5392f218f7268428c0617e570a6b674..fc16d0f417010325c502210c1aa3e4cf3dfb47a0 100644 (file)
 #include "fp8_base.h"
 #include "fp8_button.h"
 
+#ifdef FADERPORT16
+# define N_STRIPS 16
+#elif defined FADERPORT2
+# define N_STRIPS 1
+#else
+# define N_STRIPS 8
+#endif
+
 namespace ARDOUR {
        class Stripable;
        class AutomationControl;
@@ -35,7 +43,7 @@ namespace ARDOUR {
        class ReadOnlyControl;
 }
 
-namespace ArdourSurface {
+namespace ArdourSurface { namespace FP_NAMESPACE {
 
 class FP8Strip
 {
@@ -43,12 +51,33 @@ public:
        FP8Strip (FP8Base& b, uint8_t id);
        ~FP8Strip ();
 
+       enum CtrlElement {
+               BtnSolo,
+               BtnMute,
+               BtnSelect,
+               Fader,
+               Meter,
+               Redux,
+               BarVal,
+               BarMode
+       };
+
+       static uint8_t midi_ctrl_id (CtrlElement type, uint8_t id);
+
        FP8ButtonInterface& solo_button () { return _solo; }
        FP8ButtonInterface& mute_button () { return _mute; }
        FP8ButtonInterface& selrec_button () { return _selrec; }
        FP8ButtonInterface& recarm_button () { return *_selrec.button_shift(); }
        FP8ButtonInterface& select_button () { return *_selrec.button(); }
 
+       void set_select_button_color (uint32_t color) {
+               if ((color & 0xffffff00) == 0) {
+                       select_button ().set_color (0xffffffff);
+               } else {
+                       select_button ().set_color (color);
+               }
+       }
+
        bool midi_touch (bool t);
        bool midi_fader (float val);
 
@@ -81,6 +110,7 @@ public:
                CTRL_TEXT2  = 0x400,
                CTRL_TEXT3  = 0x800,
 
+               CTRL_TEXT01 = 0x300,
                CTRL_TEXT   = 0xf00,
                CTRL_ALL    = 0xfff,
        };
@@ -106,7 +136,7 @@ private:
        PBD::ScopedConnection _base_connection; // periodic
        PBD::ScopedConnectionList _button_connections;
 
-       boost::shared_ptr<ARDOUR::Stripable> _stripable;
+       std::string _stripable_name;
 
        boost::shared_ptr<ARDOUR::AutomationControl> _fader_ctrl;
        boost::shared_ptr<ARDOUR::AutomationControl> _mute_ctrl;
@@ -147,9 +177,10 @@ private:
        void set_recarm ();
 
        /* periodic poll, update view */
+       void set_strip_name ();
        void periodic_update_fader ();
        void periodic_update_meter ();
-       void periodic_update_timecode ();
+       void periodic_update_timecode (uint32_t);
        void periodic ();
 
        /* cache */
@@ -160,7 +191,7 @@ private:
 
        /* display */
        void set_strip_mode (uint8_t, bool clear = false);
-       void set_bar_mode (uint8_t);
+       void set_bar_mode (uint8_t, bool force = false);
 
        uint8_t _strip_mode;
        uint8_t _bar_mode;
@@ -168,5 +199,5 @@ private:
        std::string _last_line[4];
 };
 
-} /* namespace */
+} /* namespace */
 #endif /* _ardour_surfaces_fp8strip_h_ */