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 ***************************************************************************/
10 #ifndef _OKULAR_SOUND_H_
11 #define _OKULAR_SOUND_H_
13 #include <okular/core/okular_export.h>
15 #include <QtCore/QByteArray>
16 #include <QtCore/QString>
21 * @short Contains information about a sound object.
23 * This class encapsulates the information about a sound object
24 * which is used for links on enter/leave page event.
26 class OKULAR_EXPORT Sound
30 * Describes where the sound is stored.
33 External
, ///< Is stored at external resource (e.g. url)
34 Embedded
///< Is stored embedded in the document
38 * Describes the encoding of the sound data.
41 Raw
, ///< Is not encoded
42 Signed
, ///< Is encoded with twos-complement values
43 muLaw
, ///< Is ยต-law encoded
44 ALaw
///< Is A-law encoded
48 * Creates a new sound object with the given embedded
51 explicit Sound( const QByteArray
& data
);
54 * Creates a new sound object with the given external @p filename.
56 explicit Sound( const QString
& filename
);
59 * Destroys the sound object.
64 * Returns the type of the sound object.
66 SoundType
soundType() const;
69 * Returns the external storage url of the sound data.
74 * Returns the embedded sound data.
76 QByteArray
data() const;
79 * Sets the sampling @p rate.
81 void setSamplingRate( double rate
);
84 * Returns the sampling rate.
86 double samplingRate() const;
89 * Sets the number of @p channels.
91 void setChannels( int channels
);
94 * Returns the number of channels.
99 * Sets the bits per sample @p rate.
101 void setBitsPerSample( int rate
);
104 * Returns the bits per sample rate.
106 int bitsPerSample() const;
109 * Sets the type of sound @p encoding.
111 void setSoundEncoding( SoundEncoding encoding
);
114 * Returns the sound encoding.
116 SoundEncoding
soundEncoding() const;
122 Q_DISABLE_COPY( Sound
)