Skip to content

Commit e9d2e5a

Browse files
committed
Add patch to load older saved files
1 parent c1456b3 commit e9d2e5a

2 files changed

Lines changed: 36 additions & 7 deletions

File tree

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.31101.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

Source/UI/EditorViewport.cpp

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1466,6 +1466,7 @@ const String EditorViewport::loadState(File fileToLoad)
14661466

14671467
bool sameVersion = false;
14681468
bool pluginAPI = false;
1469+
bool rhythmNodePatch = false;
14691470
String versionString;
14701471

14711472
forEachXmlChildElement(*xml, element)
@@ -1477,8 +1478,12 @@ const String EditorViewport::loadState(File fileToLoad)
14771478
if (element2->hasTagName("VERSION"))
14781479
{
14791480
versionString = element2->getAllSubText();
1480-
// float majorVersion = versionString.upToFirstOccurrenceOf(".", false, true).getIntValue();
1481-
// float minorVersion = versionString.fromFirstOccurrenceOf(".", false, true).getFloatValue();
1481+
StringArray tokens;
1482+
tokens.addTokens(versionString, ".", String::empty);
1483+
1484+
//Patch to correctly load saved chains from before 0.4.4
1485+
if (tokens[0].getIntValue() == 0 && tokens[1].getIntValue() == 4 && tokens[2].getIntValue() < 4)
1486+
rhythmNodePatch = true;
14821487

14831488
if (versionString.equalsIgnoreCase(JUCEApplication::getInstance()->getApplicationVersion()))
14841489
sameVersion = true;
@@ -1570,6 +1575,20 @@ const String EditorViewport::loadState(File fileToLoad)
15701575
procDesc.add(processor->getIntAttribute("libraryVersion"));
15711576
procDesc.add(processor->getBoolAttribute("isSource"));
15721577
procDesc.add(processor->getBoolAttribute("isSink"));
1578+
1579+
if (rhythmNodePatch) //old version, when rhythm was a plugin
1580+
{
1581+
if (int(procDesc[2]) == -1) //if builtin
1582+
{
1583+
if (int(procDesc[3]) == 0) //Rhythm node
1584+
{
1585+
procDesc.set(2, 4); //DataThread
1586+
procDesc.set(3, 1); //index
1587+
procDesc.set(4, "Rhytm FPGA"); //libraryName
1588+
}
1589+
}
1590+
}
1591+
15731592
SourceDetails sd = SourceDetails(procDesc,
15741593
0,
15751594
Point<int>(0,0));

0 commit comments

Comments
 (0)