add conditional use of jack_port_rename(), a newly added public API for JACK
This commit is contained in:
parent
9e2048decf
commit
aaab192436
@ -106,7 +106,16 @@ JACKAudioBackend::when_connected_to_jack ()
|
||||
int
|
||||
JACKAudioBackend::set_port_name (PortHandle port, const std::string& name)
|
||||
{
|
||||
#if HAVE_JACK_PORT_RENAME
|
||||
jack_client_t* client = _jack_connection->jack();
|
||||
if (client) {
|
||||
return jack_port_rename (client, (jack_port_t*) port, name.c_str());
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
#else
|
||||
return jack_port_set_name ((jack_port_t*) port, name.c_str());
|
||||
#endif
|
||||
}
|
||||
|
||||
string
|
||||
|
@ -66,6 +66,7 @@ JPFUN(1, const char *, port_type, (const jack_port_t *p), (p), 0)
|
||||
JPFUN(1, const char **, port_get_connections, (const jack_port_t *p), (p), 0)
|
||||
JPFUN(1, const char **, port_get_all_connections, (const jack_client_t *c, const jack_port_t *p), (c,p), 0)
|
||||
JPFUN(1, int, port_set_name, (jack_port_t *p, const char *n), (p,n), 0)
|
||||
JVFUN(1, port_set_rename, (jack_client_t*, jack_port_t *p, const char *n), (c, p,n))
|
||||
JPFUN(1, int, port_disconnect, (jack_client_t *c, jack_port_t *p), (c,p), 0)
|
||||
JPFUN(1, int, connect, (jack_client_t *c, const char *s, const char *d), (c,s,d), -1)
|
||||
JPFUN(1, int, disconnect, (jack_client_t *c, const char *s, const char *d), (c,s,d), -1)
|
||||
|
@ -95,6 +95,7 @@ int have_libjack(void);
|
||||
#define jack_port_by_name WJACK_port_by_name
|
||||
#define jack_port_by_id WJACK_port_by_id
|
||||
#define jack_port_set_name WJACK_port_set_name
|
||||
#define jack_port_rename WJACK_port_rename
|
||||
#define jack_port_disconnect WJACK_port_disconnect
|
||||
#define jack_port_register WJACK_port_register
|
||||
#define jack_port_unregister WJACK_port_unregister
|
||||
|
@ -45,7 +45,16 @@ def configure(conf):
|
||||
errmsg = 'not found (or broken). JACK metadata API will not be used',
|
||||
define_name = 'HAVE_JACK_METADATA',
|
||||
uselib = 'JACK')
|
||||
|
||||
|
||||
# Check to see if jack_port_rename() is available and working
|
||||
conf.check_cxx(fragment = "#include <jack/jack.h>\nint main(void) { jack_client_t* c; jack_port_t* p; jack_port_rename (c, p, \"foo\"); return 0; }\n",
|
||||
mandatory = False,
|
||||
msg = 'Checking for jack_port_rename()',
|
||||
okmsg = 'ok',
|
||||
errmsg = 'not found (or broken). jack_port_rename() will not be used, and jack_port_set_name() will be used instead',
|
||||
define_name = 'HAVE_JACK_PORT_RENAME',
|
||||
uselib = 'JACK')
|
||||
|
||||
def build(bld):
|
||||
obj = bld(features = 'c cxx cxxshlib')
|
||||
obj.source = [
|
||||
@ -73,6 +82,10 @@ def build(bld):
|
||||
obj.cxxflags += [ '-DHAVE_JACK_METADATA' ]
|
||||
obj.cflags += [ '-DHAVE_JACK_METADATA' ]
|
||||
|
||||
if bld.is_defined ('HAVE_JACK_PORT_RENAME'):
|
||||
obj.cxxflags += [ '-DHAVE_JACK_PORT_RENAME' ]
|
||||
obj.cflags += [ '-DHAVE_JACK_PORT_RENAME' ]
|
||||
|
||||
if (bld.env['build_target'] == 'mingw'):
|
||||
obj.uselib = [ 'PORTAUDIO' ]
|
||||
else:
|
||||
|
Loading…
Reference in New Issue
Block a user