Open Lighting Architecture  0.9.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SunliteFactory.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  * SunliteFactory.h
17  * The WidgetFactory for SunLite widgets.
18  * Copyright (C) 2014 Simon Newton
19  */
20 
21 #ifndef PLUGINS_USBDMX_SUNLITEFACTORY_H_
22 #define PLUGINS_USBDMX_SUNLITEFACTORY_H_
23 
24 #include "ola/base/Macro.h"
25 #include "plugins/usbdmx/Sunlite.h"
26 #include "plugins/usbdmx/WidgetFactory.h"
27 
28 namespace ola {
29 namespace plugin {
30 namespace usbdmx {
31 
35 class SunliteFactory : public BaseWidgetFactory<Sunlite> {
36  public:
37  explicit SunliteFactory(class LibUsbAdaptor *adaptor)
38  : m_adaptor(adaptor) {}
39 
40  bool DeviceAdded(
41  WidgetObserver *observer,
42  libusb_device *usb_device,
43  const struct libusb_device_descriptor &descriptor);
44 
45  void DeviceRemoved(WidgetObserver *observer,
46  libusb_device *device);
47 
48  private:
49  class LibUsbAdaptor* const m_adaptor;
50 
51  // The product ID for widgets that are missing their firmware.
52  static const uint16_t EMPTY_PRODUCT_ID;
53  // The product ID for widgets with the firmware.
54  static const uint16_t FULL_PRODUCT_ID;
55  static const uint16_t VENDOR_ID;
56 
58 };
59 } // namespace usbdmx
60 } // namespace plugin
61 } // namespace ola
62 #endif // PLUGINS_USBDMX_SUNLITEFACTORY_H_