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 MSG_PLAYLIST_IMPORT_FAILED = 'plif' 17 }; 18 19 class PlaylistObserver : public Playlist::Listener, public AbstractLOAdapter { 20 public: 21 PlaylistObserver(BHandler* target); 22 virtual ~PlaylistObserver(); 23 24 virtual void ItemAdded(PlaylistItem* item, int32 index); 25 virtual void ItemRemoved(int32 index); 26 27 virtual void ItemsSorted(); 28 29 virtual void CurrentItemChanged(int32 newIndex, bool play); 30 31 virtual void ImportFailed(); 32 }; 33 34 #endif // PLAYLIST_OBSERVER_H 35