-
Notifications
You must be signed in to change notification settings - Fork 6
/
cplaystate.h
120 lines (102 loc) · 2.93 KB
/
cplaystate.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
/*********************** Information *************************\
| $HeadURL$
|
| Author: Jo2003
|
| Begin: 24.02.2010 / 10:41:34
|
| Last edited by: $Author$
|
| $Id$
\*************************************************************/
#ifndef __030410__CPLAYSTATE_H
#define __030410__CPLAYSTATE_H
#include <QString>
#include <QDateTime>
#include <QtGui>
#include <QMessageBox>
#include <QProcess>
#include "templates.h"
//--------------------------------------------------------------
// name space for playstate ...
//--------------------------------------------------------------
namespace PlayState
{
enum ePlayState
{
PS_READY,
PS_OPEN,
PS_BUFFER,
PS_PLAY,
PS_PAUSE,
PS_STOP,
PS_END,
PS_ERROR,
PS_RECORD,
PS_TIMER_RECORD,
PS_TIMER_STBY,
PS_WTF = 255 // ;-)
};
class CPlayState;
}
/********************************************************************\
| Class: CPlayState
| Date: 08.04.2010 / 14:22:18
| Author: Jo2003
| Description: represent the play state ...
|
\********************************************************************/
class CPlayState : public QObject
{
Q_OBJECT
public:
CPlayState(QObject *parent = 0);
~CPlayState ();
void setParentWidget (QWidget *parent);
void setInfo (const QString& title, const QString& chan = QString(),
const QDateTime& start = QDateTime(),
const QDateTime& end = QDateTime(),
bool bAr = false, bool bTimrec = false);
void setTitle (const QString& title);
void setChannel (const QString& chan);
void setStartEnd (const QDateTime& start, const QDateTime& end);
void setArchive (bool bAr);
void setTimerRec (bool bTimrec);
bool permitAction (PlayState::ePlayState newState);
bool permitClose ();
bool permitStreamCtrl ();
void setState (PlayState::ePlayState newState);
void doStateBackup ();
const QString& title();
const QString& channel();
const QDateTime& start();
const QDateTime& end();
ulong runtime();
bool archive();
bool timerRecord();
PlayState::ePlayState state();
PlayState::ePlayState backupState();
QString stateText (PlayState::ePlayState state);
protected:
bool WantToStopRec ();
bool WantToClose ();
private:
QDateTime dtStart;
QDateTime dtEnd;
QString sTitle;
QString sChannel;
ulong ulRunTime;
bool bArchive;
bool bTimer;
QWidget *pParentWidget;
PlayState::ePlayState eActState;
PlayState::ePlayState eBackupState;
public slots:
void slotProcStateChanged (QProcess::ProcessState newState);
signals:
void sigStateChange (int iOldState, int iNewState);
};
#endif // __030410__CPLAYSTATE_H
/************************* History ***************************\
| $Log$
\*************************************************************/