summaryrefslogtreecommitdiff
path: root/libs/ardour/ardour
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2006-04-24 22:45:19 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2006-04-24 22:45:19 +0000
commit028e1ebc4a392572cae586d0e9044a32b867cba4 (patch)
tree36d3a748486feb3f41575708bef8b153fef2cad4 /libs/ardour/ardour
parent484debb45c5ea45bccf0f9cb05b1239a9c2244a3 (diff)
a) completely refactor abstract UI code
b) single-thread Tranzport implementation c) implement BasicUI to share functionality across multiple controllers d) various minor fixes here and there git-svn-id: svn://localhost/trunk/ardour2@468 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/ardour')
-rw-r--r--libs/ardour/ardour/ardour.h3
-rw-r--r--libs/ardour/ardour/basic_ui.h34
-rw-r--r--libs/ardour/ardour/configuration.h3
-rw-r--r--libs/ardour/ardour/control_protocol.h48
-rw-r--r--libs/ardour/ardour/control_protocol_manager.h11
-rw-r--r--libs/ardour/ardour/session.h2
6 files changed, 57 insertions, 44 deletions
diff --git a/libs/ardour/ardour/ardour.h b/libs/ardour/ardour/ardour.h
index 45b45ecd06..28c5f07fce 100644
--- a/libs/ardour/ardour/ardour.h
+++ b/libs/ardour/ardour/ardour.h
@@ -50,7 +50,8 @@ namespace ARDOUR {
std::string get_user_ardour_path ();
- std::string get_system_ardour_path ();
+ std::string get_system_data_path ();
+ std::string get_system_module_path ();
std::string find_config_file (std::string name);
std::string find_data_file (std::string name, std::string subdir = "" );
diff --git a/libs/ardour/ardour/basic_ui.h b/libs/ardour/ardour/basic_ui.h
new file mode 100644
index 0000000000..aba8090add
--- /dev/null
+++ b/libs/ardour/ardour/basic_ui.h
@@ -0,0 +1,34 @@
+#ifndef __ardour_basic_ui_h__
+#define __ardour_basic_ui_h__
+
+namespace ARDOUR {
+ class Session;
+}
+
+class BasicUI {
+ public:
+ BasicUI (ARDOUR::Session&);
+ virtual ~BasicUI ();
+
+ void loop_toggle ();
+ void goto_start ();
+ void goto_end ();
+ void add_marker ();
+ void rewind ();
+ void ffwd ();
+ void transport_stop ();
+ void transport_play ();
+ void rec_enable_toggle ();
+ void save_state ();
+ void prev_marker ();
+ void next_marker ();
+ void move_at (float speed);
+ void undo ();
+ void redo ();
+ void toggle_all_rec_enables ();
+
+ protected:
+ ARDOUR::Session& session;
+};
+
+#endif /* __ardour_basic_ui_h__ */
diff --git a/libs/ardour/ardour/configuration.h b/libs/ardour/ardour/configuration.h
index d067bc6e61..60b5e8a2c3 100644
--- a/libs/ardour/ardour/configuration.h
+++ b/libs/ardour/ardour/configuration.h
@@ -60,6 +60,8 @@ class Configuration : public Stateful
int set_state (const XMLNode&);
XMLNode& get_state (void);
+ XMLNode* control_protocol_state () { return _control_protocol_state; }
+
/* define accessor methods */
#undef CONFIG_VARIABLE
@@ -88,6 +90,7 @@ class Configuration : public Stateful
#undef CONFIG_VARIABLE_SPECIAL
bool user_configuration;
+ XMLNode* _control_protocol_state;
XMLNode& state (bool user_only);
};
diff --git a/libs/ardour/ardour/control_protocol.h b/libs/ardour/ardour/control_protocol.h
index 64658fc199..70c7d2dc0d 100644
--- a/libs/ardour/ardour/control_protocol.h
+++ b/libs/ardour/ardour/control_protocol.h
@@ -5,37 +5,25 @@
#include <list>
#include <sigc++/sigc++.h>
+#include <ardour/basic_ui.h>
+
namespace ARDOUR {
class Route;
class Session;
-class ControlProtocol : public sigc::trackable {
+class ControlProtocol : public sigc::trackable, public BasicUI {
public:
ControlProtocol (Session&, std::string name);
virtual ~ControlProtocol();
- virtual int init () { return 0; }
-
- sigc::signal<void> ActiveChanged;
-
- enum SendWhat {
- SendRoute,
- SendGlobal
- };
-
std::string name() const { return _name; }
- void set_send (SendWhat);
- void set_active (bool yn);
- bool get_active() const { return active_thread > 0; }
+ virtual int set_active (bool yn) = 0;
+ bool get_active() const { return _active; }
- bool send() const { return _send != 0; }
- bool send_route_feedback () const { return _send & SendRoute; }
- bool send_global_feedback () const { return _send & SendGlobal; }
+ sigc::signal<void> ActiveChanged;
- virtual void send_route_feedback (std::list<Route*>&) {}
- virtual void send_global_feedback () {}
/* signals that a control protocol can emit and other (presumably graphical)
user interfaces can respond to
@@ -48,30 +36,8 @@ class ControlProtocol : public sigc::trackable {
static sigc::signal<void,float> ScrollTimeline;
protected:
-
- ARDOUR::Session& session;
- SendWhat _send;
std::string _name;
- int active_thread;
- int thread_request_pipe[2];
- pthread_t _thread;
-
- static void* _thread_work (void *);
- void* thread_work ();
-
- struct ThreadRequest {
- enum Type {
- Start,
- Stop,
- Quit
- };
- };
-
- int init_thread();
- int start_thread ();
- int stop_thread ();
- void terminate_thread ();
- int poke_thread (ThreadRequest::Type);
+ bool _active;
};
extern "C" {
diff --git a/libs/ardour/ardour/control_protocol_manager.h b/libs/ardour/ardour/control_protocol_manager.h
index b06c3024b6..c19649e38b 100644
--- a/libs/ardour/ardour/control_protocol_manager.h
+++ b/libs/ardour/ardour/control_protocol_manager.h
@@ -8,6 +8,8 @@
#include <pbd/lockmonitor.h>
+#include <ardour/stateful.h>
+
namespace ARDOUR {
class ControlProtocol;
@@ -19,9 +21,10 @@ struct ControlProtocolInfo {
ControlProtocol* protocol;
std::string name;
std::string path;
+ bool requested;
};
- class ControlProtocolManager : public sigc::trackable
+ class ControlProtocolManager : public sigc::trackable, public Stateful
{
public:
ControlProtocolManager ();
@@ -38,6 +41,11 @@ struct ControlProtocolInfo {
std::list<ControlProtocolInfo*> control_protocol_info;
+ static const std::string state_node_name;
+
+ int set_state (const XMLNode&);
+ XMLNode& get_state (void);
+
private:
static ControlProtocolManager* _instance;
@@ -49,6 +57,7 @@ struct ControlProtocolInfo {
int control_protocol_discover (std::string path);
ControlProtocolDescriptor* get_descriptor (std::string path);
+ ControlProtocolInfo* cpi_by_name (std::string);
};
} // namespace
diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h
index 924a482936..57f01bf690 100644
--- a/libs/ardour/ardour/session.h
+++ b/libs/ardour/ardour/session.h
@@ -245,7 +245,7 @@ class Session : public sigc::trackable, public Stateful
std::string dead_sound_dir () const;
std::string automation_dir () const;
- static string suffixed_search_path (std::string suffix);
+ static string suffixed_search_path (std::string suffix, bool data);
static string control_protocol_path ();
static string template_path ();
static string template_dir ();