summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2007-03-15 13:25:01 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2007-03-15 13:25:01 +0000
commit6fadaae2cbc6ed0bc83136cde7536623894f819d (patch)
treedcb8ea37c6b9e1cc671a43ce1676a8aa231e0f8c /libs
parenta1960ba3c0c751e9f5fef4ccae70c46ae713c7cb (diff)
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
Diffstat (limited to 'libs')
-rw-r--r--libs/ardour/ardour/configuration_vars.h2
-rw-r--r--libs/ardour/osc.cc17
2 files changed, 15 insertions, 4 deletions
diff --git a/libs/ardour/ardour/configuration_vars.h b/libs/ardour/ardour/configuration_vars.h
index 1296ab0dad..674a9232b5 100644
--- a/libs/ardour/ardour/configuration_vars.h
+++ b/libs/ardour/ardour/configuration_vars.h
@@ -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 */
diff --git a/libs/ardour/osc.cc b/libs/ardour/osc.cc
index bb87708f9e..d999386005 100644
--- a/libs/ardour/osc.cc
+++ b/libs/ardour/osc.cc
@@ -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;
}