Fix Lua Mixer Scripts source naming (#842)
* getSourceString() return a correct string for lcdcolor when the source es a LUA script * getSourceString() return a formated string with instanceName or scriptName and outputName Co-authored-by: Runsys16 <rene.negre@orange.com>
This commit is contained in:
@@ -443,8 +443,23 @@ char * getSourceString(char * dest, mixsrc_t idx)
|
|||||||
div_t qr = div(idx-MIXSRC_FIRST_LUA, MAX_SCRIPT_OUTPUTS);
|
div_t qr = div(idx-MIXSRC_FIRST_LUA, MAX_SCRIPT_OUTPUTS);
|
||||||
if (qr.quot < MAX_SCRIPTS && qr.rem < scriptInputsOutputs[qr.quot].outputsCount) {
|
if (qr.quot < MAX_SCRIPTS && qr.rem < scriptInputsOutputs[qr.quot].outputsCount) {
|
||||||
*dest++ = CHAR_LUA;
|
*dest++ = CHAR_LUA;
|
||||||
// *dest++ = '1'+qr.quot;
|
// temporary string
|
||||||
strcpy(dest, scriptInputsOutputs[qr.quot].outputs[qr.rem].name);
|
#define MAX_CHAR 16
|
||||||
|
char temp[MAX_CHAR];
|
||||||
|
strncpy( temp, g_model.scriptsData[qr.quot].name, MAX_CHAR );
|
||||||
|
|
||||||
|
// instance Name is empty : dest = n-ScriptFileName/OutputName
|
||||||
|
if ( temp[0]== 0) {
|
||||||
|
snprintf( temp, MAX_CHAR, "%d-%s/%s", qr.quot+1,
|
||||||
|
g_model.scriptsData[qr.quot].file,
|
||||||
|
scriptInputsOutputs[qr.quot].outputs[qr.rem].name );
|
||||||
|
// instance Name is not empty : dest = InstanceName/OutputName
|
||||||
|
} else {
|
||||||
|
snprintf( temp, MAX_CHAR, "%s/%s", g_model.scriptsData[qr.quot].name,
|
||||||
|
scriptInputsOutputs[qr.quot].outputs[qr.rem].name );
|
||||||
|
}
|
||||||
|
|
||||||
|
strcpy( dest, temp);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
strcpy(dest, "N/A");
|
strcpy(dest, "N/A");
|
||||||
|
|||||||
Reference in New Issue
Block a user