conform to new CP API design
[ardour.git] / libs / surfaces / tranzport / init.cc
index 94f85bdc56935898824ecb0c2393fc218d7a410b..289d4d79a72375fd0e413fbc03b19f157dcf3f7d 100644 (file)
@@ -86,18 +86,8 @@ TranzportControlProtocol::set_active (bool yn)
                                return -1;
                        }
 
-                       if (pthread_create_and_store (X_("tranzport monitor"), &thread, 0, _monitor_work, this) == 0) {
+                       if (pthread_create_and_store (X_("tranzport monitor"), &thread, _monitor_work, this) == 0) {
                                _active = true;
-#if TRANZPORT_THREADS                      
-                       if (pthread_create_and_store (X_("tranzport read"), &thread_read, 0, _read_work, this) == 0) {
-                               _active_read = true;
-                       if (pthread_create_and_store (X_("tranzport write"), &thread_write, 0, _write_work, this) == 0) {
-                               _active_write = true;
-                       if (pthread_create_and_store (X_("tranzport process"), &thread_process, 0, _process_work, this) == 0) {
-                               _active_process = true;
-                       if (pthread_create_and_store (X_("tranzport timer"), &thread_timer, 0, _process_timer, this) == 0) {
-                               _active_process = true;
-#endif
                        } else {
                                return -1;
                        }
@@ -112,19 +102,14 @@ TranzportControlProtocol::set_active (bool yn)
 // thread FIXME - wait til all writes are done
                                for(int x = 0; (x < 20/MAX_TRANZPORT_INFLIGHT) && flush(); x++) { usleep(100); }
                        }
-#if TRANZPORT_THREADS                      
-                       pthread_cancel_one (_thread_timer);
-                       pthread_cancel_one (_thread_process);
-                       pthread_cancel_one (_thread_read);
-                       pthread_cancel_one (_thread_write);
-#endif
+
                        pthread_cancel_one (thread);
 
                        cerr << "Tranzport Thread dead\n";
                        close ();
                        _active = false;
                        cerr << "End tranzport shutdown\n";
-               } 
+               }
        }
 
        return 0;
@@ -173,7 +158,7 @@ TranzportControlProtocol::monitor_work ()
        bool first_time = true;
        uint8_t offline = 0;
 
-       PBD::ThreadCreated (pthread_self(), X_("Tranzport"));
+       register_thread (X_("Tranzport"));
        pthread_setcancelstate (PTHREAD_CANCEL_ENABLE, 0);
        pthread_setcanceltype (PTHREAD_CANCEL_ASYNCHRONOUS, 0);
        rtpriority_set();