Re: Feedback on string-convert branch
Tim Mayberry <[email protected]> Thu, 5 Jan 2017 09:12:33 +1000
| Newsgroups | gmane.comp.audio.ardour.devel |
|---|---|
| Message-ID | <CAM2edBh27HTkMq0SA-=MgyPK6++Z4Nqx+q-HWTm+akWRiKiT_Q@mail.gmail.com> |
On Thu, Jan 5, 2017 at 7:14 AM, Paul Davis <[email protected]> wrote: > > > On Wed, Jan 4, 2017 at 12:52 PM, Tim Mayberry <[email protected]> wrote: > >> I've pushed a branch called string-convert to the main repository that >> I'd like >> some feedback on from the other developers when they get a chance. It >> represents a fair bit of work over the last year or so and is attempt to >> make >> improvements to the de/serialization code in Ardour. >> > > I still don't understand how this is supposed to work with plugin data. If > you leave the global locale setting untouched, how do we know what to do > when reloading plugin data across two systems where the global locale may > be different? > > Of the 100 or so LocaleGuard's in master, the 10 or so that remain are in the Plugin get/set_state methods, which is why I mentioned removing LocaleGuard's that guard internal string conversion. That some plugins depend on a specific global locale for correct operation or worse modify the global locale is dissappointing but seems to be a reality and it is accounted for in the branch. There will be some further small changes necessary to account for the recent LocaleMode changes to work correctly if the global C++ locale is used for localization of numeric data via string_compose/iostream/stringstring. In master AFAICT the LocaleMode setting won't currently work correctly for C++ level numeric conversion because as I mentioned, the PBD::LocaleGuard constructor sets the global C++ locale to "C" and then only the global C locale is reset in the LocaleGuard destructor, which means that the global C++ locale is always "C" for the purposes of numeric conversion and there are a fair few places in master (that don't use a LocaleGuard) that make this assumption or at least rely on it for correct behaviour. Tim _______________________________________________ ardour-dev mailing list [email protected] http://lists.ardour.org/listinfo.cgi/ardour-dev-ardour.org