[vlc-devel] [RFC] autosaving config options.

Derk-Jan Hartman hartman at videolan.org
Mon Aug 25 20:00:22 CEST 2008


On 25 aug 2008, at 17:35, Rémi Denis-Courmont wrote:
> On Mon, 25 Aug 2008 17:01:55 +0200, Derk-Jan Hartman <hartman at videolan.org 
> >
> wrote:
>> 1: we remove change_autosave() from the core.
>> 2: we introduce something like config_SetAutoSave( optionname, true/
>> false) This option will set the flag that change_autosave() used to  
>> set.
>
> This fails to address the fundamental flaw. You can still end up  
> with a
> configuration change meant to be saved, and one not - at least onto  
> the
> same configuration setting.

I know, its just an improvement.
So your problem with this solution is that it still allows a  
commandline option to be saved if another interface marks that option  
as auto-saveable ?

> IMHO, we should be able to set _and_get_[1] either:
> - the saved and current configuration (to the same new value),
> - or only the current configuration.
>
> [1] so that the UI can display the saved configuration without  
> command line
> interference.

You want to expose the config item->saved (Currently only item->value  
is exposed) ? So that the preferences of Qt4 and OSX would only show  
the Saved values, instead of the "current values" ? Such that when you  
change the preferences and save them, only the original values are  
saved, and not something that was changed on the fly ?

> And then, there's the persistent lack of clear policy for using  
> config_* vs
> var_*.

gibalou was gonna merge the two at one time. But he never described  
how that would be done. Since it didn't happen, everyone started using  
config_Put again to save options. I doubt this was ever the intent.  
Perhaps the variable should have the autosave flag, instead of the  
config options, so that you don't have to use config_Put* Still, it  
sounds kinda over the top.

The best would be a total redesign of to merge the two of course, but  
I don't hear anyone volunteering...

The next closest wanted behaviour would likely be:
config_Get( name ) gets the SAVED value of the config option.
config_Put( variable ) saves the value of the variable to the config  
option (for preferences)
config_SaveConfigFile( ) saves the things communicated by  
config_Save() to file. To be called by preferences interfaces, and  
"autosave" when we shut VLC.
var_Create() autoinherits values from config options if such config  
options exist
var_AutoSave() makes sure config_Save() is called whenever the modules  
value changes (callback). Since variables are bound to objects, this  
will make things

Oh, and then we STILL need a way to make command-line options  
unsaveable .......
By creating/setting variables at libvlc object level I guess, instead  
of changing the values of the config itself.

DJ


More information about the vlc-devel mailing list