Lumiverse  2.5
A framework for creating lighting control applications
ArtNetInterface.h
Go to the documentation of this file.
1 
4 #ifndef _ARTNETINTERFACE_H_
5 #define _ARTNETINTERFACE_H_
6 
7 #pragma once
8 #include "LumiverseCoreConfig.h"
9 
10 #ifdef USE_ARTNET
11 
12 #include <lib/libartnet/artnet.h>
13 #include <lib/libjson/libjson.h>
14 
15 #include "DMXInterface.h"
16 #include "Logger.h"
17 #include <string>
18 #include <sstream>
19 #include <iostream>
20 #include <set>
21 
22 namespace Lumiverse {
31  class ArtNetInterface : public DMXInterface
32  {
33  public:
43  ArtNetInterface(string id, string ip, string broadcast = "", bool verbose = false);
44 
45  ~ArtNetInterface();
46 
47  virtual void init();
48 
49  virtual void sendDMX(unsigned char* data, unsigned int universe);
50 
51  virtual void closeInt();
52 
53  virtual void reset();
54 
55  virtual JSONNode toJSON();
56 
57  virtual string getInterfaceType() { return "ArtNetInterface"; }
58 
59  string getIP() { return m_ip; }
60  void setIP(string ip) { m_ip = ip; }
61 
62  string getBroadcast() { return m_broadcast; }
63  void setBroadcast(string bc) { m_broadcast = bc; }
64 
65  private:
66  void initUniverse(int universe);
67 
68  string m_ip;
69  string m_broadcast;
70  bool m_verbose;
71  bool m_connected;
72 
73  artnet_node m_node;
74 
81  set<int> m_universes;
82  };
83 }
84 
85 #endif
86 
87 #endif
void init(const char *jsonPatchStr, const char *filename)
Initializes data structures.
Definition: Dumiverse.cpp:29
Contains functions for logging information to console or file.
Base class describing how DMX Interfaces should act.
Contains all core Lumiverse functions and variables.
Definition: Device.cpp:2