1 /* 2 * Copyright © 2008 Stephan Aßmus. All rights reserved. 3 * 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 "Command.h" 10 11 class Playlist; 12 struct entry_ref; 13 14 class RandomizePLItemsCommand : public Command { 15 public: 16 RandomizePLItemsCommand( 17 Playlist* playlist, 18 const int32* indices, 19 int32 count); 20 virtual ~RandomizePLItemsCommand(); 21 22 virtual status_t InitCheck(); 23 24 virtual status_t Perform(); 25 virtual status_t Undo(); 26 27 virtual void GetName(BString& name); 28 29 private: 30 status_t _Sort(bool random); 31 32 Playlist* fPlaylist; 33 entry_ref* fRefs; 34 int32* fListIndices; 35 int32* fRandomInternalIndices; 36 int32 fCount; 37 }; 38 39 #endif // RANDOMIZE_PL_ITEMS_COMMAND_H 40