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 "PLItemsCommand.h" 10 11 class RandomizePLItemsCommand : public PLItemsCommand { 12 public: 13 RandomizePLItemsCommand( 14 Playlist* playlist, 15 const int32* indices, 16 int32 count); 17 virtual ~RandomizePLItemsCommand(); 18 19 virtual status_t InitCheck(); 20 21 virtual status_t Perform(); 22 virtual status_t Undo(); 23 24 virtual void GetName(BString& name); 25 26 private: 27 status_t _Sort(bool random); 28 29 Playlist* fPlaylist; 30 PlaylistItem** fItems; 31 int32* fListIndices; 32 int32* fRandomInternalIndices; 33 int32 fCount; 34 }; 35 36 #endif // RANDOMIZE_PL_ITEMS_COMMAND_H 37