00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef _PLAYSTATE_H
00022 #define _PLAYSTATE_H
00023
00024 #include "playlistmodel.h"
00025
00030 class PlayState
00031 {
00032 public:
00036 virtual bool next() = 0;
00037
00041 virtual bool previous() = 0;
00042
00046 virtual void resetState()
00047 {
00048 ;
00049 }
00053 virtual void prepare()
00054 {
00055 ;
00056 }
00057 virtual ~PlayState()
00058 {
00059 ;
00060 }
00061 PlayState(PlayListModel* model) : m_model(model)
00062 {
00063 ;
00064 }
00065 protected:
00066
00068 PlayListModel* m_model;
00069 };
00070
00075 class NormalPlayState : public PlayState
00076 {
00077 public:
00078 virtual bool next();
00079 virtual bool previous();
00080 NormalPlayState(PlayListModel* model);
00081 };
00082
00087 class ShufflePlayState : public PlayState
00088 {
00089 public:
00090 virtual bool next();
00091 virtual bool previous();
00092 virtual void prepare();
00093 ShufflePlayState(PlayListModel* model);
00094 virtual void resetState();
00095 private:
00096
00098 int m_shuffled_current;
00099
00101 QList<int> m_shuffled_indexes;
00102 };
00103
00104
00105 #endif