projects
/
euphoria.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Handle broadcast_playlist_loaded.
[euphoria.git]
/
lib
/
playlist.rb
diff --git
a/lib/playlist.rb
b/lib/playlist.rb
index 0df6ff162ead0d094cf749bacc1326b22cd79998..9406a5b52ccb7734167a2bf9e8a554aa7a2df58b 100644
(file)
--- a/
lib/playlist.rb
+++ b/
lib/playlist.rb
@@
-12,12
+12,14
@@
class Playlist < Array
@eet = nil
@container = nil
@eet = nil
@container = nil
- @xmms.playlist_list.notifier { |res| push(*res.value) }
+ query_contents
- begin
- @current_pos = @xmms.playlist_current_pos.wait.value
- rescue Xmms::Result::ValueError
- @current_pos = nil
+ @xmms.playlist.current_pos.notifier do |res|
+ begin
+ @current_pos = res.value
+ rescue Xmms::Result::ValueError
+ @current_pos = nil
+ end
end
@xmms.broadcast_playlist_current_pos.notifier do |res|
end
@xmms.broadcast_playlist_current_pos.notifier do |res|
@@
-29,15
+31,18
@@
class Playlist < Array
current_item.hilighted = true
end
current_item.hilighted = true
end
+ @xmms.broadcast_playlist_loaded.
+ notifier(&method(:on_playlist_loaded))
+
@xmms.broadcast_playlist_changed.notifier do |res|
case res.value[:type]
@xmms.broadcast_playlist_changed.notifier do |res|
case res.value[:type]
- when Xmms::
Result::PLAYLIST_CHANGED_
ADD
+ when Xmms::
Playlist::
ADD
self << res.value[:id]
self << res.value[:id]
- when Xmms::
Result::PLAYLIST_CHANGED_
REMOVE
+ when Xmms::
Playlist::
REMOVE
# the daemon sends the position of the song, not the
# unique mlib id
delete(self[res.value[:position]])
# the daemon sends the position of the song, not the
# unique mlib id
delete(self[res.value[:position]])
- when Xmms::
Result::PLAYLIST_CHANGED_
CLEAR
+ when Xmms::
Playlist::
CLEAR
clear
end
end
clear
end
end
@@
-157,6
+162,7
@@
class Playlist < Array
@ee = Ecore::Evas::SoftwareX11.new
@ee.title = "Euphoria Playlist"
@ee.borderless = true
@ee = Ecore::Evas::SoftwareX11.new
@ee.title = "Euphoria Playlist"
@ee.borderless = true
+ @ee.evas.font_hinting = Evas::Evas::AUTO
@ee.on_pre_render { Edje::thaw }
@ee.on_post_render { Edje::freeze }
@ee.on_pre_render { Edje::thaw }
@ee.on_post_render { Edje::freeze }
@@
-189,4
+195,15
@@
class Playlist < Array
@ee.shaped = !@edje.data("shaped").nil?
end
@ee.shaped = !@edje.data("shaped").nil?
end
+
+ def query_contents
+ @xmms.playlist.entries.notifier do |res|
+ push(*res.value)
+ end
+ end
+
+ def on_playlist_loaded(res)
+ clear
+ query_contents
+ end
end
end