Okular

sound.h
1 /*
2  SPDX-FileCopyrightText: 2006 Pino Toscano <[email protected]>
3 
4  SPDX-License-Identifier: GPL-2.0-or-later
5 */
6 
7 #ifndef _OKULAR_SOUND_H_
8 #define _OKULAR_SOUND_H_
9 
10 #include "okularcore_export.h"
11 
12 #include <QByteArray>
13 #include <QString>
14 
15 namespace Okular
16 {
17 /**
18  * @short Contains information about a sound object.
19  *
20  * This class encapsulates the information about a sound object
21  * which is used for links on enter/leave page event.
22  */
23 class OKULARCORE_EXPORT Sound
24 {
25 public:
26  /**
27  * Describes where the sound is stored.
28  */
29  enum SoundType {
30  External, ///< Is stored at external resource (e.g. url)
31  Embedded ///< Is stored embedded in the document
32  };
33 
34  /**
35  * Describes the encoding of the sound data.
36  */
38  Raw, ///< Is not encoded
39  Signed, ///< Is encoded with twos-complement values
40  muLaw, ///< Is µ-law encoded
41  ALaw ///< Is A-law encoded
42  };
43 
44  /**
45  * Creates a new sound object with the given embedded
46  * sound @p data.
47  */
48  explicit Sound(const QByteArray &data);
49 
50  /**
51  * Creates a new sound object with the given external @p url.
52  */
53  explicit Sound(const QString &url);
54 
55  /**
56  * Destroys the sound object.
57  */
58  ~Sound();
59 
60  /**
61  * Returns the type of the sound object.
62  */
63  SoundType soundType() const;
64 
65  /**
66  * Returns the external storage url of the sound data.
67  */
68  QString url() const;
69 
70  /**
71  * Returns the embedded sound data.
72  */
73  QByteArray data() const;
74 
75  /**
76  * Sets the sampling @p rate.
77  */
78  void setSamplingRate(double rate);
79 
80  /**
81  * Returns the sampling rate.
82  */
83  double samplingRate() const;
84 
85  /**
86  * Sets the number of @p channels.
87  */
88  void setChannels(int channels);
89 
90  /**
91  * Returns the number of channels.
92  */
93  int channels() const;
94 
95  /**
96  * Sets the bits per sample @p bitsPerSample.
97  */
98  void setBitsPerSample(int bitsPerSample);
99 
100  /**
101  * Returns the bits per sample rate.
102  */
103  int bitsPerSample() const;
104 
105  /**
106  * Sets the type of sound @p encoding.
107  */
108  void setSoundEncoding(SoundEncoding encoding);
109 
110  /**
111  * Returns the sound encoding.
112  */
113  SoundEncoding soundEncoding() const;
114 
115 private:
116  class Private;
117  Private *const d;
118 
119  Q_DISABLE_COPY(Sound)
120 };
121 
122 }
123 
124 #endif
SoundType
Describes where the sound is stored.
Definition: sound.h:29
Contains information about a sound object.
Definition: sound.h:23
The documentation to the global Okular namespace.
Definition: action.h:16
SoundEncoding
Describes the encoding of the sound data.
Definition: sound.h:37
@ External
Is stored at external resource (e.g. url)
Definition: sound.h:30
@ Raw
Is not encoded.
Definition: sound.h:38
@ Signed
Is encoded with twos-complement values.
Definition: sound.h:39
@ muLaw
Is µ-law encoded.
Definition: sound.h:40
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Tue Sep 26 2023 04:06:53 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.