From 32b2999fac73ed8cbe0bc50b38ec50d11e760869 Mon Sep 17 00:00:00 2001 From: fgau Date: Tue, 13 Jan 2009 19:33:47 +0000 Subject: [PATCH] add set, play, stop ringtones methods git-svn-id: http://www.neo1973-germany.de/svn@231 46df4e5c-bc4e-4628-a0fc-830ba316316d --- epydial/epydial.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/epydial/epydial.py b/epydial/epydial.py index b2e8187..73f2dd5 100755 --- a/epydial/epydial.py +++ b/epydial/epydial.py @@ -23,6 +23,7 @@ DB_FILE_PATH = "/media/card/epydialdb/epydial.sqlite" DB_PATH = "/media/card/epydialdb/" PIX_WEATHER_FILE_PATH = "data/themes_data/blackwhite/images/stardock_weather/" MP3_FILE_PATH = "/media/card/mp3/" +RINGTONE_FILE = "/usr/share/epydial/data/sounds/ringtone_simple02.mp3" DIALER_SCREEN_NAME = "pyneo/dialer/main" INCALL_SCREEN_NAME = "pyneo/dialer/incall" @@ -488,6 +489,7 @@ class PyneoController(object): except: print '--- NULL new sms' class_.gsm_sms.DeleteAll(dbus_interface=DIN_STORAGE) + PyneoController.stop_ringtone() @classmethod def show_sms_screen(class_): @@ -545,6 +547,18 @@ class PyneoController(object): def set_volume(class_, status): class_.mp3.SetVolume(status, dbus_interface='org.pyneo.Music') + @classmethod + def set_ringtone(class_, sound_file): + class_.mp3.SetRingtone(sound_file, dbus_interface='org.pyneo.Music') + + @classmethod + def play_ringtone(class_): + class_.mp3.PlayRingtone(dbus_interface='org.pyneo.Music') + + @classmethod + def stop_ringtone(class_): + class_.mp3.StopRingtone(dbus_interface='org.pyneo.Music') + @classmethod def db_check(class_): if not os.path.exists(DB_FILE_PATH): @@ -607,6 +621,8 @@ class Dialer(object): PyneoController.db_check() PyneoController.set_playlist_from_dir() + PyneoController.set_ringtone(RINGTONE_FILE) + PyneoController.play_ringtone() PyneoController.power_up_gsm() PyneoController.get_gsm_keyring()