Skip to content

Commit 127d99c

Browse files
committed
Merge pull request #22 from aacuevas/RecordingThread
Recording disk writes dedicated thread
2 parents f58d181 + 92489a6 commit 127d99c

35 files changed

Lines changed: 1249 additions & 363 deletions

Builds/Linux/Makefile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,8 @@ OBJECTS := \
106106
$(OBJDIR)/ParameterEditor_112258eb.o \
107107
$(OBJDIR)/Parameter_b3e5ac9e.o \
108108
$(OBJDIR)/ProcessorGraph_8c3a250a.o \
109+
$(OBJDIR)/DataQueue_d6cc297a.o \
110+
$(OBJDIR)/RecordThread_fb797372.o \
109111
$(OBJDIR)/EngineConfigWindow_4fd44ceb.o \
110112
$(OBJDIR)/OriginalRecording_d6dc3293.o \
111113
$(OBJDIR)/RecordEngine_97ef83aa.o \
@@ -442,6 +444,16 @@ $(OBJDIR)/ProcessorGraph_8c3a250a.o: ../../Source/Processors/ProcessorGraph/Proc
442444
@echo "Compiling ProcessorGraph.cpp"
443445
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
444446

447+
$(OBJDIR)/DataQueue_d6cc297a.o: ../../Source/Processors/RecordNode/DataQueue.cpp
448+
-@mkdir -p $(OBJDIR)
449+
@echo "Compiling DataQueue.cpp"
450+
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
451+
452+
$(OBJDIR)/RecordThread_fb797372.o: ../../Source/Processors/RecordNode/RecordThread.cpp
453+
-@mkdir -p $(OBJDIR)
454+
@echo "Compiling RecordThread.cpp"
455+
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
456+
445457
$(OBJDIR)/EngineConfigWindow_4fd44ceb.o: ../../Source/Processors/RecordNode/EngineConfigWindow.cpp
446458
-@mkdir -p $(OBJDIR)
447459
@echo "Compiling EngineConfigWindow.cpp"

Builds/MacOSX/open-ephys.xcodeproj/project.pbxproj

Lines changed: 23 additions & 9 deletions
Large diffs are not rendered by default.

Builds/VisualStudio2012/open-ephys.vcxproj

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,8 @@
310310
<ClCompile Include="..\..\Source\Processors\Parameter\ParameterEditor.cpp"/>
311311
<ClCompile Include="..\..\Source\Processors\Parameter\Parameter.cpp"/>
312312
<ClCompile Include="..\..\Source\Processors\ProcessorGraph\ProcessorGraph.cpp"/>
313+
<ClCompile Include="..\..\Source\Processors\RecordNode\DataQueue.cpp"/>
314+
<ClCompile Include="..\..\Source\Processors\RecordNode\RecordThread.cpp"/>
313315
<ClCompile Include="..\..\Source\Processors\RecordNode\EngineConfigWindow.cpp"/>
314316
<ClCompile Include="..\..\Source\Processors\RecordNode\OriginalRecording.cpp"/>
315317
<ClCompile Include="..\..\Source\Processors\RecordNode\RecordEngine.cpp"/>
@@ -1525,6 +1527,9 @@
15251527
<ClInclude Include="..\..\Source\Processors\Parameter\ParameterEditor.h"/>
15261528
<ClInclude Include="..\..\Source\Processors\Parameter\Parameter.h"/>
15271529
<ClInclude Include="..\..\Source\Processors\ProcessorGraph\ProcessorGraph.h"/>
1530+
<ClInclude Include="..\..\Source\Processors\RecordNode\DataQueue.h"/>
1531+
<ClInclude Include="..\..\Source\Processors\RecordNode\EventQueue.h"/>
1532+
<ClInclude Include="..\..\Source\Processors\RecordNode\RecordThread.h"/>
15281533
<ClInclude Include="..\..\Source\Processors\RecordNode\EngineConfigWindow.h"/>
15291534
<ClInclude Include="..\..\Source\Processors\RecordNode\OriginalRecording.h"/>
15301535
<ClInclude Include="..\..\Source\Processors\RecordNode\RecordEngine.h"/>

Builds/VisualStudio2012/open-ephys.vcxproj.filters

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,12 @@
571571
<ClCompile Include="..\..\Source\Processors\ProcessorGraph\ProcessorGraph.cpp">
572572
<Filter>open-ephys\Source\Processors\ProcessorGraph</Filter>
573573
</ClCompile>
574+
<ClCompile Include="..\..\Source\Processors\RecordNode\DataQueue.cpp">
575+
<Filter>open-ephys\Source\Processors\RecordNode</Filter>
576+
</ClCompile>
577+
<ClCompile Include="..\..\Source\Processors\RecordNode\RecordThread.cpp">
578+
<Filter>open-ephys\Source\Processors\RecordNode</Filter>
579+
</ClCompile>
574580
<ClCompile Include="..\..\Source\Processors\RecordNode\EngineConfigWindow.cpp">
575581
<Filter>open-ephys\Source\Processors\RecordNode</Filter>
576582
</ClCompile>
@@ -2073,6 +2079,15 @@
20732079
<ClInclude Include="..\..\Source\Processors\ProcessorGraph\ProcessorGraph.h">
20742080
<Filter>open-ephys\Source\Processors\ProcessorGraph</Filter>
20752081
</ClInclude>
2082+
<ClInclude Include="..\..\Source\Processors\RecordNode\DataQueue.h">
2083+
<Filter>open-ephys\Source\Processors\RecordNode</Filter>
2084+
</ClInclude>
2085+
<ClInclude Include="..\..\Source\Processors\RecordNode\EventQueue.h">
2086+
<Filter>open-ephys\Source\Processors\RecordNode</Filter>
2087+
</ClInclude>
2088+
<ClInclude Include="..\..\Source\Processors\RecordNode\RecordThread.h">
2089+
<Filter>open-ephys\Source\Processors\RecordNode</Filter>
2090+
</ClInclude>
20762091
<ClInclude Include="..\..\Source\Processors\RecordNode\EngineConfigWindow.h">
20772092
<Filter>open-ephys\Source\Processors\RecordNode</Filter>
20782093
</ClInclude>

Builds/VisualStudio2013/open-ephys.sln

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,31 @@
1-
Microsoft Visual Studio Solution File, Format Version 11.00
1+
Microsoft Visual Studio Solution File, Format Version 12.00
22
# Visual Studio 2013
3-
Project("{5A05F353-1D63-394C-DFB0-981BB2309002}") = "open-ephys", "open-ephys.vcxproj", "{9C924D66-7DEC-1AEF-B375-DB8666BFB909}"
3+
VisualStudioVersion = 12.0.40629.0
4+
MinimumVisualStudioVersion = 10.0.40219.1
5+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "open-ephys", "open-ephys.vcxproj", "{9C924D66-7DEC-1AEF-B375-DB8666BFB909}"
46
EndProject
57
Global
68
GlobalSection(SolutionConfigurationPlatforms) = preSolution
79
Debug|Win32 = Debug|Win32
8-
Release|Win32 = Release|Win32
10+
Debug|x64 = Debug|x64
11+
Debug64|Win32 = Debug64|Win32
912
Debug64|x64 = Debug64|x64
13+
Release|Win32 = Release|Win32
14+
Release|x64 = Release|x64
15+
Release64|Win32 = Release64|Win32
1016
Release64|x64 = Release64|x64
1117
EndGlobalSection
1218
GlobalSection(ProjectConfigurationPlatforms) = postSolution
1319
{9C924D66-7DEC-1AEF-B375-DB8666BFB909}.Debug|Win32.ActiveCfg = Debug|Win32
1420
{9C924D66-7DEC-1AEF-B375-DB8666BFB909}.Debug|Win32.Build.0 = Debug|Win32
15-
{9C924D66-7DEC-1AEF-B375-DB8666BFB909}.Release|Win32.ActiveCfg = Release|Win32
16-
{9C924D66-7DEC-1AEF-B375-DB8666BFB909}.Release|Win32.Build.0 = Release|Win32
21+
{9C924D66-7DEC-1AEF-B375-DB8666BFB909}.Debug|x64.ActiveCfg = Debug|Win32
22+
{9C924D66-7DEC-1AEF-B375-DB8666BFB909}.Debug64|Win32.ActiveCfg = Debug64|x64
1723
{9C924D66-7DEC-1AEF-B375-DB8666BFB909}.Debug64|x64.ActiveCfg = Debug64|x64
1824
{9C924D66-7DEC-1AEF-B375-DB8666BFB909}.Debug64|x64.Build.0 = Debug64|x64
25+
{9C924D66-7DEC-1AEF-B375-DB8666BFB909}.Release|Win32.ActiveCfg = Release|Win32
26+
{9C924D66-7DEC-1AEF-B375-DB8666BFB909}.Release|Win32.Build.0 = Release|Win32
27+
{9C924D66-7DEC-1AEF-B375-DB8666BFB909}.Release|x64.ActiveCfg = Release|Win32
28+
{9C924D66-7DEC-1AEF-B375-DB8666BFB909}.Release64|Win32.ActiveCfg = Release64|x64
1929
{9C924D66-7DEC-1AEF-B375-DB8666BFB909}.Release64|x64.ActiveCfg = Release64|x64
2030
{9C924D66-7DEC-1AEF-B375-DB8666BFB909}.Release64|x64.Build.0 = Release64|x64
2131
EndGlobalSection

Builds/VisualStudio2013/open-ephys.vcxproj

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,8 @@
314314
<ClCompile Include="..\..\Source\Processors\Parameter\ParameterEditor.cpp"/>
315315
<ClCompile Include="..\..\Source\Processors\Parameter\Parameter.cpp"/>
316316
<ClCompile Include="..\..\Source\Processors\ProcessorGraph\ProcessorGraph.cpp"/>
317+
<ClCompile Include="..\..\Source\Processors\RecordNode\DataQueue.cpp"/>
318+
<ClCompile Include="..\..\Source\Processors\RecordNode\RecordThread.cpp"/>
317319
<ClCompile Include="..\..\Source\Processors\RecordNode\EngineConfigWindow.cpp"/>
318320
<ClCompile Include="..\..\Source\Processors\RecordNode\OriginalRecording.cpp"/>
319321
<ClCompile Include="..\..\Source\Processors\RecordNode\RecordEngine.cpp"/>
@@ -1529,6 +1531,9 @@
15291531
<ClInclude Include="..\..\Source\Processors\Parameter\ParameterEditor.h"/>
15301532
<ClInclude Include="..\..\Source\Processors\Parameter\Parameter.h"/>
15311533
<ClInclude Include="..\..\Source\Processors\ProcessorGraph\ProcessorGraph.h"/>
1534+
<ClInclude Include="..\..\Source\Processors\RecordNode\DataQueue.h"/>
1535+
<ClInclude Include="..\..\Source\Processors\RecordNode\EventQueue.h"/>
1536+
<ClInclude Include="..\..\Source\Processors\RecordNode\RecordThread.h"/>
15321537
<ClInclude Include="..\..\Source\Processors\RecordNode\EngineConfigWindow.h"/>
15331538
<ClInclude Include="..\..\Source\Processors\RecordNode\OriginalRecording.h"/>
15341539
<ClInclude Include="..\..\Source\Processors\RecordNode\RecordEngine.h"/>

Builds/VisualStudio2013/open-ephys.vcxproj.filters

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,12 @@
571571
<ClCompile Include="..\..\Source\Processors\ProcessorGraph\ProcessorGraph.cpp">
572572
<Filter>open-ephys\Source\Processors\ProcessorGraph</Filter>
573573
</ClCompile>
574+
<ClCompile Include="..\..\Source\Processors\RecordNode\DataQueue.cpp">
575+
<Filter>open-ephys\Source\Processors\RecordNode</Filter>
576+
</ClCompile>
577+
<ClCompile Include="..\..\Source\Processors\RecordNode\RecordThread.cpp">
578+
<Filter>open-ephys\Source\Processors\RecordNode</Filter>
579+
</ClCompile>
574580
<ClCompile Include="..\..\Source\Processors\RecordNode\EngineConfigWindow.cpp">
575581
<Filter>open-ephys\Source\Processors\RecordNode</Filter>
576582
</ClCompile>
@@ -2073,6 +2079,15 @@
20732079
<ClInclude Include="..\..\Source\Processors\ProcessorGraph\ProcessorGraph.h">
20742080
<Filter>open-ephys\Source\Processors\ProcessorGraph</Filter>
20752081
</ClInclude>
2082+
<ClInclude Include="..\..\Source\Processors\RecordNode\DataQueue.h">
2083+
<Filter>open-ephys\Source\Processors\RecordNode</Filter>
2084+
</ClInclude>
2085+
<ClInclude Include="..\..\Source\Processors\RecordNode\EventQueue.h">
2086+
<Filter>open-ephys\Source\Processors\RecordNode</Filter>
2087+
</ClInclude>
2088+
<ClInclude Include="..\..\Source\Processors\RecordNode\RecordThread.h">
2089+
<Filter>open-ephys\Source\Processors\RecordNode</Filter>
2090+
</ClInclude>
20762091
<ClInclude Include="..\..\Source\Processors\RecordNode\EngineConfigWindow.h">
20772092
<Filter>open-ephys\Source\Processors\RecordNode</Filter>
20782093
</ClInclude>

Source/CoreServices.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,16 @@ void setAppendTextToRecordingDir(String text)
107107
getControlPanel()->setAppendText(text);
108108
}
109109

110+
String getSelectedRecordEngineId()
111+
{
112+
return getControlPanel()->getSelectedRecordEngineId();
113+
}
114+
115+
bool setSelectedRecordEngineId(String id)
116+
{
117+
return getControlPanel()->setSelectedRecordEngineId(id);
118+
}
119+
110120
namespace RecordNode
111121
{
112122
void createNewrecordingDir()
@@ -145,7 +155,7 @@ int addSpikeElectrode(SpikeRecordInfo* elec)
145155
}
146156
};
147157

148-
PLUGIN_API const char* getApplicationResource(const char* name, int& size)
158+
const char* getApplicationResource(const char* name, int& size)
149159
{
150160
return BinaryData::getNamedResource(name, size);
151161
}

Source/CoreServices.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,14 @@ PLUGIN_API void setPrependTextToRecordingDir(String text);
7878
/** Manually set the text to be appended to the recording directory */
7979
PLUGIN_API void setAppendTextToRecordingDir(String text);
8080

81+
/** Gets the ID fo the selected Record Engine*/
82+
PLUGIN_API String getSelectedRecordEngineId();
83+
84+
/** Sets a specific RecordEngine to be used based on its id.
85+
Return true if there is an engine with the specified ID and it's possible to
86+
change the current engine or false otherwise. */
87+
PLUGIN_API bool setSelectedRecordEngineId(String id);
88+
8189
namespace RecordNode
8290
{
8391
/** Forces creation of new directory on recording */
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/*
2+
------------------------------------------------------------------
3+
4+
This file is part of the Open Ephys GUI
5+
Copyright (C) 2013 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+
/*
25+
This file references the CoreServices namespace header, in case a plugin type that usually doesn't
26+
access this namespace (FileSource, for example) needs, as a particular case, use its functionality
27+
*/
28+
29+
#include "../../CoreServices.h"

0 commit comments

Comments
 (0)