Mercurial > boomslang
comparison pyntnclick/sound.py @ 572:e393954e3749 pyntnclick
Move get_current_playlist onto sound object
author | Neil Muller <neil@dip.sun.ac.za> |
---|---|
date | Sat, 11 Feb 2012 15:53:14 +0200 |
parents | 9c3528c2cbe5 |
children | 1b1ab71535bd |
comparison
equal
deleted
inserted
replaced
571:20e296d4a3a5 | 572:e393954e3749 |
---|---|
109 return albow.music.get_music(name, prefix=prefix) | 109 return albow.music.get_music(name, prefix=prefix) |
110 | 110 |
111 def change_playlist(self, new_playlist): | 111 def change_playlist(self, new_playlist): |
112 albow.music.change_playlist(new_playlist) | 112 albow.music.change_playlist(new_playlist) |
113 | 113 |
114 def get_current_playlist(): | |
115 if albow.music.music_enabled and albow.music.current_playlist: | |
116 return albow.music.current_playlist | |
117 | |
114 | 118 |
115 def start_next_music(): | 119 def start_next_music(): |
116 """Start playing the next item from the current playlist immediately.""" | 120 """Start playing the next item from the current playlist immediately.""" |
117 if albow.music.music_enabled and albow.music.current_playlist: | 121 if albow.music.music_enabled and albow.music.current_playlist: |
118 next_music = albow.music.current_playlist.next() | 122 next_music = albow.music.current_playlist.next() |
122 music.play() | 126 music.play() |
123 albow.music.next_change_delay = albow.music.change_delay | 127 albow.music.next_change_delay = albow.music.change_delay |
124 albow.music.current_music = next_music | 128 albow.music.current_music = next_music |
125 | 129 |
126 | 130 |
127 def get_current_playlist(): | |
128 if albow.music.music_enabled and albow.music.current_playlist: | |
129 return albow.music.current_playlist | |
130 | |
131 # Monkey patch | 131 # Monkey patch |
132 albow.music.start_next_music = start_next_music | 132 albow.music.start_next_music = start_next_music |