Skip to content
Snippets Groups Projects
Commit 6eb47146 authored by Septen's avatar Septen
Browse files

Template files for plugins necessary changes.

parent 5ccd6197
No related branches found
No related tags found
No related merge requests found
......@@ -2,7 +2,7 @@
------------------------------------------------------------------
This file is part of the Open Ephys GUI
Copyright (C) 2014 Open Ephys
Copyright (C) 2016 Open Ephys
------------------------------------------------------------------
......@@ -21,11 +21,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "ExampleEditor.h"
#include "ExampleProcessor.h"
#include "EDITORCLASSNAME.h"
#include "FILTERCLASSNAME.h"
ExampleEditor::ExampleEditor(GenericProcessor* parentNode, bool useDefaultParameterEditors = true)
: GenericEditor(parentNode, useDefaultParameterEditors)
EDITORCLASSNAME::EDITORCLASSNAME (GenericProcessor* parentNode, bool useDefaultParameterEditors = true)
: GenericEditor (parentNode, useDefaultParameterEditors)
{
//Most used buttons are UtilityButton, which shows a simple button with text and ElectrodeButton, which is an on-off button which displays a channel.
exampleButton = new UtilityButton("Button text", Font("Default", 15, Font::plain));
......@@ -41,7 +41,7 @@ The listener methods that reacts to the button click. The same method is called
on the editor, so the button variable, which cointains a pointer to the button that called the method
has to be checked to know which function to perform.
*/
void ExampleEditor::buttonEvent(Button* button)
void EDITORCLASSNAME::buttonEvent (Button* button)
{
if (button == exampleButton)
{
......@@ -58,4 +58,4 @@ void ExampleEditor::buttonEvent(Button* button)
}
}
}
\ No newline at end of file
}
......@@ -2,7 +2,7 @@
------------------------------------------------------------------
This file is part of the Open Ephys GUI
Copyright (C) 2014 Open Ephys
Copyright (C) 2016 Open Ephys
------------------------------------------------------------------
......@@ -21,8 +21,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef EXAMPLEEDITOR_H_INCLUDED
#define EXAMPLEEDITOR_H_INCLUDED
#ifndef HEADERGUARD
#define HEADERGUARD
#include <EditorHeaders.h>
......@@ -38,17 +38,16 @@ have a single button which will set a parameter in the processor.
*/
class ExampleEditor : public GenericEditor //Generic Editor adds listeners for buttons and sliders.
//Other possible JUCE controls can be added and listened by inheriting from the appropiate XXX:Listener class
//See JUCE documentation to find other available controls.
class EDITORCLASSNAME : public GenericEditor //Generic Editor adds listeners for buttons and sliders.
//Other possible JUCE controls can be added and listened by inheriting from the appropiate XXX:Listener class
//See JUCE documentation to find other available controls.
{
public:
/** The class constructor, used to initialize any members. */
ExampleEditor(GenericProcessor* parentNode, bool useDefaultParameterEditors);
EDITORCLASSNAME (GenericProcessor* parentNode, bool useDefaultParameterEditors);
/** The class destructor, used to deallocate memory */
~ExampleEditor();
~EDITORCLASSNAME();
/**
Unlike processors, which have a minimum set of required methods,
......@@ -57,7 +56,7 @@ public:
*/
/** This method executes whenever a custom button is pressed */
void buttonEvent(Button* button);
void buttonEvent (Button* button);
/** Called to inform the editor that acquisition is about to start*/
//void startAcquisition();
......@@ -72,7 +71,6 @@ public:
private:
/**
Here would be all the required internal variables.
In this case, we have a single button.
......@@ -81,7 +79,7 @@ private:
//Always use JUCE RAII classes instead of pure pointers.
ScopedPointer<Button> exampleButton;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(ExampleEditor);
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (EDITORCLASSNAME);
};
#endif
\ No newline at end of file
#endif // HEADERGUARD
/*
------------------------------------------------------------------
This file is part of the Open Ephys GUI
Copyright (C) 2014 Open Ephys
Copyright (C) 2016 Open Ephys
------------------------------------------------------------------
......@@ -24,40 +23,37 @@
#include <stdio.h>
#include "ExampleProcessor.h"
FILTERHEADERS
//If the processor uses a custom editor, it needs its header to instantiate it
//#include "ExampleEditor.h"
ExampleProcessor::ExampleProcessor()
: GenericProcessor("Example Processor") //, threshold(200.0), state(true)
FILTERCLASSNAME::FILTERCLASSNAME()
: GenericProcessor ("FILTERCLASSNAME") //, threshold(200.0), state(true)
{
//Without a custom editor, generic parameter controls can be added
//Without a custom editor, generic parameter controls can be added
//parameters.add(Parameter("thresh", 0.0, 500.0, 200.0, 0));
}
ExampleProcessor::~ExampleProcessor()
FILTERCLASSNAME::~FILTERCLASSNAME()
{
}
/**
If the processor uses a custom editor, this method must be present.
*/
/*
AudioProcessorEditor* ExampleProcessor::createEditor()
AudioProcessorEditor* FILTERCLASSNAME::createEditor()
{
editor = new ExampleEditor(this, true);
editor = new EDITORCLASSNAME (this, true);
//std::cout << "Creating editor." << std::endl;
return editor;
}
*/
void ExampleProcessor::setParameter(int parameterIndex, float newValue)
void FILTERCLASSNAME::setParameter(int parameterIndex, float newValue)
{
//Parameter& p = parameters.getReference(parameterIndex);
......@@ -69,7 +65,7 @@ void ExampleProcessor::setParameter(int parameterIndex, float newValue)
editor->updateParameterButtons(parameterIndex);
}
void ExampleProcessor::process(AudioSampleBuffer& buffer,
void FILTERCLASSNAME::process(AudioSampleBuffer& buffer,
MidiBuffer& events)
{
/**
......@@ -123,6 +119,4 @@ void ExampleProcessor::process(AudioSampleBuffer& buffer,
}
*/
}
......@@ -2,7 +2,7 @@
------------------------------------------------------------------
This file is part of the Open Ephys GUI
Copyright (C) 2014 Open Ephys
Copyright (C) 2016 Open Ephys
------------------------------------------------------------------
......@@ -21,8 +21,8 @@
*/
#ifndef EXAMPLEPROCESSOR_H_INCLUDED
#define EXAMPLEPROCESSOR_H_INCLUDED
#ifndef HEADERGUARD
#define HEADERGUARD
#ifdef _WIN32
#include <Windows.h>
......@@ -41,16 +41,15 @@
*/
class ExampleProcessor : public GenericProcessor
class FILTERCLASSNAME : public GenericProcessor
{
public:
/** The class constructor, used to initialize any members. */
ExampleProcessor();
FILTERCLASSNAME();
/** The class destructor, used to deallocate memory */
~ExampleProcessor();
~FILTERCLASSNAME();
/** Determines whether the processor is treated as a source. */
bool isSource()
......@@ -86,12 +85,12 @@ public:
Continuous signals arrive in the "buffer" variable, event data (such as TTLs
and spikes) is contained in the "events" variable.
*/
void process(AudioSampleBuffer& buffer, MidiBuffer& events);
void process (AudioSampleBuffer& buffer, MidiBuffer& events);
/** The method that standard controls on the editor will call.
It is recommended that any variables used by the "process" function
are modified only through this method while data acquisition is active. */
void setParameter(int parameterIndex, float newValue);
void setParameter (int parameterIndex, float newValue);
/** Optional method called every time the signal chain is refreshed or changed in any way.
......@@ -111,8 +110,8 @@ private:
// float threshold;
// bool state;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(ExampleProcessor);
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (FILTERCLASSNAME);
};
#endif // EXAMPLEPROCESSOR_H_INCLUDED
#endif // HEADERGUARD
......@@ -2,7 +2,7 @@
------------------------------------------------------------------
This file is part of the Open Ephys GUI
Copyright (C) 2013 Open Ephys
Copyright (C) 2016 Open Ephys
------------------------------------------------------------------
......@@ -22,7 +22,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <PluginInfo.h>
#include "ExampleProcessor.h"
#include "FILTERCLASSNAME.h"
#include <string>
#ifdef WIN32
#include <Windows.h>
......@@ -39,8 +39,8 @@ extern "C" EXPORT void getLibInfo(Plugin::LibraryInfo* info)
{
info->apiVersion = PLUGIN_API_VER; /*API version, defined by the GUI source.
Should not be changed to ensure it is always equal to the one used in the latest codebase. The GUI refueses to load plugins with mismatched API versions */
info->name = "Example library"; //Name of the Library, used only for information
info->libVersion = 1; //Version of the library, used only for information
info->name = "FILTERLIBRARYNAME"; //Name of the Library, used only for information
info->libVersion = FILTERLIBRARYVERSION; //Version of the library, used only for information
info->numPlugins = NUM_PLUGINS;
}
......@@ -52,9 +52,9 @@ extern "C" EXPORT int getPluginInfo(int index, Plugin::PluginInfo* info)
case 0:
info->type = Plugin::ProcessorPlugin; //Type of plugin. See "Source/Processors/PluginManager/OpenEphysPlugin.h" for complete info about the different type structures
//For processor
info->processor.name = "Example Processor"; //Processor name shown in the GUI
info->processor.name = "FILTERHUMANREADABLENAME"; //Processor name shown in the GUI
info->processor.type = Plugin::FilterProcessor; //Type of processor. Can be FilterProcessor, SourceProcessor, SinkProcessor or UtilityProcessor. Specifies where on the processor list will appear
info->processor.creator = &(Plugin::createProcessor<ExampleProcessor>); //Class factory pointer. Replace "ExampleProcessor" with the name of your class.
info->processor.creator = &(Plugin::createProcessor<FILTERCLASSNAME>); //Class factory pointer. Replace "ExampleProcessor" with the name of your class.
break;
/**
Examples for other plugin types
......@@ -94,4 +94,4 @@ BOOL WINAPI DllMain(IN HINSTANCE hDllHandle,
return TRUE;
}
#endif
\ No newline at end of file
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment