Frapper  1.0a
BroadcastNode.h
Go to the documentation of this file.
1 /*
2 -----------------------------------------------------------------------------
3 This source file is part of FRAPPER
4 research.animationsinstitut.de
5 sourceforge.net/projects/frapper
6 
7 Copyright (c) 2008-2009 Filmakademie Baden-Wuerttemberg, Institute of Animation
8 
9 This program is free software; you can redistribute it and/or modify it under
10 the terms of the GNU Lesser General Public License as published by the Free Software
11 Foundation; version 2.1 of the License.
12 
13 This program is distributed in the hope that it will be useful, but WITHOUT
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
16 
17 You should have received a copy of the GNU Lesser General Public License along with
18 this program; if not, write to the Free Software Foundation, Inc., 59 Temple
19 Place - Suite 330, Boston, MA 02111-1307, USA, or go to
20 http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html
21 -----------------------------------------------------------------------------
22 */
23 
33 
34 #ifndef BroadcastNode_H
35 #define BroadcastNode_H
36 
37 #include "Node.h"
38 #include <QtCore/QTimer>
39 #include <QtNetwork/QUdpSocket>
40 
41 // OGRE
42 #include "Ogre.h"
43 #if (OGRE_PLATFORM == OGRE_PLATFORM_WIN32)
44 #include <windows.h>
45 #endif
46 
47 namespace BroadcastNode {
48 using namespace Frapper;
49 
54 class BroadcastNode : public Node
55 {
56 
57  Q_OBJECT
59 
60 public: // constructors and destructors
61 
68  BroadcastNode ( QString name, ParameterGroup *parameterRoot );
69 
73  ~BroadcastNode ();
74 
75 public: // functions
76 
77 
78 public slots: //
79 
83  void setHostAddress();
84 
88  void setPort();
89 
93  void setInterval();
94 
98  void toggleRun();
99 
103  void updateTimer ();
104 
105 protected: // functions
106 
107 
108 private: // data
109 
113  QTimer *m_timer;
114 
118  QUdpSocket *m_udpSocket;
119 
123  QHostAddress m_hostAddress;
124 
128  unsigned int m_port;
129 
133  unsigned int m_sequenceIdHigh;
134  unsigned int m_sequenceIdLow;
135 };
136 
137 } // namespace BroadcastNode
138 
139 #endif