Ardour  9.2-79-gba93f2fe52
control_protocol_manager.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2017 Paul Davis <paul@linuxaudiosystems.com>
3  * Copyright (C) 2007 Tim Mayberry <mojofunk@gmail.com>
4  * Copyright (C) 2009-2012 David Robillard <d@drobilla.net>
5  * Copyright (C) 2009 Carl Hetherington <carl@carlh.net>
6  * Copyright (C) 2015-2016 Robin Gareus <robin@gareus.org>
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License along
19  * with this program; if not, write to the Free Software Foundation, Inc.,
20  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21  */
22 
23 #ifndef ardour_control_protocol_manager_h
24 #define ardour_control_protocol_manager_h
25 
26 #include <string>
27 #include <list>
28 
29 
30 #include "pbd/rwlock.h"
31 #include "pbd/stateful.h"
32 
33 #include "control_protocol/types.h"
34 
35 #include "ardour/session_handle.h"
36 
37 namespace ARDOUR {
38 
39 class ControlProtocol;
40 class ControlProtocolDescriptor;
41 class Session;
42 
44  public:
47  std::string name;
48  std::string path;
49  bool requested;
50  bool automatic;
52 
54  : descriptor (0)
55  , protocol (0)
56  , requested (false)
57  , automatic (false)
58  , state (0)
59  {}
61 
62 };
63 
65 {
66  public:
68 
70 
73  void foreach_known_protocol (std::function<void(const ControlProtocolInfo*)>);
75  void drop_protocols ();
77  void probe_usb_control_protocols (bool, uint16_t, uint16_t);
78 
81 
82  std::list<ControlProtocolInfo*> control_protocol_info;
83 
84  static const std::string state_node_name;
85 
86  int set_state (const XMLNode&, int version);
87  XMLNode& get_state () const;
88 
90 
93 
94  private:
97 
99  std::list<ControlProtocol*> control_protocols;
100 
102 
103  int control_protocol_discover (std::string path);
107  int teardown (ControlProtocolInfo&, bool lock_required);
108 };
109 
110 } // namespace
111 
112 #endif // ardour_control_protocol_manager_h
ControlProtocolDescriptor * descriptor
int teardown(ControlProtocolInfo &, bool lock_required)
int deactivate(ControlProtocolInfo &)
void stripable_selection_changed(ARDOUR::StripableNotificationListPtr)
ControlProtocolInfo * cpi_by_name(std::string)
PBD::Signal< void(ControlProtocolInfo *)> ProtocolStatusChange
ControlProtocolDescriptor * get_descriptor(std::string path)
static const std::string state_node_name
int control_protocol_discover(std::string path)
int set_state(const XMLNode &, int version)
static ControlProtocolManager * _instance
int activate(ControlProtocolInfo &)
void probe_usb_control_protocols(bool, uint16_t, uint16_t)
std::list< ControlProtocol * > control_protocols
static ControlProtocolManager & instance()
std::list< ControlProtocolInfo * > control_protocol_info
ControlProtocol * instantiate(ControlProtocolInfo &)
void foreach_known_protocol(std::function< void(const ControlProtocolInfo *)>)
static PBD::Signal< void(ARDOUR::StripableNotificationListPtr)> StripableSelectionChanged
Definition: xml++.h:114
#define LIBARDOUR_API
PBD::PropertyDescriptor< bool > automatic
std::shared_ptr< StripableNotificationList > StripableNotificationListPtr