Volume through new preferences tree
The volume is now controlled through the preferences tree.
This commit is contained in:
parent
3cd7f4b20f
commit
4335c1a111
|
@ -10,7 +10,7 @@ audio = None
|
|||
tdelta = None
|
||||
|
||||
def ls_init():
|
||||
libsaria.init_pref("volume", 1.0)
|
||||
libsaria.init_pref2("libsaria.audio.volume", 1.0)
|
||||
libsaria.event.invite("POSTINIT", ls_init)
|
||||
|
||||
def init():
|
||||
|
|
|
@ -20,7 +20,7 @@ def init():
|
|||
|
||||
lock.acquire()
|
||||
player = gst.element_factory_make("playbin2", "player")
|
||||
set_volume_locked(libsaria.prefs["volume"])
|
||||
set_volume_locked(libsaria.prefs2.get_pref("libsaria.audio.volume"))
|
||||
time = gst.Format(gst.FORMAT_TIME)
|
||||
bus = player.get_bus()
|
||||
bus.add_signal_watch()
|
||||
|
@ -181,7 +181,7 @@ def seek(prcnt):
|
|||
def set_volume_locked(prcnt):
|
||||
global player
|
||||
player.set_property("volume", prcnt)
|
||||
libsaria.prefs["volume"] = prcnt
|
||||
libsaria.prefs2.set_pref("libsaria.audio.volume", prcnt)
|
||||
return prcnt
|
||||
|
||||
def set_volume(prcnt):
|
||||
|
|
|
@ -146,7 +146,7 @@ class VolumeButton(gtk.VolumeButton):
|
|||
|
||||
adj = self.get_adjustment()
|
||||
adj.set_page_increment(0.05)
|
||||
self.set_value(prefs["volume"])
|
||||
self.set_value(prefs2.get_pref("libsaria.audio.volume"))
|
||||
self.resize()
|
||||
|
||||
self.connect("value-changed", self.changed)
|
||||
|
|
Loading…
Reference in New Issue