Open Lighting Architecture: plugins/usbdmx/UsbDmxPlugin.h Source File

| Open Lighting Architecture 0.10.9

Loading...
Searching...
No Matches
UsbDmxPlugin.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 * UsbDmxPlugin.h
17 * A plugin that uses libusb to communicate with USB devices.
18 * Copyright (C) 2010 Simon Newton
19 */
20
21#ifndef PLUGINS_USBDMX_USBDMXPLUGIN_H_
22#define PLUGINS_USBDMX_USBDMXPLUGIN_H_
23
24#include <memory>
25#include <string>
26#include "ola/base/Macro.h"
27#include "ola/plugin_id.h"
28#include "olad/Plugin.h"
29
30namespace ola {
31namespace plugin {
32namespace usbdmx {
33
44 class UsbDmxPlugin: public ola::Plugin {
45 public:
51 explicit UsbDmxPlugin(PluginAdaptor *plugin_adaptor);
52 ~UsbDmxPlugin();
53
54 std::string Name() const { return PLUGIN_NAME; }
55 std::string Description() const;
56 ola_plugin_id Id() const { return OLA_PLUGIN_USBDMX; }
57 std::string PluginPrefix() const { return PLUGIN_PREFIX; }
58
59 private:
60 std::auto_ptr<class PluginImplInterface> m_impl;
61
62 bool StartHook();
63 bool StopHook();
64 bool SetDefaultPreferences();
65
66 static const char PLUGIN_NAME[];
67 static const char PLUGIN_PREFIX[];
68 static const char LIBUSB_DEBUG_LEVEL_KEY[];
69 static int LIBUSB_DEFAULT_DEBUG_LEVEL;
70 static int LIBUSB_MAX_DEBUG_LEVEL;
71
72 UsbDmxPlugin(const UsbDmxPlugin &) = delete;
73 const UsbDmxPlugin &operator=(const UsbDmxPlugin &) = delete;
74};
75} // namespace usbdmx
76} // namespace plugin
77} // namespace ola
78#endif // PLUGINS_USBDMX_USBDMXPLUGIN_H_
Macro.h
Helper macros.
ola::PluginAdaptor
Definition PluginAdaptor.h:41
ola::Plugin
Definition Plugin.h:118
ola::Plugin::SetDefaultPreferences
virtual bool SetDefaultPreferences()
Definition Plugin.h:159
ola::plugin::usbdmx::UsbDmxPlugin
A plugin that uses libusb to communicate with USB devices.
Definition UsbDmxPlugin.h:44
ola::plugin::usbdmx::UsbDmxPlugin::Name
std::string Name() const
Get the plugin name.
Definition UsbDmxPlugin.h:54
ola::plugin::usbdmx::UsbDmxPlugin::Id
ola_plugin_id Id() const
Get the plugin ID of this plugin.
Definition UsbDmxPlugin.h:56
ola::plugin::usbdmx::UsbDmxPlugin::PluginPrefix
std::string PluginPrefix() const
The prefix to use for storing configuration files.
Definition UsbDmxPlugin.h:57
ola::plugin::usbdmx::UsbDmxPlugin::UsbDmxPlugin
UsbDmxPlugin(PluginAdaptor *plugin_adaptor)
Create a new UsbDmxPlugin.
Definition UsbDmxPlugin.cpp:47
ola::plugin::usbdmx::UsbDmxPlugin::Description
std::string Description() const
Definition UsbDmxPlugin.cpp:89
ola::plugin::usbdmx
The plugin for hardware using libusb.
ola::plugin
Code for supported devices and protocols.
ola
The namespace containing all OLA symbols.
Definition Credentials.cpp:44