OpenEphysLib file
All plugins need a fixed set of exported functions and info structures to allow the Plugin Manager inside the core GUI to know about the plugin, which functionalities it provides and if it is compatible with the running version. All these information is located in the OpenEphysLib.cpp file in each plugin. While actually having a file named this way is not required, it is recommended to ease identification of these structures by future developers. In fact, it is highly advised to use an existing OpenEphysLib.cpp as a template, like the one present in the ExampleProcessor folder, which has extensive comments documenting each function.
As a reference, here are the methods and structures used in that file. The formal definitions can be found in the OpenEphysPlugin.h file.
Macros
- NUM_PLUGINS is defined in the OpenEphysLib.cpp file as an easy to locate way to specify the number of different plugins that the library exports.
- PLUGIN_API_VER is defined in the Core GUI plugin headers and is used to ensure that the version compiled into the plugin information structures matches with the one in the codebase used to build them.
Exported Functions
- void getLibInfo (Plugin::LibraryInfo* info) allows the Plugin Manager to fill a structure with the basic information about the library, like the plugin API version used or the number of plugins available
- int getPluginInfo (int index, Plugin::PluginInfo* info) alows the Plugin Manager to fill a structure with information about a specific plugin inside the library. Return 0 if successful or -1 if the provided index does not correspond to an available plugin.
Info Structures
Library Info
This structure contains information about the library as a whole. Its fields are
- The name of the library, used for bookkeeping purposes
- The version of the library
- The plugin API version the library has been built with. If the API version of a plugin does not match with the one in the running GUI, it won't load.
- The number of different plugins present in the library
Plugin Info
This structure contains the information about a single plugin. Its fields are
- The type of plugin (Processor, DataThread, RecordEngine or FileSource)
- A C union of different structures with detailed info for each type of plugins, This field can be
- a ProcessorInfo struct
- a DataThreadInfo struct
- a RecordEngineInfo struct
- a FileSourceInfo struct
Processor Info
Contains information about a processor plugin. Its fields are
- The name of the processor, as will be shown in the processor list
- A pointer to a factory method to instantiate the processor
- The type of processor this plugin is: Source, Sink, Filter or Utility
DataThread Info
Contains information about a DataThread plugin, Its fields are
- The name of the Data Thread, as will be shown in the processor list as a source processor
- A pointer to a factory method to instantiate the DataThread
RecordEngine Info
Contains information about a RecordEngine plugin, Its fields are
- The name of the Record Engine, as will be shown in the record file format dropdown selector
- A pointer to a factory method to instantiate the RecordEngine
FileSource Info
Contains information about a File Source plugin. Its fields are
- The name of the File Source. It is kept for bookkeeping purposes, but does not currently appear in the GUI.
- A pointer to a factory method to instantiate the FileSource
- A semicolon separated list of extensions supported by the plugin