Play a startup sound if it exists.
This commit is contained in:
parent
d8a5fed0e0
commit
9ffcbfca4d
@ -24,6 +24,7 @@ import pygtk
|
|||||||
pygtk.require('2.0')
|
pygtk.require('2.0')
|
||||||
import gtk
|
import gtk
|
||||||
import gobject
|
import gobject
|
||||||
|
import gst
|
||||||
|
|
||||||
from sugar import logger
|
from sugar import logger
|
||||||
from sugar import env
|
from sugar import env
|
||||||
@ -82,13 +83,19 @@ def check_cm(bus_name):
|
|||||||
pass
|
pass
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def _unfreeze_dcon_idle_cb():
|
def _shell_started_cb():
|
||||||
# Unfreeze the display when it's stable
|
# Unfreeze the display
|
||||||
hw_manager = hardwaremanager.get_manager()
|
hw_manager = hardwaremanager.get_manager()
|
||||||
hw_manager.set_dcon_freeze(0)
|
hw_manager.set_dcon_freeze(0)
|
||||||
|
|
||||||
|
startup_sound = os.path.join(env.get_sounds_path('startup.ogg'))
|
||||||
|
if os.path.exists(startup_sound):
|
||||||
|
player = gst.element_factory_make("playbin", "player")
|
||||||
|
player.set_property("uri", "file://" + startup_sound)
|
||||||
|
player.set_state(gst.STATE_PLAYING)
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
gobject.idle_add(_unfreeze_dcon_idle_cb)
|
gobject.idle_add(_shell_started_cb)
|
||||||
|
|
||||||
_save_session_info()
|
_save_session_info()
|
||||||
_start_matchbox()
|
_start_matchbox()
|
||||||
|
@ -73,6 +73,9 @@ def get_user_library_path():
|
|||||||
def get_locale_path(path=None):
|
def get_locale_path(path=None):
|
||||||
return _get_prefix_path('share/locale', path)
|
return _get_prefix_path('share/locale', path)
|
||||||
|
|
||||||
|
def get_sounds_path(path=None):
|
||||||
|
return _get_prefix_path('share/sounds', path)
|
||||||
|
|
||||||
def get_bin_path(path=None):
|
def get_bin_path(path=None):
|
||||||
return _get_sugar_path('bin', path)
|
return _get_sugar_path('bin', path)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user