OSC: New personal monitor buses no longer need to be hidden
[ardour.git] / libs / surfaces / tranzport / init.cc
index 1e284b5831ff8a4d4b7ce6028b8601f3bca1dc05..56501b2c2cbb8d38e0c878670057bb0f2258595f 100644 (file)
@@ -43,16 +43,12 @@ TranzportControlProtocol::~TranzportControlProtocol ()
 
 int TranzportControlProtocol::rtpriority_set(int priority)
 {
-       struct sched_param rtparam;
-       int err;
        char *a = (char*) alloca(4096*2); a[0] = 'a'; a[4096] = 'b';
-       memset (&rtparam, 0, sizeof (rtparam));
-       rtparam.sched_priority = priority; /* XXX should be relative to audio (JACK) thread */
        // Note - try SCHED_RR with a low limit
        // - we don't care if we can't write everything this ms
        // and it will help if we lose the device
-       if ((err = pthread_setschedparam (pthread_self(), SCHED_FIFO, &rtparam)) != 0) {
-               PBD::info << string_compose (_("%1: thread not running with realtime scheduling (%2)"), name(), strerror (errno)) << endmsg;
+       if (set_thread_priority (SCHED_FIFO, priority)) {
+               PBD::info << string_compose (_("%1: thread not running with realtime scheduling."), name(), strerror (errno)) << endmsg;
                return 1;
        }
        return 0;
@@ -127,7 +123,7 @@ TranzportControlProtocol::TranzportControlProtocol (Session& s)
        _device_status = STATUS_OFFLINE;
        udev = 0;
        current_track_id = 0;
-       last_where = max_frames;
+       last_where = max_samples;
        wheel_mode = WheelTimeline;
        wheel_shift_mode = WheelShiftGain;
        wheel_increment = WheelIncrScreen;