1 | /* This file is part of the KDE project |
2 | Copyright (C) 2005 Matthias Kretz <kretz@kde.org> |
3 | |
4 | This library is free software; you can redistribute it and/or |
5 | modify it under the terms of the GNU Lesser General Public |
6 | License as published by the Free Software Foundation; either |
7 | version 2.1 of the License, or (at your option) version 3, or any |
8 | later version accepted by the membership of KDE e.V. (or its |
9 | successor approved by the membership of KDE e.V.), Nokia Corporation |
10 | (or its successors, if any) and the KDE Free Qt Foundation, which shall |
11 | act as a proxy defined in Section 6 of version 3 of the license. |
12 | |
13 | This library is distributed in the hope that it will be useful, |
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
16 | Lesser General Public License for more details. |
17 | |
18 | You should have received a copy of the GNU Lesser General Public |
19 | License along with this library. If not, see <http://www.gnu.org/licenses/>. |
20 | |
21 | */ |
22 | |
23 | #include "audiodataoutput.h" |
24 | #include "audiodataoutput_p.h" |
25 | #include "factory_p.h" |
26 | |
27 | #define PHONON_CLASSNAME AudioDataOutput |
28 | |
29 | namespace Phonon |
30 | { |
31 | |
32 | PHONON_HEIR_IMPL(AbstractAudioOutput) |
33 | |
34 | PHONON_GETTER(int, dataSize, d->dataSize) |
35 | PHONON_GETTER(int, sampleRate, -1) |
36 | PHONON_SETTER(setDataSize, dataSize, int) |
37 | |
38 | bool AudioDataOutputPrivate::aboutToDeleteBackendObject() |
39 | { |
40 | Q_ASSERT(m_backendObject); |
41 | pBACKEND_GET(int, dataSize, "dataSize" ); |
42 | |
43 | return AbstractAudioOutputPrivate::aboutToDeleteBackendObject(); |
44 | } |
45 | |
46 | void AudioDataOutputPrivate::setupBackendObject() |
47 | { |
48 | P_Q(AudioDataOutput); |
49 | Q_ASSERT(m_backendObject); |
50 | AbstractAudioOutputPrivate::setupBackendObject(); |
51 | |
52 | // set up attributes |
53 | pBACKEND_CALL1("setDataSize" , int, dataSize); |
54 | |
55 | qRegisterMetaType<QMap<Phonon::AudioDataOutput::Channel, QVector<qint16> > >(typeName: "QMap<Phonon::AudioDataOutput::Channel, QVector<qint16> >" ); |
56 | |
57 | QObject::connect(sender: m_backendObject, |
58 | SIGNAL(dataReady(QMap<Phonon::AudioDataOutput::Channel,QVector<qint16> >)), |
59 | receiver: q, SIGNAL(dataReady(QMap<Phonon::AudioDataOutput::Channel,QVector<qint16> >))); |
60 | QObject::connect(sender: m_backendObject, SIGNAL(endOfMedia(int)), receiver: q, SIGNAL(endOfMedia(int))); |
61 | } |
62 | |
63 | } // namespace Phonon |
64 | |
65 | #undef PHONON_CLASSNAME |
66 | // vim: sw=4 ts=4 tw=80 |
67 | |