Enlightenment CVS committal
Author : tsauerbeck
Project : e17
Module : apps/euphoria
Dir : e17/apps/euphoria/lib
Modified Files:
playlist.rb
Log Message:
move playlist_list and playlist_changed code to the playlist class
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/euphoria/lib/playlist.rb,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -3 -r1.7 -r1.8
--- playlist.rb 27 Apr 2005 20:05:14 -0000 1.7
+++ playlist.rb 27 Apr 2005 20:09:17 -0000 1.8
@@ -1,4 +1,4 @@
-# $Id: playlist.rb,v 1.7 2005/04/27 20:05:14 tsauerbeck Exp $
+# $Id: playlist.rb,v 1.8 2005/04/27 20:09:17 tsauerbeck Exp $
require "euphoria/playlist_item"
@@ -11,6 +11,8 @@
@eet = nil
@container = nil
+ @xmms.playlist_list.notifier { |res| push(*res.value) }
+
begin
@current_pos = @xmms.playlist_current_pos.wait.value
rescue XmmsClient::ValueError
@@ -22,6 +24,21 @@
current_item.hilight
end
+ @xmms.broadcast_playlist_changed.notifier do |res|
+ type, id, arg = res.playlist_change
+
+ case type
+ when XmmsClient::Result::PLAYLIST_CHANGED_ADD
+ self << id
+ when XmmsClient::Result::PLAYLIST_CHANGED_REMOVE
+ # the daemon sends the position of the
song, not the
+ # unique mlib id
+ delete(self[id])
+ when XmmsClient::Result::PLAYLIST_CHANGED_CLEAR
+ clear
+ end
+ end
+
@xmms.broadcast_medialib_entry_changed.notifier do |res|
@xmms.medialib_get_info(res.value).notifier do |res2|
props = res.value
-------------------------------------------------------
SF.Net email is sponsored by: Tell us your software development plans!
Take this survey and enter to win a one-year sub to SourceForge.net
Plus IDC's 2005 look-ahead and a copy of this survey
Click here to start! http://www.idcswdc.com/cgi-bin/survey?id=105hix
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs