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