Open Lighting Architecture  0.9.1
 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
15  *
16  * StageProfiPlugin.h
17  * Interface for the stageprofi plugin class
18  * Copyright (C) 2006 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 
34 class StageProfiDevice;
35 
36 class StageProfiPlugin: public Plugin {
37  public:
38  explicit StageProfiPlugin(PluginAdaptor *plugin_adaptor):
39  Plugin(plugin_adaptor) {}
40  ~StageProfiPlugin() {}
41 
42  std::string Name() const { return PLUGIN_NAME; }
43  ola_plugin_id Id() const { return OLA_PLUGIN_STAGEPROFI; }
44  std::string Description() const;
45  int SocketClosed(ola::io::ConnectedDescriptor *socket);
46  std::string PluginPrefix() const { return PLUGIN_PREFIX; }
47 
48  private:
49  bool StartHook();
50  bool StopHook();
51  bool SetDefaultPreferences();
52  void DeleteDevice(StageProfiDevice *device);
53 
54  std::vector<StageProfiDevice*> m_devices; // list of our devices
55 
56  static const char STAGEPROFI_DEVICE_PATH[];
57  static const char STAGEPROFI_DEVICE_NAME[];
58  static const char PLUGIN_NAME[];
59  static const char PLUGIN_PREFIX[];
60  static const char DEVICE_KEY[];
61 };
62 } // namespace stageprofi
63 } // namespace plugin
64 } // namespace ola
65 #endif // PLUGINS_STAGEPROFI_STAGEPROFIPLUGIN_H_