add basic support for the griffin powermate (a control surface) (from ben loftis)
[ardour.git] / libs / surfaces / powermate / interface.cc
1 /*
2         Ardour9pin interface file
3         Ben Loftis
4         Created: 05/18/06 11:07:56
5         Copyright Harrison Audio, LLC, 2007
6 */
7
8 #include "powermate.h"
9
10 using namespace ARDOUR;
11
12 ControlProtocol*
13 new_powermate_protocol (ControlProtocolDescriptor* descriptor, Session* s)
14 {
15         PowermateControlProtocol* pcp = new PowermateControlProtocol (*s);
16
17         if (pcp->set_active (true)) {
18                 delete pcp;
19                 return 0;
20         }
21
22         return pcp;
23         
24 }
25
26 void
27 delete_powermate_protocol (ControlProtocolDescriptor* descriptor, ControlProtocol* cp)
28 {
29         delete cp;
30 }
31
32 bool
33 probe_powermate_protocol (ControlProtocolDescriptor* descriptor)
34 {
35         return PowermateControlProtocol::probe ();
36 }
37
38 static ControlProtocolDescriptor powermate_descriptor = {
39         name : "powermate",
40         id : "uri://ardour.org/ardour/powermate:0",
41         ptr : 0,
42         module : 0,
43         mandatory : 0,
44         supports_feedback : false,
45         probe : probe_powermate_protocol,
46         initialize : new_powermate_protocol,
47         destroy : delete_powermate_protocol
48 };
49         
50
51 extern "C" {
52 ControlProtocolDescriptor* 
53 protocol_descriptor () {
54         return &powermate_descriptor;
55 }
56 }
57