Open Lighting Architecture: plugins/osc/OSCDevice.h Source File

| Open Lighting Architecture 0.10.9

Loading...
Searching...
No Matches
OSCDevice.h
1/*
2 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License as published by
4 * the Free Software Foundation; either version 2 of the License, or
5 * (at your option) any later version.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU Library General Public License for more details.
11 *
12 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software
14 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
15 *
16 * OSCDevice.h
17 * The OSC Device.
18 * Copyright (C) 2012 Simon Newton
19 */
20
21#ifndef PLUGINS_OSC_OSCDEVICE_H_
22#define PLUGINS_OSC_OSCDEVICE_H_
23
24#include <memory>
25#include <string>
26#include <vector>
27#include "ola/io/SelectServerInterface.h"
28#include "ola/network/SocketAddress.h"
29#include "olad/Device.h"
30#include "plugins/osc/OSCTarget.h"
31#include "plugins/osc/OSCNode.h"
32
33namespace ola {
34
35class AbstractPlugin;
36
37namespace plugin {
38namespace osc {
39
40 class OSCDevice: public Device {
41 public:
42 struct PortConfig {
43 PortConfig() : data_format(OSCNode::FORMAT_BLOB) {}
44
45 std::vector<OSCTarget> targets;
46 OSCNode::DataFormat data_format;
47 };
48
49 typedef std::vector<PortConfig> PortConfigs;
50
51 OSCDevice(AbstractPlugin *owner,
52 PluginAdaptor *plugin_adaptor,
53 uint16_t udp_port,
54 const std::vector<std::string> &addresses,
55 const PortConfigs &port_configs);
56 std::string DeviceId() const { return "1"; }
57
58 bool AllowLooping() const { return true; }
59 bool AllowMultiPortPatching() const { return true; }
60
61 protected:
62 PluginAdaptor *m_plugin_adaptor;
63 const std::vector<std::string> m_port_addresses;
64 const PortConfigs m_port_configs;
65 std::auto_ptr<class OSCNode> m_osc_node;
66
67 bool StartHook();
68
69 static const char DEVICE_NAME[];
70};
71} // namespace osc
72} // namespace plugin
73} // namespace ola
74#endif // PLUGINS_OSC_OSCDEVICE_H_
SocketAddress.h
Represents Socket Addresses.
ola::AbstractPlugin
Definition Plugin.h:38
ola::PluginAdaptor
Definition PluginAdaptor.h:41
ola::plugin::osc::OSCDevice::OSCDevice
OSCDevice(AbstractPlugin *owner, PluginAdaptor *plugin_adaptor, uint16_t udp_port, const std::vector< std::string > &addresses, const PortConfigs &port_configs)
Definition OSCDevice.cpp:47
ola::plugin::osc::OSCDevice::DeviceId
std::string DeviceId() const
The device ID.
Definition OSCDevice.h:56
ola::plugin::osc::OSCDevice::StartHook
bool StartHook()
Called during Start().
Definition OSCDevice.cpp:67
ola::plugin::osc
Code for the OSC protocol.
ola::plugin
Code for supported devices and protocols.
ola
The namespace containing all OLA symbols.
Definition Credentials.cpp:44