Open Lighting Architecture
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
StageProfiPlugin.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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
15  *
16  * StageProfiPlugin.h
17  * Interface for the stageprofi plugin class
18  * Copyright (C) 2006-2008 Simon Newton
19  */
20 
21 #ifndef PLUGINS_STAGEPROFI_STAGEPROFIPLUGIN_H_
22 #define PLUGINS_STAGEPROFI_STAGEPROFIPLUGIN_H_
23 
24 #include <vector>
25 #include <string>
26 #include "olad/Plugin.h"
27 #include "ola/network/Socket.h"
28 #include "ola/plugin_id.h"
29 
30 namespace ola {
31 namespace plugin {
32 namespace stageprofi {
33 
35 using std::string;
36 
37 class StageProfiDevice;
38 
39 class StageProfiPlugin: public Plugin {
40  public:
41  explicit StageProfiPlugin(PluginAdaptor *plugin_adaptor):
42  Plugin(plugin_adaptor) {}
43  ~StageProfiPlugin() {}
44 
45  string Name() const { return PLUGIN_NAME; }
46  ola_plugin_id Id() const { return OLA_PLUGIN_STAGEPROFI; }
47  string Description() const;
48  int SocketClosed(ConnectedDescriptor *socket);
49  string PluginPrefix() const { return PLUGIN_PREFIX; }
50 
51  private:
52  bool StartHook();
53  bool StopHook();
54  bool SetDefaultPreferences();
55  void DeleteDevice(StageProfiDevice *device);
56 
57  std::vector<StageProfiDevice*> m_devices; // list of our devices
58 
59  static const char STAGEPROFI_DEVICE_PATH[];
60  static const char STAGEPROFI_DEVICE_NAME[];
61  static const char PLUGIN_NAME[];
62  static const char PLUGIN_PREFIX[];
63  static const char DEVICE_KEY[];
64 };
65 } // namespace stageprofi
66 } // namespace plugin
67 } // namespace ola
68 #endif // PLUGINS_STAGEPROFI_STAGEPROFIPLUGIN_H_