~ubuntu-branches/ubuntu/oneiric/phonon/oneiric-201108111512

« back to all changes in this revision

Viewing changes to qt7/quicktimeaudioplayer.h

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2011-01-24 10:12:11 UTC
  • mfrom: (0.5.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20110124101211-w9rew7q0dmwbwhqx
Tags: 4:4.7.0really4.4.4-0ubuntu1
* New upstream release
* Xine and GStreamer backends now split out source, remove build-deps and
  binary packages from debian/control
* Remove 02_no_rpath.patch, now upstream
* Disable kubuntu04_no_va_mangle.patch, no longer applies
* Remove kubuntu_05_gst_codec_installer_window_id.diff, kubuntu_06_forward_events.diff,
  kubuntu_07_include_fix.diff, gstreamer now separate

Show diffs side-by-side

added added

removed removed

Lines of Context:
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
 
 
33
 
QT_BEGIN_NAMESPACE
34
 
 
35
 
namespace Phonon
36
 
{
37
 
namespace 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
 
 
110
 
QT_END_NAMESPACE
111
 
 
112
 
#endif // Phonon_QT7_QUICKTIMEAUDIOPLAYER_H