summaryrefslogtreecommitdiff
path: root/receiver/src/ofApp.h
blob: d8a9526576834c3b4f2546b66b676ef6b539420d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
/*

	OpenFrameworks NDI receiver example

	using the NDI SDK to receive frames via network

	http://NDI.NewTek.com

	Copyright (C) 2016-2017 Lynn Jarvis.

	http://www.spout.zeal.co

	=========================================================================
	This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
	=========================================================================
*/
#pragma once

#include "ofMain.h"
#include "ofxNDI.h" // NDI classes

#include "ofxNDIdialog.h" // for the sender dialog
//
// Also if you want to use the sender selection dialog,
// include in your project from the ofxNDI addon source files :
//     ofxNDIdialog.h
//     ofxNDIdialog.cpp
//     resource.h
//     resource.rc 
// If this conflicts with existing resources, you will need to include
// the code for the dialog within your own resource files and change
// identifiers as necessary.
//

class ofApp : public ofBaseApp {

	public:

		void setup();
		void update();
		void draw();

		void keyPressed(int key);
		void keyReleased(int key);
		void mouseMoved(int x, int y );
		void mouseDragged(int x, int y, int button);
		void mousePressed(int x, int y, int button);
		void mouseReleased(int x, int y, int button);
		void mouseEntered(int x, int y);
		void mouseExited(int x, int y);
		void windowResized(int w, int h);
		void dragEvent(ofDragInfo dragInfo);
		void gotMessage(ofMessage msg);
	
		ofxNDIreceiver ndiReceiver; // NDI receiver object
		ofxNDIdialog ndiDialog;     // for the sender dialog

		ofImage ndiImage;           // Image used for pixel transfer and display
		char senderName[256];	    // Sender name used by a receiver
		int nSenders;
		unsigned int senderWidth;
		unsigned int senderHeight;
		bool bNDIreceiver;

		// For received frame fps calculations
		double startTime, lastTime, frameTime, frameRate, fps;



};