amoblin
unread,Apr 22, 2009, 3:52:44 AM4/22/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to gmbox-dev
实现播放状态通知
先引进包
import pynotify
在MainWindow的函数setupSystray中加入:
pynotify.init("Some Application or Title")
self.notification = pynotify.Notification("Title", "body",
"dialog-warning")
self.notification.set_urgency(pynotify.URGENCY_NORMAL)
self.notification.set_timeout(1)
在downone下增加:
self.notification = pynotify.Notification("下载",
self._songlist.get_title(self.path[0]), "dialog-warning")
self.notification.set_timeout(1)
self.notification.show()
同样的listen下也增加:
self.notification = pynotify.Notification("试听",
self._songlist.get_title(self.path[0]), "dialog-warning")
self.notification.set_timeout(1)
self.notification.show()
那么要在gmbox.py里增加两个函数
def get_title(self,i=0):
song=self.songlist[i]
return song['title']
def get_artist(self,i=0):
song=self.songlist[i]
return song['artist']
未来想这样:自动循环播放,切歌时显示歌曲信息。