1 /***************************************************************************
2 * Copyright (C) 2006 by Pino Toscano <pino@kde.org> *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (at your option) any later version. *
8 ***************************************************************************/
12 #include <QtCore/QVariant>
14 using namespace Okular
;
19 Private( const QByteArray
&data
)
20 : m_data( QVariant( data
) ),
21 m_type( Sound::Embedded
)
26 Private( const QString
&url
)
27 : m_data( QVariant( url
) ),
28 m_type( Sound::External
)
35 m_samplingRate
= 44100.0;
38 m_soundEncoding
= Sound::Raw
;
42 Sound::SoundType m_type
;
43 double m_samplingRate
;
46 SoundEncoding m_soundEncoding
;
49 Sound::Sound( const QByteArray
& data
)
50 : d( new Private( data
) )
54 Sound::Sound( const QString
& url
)
55 : d( new Private( url
) )
64 Sound::SoundType
Sound::soundType() const
69 QString
Sound::url() const
71 return d
->m_type
== Sound::External
? d
->m_data
.toString() : QString();
74 QByteArray
Sound::data() const
76 return d
->m_type
== Sound::Embedded
? d
->m_data
.toByteArray() : QByteArray();
79 double Sound::samplingRate() const
81 return d
->m_samplingRate
;
84 void Sound::setSamplingRate( double samplingRate
)
86 d
->m_samplingRate
= samplingRate
;
89 int Sound::channels() const
94 void Sound::setChannels( int channels
)
96 d
->m_channels
= channels
;
99 int Sound::bitsPerSample() const
101 return d
->m_bitsPerSample
;
104 void Sound::setBitsPerSample( int bitsPerSample
)
106 d
->m_bitsPerSample
= bitsPerSample
;
109 Sound::SoundEncoding
Sound::soundEncoding() const
111 return d
->m_soundEncoding
;
114 void Sound::setSoundEncoding( Sound::SoundEncoding soundEncoding
)
116 d
->m_soundEncoding
= soundEncoding
;