1 | /**
|
---|
2 | *
|
---|
3 | * Distributed under the UTC Heudiascy Pacpus License, Version 1.0.
|
---|
4 | * Copyright (c) UTC Heudiasyc 2010 - 2013. All rights reserved.
|
---|
5 | *
|
---|
6 | * See the LICENSE file for more information or a copy at:
|
---|
7 | * http://www.hds.utc.fr/~kurdejma/LICENSE_1_0.txt
|
---|
8 | *
|
---|
9 | */
|
---|
10 |
|
---|
11 | #ifndef DEF_PACPUS_DBTPLYENGINESTATECHART_H
|
---|
12 | #define DEF_PACPUS_DBTPLYENGINESTATECHART_H
|
---|
13 |
|
---|
14 | #include <QString>
|
---|
15 |
|
---|
16 | #include <Pacpus/DbitePlayer/DbitePlayerConfig.h>
|
---|
17 |
|
---|
18 | namespace pacpus {
|
---|
19 |
|
---|
20 | class DbtPlyEngine;
|
---|
21 |
|
---|
22 | ////////////////////////////////////////////////////////////////////////////////
|
---|
23 | class DBITE_PLAYER_API DbtPlyEngineState
|
---|
24 | {
|
---|
25 | public:
|
---|
26 | virtual ~DbtPlyEngineState();
|
---|
27 |
|
---|
28 | virtual void play(DbtPlyEngine & engine);
|
---|
29 | virtual void pause(DbtPlyEngine & engine);
|
---|
30 | virtual void stop(DbtPlyEngine & engine);
|
---|
31 |
|
---|
32 | virtual void speedUp(DbtPlyEngine & engine);
|
---|
33 | virtual void speedDown(DbtPlyEngine & engine);
|
---|
34 |
|
---|
35 | virtual bool isPlaying();
|
---|
36 |
|
---|
37 | virtual QString toString() const = 0;
|
---|
38 |
|
---|
39 | protected:
|
---|
40 | DbtPlyEngineState();
|
---|
41 | };
|
---|
42 |
|
---|
43 | ////////////////////////////////////////////////////////////////////////////////
|
---|
44 | class DBITE_PLAYER_API PlayingState
|
---|
45 | : public DbtPlyEngineState
|
---|
46 | {
|
---|
47 | public:
|
---|
48 | virtual void pause(DbtPlyEngine & engine);
|
---|
49 | virtual void stop(DbtPlyEngine & engine);
|
---|
50 |
|
---|
51 | virtual bool isPlaying();
|
---|
52 |
|
---|
53 | virtual QString toString() const;
|
---|
54 | static DbtPlyEngineState * getInstance();
|
---|
55 |
|
---|
56 | private:
|
---|
57 | PlayingState();
|
---|
58 | static PlayingState mInstance;
|
---|
59 | };
|
---|
60 |
|
---|
61 | ////////////////////////////////////////////////////////////////////////////////
|
---|
62 | class DBITE_PLAYER_API PausedState
|
---|
63 | : public DbtPlyEngineState
|
---|
64 | {
|
---|
65 | public:
|
---|
66 | virtual void play(DbtPlyEngine & engine);
|
---|
67 | virtual void stop(DbtPlyEngine & engine);
|
---|
68 |
|
---|
69 | virtual QString toString() const;
|
---|
70 | static DbtPlyEngineState * getInstance();
|
---|
71 |
|
---|
72 | private:
|
---|
73 | PausedState();
|
---|
74 | static PausedState mInstance;
|
---|
75 | };
|
---|
76 |
|
---|
77 | ////////////////////////////////////////////////////////////////////////////////
|
---|
78 | class DBITE_PLAYER_API StoppedState
|
---|
79 | : public DbtPlyEngineState
|
---|
80 | {
|
---|
81 | public:
|
---|
82 | virtual void play(DbtPlyEngine & engine);
|
---|
83 |
|
---|
84 | virtual QString toString() const;
|
---|
85 | static DbtPlyEngineState * getInstance();
|
---|
86 |
|
---|
87 | private:
|
---|
88 | StoppedState();
|
---|
89 | static StoppedState mInstance;
|
---|
90 | };
|
---|
91 |
|
---|
92 | } // namespace pacpus
|
---|
93 |
|
---|
94 | #endif // DEF_PACPUS_DBTPLYENGINESTATECHART_H
|
---|