Open Lighting Architecture: plugins/dmx4linux/Dmx4LinuxPlugin.h Source File

| Open Lighting Architecture 0.10.9

Loading...
Searching...
No Matches
Dmx4LinuxPlugin.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 * Dmx4LinuxPlugin.h
17 * Interface for the dmx4linux plugin class
18 * Copyright (C) 2006 Simon Newton
19 */
20
21#ifndef PLUGINS_DMX4LINUX_DMX4LINUXPLUGIN_H_
22#define PLUGINS_DMX4LINUX_DMX4LINUXPLUGIN_H_
23
24#include <vector>
25#include <string>
26#include "ola/DmxBuffer.h"
27#include "olad/Plugin.h"
28#include "ola/network/Socket.h"
29#include "ola/plugin_id.h"
30#include "plugins/dmx4linux/Dmx4LinuxPort.h"
31#include "plugins/dmx4linux/Dmx4LinuxSocket.h"
32
33namespace ola {
34namespace plugin {
35namespace dmx4linux {
36
37class Dmx4LinuxDevice;
38
39 class Dmx4LinuxPlugin: public ola::Plugin {
40 public:
41 explicit Dmx4LinuxPlugin(PluginAdaptor *plugin_adaptor):
42 Plugin(plugin_adaptor),
43 m_in_descriptor(NULL),
44 m_out_descriptor(NULL),
45 m_in_devices_count(0),
46 m_in_buffer(NULL) {}
47 ~Dmx4LinuxPlugin();
48
49 string Name() const { return PLUGIN_NAME; }
50 string Description() const;
51 ola_plugin_id Id() const { return OLA_PLUGIN_DMX4LINUX; }
52
53 int SocketReady();
54 string PluginPrefix() const { return PLUGIN_PREFIX; }
55
56 private:
57 bool StartHook();
58 bool StopHook();
59 bool SetDefaultPreferences();
60
61 bool SetupDescriptors();
62 int CleanupDescriptors();
63 bool SetupDevice(string family, int d4l_uni, int dir);
64 bool SetupDevices();
65
66 vector<Dmx4LinuxDevice*> m_devices; // list of out devices
67 vector<Dmx4LinuxInputPort*> m_in_ports; // list of in ports
68 string m_out_dev; // path to the dmx output device
69 string m_in_dev; // path to the dmx input device
70 Dmx4LinuxSocket *m_in_descriptor;
71 Dmx4LinuxSocket *m_out_descriptor;
72 int m_in_devices_count; // number of input devices
73 uint8_t *m_in_buffer; // input buffer
74
75 static const char DMX4LINUX_OUT_DEVICE[];
76 static const char DMX4LINUX_IN_DEVICE[];
77 static const char OUT_DEV_KEY[];
78 static const char IN_DEV_KEY[];
79 static const char PLUGIN_NAME[];
80 static const char PLUGIN_PREFIX[];
81};
82} // namespace dmx4linux
83} // namespace plugin
84} // namespace ola
85
86#endif // PLUGINS_DMX4LINUX_DMX4LINUXPLUGIN_H_
DmxBuffer.h
A class used to hold a single universe of DMX data.
ola::PluginAdaptor
Definition PluginAdaptor.h:41
ola::Plugin
Definition Plugin.h:118
ola::Plugin::SetDefaultPreferences
virtual bool SetDefaultPreferences()
Definition Plugin.h:159
ola::plugin::dmx4linux::Dmx4LinuxDevice
Definition Dmx4LinuxDevice.h:31
ola::plugin::dmx4linux::Dmx4LinuxPlugin::Description
string Description() const
Definition Dmx4LinuxPlugin.cpp:112
ola::plugin::dmx4linux::Dmx4LinuxPlugin::Name
string Name() const
Get the plugin name.
Definition Dmx4LinuxPlugin.h:49
ola::plugin::dmx4linux::Dmx4LinuxPlugin::Id
ola_plugin_id Id() const
Get the plugin ID of this plugin.
Definition Dmx4LinuxPlugin.h:51
ola::plugin::dmx4linux::Dmx4LinuxPlugin::PluginPrefix
string PluginPrefix() const
The prefix to use for storing configuration files.
Definition Dmx4LinuxPlugin.h:54
ola::plugin::dmx4linux::Dmx4LinuxSocket
Definition Dmx4LinuxSocket.h:30
ola::plugin::dmx4linux
Code for DMX4Linux devices.
ola::plugin
Code for supported devices and protocols.
ola
The namespace containing all OLA symbols.
Definition Credentials.cpp:44