make OSC off by default, and add menu item to control it

git-svn-id: svn://localhost/ardour2/trunk@1594 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis
2007-03-15 13:25:01 +00:00
parent a1960ba3c0
commit 6fadaae2cb
6 changed files with 37 additions and 4 deletions

View File

@@ -38,7 +38,7 @@ CONFIG_VARIABLE (HeaderFormat, native_file_header_format, "native-file-header-f
/* OSC */
CONFIG_VARIABLE (uint32_t, osc_port, "osc-port", 3819)
CONFIG_VARIABLE (bool, use_osc, "use-osc", true)
CONFIG_VARIABLE (bool, use_osc, "use-osc", false)
/* crossfades */

View File

@@ -58,6 +58,11 @@ int
OSC::start ()
{
char tmpstr[255];
if (_osc_server) {
/* already started */
return 0;
}
for (int j=0; j < 20; ++j) {
snprintf(tmpstr, sizeof(tmpstr), "%d", _port);
@@ -108,16 +113,22 @@ OSC::start ()
int
OSC::stop ()
{
if (_osc_server == 0) {
/* already stopped */
return 0;
}
// stop server thread
terminate_osc_thread();
lo_server_free (_osc_server);
_osc_server = 0;
if (!_osc_unix_socket_path.empty()) {
// unlink it
unlink(_osc_unix_socket_path.c_str());
}
// stop server thread
terminate_osc_thread();
return 0;
}