source: trunk/src/3rdparty/phonon/qt7/quicktimeaudioplayer.h

Last change on this file was 2, checked in by Dmitry A. Kuminov, 17 years ago

Initially imported qt-all-opensource-src-4.5.1 from Trolltech.

File size: 3.3 KB
Line 
1/* This file is part of the KDE project.
2
3 Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
4
5 This library is free software: you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as published by
7 the Free Software Foundation, either version 2.1 or 3 of the License.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU Lesser General Public License for more details.
13
14 You should have received a copy of the GNU Lesser General Public License
15 along with this library. If not, see <http://www.gnu.org/licenses/>.
16*/
17
18#ifndef Phonon_QT7_QUICKTIMEAUDIOPLAYER_H
19#define Phonon_QT7_QUICKTIMEAUDIOPLAYER_H
20
21#include "backendheader.h"
22
23#ifdef QUICKTIME_C_API_AVAILABLE
24 #include <QuickTime/QuickTime.h>
25 #undef check // avoid name clash;
26#endif
27
28#include <phonon/mediasource.h>
29#include <Carbon/Carbon.h>
30#include <QtCore/QString>
31#include "audionode.h"
32
33QT_BEGIN_NAMESPACE
34
35namespace Phonon
36{
37namespace QT7
38{
39 class AudioGraph;
40 class MediaNodeEvent;
41 class QuickTimeVideoPlayer;
42
43 class QuickTimeAudioPlayer : public AudioNode
44 {
45 public:
46 enum State {Playing, Paused, NoMedia, NoState};
47
48 QuickTimeAudioPlayer();
49 virtual ~QuickTimeAudioPlayer();
50
51 void play();
52 void pause();
53 void seek(quint64 milliseconds);
54 void enableAudio(bool enable);
55 bool audioEnabled();
56 void flush();
57
58 void setVideoPlayer(QuickTimeVideoPlayer *videoPlayer);
59 void unsetVideoPlayer();
60
61 bool hasAudio();
62 bool isPlaying();
63 void scheduleAudioToGraph();
64 long regularTaskFrequency();
65 quint64 currentTime();
66 QString currentTimeString();
67 QuickTimeVideoPlayer *videoPlayer();
68
69 ComponentDescription getAudioNodeDescription() const;
70 void initializeAudioUnit();
71 bool fillInStreamSpecification(AudioConnection *connection, ConnectionSide side);
72 void mediaNodeEvent(const MediaNodeEvent *event);
73
74 static bool soundPlayerIsAwailable();
75
76 private:
77 void initSoundExtraction();
78 void newGraphNotification();
79 void allocateSoundSlices();
80 void scheduleSoundSlices();
81
82 State m_state;
83 QuickTimeVideoPlayer *m_videoPlayer;
84
85#ifdef QUICKTIME_C_API_AVAILABLE
86 MovieAudioExtractionRef m_audioExtractionRef;
87#endif
88
89 ScheduledAudioSlice *m_sliceList;
90 AudioChannelLayout *m_audioChannelLayout;
91 UInt32 m_audioChannelLayoutSize;
92 AudioStreamBasicDescription m_audioStreamDescription;
93
94 bool m_discrete;
95 bool m_playerUnitStarted;
96 bool m_audioExtractionComplete;
97 bool m_audioEnabled;
98 bool m_audioUnitIsReset;
99
100 long m_samplesRemaining;
101 int m_sliceCount;
102 int m_maxExtractionPacketCount;
103
104 Float64 m_sampleTimeStamp;
105 quint64 m_startTime;
106 };
107
108}} // namespace Phonon::QT7
109
110QT_END_NAMESPACE
111
112#endif // Phonon_QT7_QUICKTIMEAUDIOPLAYER_H
Note: See TracBrowser for help on using the repository browser.