1 /* 2 * Copyright 2007-2009 Stephan Aßmus <superstippi@gmx.de>. 3 * All rights reserved. Distributed under the terms of the MIT License. 4 */ 5 #ifndef PLAYLIST_OBSERVER_H 6 #define PLAYLIST_OBSERVER_H 7 8 #include "AbstractLOAdapter.h" 9 #include "Playlist.h" 10 11 enum { 12 MSG_PLAYLIST_ITEM_ADDED = 'plia', 13 MSG_PLAYLIST_ITEM_REMOVED = 'plir', 14 MSG_PLAYLIST_ITEMS_SORTED = 'plis', 15 MSG_PLAYLIST_CURRENT_ITEM_CHANGED = 'plcc' 16 }; 17 18 class PlaylistObserver : public Playlist::Listener, public AbstractLOAdapter { 19 public: 20 PlaylistObserver(BHandler* target); 21 virtual ~PlaylistObserver(); 22 23 virtual void ItemAdded(PlaylistItem* item, int32 index); 24 virtual void ItemRemoved(int32 index); 25 26 virtual void ItemsSorted(); 27 28 virtual void CurrentItemChanged(int32 newIndex); 29 }; 30 31 #endif // PLAYLIST_OBSERVER_H 32