Base class for creating processor editors. More...
#include <GenericEditor.h>
Public Member Functions | |
GenericEditor (GenericProcessor *owner) | |
Constructor. | |
virtual | ~GenericEditor () |
Destructor. | |
void | paint (Graphics &g) |
Draws the editor's background. | |
bool | keyPressed (const KeyPress &key) |
Called whenever a key is pressed and the editor has keyboard focus. | |
void | switchSelectedState () |
Toggles the editor's selection state. | |
void | select () |
Highlights an editor and calls editorWasClicked(). | |
void | highlight () |
Highlights an editor. | |
void | deselect () |
Deselects an editor. | |
bool | getSelectionState () |
Returns an editor's selection state. | |
void | enable () |
Used to enable an editor's processor. | |
void | disable () |
Used to disable an editor's processor. | |
bool | getEnabledState () |
Returns whether or not the editor's processor is enabled (i.e., whether it's able to handle data. | |
void | setEnabledState (bool) |
Used to enable or disable an editor's processor. | |
void | startAcquisition () |
Called just prior to the start of acquisition, to allow the editor to prepare. | |
void | stopAcquisition () |
Called after the end of acquisition. | |
String | getName () |
Returns the name of the editor. | |
virtual void | tabNumber (int t) |
Sets the number of the editor's associated tab in the DataViewport. | |
int | tabNumber () |
Returns the number of the editor's associated tab in the DataViewport. | |
virtual void | switchSource (int) |
Required for MergerEditor only. | |
virtual void | switchSource () |
Required for MergerEditor only. | |
GenericProcessor * | getProcessor () const |
Returns the processor associated with an editor. | |
void | fadeIn () |
Causes the editor to fade in when it first appears in the EditorViewport. | |
virtual void | switchDest () |
Required for SplitterEditor only. | |
virtual void | switchIO (int) |
Required for SplitterEditor and MergerEditor only. | |
virtual void | buttonClicked (Button *button) |
Handles button clicks for all editors. | |
virtual void | buttonEvent (Button *button) |
Called by buttonClicked(). | |
virtual void | sliderValueChanged (Slider *slider) |
Handles slider events for all editors. | |
virtual void | sliderEvent (Slider *slider) |
Called by sliderValueChanged(). | |
virtual void | editorWasClicked () |
Required for opening displays in a VisualizerEditor. | |
bool | checkDrawerButton (Button *button) |
Checks to see if a button click occurred on the ChannelSelector drawer button. | |
bool | getRecordStatus (int chan) |
Returns the record status of a given channel from the ChannelSelector. | |
bool | getAudioStatus (int chan) |
Returns the audio monitoring status of a given channel from the ChannelSelector. | |
void | selectChannels (Array< int >) |
Selects all the channels in the input array. | |
void | refreshColors () |
Refreshes an editor's background colors when the user selects new ones with the ColourSelector. | |
virtual void | update () |
Called when an editor's processor updates its settings (mainly to update channel count). | |
virtual void | updateSettings () |
Called by the update() method to allow the editor to update its custom settings. | |
virtual void | updateVisualizer () |
Allows an editor to update the settings of its visualizer (such as channel count and sample rate). | |
virtual void | channelChanged (int chan) |
Used by SpikeDetectorEditor. | |
Array< int > | getActiveChannels () |
Returns all selected channels from the ChannelSelector. | |
Channel * | getChannel (int chan) |
Returns the Channel object for a given continuous channel number. | |
Channel * | getEventChannel (int chan) |
Returns the Channel object for a given event channel number. | |
![]() | |
AccessClass () | |
~AccessClass () | |
void | setUIComponent (UIComponent *) |
Sets the object's UIComponent and copies all the necessary pointers from the UIComponent. | |
virtual void | updateChildComponents () |
Called within setUIComponent() to enable subclasses to update their members' pointers. | |
EditorViewport * | getEditorViewport () |
Returns a pointer to the application's EditorViewport. | |
DataViewport * | getDataViewport () |
Returns a pointer to the application's DataViewport. | |
ProcessorList * | getProcessorList () |
Returns a pointer to the application's ProcessorList. | |
ProcessorGraph * | getProcessorGraph () |
Returns a pointer to the application's ProcessorGraph. | |
ControlPanel * | getControlPanel () |
Returns a pointer to the application's DataViewport. | |
MessageCenter * | getMessageCenter () |
Returns a pointer to the application's MessageCenter. | |
UIComponent * | getUIComponent () |
Returns a pointer to the application's UIComponent. | |
AudioComponent * | getAudioComponent () |
Returns a pointer to the application's AudioComponent. |
Public Attributes | |
int | desiredWidth |
Determines how wide the editor will be drawn. | |
int | nodeId |
The unique integer ID of the editor's processor. | |
bool | isFading |
Indicates whether or not the editor is in the processof fading in. | |
float | accumulator |
Used to control the speed at which the editor fades in. | |
Array< ParameterEditor * > | parameterEditors |
An array of pointers to ParameterEditors created based on the Parameters of an editor's underlying processor. | |
Font | titleFont |
Stores the font used to display the editor's name. |
Protected Member Functions | |
virtual void | addParameterEditors () |
Can be overridden to customize the layout of ParameterEditors. |
Protected Attributes | |
DrawerButton * | drawerButton |
A pointer to the button that opens the drawer for the ChannelSelector. | |
int | drawerWidth |
Determines the width of the ChannelSelector drawer when opened. | |
ChannelSelector * | channelSelector |
A pointer to the editor's ChannelSelector. |
Base class for creating processor editors.
If a processor doesn't havesign an editor defined, a GenericEditor will be used.
Classes derived from this class must place their controls as child components. They shouldn't try to re-draw any aspects of their background.
GenericEditor::GenericEditor | ( | GenericProcessor * | owner | ) |
Constructor.
Loads fonts and creates default buttons.
|
virtual |
Destructor.
void GenericEditor::paint | ( | Graphics & | g | ) |
Draws the editor's background.
bool GenericEditor::keyPressed | ( | const KeyPress & | key | ) |
Called whenever a key is pressed and the editor has keyboard focus.
void GenericEditor::switchSelectedState | ( | ) |
Toggles the editor's selection state.
void GenericEditor::select | ( | ) |
Highlights an editor and calls editorWasClicked().
void GenericEditor::highlight | ( | ) |
Highlights an editor.
void GenericEditor::deselect | ( | ) |
Deselects an editor.
bool GenericEditor::getSelectionState | ( | ) |
Returns an editor's selection state.
void GenericEditor::enable | ( | ) |
Used to enable an editor's processor.
Reimplemented in VisualizerEditor.
void GenericEditor::disable | ( | ) |
Used to disable an editor's processor.
Reimplemented in VisualizerEditor.
bool GenericEditor::getEnabledState | ( | ) |
Returns whether or not the editor's processor is enabled (i.e., whether it's able to handle data.
void GenericEditor::setEnabledState | ( | bool | ) |
Used to enable or disable an editor's processor.
void GenericEditor::startAcquisition | ( | ) |
Called just prior to the start of acquisition, to allow the editor to prepare.
Reimplemented in ResamplingNodeEditor.
void GenericEditor::stopAcquisition | ( | ) |
Called after the end of acquisition.
Reimplemented in ResamplingNodeEditor.
String GenericEditor::getName | ( | ) |
Returns the name of the editor.
|
virtual |
Sets the number of the editor's associated tab in the DataViewport.
int GenericEditor::tabNumber | ( | ) |
Returns the number of the editor's associated tab in the DataViewport.
|
virtual |
Required for MergerEditor only.
Reimplemented in MergerEditor.
|
virtual |
Required for MergerEditor only.
Reimplemented in MergerEditor.
GenericProcessor* GenericEditor::getProcessor | ( | ) | const |
Returns the processor associated with an editor.
void GenericEditor::fadeIn | ( | ) |
Causes the editor to fade in when it first appears in the EditorViewport.
|
virtual |
Required for SplitterEditor only.
Reimplemented in SplitterEditor.
|
virtual |
Required for SplitterEditor and MergerEditor only.
Reimplemented in MergerEditor, and SplitterEditor.
|
virtual |
Handles button clicks for all editors.
Deals with clicks on the editor's title bar and channel selector drawer.
|
virtual |
Called by buttonClicked().
Deals with clicks on custom buttons. Subclasses of GenericEditor should modify this method only.
Reimplemented in SpikeDetectorEditor, VisualizerEditor, MergerEditor, SplitterEditor, SignalGeneratorEditor, EventNodeEditor, FilterEditor, and ReferenceNodeEditor.
|
virtual |
Handles slider events for all editors.
|
virtual |
Called by sliderValueChanged().
Deals with clicks on custom sliders. Subclasses of GenericEditor should modify this method only.
Reimplemented in SpikeDetectorEditor, and SignalGeneratorEditor.
|
virtual |
Required for opening displays in a VisualizerEditor.
Hopefully will be deprecated soon.
Reimplemented in VisualizerEditor.
bool GenericEditor::checkDrawerButton | ( | Button * | button | ) |
Checks to see if a button click occurred on the ChannelSelector drawer button.
bool GenericEditor::getRecordStatus | ( | int | chan | ) |
Returns the record status of a given channel from the ChannelSelector.
bool GenericEditor::getAudioStatus | ( | int | chan | ) |
Returns the audio monitoring status of a given channel from the ChannelSelector.
void GenericEditor::selectChannels | ( | Array< int > | ) |
Selects all the channels in the input array.
void GenericEditor::refreshColors | ( | ) |
Refreshes an editor's background colors when the user selects new ones with the ColourSelector.
|
virtual |
Called when an editor's processor updates its settings (mainly to update channel count).
|
virtual |
Called by the update() method to allow the editor to update its custom settings.
Reimplemented in RecordControlEditor.
|
virtual |
Allows an editor to update the settings of its visualizer (such as channel count and sample rate).
Reimplemented in VisualizerEditor.
|
virtual |
Used by SpikeDetectorEditor.
Reimplemented in SpikeDetectorEditor.
Array<int> GenericEditor::getActiveChannels | ( | ) |
Returns all selected channels from the ChannelSelector.
Channel* GenericEditor::getChannel | ( | int | chan | ) |
Returns the Channel object for a given continuous channel number.
Channel* GenericEditor::getEventChannel | ( | int | chan | ) |
Returns the Channel object for a given event channel number.
|
protectedvirtual |
Can be overridden to customize the layout of ParameterEditors.
Reimplemented in SignalGeneratorEditor.
int GenericEditor::desiredWidth |
Determines how wide the editor will be drawn.
int GenericEditor::nodeId |
The unique integer ID of the editor's processor.
bool GenericEditor::isFading |
Indicates whether or not the editor is in the processof fading in.
float GenericEditor::accumulator |
Used to control the speed at which the editor fades in.
Array<ParameterEditor*> GenericEditor::parameterEditors |
An array of pointers to ParameterEditors created based on the Parameters of an editor's underlying processor.
Font GenericEditor::titleFont |
Stores the font used to display the editor's name.
|
protected |
A pointer to the button that opens the drawer for the ChannelSelector.
|
protected |
Determines the width of the ChannelSelector drawer when opened.
|
protected |
A pointer to the editor's ChannelSelector.