diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2008-04-17 05:58:43 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2008-04-17 05:58:43 +0000 |
commit | 803b502bf176c417a70498a98173fb09691a80b7 (patch) | |
tree | 0678e953e5739758b86988c4340cbc3406927a7c /libs/ardour | |
parent | 9aeccd52c83bf020df490f64e8716ff8ddd2ee76 (diff) |
AccessAction() OSC patch from Ryan Scott
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@3258 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour')
-rw-r--r-- | libs/ardour/ardour/osc.h | 21 | ||||
-rw-r--r-- | libs/ardour/ardour/session.h | 1 | ||||
-rw-r--r-- | libs/ardour/osc.cc | 20 | ||||
-rw-r--r-- | libs/ardour/session.cc | 2 | ||||
-rw-r--r-- | libs/ardour/session_export.cc | 2 |
5 files changed, 39 insertions, 7 deletions
diff --git a/libs/ardour/ardour/osc.h b/libs/ardour/ardour/osc.h index 3f1ce03445..d7c2f4bd85 100644 --- a/libs/ardour/ardour/osc.h +++ b/libs/ardour/ardour/osc.h @@ -54,12 +54,13 @@ class OSC : public BasicUI, public sigc::trackable lo_server _osc_server; lo_server _osc_unix_server; std::string _osc_unix_socket_path; - std::string _osc_url_file; + std::string _osc_url_file; pthread_t _osc_thread; int _request_pipe[2]; static void * _osc_receiver(void * arg); void osc_receiver(); + void send(); // This should accept an OSC payload bool init_osc_thread (); void terminate_osc_thread (); @@ -69,6 +70,11 @@ class OSC : public BasicUI, public sigc::trackable void session_going_away (); + // Handlers for "Application Hook" signals + void session_loaded( ARDOUR::Session& ); + void session_exported( std::string, std::string ); + // end "Application Hook" handles + std::string get_server_url (); std::string get_unix_server_url (); @@ -101,18 +107,19 @@ class OSC : public BasicUI, public sigc::trackable PATH_CALLBACK(rec_enable_toggle); PATH_CALLBACK(toggle_all_rec_enables); -#define PATH_CALLBACK1(name,type) \ +#define PATH_CALLBACK1(name,type,optional) \ static int _ ## name (const char *path, const char *types, lo_arg **argv, int argc, void *data, void *user_data) { \ return static_cast<OSC*>(user_data)->cb_ ## name (path, types, argv, argc, data); \ } \ int cb_ ## name (const char *path, const char *types, lo_arg **argv, int argc, void *data) { \ - if (argc > 0) { \ - name (argv[0]->type); \ - }\ - return 0; \ + if (argc > 0) { \ + name (optional argv[0]->type); \ + } \ + return 0; \ } - PATH_CALLBACK1(set_transport_speed,f); + PATH_CALLBACK1(set_transport_speed,f,); + PATH_CALLBACK1(access_action,s,&); }; } diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h index ea9ab014a8..ea89ab84ec 100644 --- a/libs/ardour/ardour/session.h +++ b/libs/ardour/ardour/session.h @@ -603,6 +603,7 @@ class Session : public PBD::StatefulDestructible int start_audio_export (ARDOUR::AudioExportSpecification&); int stop_audio_export (ARDOUR::AudioExportSpecification&); void finalize_audio_export (); + static sigc::signal<void, std::string, std::string> Exported; void add_source (boost::shared_ptr<Source>); void remove_source (boost::weak_ptr<Source>); diff --git a/libs/ardour/osc.cc b/libs/ardour/osc.cc index e2ad9a2951..ea3c2f4d4c 100644 --- a/libs/ardour/osc.cc +++ b/libs/ardour/osc.cc @@ -176,6 +176,7 @@ OSC::register_callbacks() #define REGISTER_CALLBACK(serv,path,types, function) lo_server_add_method (serv, path, types, OSC::_ ## function, this) REGISTER_CALLBACK (serv, "/ardour/add_marker", "", add_marker); + REGISTER_CALLBACK (serv, "/ardour/access_action", "s", access_action); REGISTER_CALLBACK (serv, "/ardour/loop_toggle", "", loop_toggle); REGISTER_CALLBACK (serv, "/ardour/goto_start", "", goto_start); REGISTER_CALLBACK (serv, "/ardour/goto_end", "", goto_end); @@ -401,6 +402,10 @@ OSC::set_session (Session& s) { session = &s; session->GoingAway.connect (mem_fun (*this, &OSC::session_going_away)); + + // "Application Hooks" + session_loaded( s ); + session->Exported.connect( mem_fun( *this, &OSC::session_exported ) ); } void @@ -409,6 +414,21 @@ OSC::session_going_away () session = 0; } +// "Application Hook" Handlers // +void +OSC::session_loaded( Session& s ) { + lo_address listener = lo_address_new( NULL, "7770" ); + lo_send( listener, "/session/loaded", "ss", s.path().c_str(), s.name().c_str() ); +} + +void +OSC::session_exported( std::string path, std::string name ) { + lo_address listener = lo_address_new( NULL, "7770" ); + lo_send( listener, "/session/exported", "ss", path.c_str(), name.c_str() ); +} + +// end "Application Hook" Handlers // + /* path callbacks */ int diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index 56291e941e..5b8d2f8506 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -118,6 +118,8 @@ sigc::signal<void> Session::AutoBindingOn; sigc::signal<void> Session::AutoBindingOff; +sigc::signal<void, std::string, std::string> Session::Exported; + int Session::find_session (string str, string& path, string& snapshot, bool& isnew) { diff --git a/libs/ardour/session_export.cc b/libs/ardour/session_export.cc index e7a3b3b40f..33c9e0062d 100644 --- a/libs/ardour/session_export.cc +++ b/libs/ardour/session_export.cc @@ -454,6 +454,8 @@ Session::stop_audio_export (AudioExportSpecification& spec) spec.freewheel_connection.disconnect (); spec.clear (); /* resets running/stop etc */ + Exported( spec.path, name() ); + return 0; } |