Ardour  9.0-pre0-384-ga76afae0e9
wiimote.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2008-2017 Paul Davis <paul@linuxaudiosystems.com>
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License along
15  * with this program; if not, write to the Free Software Foundation, Inc.,
16  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17  */
18 
19 #ifndef ardour_wiimote_control_protocol_h
20 #define ardour_wiimote_control_protocol_h
21 
22 #include <cwiid.h>
23 
24 #define ABSTRACT_UI_EXPORTS
25 #include "pbd/abstract_ui.h"
26 #include "ardour/types.h"
28 
29 struct WiimoteControlUIRequest : public BaseUI::BaseRequestObject {
30 public:
33 };
34 
37  , public AbstractUI<WiimoteControlUIRequest>
38 {
39 public:
42 
43  int set_active (bool yn);
44 
45  XMLNode& get_state () const;
46  int set_state (const XMLNode&, int version);
47 
50 
51  void wiimote_callback (int mesg_count, union cwiid_mesg mesg[]);
52 
54 
56 
57 protected:
59  int start ();
60  int stop ();
61 
62  void thread_init ();
63 
64  bool connect_idle ();
65  bool connect_wiimote ();
66 
68 
69 protected:
71  cwiid_wiimote_t* wiimote;
72  GSource *idle_source;
73  uint16_t button_state;
75 };
76 
77 #endif /* ardour_wiimote_control_protocol_h */
78 
void do_request(WiimoteControlUIRequest *)
void wiimote_callback(int mesg_count, union cwiid_mesg mesg[])
XMLNode & get_state() const
virtual ~WiimoteControlProtocol()
WiimoteControlProtocol(ARDOUR::Session &)
cwiid_wiimote_t * wiimote
Definition: wiimote.h:71
void stripable_selection_changed()
Definition: wiimote.h:53
CONTROL_PROTOCOL_THREADS_NEED_TEMPO_MAP_DECL()
GSource * idle_source
Definition: wiimote.h:72
bool callback_thread_registered
Definition: wiimote.h:74
PBD::ScopedConnectionList session_connections
Definition: wiimote.h:70
int set_state(const XMLNode &, int version)
int set_active(bool yn)
uint16_t button_state
Definition: wiimote.h:73
Definition: xml++.h:114