using namespace sigc;
using namespace PBD;
-#include "i18n.h"
+#include "pbd/i18n.h"
#include <pbd/abstract_ui.cc>
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;
struct sched_param rtparam;
int err;
memset (&rtparam, 0, sizeof (rtparam));
- rtparam.sched_priority = priority;
+ rtparam.sched_priority = priority;
if ((err = pthread_setschedparam (pthread_self(), SCHED_FIFO, &rtparam)) != 0) {
PBD::info << string_compose (_("%1: can't stop realtime scheduling (%2)"), name(), strerror (errno)) << endmsg;
return 1;
_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;
case 3: val = read(buf,DEFAULT_USB_TIMEOUT*2); break; // Hoo, boy, we're in trouble
default: break; // not reached
}
-
+
#if DEBUG_TRANZPORT_BITS > 9
if(_device_status != STATUS_OFFLINE && _device_status != STATUS_ONLINE && _device_status != STATUS_OK) {
printf("The device has more status bits than off or online: %d\n",_device_status);
printf("OFFLINE : %02x %02x %02x %02x %02x %02x %02x %02x\n",
buf[0],buf[1],buf[2], buf[3], buf[4], buf[5],buf[6],buf[7]);
}
-
+
if(_device_status == STATUS_OK) {
printf("OK : %02x %02x %02x %02x %02x %02x %02x %02x\n",
buf[0],buf[1],buf[2], buf[3], buf[4], buf[5],buf[6],buf[7]);