Skip to content
Snippets Groups Projects
Commit be70d18a authored by Aaron Cuevas Lopez's avatar Aaron Cuevas Lopez
Browse files

Add CoreServices methods to set and get the selected record engine

parent d4c7a7ed
No related branches found
No related tags found
No related merge requests found
......@@ -107,6 +107,16 @@ void setAppendTextToRecordingDir(String text)
getControlPanel()->setAppendText(text);
}
String getSelectedRecordEngineId()
{
return getControlPanel()->getSelectedRecordEngineId();
}
bool setSelectedRecordEngineId(String id)
{
return getControlPanel()->setSelectedRecordEngineId(id);
}
namespace RecordNode
{
void createNewrecordingDir()
......@@ -145,7 +155,7 @@ int addSpikeElectrode(SpikeRecordInfo* elec)
}
};
PLUGIN_API const char* getApplicationResource(const char* name, int& size)
const char* getApplicationResource(const char* name, int& size)
{
return BinaryData::getNamedResource(name, size);
}
......
......@@ -78,6 +78,14 @@ PLUGIN_API void setPrependTextToRecordingDir(String text);
/** Manually set the text to be appended to the recording directory */
PLUGIN_API void setAppendTextToRecordingDir(String text);
/** Gets the ID fo the selected Record Engine*/
PLUGIN_API String getSelectedRecordEngineId();
/** Sets a specific RecordEngine to be used based on its id.
Return true if there is an engine with the specified ID and it's possible to
change the current engine or false otherwise. */
PLUGIN_API bool setSelectedRecordEngineId(String id);
namespace RecordNode
{
/** Forces creation of new directory on recording */
......
......@@ -552,6 +552,30 @@ void ControlPanel::updateRecordEngineList()
recordSelector->setSelectedId(selectedEngine, sendNotification);
}
String ControlPanel::getSelectedRecordEngineId()
{
return recordEngines[recordSelector->getSelectedId() - 1]->getID();
}
bool ControlPanel::setSelectedRecordEngineId(String id)
{
if (getAcquisitionState())
{
return false;
}
int nEngines = recordEngines.size();
for (int i = 0; i < nEngines; ++i)
{
if (recordEngines[i]->getID() == id)
{
recordSelector->setSelectedId(i + 1, sendNotificationSync);
return true;
}
}
return false;
}
void ControlPanel::createPaths()
{
/* int w = getWidth() - 325;
......
......@@ -365,6 +365,10 @@ public:
void updateRecordEngineList();
String getSelectedRecordEngineId();
bool setSelectedRecordEngineId(String id);
ScopedPointer<RecordButton> recordButton;
private:
ScopedPointer<PlayButton> playButton;
......
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