![]() |
2011-04-21
, 06:45
|
|
Posts: 1,187 |
Thanked: 816 times |
Joined on Apr 2010
@ Australia
|
#2
|
![]() |
2011-04-22
, 02:22
|
Posts: 805 |
Thanked: 1,605 times |
Joined on Feb 2010
@ Gdynia, Poland
|
#3
|
import gtk import hildondesktop import hildon import os class MmmAudioWidgetPlugin(hildondesktop.HomePluginItem): def __init__(self): hildondesktop.HomePluginItem.__init__(self) self.set_size_request(90, 90) button = gtk.Button("Play") button.connect("clicked", self.play_clicked) button.show_all() self.add(button) self.set_settings(True) self.connect("show-settings", self.show_dialog) self.sound_file = "/home/user/MyDocs/sound.wav" def show_dialog(self, plugin): chooser = hildon.FileChooserDialog(plugin, gtk.FILE_CHOOSER_ACTION_OPEN) response = chooser.run() if response == gtk.RESPONSE_OK: self.sound_file = chooser.get_filename() chooser.destroy() def play_clicked(self, button): os.system("echo \"" + self.sound_file + "\"") os.system("play-sound \"" + self.sound_file + "\""); hd_plugin_type = MmmAudioWidgetPlugin # The code below is just for testing purposes. # It allows to run the widget as a standalone process. if __name__ == "__main__": import gobject gobject.type_register(hd_plugin_type) obj = gobject.new(hd_plugin_type, plugin_id="plugin_id") obj.show_all() gtk.main()
![]() |
2011-04-23
, 12:15
|
Posts: 805 |
Thanked: 1,605 times |
Joined on Feb 2010
@ Gdynia, Poland
|
#4
|
![]() |
2011-04-24
, 21:28
|
Posts: 805 |
Thanked: 1,605 times |
Joined on Feb 2010
@ Gdynia, Poland
|
#5
|
I want it just for good timing. Ever thought about cricket noises after a friend tells a bad joke? That's pretty much the only reason I would like to see this happen. Of course given the option to change the sound and anyone can come up with any sound for any kind of moment. It's corny, but it could be fun!
"You wanna have a good time? Get yourself a nice watch."