[vlc-devel] [vlc-commits] commit: Qt: save volume on exit ( Francois Cartegnie )

Rémi Denis-Courmont remi at remlab.net
Thu Jul 29 22:09:22 CEST 2010

Le jeudi 29 juillet 2010 22:49:25 Francois Cartegnie, vous avez écrit :
> Le jeudi 29 juillet 2010, Rémi Denis-Courmont a écrit :
> > Full point.
> So do you expect the user to save volume by himself when the "save volume
> on exit" option is checked ?

There is a reason why the preferences dialog has separate OK and Save buttons. 
Your stupid change made the configuration ALWAYS saved at exit. This is wrong 
and unacceptable. This is _not_ going to change just for the sake of the audio 

> Until now, Qt has 2 audio prefs:
> - Uses a default volume on start (from qt)

I don't see the point. (lib)VLC already has its default volume. Why the heck 
does the Qt4 interface needs to have its own default volume? What happens when 
we have two interfaces with their own (conflicting) default volumes then?

> - Save volume on exit (current core volume)

That similarly does not belong in the Qt4 interface settings, but in the core.

> > And really, I do not see why Qt4 needs its own volume setting.
> It does not.
> -volume is from core
> -qt-startvolume is on qt side. "default volume"

Don't you see a self-contradiction here?

> -qt-autosave-volume is on qt side. Defines is we need to replace current
> volume with qt-startvolume value.

I fail to see why this is a Qt-specific configuration. The correct way to do 
that is to use mark the audio-volume item has autosaved, and, if autosave-
volume is on, update the value from the running volume when the playlist 
object is destroyed.

Unfortumately, this is currently not possible because the running volume is 
stored in the configuration always, which is wrong. All other playback 
parameters (that I know) use the object variables and inheritance, which 
solves the problem nicely.

I am not going to come up with an alternative solution. I did not write the 
buggy Qt4 audio volume handling to begin with, nor the audio output core's, so 
I do not feel responsible for (fixing) this mess.

> One bug were caused by the qt-startvolume directly linked to the
> 'live'/core volume. Each time the user returned to the prefs, the value
> was reset to the live volume. Then prefs saving without manually restoring
> it was leading to a loss of/wrong value.

The running audio volume should be stored has a playlist (input parent) object 
variable anyway. I never fixed it because I did not have the time and courage 
to fix all the interfaces. But now, you wrote some mindboggingly complicated 
logic in the core, so I don't understand the thing (anymore), so I couldn't 
even fix it if I wanted to.

Rémi Denis-Courmont

More information about the vlc-devel mailing list