Open Ephys GUI
 All Classes Functions Variables
ProcessorGraph.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 __PROCESSORGRAPH_H_124F8B50__
25 #define __PROCESSORGRAPH_H_124F8B50__
26 
27 #include "../../JuceLibraryCode/JuceHeader.h"
28 
29 #include "../AccessClass.h"
30 
46 class GenericProcessor;
47 class RecordNode;
48 class AudioNode;
50 
51 class ProcessorGraph : public AudioProcessorGraph,
52  public AccessClass,
53  public ChangeListener
54 {
55 public:
57  ~ProcessorGraph();
58 
59  void* createNewProcessor(String& description);
60  GenericProcessor* createProcessorFromDescription(String& description);
61 
62  void removeProcessor(GenericProcessor* processor);
63 
64  void clearSignalChain();
65 
66  bool enableProcessors();
67  bool disableProcessors();
68 
69  RecordNode* getRecordNode();
70  AudioNode* getAudioNode();
71 
72  void updateConnections(Array<SignalChainTabButton*, CriticalSection>);
73 
74  bool processorWithSameNameExists(const String& name);
75 
76  void changeListenerCallback(ChangeBroadcaster* source);
77 
78  // void saveState();
79  // void loadState();
80 
81 private:
82 
83  int currentNodeId;
84 
85  enum nodeIds
86  {
87  RECORD_NODE_ID = 900,
88  AUDIO_NODE_ID = 901,
89  OUTPUT_NODE_ID = 902,
90  RESAMPLING_NODE_ID = 903
91  };
92 
93  void createDefaultNodes();
94  void clearConnections();
95 
96 };
97 
98 
99 
100 #endif // __PROCESSORGRAPH_H_124F8B50__