Open Ephys GUI
 All Classes Functions Variables Pages
WiFiOutput.h
1 /*
2  ------------------------------------------------------------------
3 
4  This file is part of the Open Ephys GUI
5  Copyright (C) 2012 Open Ephys
6 
7  ------------------------------------------------------------------
8 
9  This program is free software: you can redistribute it and/or modify
10  it under the terms of the GNU General Public License as published by
11  the Free Software Foundation, either version 3 of the License, or
12  (at your option) any later version.
13 
14  This program is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  GNU General Public License for more details.
18 
19  You should have received a copy of the GNU General Public License
20  along with this program. If not, see <http://www.gnu.org/licenses/>.
21 
22 */
23 
24 #ifndef __WIFIOUTPUT_H_94D625CE__
25 #define __WIFIOUTPUT_H_94D625CE__
26 
27 
28 #include "../../JuceLibraryCode/JuceHeader.h"
29 #include "GenericProcessor.h"
30 #include "Editors/WiFiOutputEditor.h"
31 
32 #include "../Network/PracticalSocket.h" // For UDPSocket and SocketException
33 
34 /**
35 
36  Allows the signal chain to send outputs to a client with a specific
37  IP address; used in conjunction with the Arduino WiFly shield, these
38  signals can be sent wirelessly.
39 
40  @see GenericProcessor, WiFiOutputEditor
41 
42 */
43 
44 
45 class FilterViewport;
46 
48  public Timer
49 
50 {
51 public:
52 
53  WiFiOutput();
54  ~WiFiOutput();
55 
56  void process(AudioSampleBuffer &buffer, MidiBuffer &midiMessages, int& nSamples);
57  void setParameter (int parameterIndex, float newValue);
58 
59  void handleEvent(int eventType, MidiMessage& event);
60 
61  AudioProcessorEditor* createEditor();
62 
63  bool isSink() {return true;}
64 
65 private:
66 
67  UDPSocket socket;
68 
69  void timerCallback();
70 
71  JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (WiFiOutput);
72 
73 };
74 
75 
76 #endif // __WIFIOUTPUT_H_94D625CE__