breakout control protocol code into LGPL library; fix panner buttons even more than...
[ardour.git] / libs / surfaces / tranzport / interface.cc
1 #include "control_protocol.h"
2
3 #include "tranzport_control_protocol.h"
4
5 using namespace ARDOUR;
6
7 ControlProtocol*
8 new_tranzport_protocol (ControlProtocolDescriptor* descriptor, Session* s)
9 {
10         TranzportControlProtocol* tcp = new TranzportControlProtocol (*s);
11
12         if (tcp->set_active (true)) {
13                 delete tcp;
14                 return 0;
15         }
16
17         return tcp;
18         
19 }
20
21 void
22 delete_tranzport_protocol (ControlProtocolDescriptor* descriptor, ControlProtocol* cp)
23 {
24         delete cp;
25 }
26
27 bool
28 probe_tranzport_protocol (ControlProtocolDescriptor* descriptor)
29 {
30         return TranzportControlProtocol::probe();
31 }
32
33 static ControlProtocolDescriptor tranzport_descriptor = {
34         name : "Tranzport",
35         id : "uri://ardour.org/surfaces/tranzport:0",
36         ptr : 0,
37         module : 0,
38         mandatory : 0,
39         probe : probe_tranzport_protocol,
40         initialize : new_tranzport_protocol,
41         destroy : delete_tranzport_protocol
42 };
43         
44
45 extern "C" {
46 ControlProtocolDescriptor* 
47 protocol_descriptor () {
48         return &tranzport_descriptor;
49 }
50 }
51