mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 06:44:57 +01:00
NO-OP whitespace (updated GH PR #357)
This commit is contained in:
parent
f413b83cb9
commit
63ea7b6516
132 changed files with 2774 additions and 2762 deletions
|
|
@ -50,7 +50,7 @@ AnalysisWindow::AnalysisWindow()
|
|||
, show_proportional_button (_("Proportional Spectrum, -18dB"))
|
||||
, fft_graph (16384)
|
||||
{
|
||||
set_name(_("FFT analysis window"));
|
||||
set_name (_("FFT analysis window"));
|
||||
set_title (_("Spectral Analysis"));
|
||||
|
||||
track_list_ready = false;
|
||||
|
|
|
|||
|
|
@ -1723,7 +1723,6 @@ AudioClock::on_motion_notify_event (GdkEventMotion *ev)
|
|||
|
||||
if (Keyboard::modifier_state_contains (ev->state,
|
||||
Keyboard::PrimaryModifier|Keyboard::SecondaryModifier)) {
|
||||
|
||||
pixel_frame_scale_factor = 0.025f;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1604,11 +1604,13 @@ Editor::rename_marker(ArdourMarker *marker)
|
|||
|
||||
loc = find_location_from_marker (marker, is_start);
|
||||
|
||||
if (!loc)
|
||||
if (!loc) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (loc == transport_loop_location() || loc == transport_punch_location() || loc->is_session_range())
|
||||
if (loc == transport_loop_location() || loc == transport_punch_location() || loc->is_session_range()) {
|
||||
return;
|
||||
}
|
||||
|
||||
ArdourPrompter dialog (true);
|
||||
string txt;
|
||||
|
|
|
|||
|
|
@ -43,11 +43,11 @@ namespace NSM
|
|||
#undef OSC_REPLY
|
||||
#undef OSC_REPLY_ERR
|
||||
|
||||
#define OSC_REPLY( value ) lo_send_from( ((NSM::Client*)user_data)->nsm_addr, ((NSM::Client*)user_data)->_server, LO_TT_IMMEDIATE, "/reply", "ss", path, value )
|
||||
#define OSC_REPLY(value) lo_send_from( ((NSM::Client*)user_data)->nsm_addr, ((NSM::Client*)user_data)->_server, LO_TT_IMMEDIATE, "/reply", "ss", path, value)
|
||||
|
||||
#define OSC_REPLY_ERR( errcode, value ) lo_send_from( ((NSM::Client*)user_data)->nsm_addr, ((NSM::Client*)user_data)->_server, LO_TT_IMMEDIATE, "/error", "sis", path, errcode, value )
|
||||
#define OSC_REPLY_ERR(errcode, value) lo_send_from( ((NSM::Client*)user_data)->nsm_addr, ((NSM::Client*)user_data)->_server, LO_TT_IMMEDIATE, "/error", "sis", path, errcode, value)
|
||||
|
||||
Client::Client ( )
|
||||
Client::Client ()
|
||||
{
|
||||
nsm_addr = 0;
|
||||
_nsm_client_id = 0;
|
||||
|
|
@ -59,151 +59,156 @@ namespace NSM
|
|||
_st = 0;
|
||||
}
|
||||
|
||||
Client::~Client ( )
|
||||
Client::~Client ()
|
||||
{
|
||||
if ( _st )
|
||||
if (_st) {
|
||||
stop();
|
||||
}
|
||||
|
||||
if ( _st )
|
||||
lo_server_thread_free( _st );
|
||||
else
|
||||
lo_server_free ( _server );
|
||||
if (_st) {
|
||||
lo_server_thread_free (_st);
|
||||
} else {
|
||||
lo_server_free (_server);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Client::announce ( const char *application_name, const char *capabilities, const char *process_name )
|
||||
Client::announce (const char *application_name, const char *capabilities, const char *process_name)
|
||||
{
|
||||
|
||||
lo_address to = lo_address_new_from_url( nsm_url );
|
||||
lo_address to = lo_address_new_from_url (nsm_url);
|
||||
|
||||
if ( ! to )
|
||||
if (!to)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
int pid = (int)getpid();
|
||||
|
||||
lo_send_from( to, _server, LO_TT_IMMEDIATE, "/nsm/server/announce", "sssiii",
|
||||
lo_send_from (to, _server, LO_TT_IMMEDIATE, "/nsm/server/announce", "sssiii",
|
||||
application_name,
|
||||
capabilities,
|
||||
process_name,
|
||||
1, /* api_major_version */
|
||||
0, /* api_minor_version */
|
||||
pid );
|
||||
pid);
|
||||
|
||||
lo_address_free( to );
|
||||
lo_address_free (to);
|
||||
}
|
||||
|
||||
void
|
||||
Client::progress ( float p )
|
||||
Client::progress (float p)
|
||||
{
|
||||
if ( nsm_is_active )
|
||||
if (nsm_is_active)
|
||||
{
|
||||
lo_send_from( nsm_addr, _server, LO_TT_IMMEDIATE, "/nsm/client/progress", "f", p );
|
||||
lo_send_from (nsm_addr, _server, LO_TT_IMMEDIATE, "/nsm/client/progress", "f", p);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Client::is_dirty ( void )
|
||||
Client::is_dirty (void)
|
||||
{
|
||||
if ( nsm_is_active )
|
||||
if (nsm_is_active)
|
||||
{
|
||||
lo_send_from( nsm_addr, _server, LO_TT_IMMEDIATE, "/nsm/client/is_dirty", "" );
|
||||
lo_send_from (nsm_addr, _server, LO_TT_IMMEDIATE, "/nsm/client/is_dirty", "");
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Client::is_clean ( void )
|
||||
Client::is_clean (void)
|
||||
{
|
||||
if ( nsm_is_active )
|
||||
if (nsm_is_active)
|
||||
{
|
||||
lo_send_from( nsm_addr, _server, LO_TT_IMMEDIATE, "/nsm/client/is_clean", "" );
|
||||
lo_send_from (nsm_addr, _server, LO_TT_IMMEDIATE, "/nsm/client/is_clean", "");
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Client::message ( int priority, const char *msg )
|
||||
Client::message (int priority, const char *msg)
|
||||
{
|
||||
if ( nsm_is_active )
|
||||
if (nsm_is_active)
|
||||
{
|
||||
lo_send_from( nsm_addr, _server, LO_TT_IMMEDIATE, "/nsm/client/message", "is", priority, msg );
|
||||
lo_send_from (nsm_addr, _server, LO_TT_IMMEDIATE, "/nsm/client/message", "is", priority, msg);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
Client::broadcast ( lo_message msg )
|
||||
Client::broadcast (lo_message msg)
|
||||
{
|
||||
if ( nsm_is_active )
|
||||
if (nsm_is_active)
|
||||
{
|
||||
lo_send_message_from( nsm_addr, _server, "/nsm/server/broadcast", msg );
|
||||
lo_send_message_from (nsm_addr, _server, "/nsm/server/broadcast", msg);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Client::check ( int timeout )
|
||||
Client::check (int timeout)
|
||||
{
|
||||
if ( lo_server_wait( _server, timeout ) )
|
||||
while ( lo_server_recv_noblock( _server, 0 ) ) {}
|
||||
if (lo_server_wait (_server, timeout)) {
|
||||
while (lo_server_recv_noblock (_server, 0));
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Client::start ( )
|
||||
Client::start ()
|
||||
{
|
||||
lo_server_thread_start( _st );
|
||||
lo_server_thread_start (_st);
|
||||
}
|
||||
|
||||
void
|
||||
Client::stop ( )
|
||||
Client::stop ()
|
||||
{
|
||||
lo_server_thread_stop( _st );
|
||||
lo_server_thread_stop (_st);
|
||||
}
|
||||
|
||||
int
|
||||
Client::init ( const char *nsm_url )
|
||||
Client::init (const char *nsm_url)
|
||||
{
|
||||
this->nsm_url = nsm_url;
|
||||
|
||||
lo_address addr = lo_address_new_from_url( nsm_url );
|
||||
int proto = lo_address_get_protocol( addr );
|
||||
lo_address_free( addr );
|
||||
lo_address addr = lo_address_new_from_url (nsm_url);
|
||||
int proto = lo_address_get_protocol (addr);
|
||||
lo_address_free (addr);
|
||||
|
||||
_server = lo_server_new_with_proto( NULL, proto, NULL );
|
||||
_server = lo_server_new_with_proto (NULL, proto, NULL);
|
||||
|
||||
if ( ! _server )
|
||||
if (!_server) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
lo_server_add_method( _server, "/error", "sis", &Client::osc_error, this );
|
||||
lo_server_add_method( _server, "/reply", "ssss", &Client::osc_announce_reply, this );
|
||||
lo_server_add_method( _server, "/nsm/client/open", "sss", &Client::osc_open, this );
|
||||
lo_server_add_method( _server, "/nsm/client/save", "", &Client::osc_save, this );
|
||||
lo_server_add_method( _server, "/nsm/client/session_is_loaded", "", &Client::osc_session_is_loaded, this );
|
||||
lo_server_add_method( _server, NULL, NULL, &Client::osc_broadcast, this );
|
||||
lo_server_add_method (_server, "/error", "sis", &Client::osc_error, this);
|
||||
lo_server_add_method (_server, "/reply", "ssss", &Client::osc_announce_reply, this);
|
||||
lo_server_add_method (_server, "/nsm/client/open", "sss", &Client::osc_open, this);
|
||||
lo_server_add_method (_server, "/nsm/client/save", "", &Client::osc_save, this);
|
||||
lo_server_add_method (_server, "/nsm/client/session_is_loaded", "", &Client::osc_session_is_loaded, this);
|
||||
lo_server_add_method (_server, NULL, NULL, &Client::osc_broadcast, this);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
Client::init_thread ( const char *nsm_url )
|
||||
Client::init_thread (const char *nsm_url)
|
||||
{
|
||||
this->nsm_url = nsm_url;
|
||||
|
||||
lo_address addr = lo_address_new_from_url( nsm_url );
|
||||
int proto = lo_address_get_protocol( addr );
|
||||
lo_address_free( addr );
|
||||
lo_address addr = lo_address_new_from_url (nsm_url);
|
||||
int proto = lo_address_get_protocol (addr);
|
||||
lo_address_free (addr);
|
||||
|
||||
_st = lo_server_thread_new_with_proto( NULL, proto, NULL );
|
||||
_server = lo_server_thread_get_server( _st );
|
||||
_st = lo_server_thread_new_with_proto (NULL, proto, NULL);
|
||||
_server = lo_server_thread_get_server (_st);
|
||||
|
||||
if ( ! _server || ! _st )
|
||||
if (! _server || ! _st) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
lo_server_thread_add_method( _st, "/error", "sis", &Client::osc_error, this );
|
||||
lo_server_thread_add_method( _st, "/reply", "ssss", &Client::osc_announce_reply, this );
|
||||
lo_server_thread_add_method( _st, "/nsm/client/open", "sss", &Client::osc_open, this );
|
||||
lo_server_thread_add_method( _st, "/nsm/client/save", "", &Client::osc_save, this );
|
||||
lo_server_thread_add_method( _st, "/nsm/client/session_is_loaded", "", &Client::osc_session_is_loaded, this );
|
||||
lo_server_thread_add_method( _st, NULL, NULL, &Client::osc_broadcast, this );
|
||||
lo_server_thread_add_method (_st, "/error", "sis", &Client::osc_error, this);
|
||||
lo_server_thread_add_method (_st, "/reply", "ssss", &Client::osc_announce_reply, this);
|
||||
lo_server_thread_add_method (_st, "/nsm/client/open", "sss", &Client::osc_open, this);
|
||||
lo_server_thread_add_method (_st, "/nsm/client/save", "", &Client::osc_save, this);
|
||||
lo_server_thread_add_method (_st, "/nsm/client/session_is_loaded", "", &Client::osc_session_is_loaded, this);
|
||||
lo_server_thread_add_method (_st, NULL, NULL, &Client::osc_broadcast, this);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -213,54 +218,58 @@ namespace NSM
|
|||
/************************/
|
||||
|
||||
int
|
||||
Client::osc_broadcast ( const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data )
|
||||
Client::osc_broadcast (const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data)
|
||||
{
|
||||
return ((NSM::Client*)user_data)->command_broadcast( path, msg );
|
||||
return ((NSM::Client*)user_data)->command_broadcast (path, msg);
|
||||
}
|
||||
|
||||
int
|
||||
Client::osc_save ( const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data )
|
||||
Client::osc_save (const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data)
|
||||
{
|
||||
char *out_msg = NULL;
|
||||
|
||||
int r = ((NSM::Client*)user_data)->command_save(&out_msg);
|
||||
|
||||
if ( r )
|
||||
OSC_REPLY_ERR( r, ( out_msg ? out_msg : "") );
|
||||
else
|
||||
OSC_REPLY( "OK" );
|
||||
if (r) {
|
||||
OSC_REPLY_ERR (r, (out_msg ? out_msg : ""));
|
||||
} else {
|
||||
OSC_REPLY ("OK");
|
||||
}
|
||||
|
||||
if ( out_msg )
|
||||
free( out_msg );
|
||||
if (out_msg) {
|
||||
free (out_msg);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
Client::osc_open ( const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data )
|
||||
Client::osc_open (const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data)
|
||||
{
|
||||
char *out_msg = NULL;
|
||||
|
||||
NSM::Client *nsm = (NSM::Client*)user_data;
|
||||
|
||||
nsm->_nsm_client_id = strdup( &argv[2]->s );
|
||||
nsm->_nsm_client_path = strdup( &argv[0]->s );
|
||||
nsm->_nsm_client_id = strdup (&argv[2]->s);
|
||||
nsm->_nsm_client_path = strdup (&argv[0]->s);
|
||||
|
||||
int r = ((NSM::Client*)user_data)->command_open( &argv[0]->s, &argv[1]->s, &argv[2]->s, &out_msg);
|
||||
int r = ((NSM::Client*)user_data)->command_open (&argv[0]->s, &argv[1]->s, &argv[2]->s, &out_msg);
|
||||
|
||||
if ( r )
|
||||
OSC_REPLY_ERR( r, ( out_msg ? out_msg : "") );
|
||||
else
|
||||
OSC_REPLY( "OK" );
|
||||
if (r) {
|
||||
OSC_REPLY_ERR (r, (out_msg ? out_msg : ""));
|
||||
} else {
|
||||
OSC_REPLY ("OK");
|
||||
}
|
||||
|
||||
if ( out_msg )
|
||||
free( out_msg );
|
||||
if (out_msg) {
|
||||
free(out_msg);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
Client::osc_session_is_loaded ( const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data )
|
||||
Client::osc_session_is_loaded (const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data)
|
||||
{
|
||||
NSM::Client *nsm = (NSM::Client*)user_data;
|
||||
|
||||
|
|
@ -270,34 +279,36 @@ namespace NSM
|
|||
}
|
||||
|
||||
int
|
||||
Client::osc_error ( const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data )
|
||||
Client::osc_error (const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data)
|
||||
{
|
||||
if ( strcmp( &argv[0]->s, "/nsm/server/announce" ) )
|
||||
if (strcmp (&argv[0]->s, "/nsm/server/announce")) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
NSM::Client *nsm = (NSM::Client*)user_data;
|
||||
|
||||
|
||||
nsm->nsm_is_active = false;
|
||||
|
||||
nsm->command_active( nsm->nsm_is_active );
|
||||
nsm->command_active (nsm->nsm_is_active);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
Client::osc_announce_reply ( const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data )
|
||||
Client::osc_announce_reply (const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data)
|
||||
{
|
||||
if ( strcmp( &argv[0]->s, "/nsm/server/announce" ) )
|
||||
if (strcmp (&argv[0]->s, "/nsm/server/announce")) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
NSM::Client *nsm = (NSM::Client*)user_data;
|
||||
|
||||
nsm->nsm_is_active = true;
|
||||
nsm->_session_manager_name = strdup( &argv[2]->s );
|
||||
nsm->nsm_addr = lo_address_new_from_url( lo_address_get_url( lo_message_get_source( msg ) ));
|
||||
nsm->_session_manager_name = strdup (&argv[2]->s);
|
||||
nsm->nsm_addr = lo_address_new_from_url (lo_address_get_url (lo_message_get_source (msg)));
|
||||
|
||||
nsm->command_active( nsm->nsm_is_active );
|
||||
nsm->command_active (nsm->nsm_is_active);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ class ProxyBase;
|
|||
|
||||
class Manager : public ARDOUR::SessionHandlePtr
|
||||
{
|
||||
public:
|
||||
public:
|
||||
static Manager& instance();
|
||||
|
||||
void register_window (ProxyBase*);
|
||||
|
|
@ -66,7 +66,7 @@ class Manager : public ARDOUR::SessionHandlePtr
|
|||
void set_transient_for (Gtk::Window*);
|
||||
Gtk::Window* transient_parent() const { return current_transient_parent; }
|
||||
|
||||
private:
|
||||
private:
|
||||
typedef std::list<ProxyBase*> Windows;
|
||||
Windows _windows;
|
||||
Glib::RefPtr<Gtk::ActionGroup> window_actions;
|
||||
|
|
@ -76,26 +76,26 @@ class Manager : public ARDOUR::SessionHandlePtr
|
|||
~Manager();
|
||||
|
||||
static Manager* _instance;
|
||||
private:
|
||||
private:
|
||||
void window_proxy_was_mapped (ProxyBase*);
|
||||
void window_proxy_was_unmapped (ProxyBase*);
|
||||
};
|
||||
|
||||
class ProxyBase : public ARDOUR::SessionHandlePtr, public Gtkmm2ext::WindowProxy
|
||||
{
|
||||
public:
|
||||
public:
|
||||
ProxyBase (const std::string& name, const std::string& menu_name);
|
||||
ProxyBase (const std::string& name, const std::string& menu_name, const XMLNode&);
|
||||
|
||||
virtual ARDOUR::SessionHandlePtr* session_handle () = 0;
|
||||
|
||||
protected:
|
||||
protected:
|
||||
void setup ();
|
||||
};
|
||||
|
||||
class ProxyTemporary: public ProxyBase
|
||||
{
|
||||
public:
|
||||
public:
|
||||
ProxyTemporary (const std::string& name, Gtk::Window* win);
|
||||
~ProxyTemporary();
|
||||
|
||||
|
|
@ -114,7 +114,7 @@ class ProxyTemporary: public ProxyBase
|
|||
template<typename T>
|
||||
class ProxyWithConstructor: public ProxyBase
|
||||
{
|
||||
public:
|
||||
public:
|
||||
ProxyWithConstructor (const std::string& name, const std::string& menu_name, const boost::function<T*()>& c)
|
||||
: ProxyBase (name, menu_name) , creator (c) {}
|
||||
|
||||
|
|
@ -155,14 +155,14 @@ class ProxyWithConstructor: public ProxyBase
|
|||
}
|
||||
}
|
||||
|
||||
private:
|
||||
private:
|
||||
boost::function<T*()> creator;
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
class Proxy : public ProxyBase
|
||||
{
|
||||
public:
|
||||
public:
|
||||
Proxy (const std::string& name, const std::string& menu_name)
|
||||
: ProxyBase (name, menu_name) {}
|
||||
|
||||
|
|
@ -203,7 +203,7 @@ class Proxy : public ProxyBase
|
|||
}
|
||||
}
|
||||
|
||||
private:
|
||||
private:
|
||||
boost::function<T*()> creator;
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue