breakout control protocol code into LGPL library; fix panner buttons even more than nick did, plus some other bits and pieces

git-svn-id: svn://localhost/trunk/ardour2@522 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2006-05-23 19:54:52 +00:00
parent a222c19737
commit 2fba6d0925
25 changed files with 414 additions and 142 deletions

View file

@ -66,9 +66,7 @@ slider_position_to_gain (double pos)
TranzportControlProtocol::TranzportControlProtocol (Session& s)
: ControlProtocol (s, X_("Tranzport")),
AbstractUI<TranzportRequest> (X_("Tranzport"), false)
: ControlProtocol (s, X_("Tranzport"))
{
/* tranzport controls one track at a time */
@ -106,6 +104,28 @@ TranzportControlProtocol::~TranzportControlProtocol ()
set_active (false);
}
bool
TranzportControlProtocol::probe ()
{
struct usb_bus *bus;
struct usb_device *dev;
usb_init();
usb_find_busses();
usb_find_devices();
for (bus = usb_busses; bus; bus = bus->next) {
for(dev = bus->devices; dev; dev = dev->next) {
if (dev->descriptor.idVendor == VENDORID && dev->descriptor.idProduct == PRODUCTID) {
return true;
}
}
}
return false;
}
int
TranzportControlProtocol::set_active (bool yn)
{
@ -559,7 +579,7 @@ TranzportControlProtocol::monitor_work ()
if ((err = pthread_setschedparam (pthread_self(), SCHED_FIFO, &rtparam)) != 0) {
// do we care? not particularly.
info << string_compose (_("%1: thread not running with realtime scheduling (%2)"), BaseUI::name(), strerror (errno)) << endmsg;
info << string_compose (_("%1: thread not running with realtime scheduling (%2)"), name(), strerror (errno)) << endmsg;
}
pthread_setcancelstate (PTHREAD_CANCEL_ENABLE, 0);
@ -1554,18 +1574,3 @@ TranzportControlProtocol::print (int row, int col, const char *text)
}
}
bool
TranzportControlProtocol::caller_is_ui_thread ()
{
return (pthread_self() == thread);
}
void
TranzportControlProtocol::do_request (TranzportRequest* req)
{
if (req->type == SetCurrentTrack) {
route_table[0] = req->track;
}
return;
}