summaryrefslogtreecommitdiff
path: root/gtk2_ardour/ardour_ui.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2013-04-03 10:35:47 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2013-04-03 10:35:47 -0400
commitec6dd2dc8bff2c5c3058ce72f45d4585a0d0ff30 (patch)
treeaaab96efb81b443972dc5bf195f97c60430d0bd0 /gtk2_ardour/ardour_ui.cc
parentb27700f10c6dac772f01f199869d2d28414b60e4 (diff)
parent810a603fb2afa0a3be3e7154886e0ebe9824b93b (diff)
Merge branch 'nsm' of https://github.com/royvegard/ardour
Diffstat (limited to 'gtk2_ardour/ardour_ui.cc')
-rw-r--r--gtk2_ardour/ardour_ui.cc25
1 files changed, 12 insertions, 13 deletions
diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc
index cdf8099fd0..ac7e493fe3 100644
--- a/gtk2_ardour/ardour_ui.cc
+++ b/gtk2_ardour/ardour_ui.cc
@@ -667,16 +667,21 @@ ARDOUR_UI::startup ()
if (!nsm->init (nsm_url)) {
nsm->announce (PROGRAM_NAME, ":dirty:", "ardour3");
+ unsigned int i = 0;
// wait for announce reply from nsm server
- do {
+ for ( i = 0; i < 5000; ++i) {
nsm->check ();
- usleep (10);
- } while (!nsm->is_active ());
+ usleep (i);
+ if (nsm->is_active())
+ break;
+ }
// wait for open command from nsm server
- do {
+ for ( i = 0; i < 5000; ++i) {
nsm->check ();
- usleep (10);
- } while (!nsm->client_id ());
+ usleep (1000);
+ if (nsm->client_id ())
+ break;
+ }
if (_session && nsm) {
_session->set_nsm_state( nsm->is_active() );
@@ -699,12 +704,6 @@ ARDOUR_UI::startup ()
}
}
- // wait for session is loaded reply from nsm server
- do {
- nsm->check ();
- usleep (10);
- } while (!nsm->session_loaded ());
-
}
else {
delete nsm;
@@ -982,7 +981,7 @@ ARDOUR_UI::every_second ()
update_disk_space ();
update_timecode_format ();
- if (nsm && nsm->is_active () && nsm->session_loaded ()) {
+ if (nsm && nsm->is_active ()) {
nsm->check ();
if (!_was_dirty && _session->dirty ()) {