SmartPDF - lightweight pdf viewer app for rosapps
[reactos.git] / rosapps / smartpdf / poppler / poppler / Sound.h
1 /* Sound.h - an object that holds the sound structure
2 * Copyright (C) 2006-2007, Pino Toscano <pino@kde.org>
3 *
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, or (at your option)
7 * any later version.
8 *
9 * This program 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 General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 */
18
19 #ifndef Sound_H
20 #define Sound_H
21
22 class GooString;
23 class Object;
24 class Stream;
25
26 //------------------------------------------------------------------------
27
28 enum SoundKind {
29 soundEmbedded, // embedded sound
30 soundExternal // external sound
31 };
32
33 enum SoundEncoding {
34 soundRaw, // raw encoding
35 soundSigned, // twos-complement values
36 soundMuLaw, // mu-law-encoded samples
37 soundALaw // A-law-encoded samples
38 };
39
40 class Sound
41 {
42 public:
43 // Try to parse the Object s
44 static Sound *parseSound(Object *s);
45
46 // Destructor
47 ~Sound();
48
49 Object *getObject() { return streamObj; }
50 Stream *getStream();
51
52 SoundKind getSoundKind() { return kind; }
53 GooString *getFileName() { return fileName; }
54 double getSamplingRate() { return samplingRate; }
55 int getChannels() { return channels; }
56 int getBitsPerSample() { return bitsPerSample; }
57 SoundEncoding getEncoding() { return encoding; }
58
59 Sound *copy();
60
61 private:
62 // Create a sound. The Object obj is ensured to be a Stream with a Dict
63 Sound(Object *obj, bool readAttrs = true);
64
65 Object *streamObj;
66 SoundKind kind;
67 GooString *fileName;
68 double samplingRate;
69 int channels;
70 int bitsPerSample;
71 SoundEncoding encoding;
72 };
73
74 #endif