| 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_AudioConnection_H |
| 19 |
#define Phonon_QT7_AudioConnection_H |
| 20 |
|
| 21 |
#include <QtCore/QObject> |
| 22 |
#include "backendheader.h" |
| 23 |
|
| 24 |
#include <AudioToolbox/AudioToolbox.h> |
| 25 |
#include <AudioUnit/AudioUnit.h> |
| 26 |
|
| 27 |
QT_BEGIN_NAMESPACE |
| 28 |
|
| 29 |
namespace Phonon |
| 30 |
{ |
| 31 |
namespace QT7 |
| 32 |
{ |
| 33 |
class MediaNode; |
| 34 |
class AudioNode; |
| 35 |
class AudioGraph; |
| 36 |
|
| 37 |
class AudioConnection { |
| 38 |
public: |
| 39 |
AudioConnection(); |
| 40 |
AudioConnection(MediaNode *sink); |
| 41 |
AudioConnection(MediaNode *source, int output, MediaNode *sink, int input); |
| 42 |
|
| 43 |
AudioConnection(AudioNode *sink); |
| 44 |
AudioConnection(AudioNode *source, int output, AudioNode *sink, int input); |
| 45 |
|
| 46 |
~AudioConnection(); |
| 47 |
|
| 48 |
bool connect(AudioGraph *graph); |
| 49 |
bool disconnect(AudioGraph *graph); |
| 50 |
|
| 51 |
bool updateStreamSpecification(); |
| 52 |
bool isBetween(MediaNode *source, MediaNode *sink); |
| 53 |
bool isValid(); |
| 54 |
bool isSinkOnly(); |
| 55 |
void freeMemoryAllocations(); |
| 56 |
void invalidate(); |
| 57 |
|
| 58 |
MediaNode *m_source; |
| 59 |
AudioNode *m_sourceAudioNode; |
| 60 |
int m_sourceOutputBus; |
| 61 |
|
| 62 |
MediaNode *m_sink; |
| 63 |
AudioNode *m_sinkAudioNode; |
| 64 |
int m_sinkInputBus; |
| 65 |
|
| 66 |
AudioChannelLayout *m_sourceChannelLayout; |
| 67 |
UInt32 m_sourceChannelLayoutSize; |
| 68 |
|
| 69 |
AudioChannelLayout *m_sinkChannelLayout; |
| 70 |
UInt32 m_sinkChannelLayoutSize; |
| 71 |
|
| 72 |
AudioStreamBasicDescription m_sourceStreamDescription; |
| 73 |
AudioStreamBasicDescription m_sinkStreamDescription; |
| 74 |
|
| 75 |
bool m_hasSourceSpecification; |
| 76 |
bool m_hasSinkSpecification; |
| 77 |
bool m_connected; |
| 78 |
}; |
| 79 |
|
| 80 |
}} // namespace Phonon::QT7 |
| 81 |
|
| 82 |
QT_END_NAMESPACE |
| 83 |
|
| 84 |
#endif // Phonon_QT7_AudioConnection_H |