40 ****************************************************************************/ |
40 ****************************************************************************/ |
41 |
41 |
42 #ifndef DIRECTSHOWPLAYERCONTROL_H |
42 #ifndef DIRECTSHOWPLAYERCONTROL_H |
43 #define DIRECTSHOWPLAYERCONTROL_H |
43 #define DIRECTSHOWPLAYERCONTROL_H |
44 |
44 |
45 #include <qmediacontent.h> |
45 #include "../../src/multimedia/qmediacontent.h" |
46 #include <qmediaplayercontrol.h> |
46 #include "../../src/multimedia/qmediaplayercontrol.h" |
47 |
47 |
48 #include <QtCore/qcoreevent.h> |
48 #include <QtCore/qcoreevent.h> |
49 |
49 |
50 #include "directshowplayerservice.h" |
50 #include "directshowplayerservice.h" |
51 |
51 |
96 void updateState(QMediaPlayer::State state); |
96 void updateState(QMediaPlayer::State state); |
97 void updateStatus(QMediaPlayer::MediaStatus status); |
97 void updateStatus(QMediaPlayer::MediaStatus status); |
98 void updateMediaInfo(qint64 duration, int streamTypes, bool seekable); |
98 void updateMediaInfo(qint64 duration, int streamTypes, bool seekable); |
99 void updatePlaybackRate(qreal rate); |
99 void updatePlaybackRate(qreal rate); |
100 void updateAudioOutput(IBaseFilter *filter); |
100 void updateAudioOutput(IBaseFilter *filter); |
101 |
101 void updateError(QMediaPlayer::Error error, const QString &errorString); |
102 using QMediaPlayerControl::error; |
102 void updatePosition(qint64 position); |
103 |
103 |
104 protected: |
104 protected: |
105 void customEvent(QEvent *event); |
105 void customEvent(QEvent *event); |
106 |
106 |
107 private: |
107 private: |
110 StateProperty = 0x01, |
110 StateProperty = 0x01, |
111 StatusProperty = 0x02, |
111 StatusProperty = 0x02, |
112 StreamTypesProperty = 0x04, |
112 StreamTypesProperty = 0x04, |
113 DurationProperty = 0x08, |
113 DurationProperty = 0x08, |
114 PlaybackRateProperty = 0x10, |
114 PlaybackRateProperty = 0x10, |
115 SeekableProperty = 0x20 |
115 SeekableProperty = 0x20, |
|
116 ErrorProperty = 0x40, |
|
117 PositionProperty = 0x80 |
116 }; |
118 }; |
117 |
119 |
118 enum Event |
120 enum Event |
119 { |
121 { |
120 PropertiesChanged = QEvent::User |
122 PropertiesChanged = QEvent::User |
121 }; |
123 }; |
122 |
124 |
123 void scheduleUpdate(int properties); |
125 void scheduleUpdate(int properties); |
|
126 void emitPropertyChanges(); |
124 |
127 |
125 DirectShowPlayerService *m_service; |
128 DirectShowPlayerService *m_service; |
126 IBasicAudio *m_audio; |
129 IBasicAudio *m_audio; |
127 QIODevice *m_stream; |
130 QIODevice *m_stream; |
128 int m_updateProperties; |
131 int m_updateProperties; |
129 QMediaPlayer::State m_state; |
132 QMediaPlayer::State m_state; |
130 QMediaPlayer::MediaStatus m_status; |
133 QMediaPlayer::MediaStatus m_status; |
|
134 QMediaPlayer::Error m_error; |
131 int m_streamTypes; |
135 int m_streamTypes; |
132 int m_muteVolume; |
136 int m_muteVolume; |
|
137 qint64 m_position; |
133 qint64 m_duration; |
138 qint64 m_duration; |
134 qreal m_playbackRate; |
139 qreal m_playbackRate; |
135 bool m_seekable; |
140 bool m_seekable; |
136 QMediaContent m_media; |
141 QMediaContent m_media; |
|
142 QString m_errorString; |
137 |
143 |
138 }; |
144 }; |
139 |
145 |
140 #endif |
146 #endif |