sdkAddSettingsLineString() takes the address of a pointer.
When the settings line string is changed in the settings panel, Usine allocates memory and writes a Unicode representation of the string to that memory, then modifies the pointer to point to the Unicode string.
However, there is no proper way in the SDK to set the setting string in a User Module.
It is possible to alter the string up to the size allocated by Usine, but this is really a hack, and you cannot assign a longer string.
I thought that sdkGetSettingValue() and sdkSetSettingValue() could be used to do this, but sdkGetSettingValue() always causes Usine to crash.
Can we please have a method to set the setting line string in the SDK ?
For example, something like sdkSetSettingsLineString(string).
For previous discussion on this matter, see
https://sensomusic.org/forums/viewtopic.php?id=5999
Thanks,
Simon.
SDK method to set a Settings Line String.
-
sm_jamieson
- Member
- Posts: 555
- Contact:
This is still an issue.
We need a way to set the SettingsLineString from within the SDK.
Thanks,
Simon.
We need a way to set the SettingsLineString from within the SDK.
Thanks,
Simon.
-
sm_jamieson
- Member
- Posts: 555
- Contact:
Well, I have found the problem with sdkGetSettingValue().
It is defined like this:
/// Getter for an existing setting line entry
inline UsineEventPtr sdkGetSettingValue(AnsiCharPtr settingName)
{
UsineEventPtr settingEvent = nullptr;
m_masterInfo->GetSettingValue(m_moduleInfo, settingName, settingEvent);
return settingEvent;
}
But the SDK is wrong.The GetSettingValue need an existing event, not a null pointer.
This works for a sdkAddSettingLineSingle() :-
UsineEventPtr event;
m_masterInfo->GetSettingValue(m_moduleInfo, "Minimum value", event);
float val = sdkGetEvtData(event);
sdkSetSettingValue("Maximum value", event); // copy event to another setting
However this does not work for a sdkAddSettingsLineString() :-
m_masterInfo->GetSettingValue(m_moduleInfo, "Parameter Name", event);
AnsiCharPtr pname = sdkGetEvtPChar(event);
sdkSetSettingValue("Parameter Name 2", event); // does not work - text is blanked in setting
I have not tried all the other setting line types.
But the problem still exists. You cannot set a setting line string from within a User Module.
I have tried on recent Usine version 3.0.186.
Can we please have a method to set the setting line string in the SDK ?
Either make sdkSetSettingValue() work for strings (best solution) or add something like
sdkSetSettingsLineString("Param Name", string).
Thanks,
Simon.
It is defined like this:
/// Getter for an existing setting line entry
inline UsineEventPtr sdkGetSettingValue(AnsiCharPtr settingName)
{
UsineEventPtr settingEvent = nullptr;
m_masterInfo->GetSettingValue(m_moduleInfo, settingName, settingEvent);
return settingEvent;
}
But the SDK is wrong.The GetSettingValue need an existing event, not a null pointer.
This works for a sdkAddSettingLineSingle() :-
UsineEventPtr event;
m_masterInfo->GetSettingValue(m_moduleInfo, "Minimum value", event);
float val = sdkGetEvtData(event);
sdkSetSettingValue("Maximum value", event); // copy event to another setting
However this does not work for a sdkAddSettingsLineString() :-
m_masterInfo->GetSettingValue(m_moduleInfo, "Parameter Name", event);
AnsiCharPtr pname = sdkGetEvtPChar(event);
sdkSetSettingValue("Parameter Name 2", event); // does not work - text is blanked in setting
I have not tried all the other setting line types.
But the problem still exists. You cannot set a setting line string from within a User Module.
I have tried on recent Usine version 3.0.186.
Can we please have a method to set the setting line string in the SDK ?
Either make sdkSetSettingValue() work for strings (best solution) or add something like
sdkSetSettingsLineString("Param Name", string).
Thanks,
Simon.
-
sm_jamieson
- Member
- Posts: 555
- Contact:
This issue was reported as a bug, and a solution is on the way.
Simon.
Simon.
yes in the V188
Olivier Sens
www.brainmodular.com
www.brainmodular.com
-
sm_jamieson
- Member
- Posts: 555
- Contact:
I have tested with V188 and it works fine.
So the issue is resolved.
Thanks all.
Simon.
So the issue is resolved.
Thanks all.
Simon.
Who is online
Users browsing this forum: No registered users and 16 guests
