Open Lighting Architecture  0.9.6
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 
30 namespace ola {
31 namespace plugin {
32 namespace 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  DISALLOW_COPY_AND_ASSIGN(UsbDmxPlugin);
73 };
74 } // namespace usbdmx
75 } // namespace plugin
76 } // namespace ola
77 #endif // PLUGINS_USBDMX_USBDMXPLUGIN_H_