1
/* This file is part of the KDE project.
3
Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
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.
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.
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/>.
18
#ifndef Phonon_QT7_QUICKTIMEAUDIOPLAYER_H
19
#define Phonon_QT7_QUICKTIMEAUDIOPLAYER_H
21
#include "backendheader.h"
23
#ifdef QUICKTIME_C_API_AVAILABLE
24
#include <QuickTime/QuickTime.h>
25
#undef check // avoid name clash;
28
#include <phonon/mediasource.h>
29
#include <Carbon/Carbon.h>
30
#include <QtCore/QString>
31
#include "audionode.h"
41
class QuickTimeVideoPlayer;
43
class QuickTimeAudioPlayer : public AudioNode
46
enum State {Playing, Paused, NoMedia, NoState};
48
QuickTimeAudioPlayer();
49
virtual ~QuickTimeAudioPlayer();
53
void seek(quint64 milliseconds);
54
void enableAudio(bool enable);
58
void setVideoPlayer(QuickTimeVideoPlayer *videoPlayer);
59
void unsetVideoPlayer();
63
void scheduleAudioToGraph();
64
long regularTaskFrequency();
65
quint64 currentTime();
66
QString currentTimeString();
67
QuickTimeVideoPlayer *videoPlayer();
69
ComponentDescription getAudioNodeDescription() const;
70
void initializeAudioUnit();
71
bool fillInStreamSpecification(AudioConnection *connection, ConnectionSide side);
72
void mediaNodeEvent(const MediaNodeEvent *event);
74
static bool soundPlayerIsAwailable();
77
void initSoundExtraction();
78
void newGraphNotification();
79
void allocateSoundSlices();
80
void scheduleSoundSlices();
83
QuickTimeVideoPlayer *m_videoPlayer;
85
#ifdef QUICKTIME_C_API_AVAILABLE
86
MovieAudioExtractionRef m_audioExtractionRef;
89
ScheduledAudioSlice *m_sliceList;
90
AudioChannelLayout *m_audioChannelLayout;
91
UInt32 m_audioChannelLayoutSize;
92
AudioStreamBasicDescription m_audioStreamDescription;
95
bool m_playerUnitStarted;
96
bool m_audioExtractionComplete;
98
bool m_audioUnitIsReset;
100
long m_samplesRemaining;
102
int m_maxExtractionPacketCount;
104
Float64 m_sampleTimeStamp;
108
}} // namespace Phonon::QT7
112
#endif // Phonon_QT7_QUICKTIMEAUDIOPLAYER_H