1 /* 2 * Copyright © 2008-2009 Stephan Aßmus <superstippi@gmx.de> 3 * All rights reserved. Distributed under the terms of the MIT License. 4 */ 5 #ifndef RANDOMIZE_PL_ITEMS_COMMAND_H 6 #define RANDOMIZE_PL_ITEMS_COMMAND_H 7 8 9 #include <List.h> 10 11 #include "PLItemsCommand.h" 12 13 14 class RandomizePLItemsCommand : public PLItemsCommand { 15 public: 16 RandomizePLItemsCommand( 17 Playlist* playlist, 18 BList indices); 19 virtual ~RandomizePLItemsCommand(); 20 21 virtual status_t InitCheck(); 22 23 virtual status_t Perform(); 24 virtual status_t Undo(); 25 26 virtual void GetName(BString& name); 27 28 private: 29 status_t _Sort(bool random); 30 31 Playlist* fPlaylist; 32 int32 fCount; 33 PlaylistItem** fItems; 34 int32* fListIndices; 35 int32* fRandomInternalIndices; 36 }; 37 38 #endif // RANDOMIZE_PL_ITEMS_COMMAND_H 39