Skip to content

Commit 7825845

Browse files
authored
Merge pull request #385 from DropSnorz/fix/reaper-parser-quote
Remove quotes in parsed reaper plugin name
2 parents 4ed4d33 + 1f5f617 commit 7825845

File tree

4 files changed

+11
-4
lines changed

4 files changed

+11
-4
lines changed

owlplug-parsers/src/main/java/com/owlplug/parsers/reaper/PluginNodeListener.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,18 +50,21 @@ public void enterNode(ReaperProjectParser.NodeContext ctx) {
5050
}
5151

5252
ReaperPlugin plugin = new ReaperPlugin();
53+
54+
// Extract first node positional parameter (name)
5355
if (ctx.value().size() > 0) {
5456
plugin.setName(ctx.value(0).getText().replaceAll("\"", ""));
5557
}
58+
// Extract second node positional parameter (filename)
5659
if (ctx.value().size() > 1) {
57-
plugin.setFilename(ctx.value(1).getText());
60+
plugin.setFilename(ctx.value(1).getText().replaceAll("\"", ""));
5861
}
62+
// Extract fifth node positional parameter (rawId)
5963
if (ctx.value().size() > 4) {
6064
plugin.setRawId(ctx.value(4).getText());
6165
}
6266
reaperPlugins.add(plugin);
6367

64-
6568
}
6669

6770
@Override

owlplug-parsers/src/test/java/com/owlplug/parsers/reaper/ReaperProjectGrammarTest.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,9 @@ public void parseReaper7File() throws IOException {
7070

7171
assertEquals(2, pluginListener.getReaperPlugins().size());
7272
assertEquals("VST3i: Tunefish4 (Brain Control)", pluginListener.getReaperPlugins().get(0).getName());
73+
assertEquals("Tunefish4.vst3", pluginListener.getReaperPlugins().get(0).getFilename());
7374
assertEquals("VSTi: Dexed (Digital Suburban)", pluginListener.getReaperPlugins().get(1).getName());
75+
assertEquals("Dexed_x64-with space.dll", pluginListener.getReaperPlugins().get(1).getFilename());
7476

7577
}
7678

@@ -94,6 +96,8 @@ public void parseAdvancedReaperFile() throws IOException {
9496

9597
assertEquals(2, pluginListener.getReaperPlugins().size());
9698
assertEquals("VST: ReaComp (Cockos)", pluginListener.getReaperPlugins().get(0).getName());
99+
assertEquals("reacomp.dll", pluginListener.getReaperPlugins().get(0).getFilename());
97100
assertEquals("VSTi: ReaSynth (Cockos)", pluginListener.getReaperPlugins().get(1).getName());
101+
assertEquals("reasynth.dll", pluginListener.getReaperPlugins().get(1).getFilename());
98102
}
99103
}

owlplug-parsers/src/test/resources/reaper/reaper7.rpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@
202202
LASTSEL 0
203203
DOCKED 0
204204
BYPASS 0 0 0
205-
<VST "VSTi: Dexed (Digital Suburban)" Dexed_x64.dll 0 "" 1147500644<56535444657864646578656400000000> ""
205+
<VST "VSTi: Dexed (Digital Suburban)" "Dexed_x64-with space.dll" 0 "" 1147500644<56535444657864646578656400000000> ""
206206
ZHhlRO5e7f4AAAAAAgAAAAEAAAAAAAAAAgAAAAAAAACWFwAAAQAAAAAAEAA=
207207
VkMyIY0XAAA8ZGV4ZWRTdGF0ZSBjdXRvZmY9IjEuMDAwMDAwMDAwMDAwMDAwMDAwMDAiIHJlc289IjAuMDAwMDAwMDAwMDAwMDAwMDAwMDAiIGdhaW49IjEuMDAwMDAw
208208
MDAwMDAwMDAwMDAwMDAiIGN1cnJlbnRQcm9ncmFtPSIwIiBtb25vTW9kZT0iMCIgZW5naW5lVHlwZT0iMSIgbWFzdGVyVHVuZT0iMCIgb3BTd2l0Y2g9IjExMTExMSIg

owlplug-parsers/src/test/resources/reaper/simpleReaperFile.rpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
ATTRIBUTE3 0 -1
44
ATTRIBUTE4 0 1 1
55
<NODE2
6-
ATTRIBUTE 1 "test1" "test2"
6+
ATTRIBUTE 1 test1 "test2" "test with spaces"
77
>
88
LANEHEIGHT 0 0
99
ARM 0

0 commit comments

Comments
 (0)