|
|
2011-04-21
, 06:45
|
|
|
Posts: 1,187 |
Thanked: 816 times |
Joined on Apr 2010
@ Australia
|
#2
|
I would!
|
|
2011-04-22
, 02:22
|
|
Posts: 803 |
Thanked: 1,594 times |
Joined on Feb 2010
@ Gdynia, Poland
|
#3
|
And after reboot or removing widget from desktop and adding once again - you need to click on settings and show it music file it should play. I can assure you it plays wav files, haven't tried different, it's 4:20 AM in here... It plays basically everything, which command "play-sound" can play (it uses it). These are basically just two files: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()
It is called in widget menu "mmmAudioWidget" and after selecting should put ugly gray "Play" button on your active homescreen.
|
|
2011-04-23
, 12:15
|
|
Posts: 803 |
Thanked: 1,594 times |
Joined on Feb 2010
@ Gdynia, Poland
|
#4
|
|
|
2011-04-24
, 21:28
|
|
Posts: 803 |
Thanked: 1,594 times |
Joined on Feb 2010
@ Gdynia, Poland
|
#5
|
I will inform everyone there as soon as widget will be available in extras-devel.
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."