projects
/
ardour.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix MCP send display value scaling.
[ardour.git]
/
libs
/
surfaces
/
faderport
/
faderport.h
diff --git
a/libs/surfaces/faderport/faderport.h
b/libs/surfaces/faderport/faderport.h
index fc656d7f2a5cf56b266b32caab6d1e10d6bb4dfd..9227f1f39fce4c7636ea3c44c3f31ef9a7ecec8f 100644
(file)
--- a/
libs/surfaces/faderport/faderport.h
+++ b/
libs/surfaces/faderport/faderport.h
@@
-22,6
+22,7
@@
#include <list>
#include <map>
#include <list>
#include <map>
+#include <set>
#include <glibmm/threads.h>
#define ABSTRACT_UI_EXPORTS
#include <glibmm/threads.h>
#define ABSTRACT_UI_EXPORTS
@@
-54,6
+55,7
@@
namespace MIDI {
namespace ARDOUR {
class AsyncMIDIPort;
namespace ARDOUR {
class AsyncMIDIPort;
+ class Bundle;
class Port;
class Session;
class MidiPort;
class Port;
class Session;
class MidiPort;
@@
-151,10
+153,14
@@
class FaderPort : public ARDOUR::ControlProtocol, public AbstractUI<FaderPortReq
RewindDown = 0x2,
StopDown = 0x4,
UserDown = 0x8,
RewindDown = 0x2,
StopDown = 0x4,
UserDown = 0x8,
+ LongPress = 0x10
};
void set_action (ButtonID, std::string const& action_name, bool on_press, FaderPort::ButtonState = ButtonState (0));
};
void set_action (ButtonID, std::string const& action_name, bool on_press, FaderPort::ButtonState = ButtonState (0));
+ std::string get_action (ButtonID, bool on_press, FaderPort::ButtonState = ButtonState (0));
+ std::list<boost::shared_ptr<ARDOUR::Bundle> > bundles ();
+
private:
boost::shared_ptr<ARDOUR::Route> _current_route;
boost::weak_ptr<ARDOUR::Route> pre_master_route;
private:
boost::shared_ptr<ARDOUR::Route> _current_route;
boost::weak_ptr<ARDOUR::Route> pre_master_route;
@@
-163,6
+169,11
@@
class FaderPort : public ARDOUR::ControlProtocol, public AbstractUI<FaderPortReq
boost::shared_ptr<ARDOUR::AsyncMIDIPort> _input_port;
boost::shared_ptr<ARDOUR::AsyncMIDIPort> _output_port;
boost::shared_ptr<ARDOUR::AsyncMIDIPort> _input_port;
boost::shared_ptr<ARDOUR::AsyncMIDIPort> _output_port;
+ // Bundle to represent our input ports
+ boost::shared_ptr<ARDOUR::Bundle> _input_bundle;
+ // Bundle to represent our output ports
+ boost::shared_ptr<ARDOUR::Bundle> _output_bundle;
+
PBD::ScopedConnectionList midi_connections;
bool midi_input_handler (Glib::IOCondition ioc, boost::shared_ptr<ARDOUR::AsyncMIDIPort> port);
PBD::ScopedConnectionList midi_connections;
bool midi_input_handler (Glib::IOCondition ioc, boost::shared_ptr<ARDOUR::AsyncMIDIPort> port);
@@
-190,15
+201,15
@@
class FaderPort : public ARDOUR::ControlProtocol, public AbstractUI<FaderPortReq
int last_encoder_delta, last_last_encoder_delta;
void sysex_handler (MIDI::Parser &p, MIDI::byte *, size_t);
int last_encoder_delta, last_last_encoder_delta;
void sysex_handler (MIDI::Parser &p, MIDI::byte *, size_t);
- void
switch
_handler (MIDI::Parser &, MIDI::EventTwoBytes* tb);
+ void
button
_handler (MIDI::Parser &, MIDI::EventTwoBytes* tb);
void encoder_handler (MIDI::Parser &, MIDI::pitchbend_t pb);
void fader_handler (MIDI::Parser &, MIDI::EventTwoBytes* tb);
ButtonState button_state;
void encoder_handler (MIDI::Parser &, MIDI::pitchbend_t pb);
void fader_handler (MIDI::Parser &, MIDI::EventTwoBytes* tb);
ButtonState button_state;
- friend class Button
Info
;
+ friend class Button;
- class Button
Info
{
+ class Button {
public:
enum ActionType {
public:
enum ActionType {
@@
-206,36
+217,40
@@
class FaderPort : public ARDOUR::ControlProtocol, public AbstractUI<FaderPortReq
InternalFunction,
};
InternalFunction,
};
- Button
Info
(FaderPort& f, std::string const& str, ButtonID i, int o)
+ Button (FaderPort& f, std::string const& str, ButtonID i, int o)
: fp (f)
, name (str)
, id (i)
, out (o)
: fp (f)
, name (str)
, id (i)
, out (o)
- , type (NamedAction)
- , led_on (false)
, flash (false)
{}
void set_action (std::string const& action_name, bool on_press, FaderPort::ButtonState = ButtonState (0));
void set_action (boost::function<void()> function, bool on_press, FaderPort::ButtonState = ButtonState (0));
, flash (false)
{}
void set_action (std::string const& action_name, bool on_press, FaderPort::ButtonState = ButtonState (0));
void set_action (boost::function<void()> function, bool on_press, FaderPort::ButtonState = ButtonState (0));
- void set_led_state (boost::shared_ptr<MIDI::Port>, int onoff, bool force = false);
+ std::string get_action (bool press, FaderPort::ButtonState bs = ButtonState (0));
+
+ void set_led_state (boost::shared_ptr<MIDI::Port>, bool onoff);
void invoke (ButtonState bs, bool press);
bool uses_flash () const { return flash; }
void set_flash (bool yn) { flash = yn; }
void invoke (ButtonState bs, bool press);
bool uses_flash () const { return flash; }
void set_flash (bool yn) { flash = yn; }
+ XMLNode& get_state () const;
+ int set_state (XMLNode const&);
+
+ sigc::connection timeout_connection;
+
private:
FaderPort& fp;
std::string name;
ButtonID id;
int out;
private:
FaderPort& fp;
std::string name;
ButtonID id;
int out;
- ActionType type;
- bool led_on;
bool flash;
bool flash;
- /* could be a union if boost::function didn't require a
- * constructor
- */
struct ToDo {
struct ToDo {
+ ActionType type;
+ /* could be a union if boost::function didn't require a
+ * constructor
+ */
std::string action_name;
boost::function<void()> function;
};
std::string action_name;
boost::function<void()> function;
};
@@
-245,10
+260,16
@@
class FaderPort : public ARDOUR::ControlProtocol, public AbstractUI<FaderPortReq
ToDoMap on_release;
};
ToDoMap on_release;
};
- typedef std::map<ButtonID,Button
Info
> ButtonMap;
+ typedef std::map<ButtonID,Button> ButtonMap;
ButtonMap buttons;
ButtonMap buttons;
- ButtonInfo& button_info (ButtonID) const;
+ Button& get_button (ButtonID) const;
+
+ std::set<ButtonID> buttons_down;
+ std::set<ButtonID> consumed;
+
+ bool button_long_press_timeout (ButtonID id);
+ void start_press_timeout (Button&, ButtonID);
void all_lights_out ();
void close ();
void all_lights_out ();
void close ();
@@
-257,14
+278,16
@@
class FaderPort : public ARDOUR::ControlProtocol, public AbstractUI<FaderPortReq
PBD::ScopedConnectionList session_connections;
void connect_session_signals ();
PBD::ScopedConnectionList session_connections;
void connect_session_signals ();
- void
notify_record_state_changed
();
- void
notify_transport_state_changed
();
+ void
map_recenable_state
();
+ void
map_transport_state
();
sigc::connection blink_connection;
typedef std::list<ButtonID> Blinkers;
Blinkers blinkers;
bool blink_state;
bool blink ();
sigc::connection blink_connection;
typedef std::list<ButtonID> Blinkers;
Blinkers blinkers;
bool blink_state;
bool blink ();
+ void start_blinking (ButtonID);
+ void stop_blinking (ButtonID);
void set_current_route (boost::shared_ptr<ARDOUR::Route>);
void drop_current_route ();
void set_current_route (boost::shared_ptr<ARDOUR::Route>);
void drop_current_route ();
@@
-281,6
+304,8
@@
class FaderPort : public ARDOUR::ControlProtocol, public AbstractUI<FaderPortReq
void map_recenable ();
void map_gain ();
void map_cut ();
void map_recenable ();
void map_gain ();
void map_cut ();
+ void map_auto ();
+ void parameter_changed (std::string);
/* operations (defined in operations.cc) */
/* operations (defined in operations.cc) */
@@
-302,6
+327,8
@@
class FaderPort : public ARDOUR::ControlProtocol, public AbstractUI<FaderPortReq
void ardour_pan_azimuth (int);
void ardour_pan_width (int);
void mixbus_pan (int);
void ardour_pan_azimuth (int);
void ardour_pan_width (int);
void mixbus_pan (int);
+
+ void punch ();
};
}
};
}