File tree Expand file tree Collapse file tree 1 file changed +25
-1
lines changed
Source/Processors/RecordNode Expand file tree Collapse file tree 1 file changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -299,7 +299,31 @@ String RecordNode::handleConfigMessage (const String& msg)
299299 {
300300 RecordNodeEditor* ed = static_cast <RecordNodeEditor*> (getEditor ());
301301
302- int engineIndex = tokens[1 ].getIntValue ();
302+ String engineValue = tokens[1 ];
303+ int engineIndex = -1 ;
304+
305+ // Try to parse as an integer first
306+ if (engineValue.containsOnly (" 0123456789" ))
307+ {
308+ engineIndex = engineValue.getIntValue ();
309+ }
310+ else // If not an integer, try to match by name
311+ {
312+ auto engines = getAvailableRecordEngines ();
313+ for (int i = 0 ; i < engines.size (); ++i)
314+ {
315+ if (engines[i]->getID ().toLowerCase () == engineValue.toLowerCase ())
316+ {
317+ engineIndex = i;
318+ break ;
319+ }
320+ }
321+
322+ if (engineIndex == -1 )
323+ {
324+ return " Record Node: unknown engine name \" " + engineValue + " \" " ;
325+ }
326+ }
303327
304328 int numEngines = ((CategoricalParameter*) getParameter (" engine" ))->getCategories ().size ();
305329
You can’t perform that action at this time.
0 commit comments