2014-10-15 3:20 GMT+02:00 Tim E. Real <[email protected]>:
> On October 14, 2014 08:18:35 PM Robert Jonsson wrote:
>> So far the only solution I found is to set the environment variable
>> LC_NUMERIC to nothing. Works, but there are surely drawbacks..
>>
>> At one point it worked due to both the string from the descriptor and
>> the stored Label had been converted, not sure what I did...
>> seems I _can_ read out the descriptor unconverted at one place so it
>> must be possible but I'm just too tired to understand ... ;o)
>>
>> Regards,
>> Robert
>>
>> 2014-10-14 19:13 GMT+02:00 Robert Jonsson <[email protected]>:
>> > Hi guys,
>> >
>> > Conversions are a problem that crops up time after time and I never
>> > know what the proper solution is so I thought I would bring it up
>> > here.
>> >
>> > This time it's decimal commas, again. Sweden has a decimal comma
>> > instead of decimal point.
>> > What I noticed now is that I can't load some plugins with a dot in
>> > their names. For reasons I cannot fathom the string reading functions
>> > converts this dot into a comma.
>> >
>> > See for instance cmt ladspa plugin:
>> > "Delay 0.1", which is listed as "Delay 0,1".
>> > It leads to a crash, I can fix that but I can't for the life of me
>> > find the proper solution to reading this string without it being
>> > affected by conversion.
>> >
>> > I think the conversion occurs when creating the Plugin object at
>> >
>> > Plugin::Plugin(QFileInfo* f, const LADSPA_Descriptor* d, bool isDssi,
>> > bool isDssiSynth)
>> >
>> > I think it's the below line that causes it since the descriptor should
>> > just be a pointer into a memory area.
>> > _label = QString(d->Label);
>> >
>> > I tried printf("descriptor label = %s\n", d->Label);
>> > This printout is also converted.
>> >
>> > Anyone has a better understanding on the right way of reading literal
>> > strings?
>> >
>> > Regards,
>> > Robert
>>
>
>
> Quick answer, will try to investigate more...
>
> The one and only other time this issue made itself known was this:
>
> ChangeLog:
>
> 05.06.2009
> * Fixed: Users in some locales reported audio automation save/load
> corruption. (T356)
> - Changed CtrlList::read() to use QString and QLocale instead of
> strtol() and strtod().
> - Checked: Other places using QString::toDouble() work OK because
> QString will fallback
> to 'C' locale if formatting using current locale fails. (Hmm... But
> is it a speed hit?)
>
> The issue was some locales were saving controller list values like 12,3
> and others 12.3 and so on.
>
> Take a look at how I load/save the controller values in class CtrlList.
> Maybe it is what you want?
>
> I remember checking a bunch of other places to make sure they were OK,
> but that was numerals, not text.
Many thanks for the insight into QLocale, it almost should be able to
do what I want but I can't get it to import a string with the c()
locale, need to study this more.
Though it just completely baffles my mind how the following code:
LADSPA_Descriptor_Function ladspa =
(LADSPA_Descriptor_Function)dlsym(handle, "ladspa_descriptor");
const LADSPA_Descriptor* descr;
for (unsigned long i = 0;; ++i)
{
descr = ladspa(i);
* if (descr == NULL)
break;
...
can yield a string conversion if I place a break point at * and
inspect descr->Label.
I need to check some other computer if it's really supposed to work this way..
>
> And I remember this oddity if it sheds any kind of light, don't know if
> still true today:
>
> void Song::setUndoRedoText()
> {
> ...
> s += ", .."; // Hm, the tooltip will not show three dots "..."
> ...
> }
Indeed that points to some similar fuckery!
Regards,
Robert
------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
_______________________________________________
Lmuse-developer mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/lmuse-developer