source: trunk/poppler/mypoppler/poppler/Sound.h @ 461

Last change on this file since 461 was 250, checked in by Eugene Romanenko, 13 years ago

PDF plugin: poppler library updated to version 0.8.3

File size: 2.0 KB
Line 
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., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
17 */
18
19#ifndef Sound_H
20#define Sound_H
21
22class GooString;
23class Object;
24class Stream;
25
26//------------------------------------------------------------------------
27
28enum SoundKind {
29  soundEmbedded,                // embedded sound
30  soundExternal                 // external sound
31};
32
33enum SoundEncoding {
34  soundRaw,                     // raw encoding
35  soundSigned,                  // twos-complement values
36  soundMuLaw,                   // mu-law-encoded samples
37  soundALaw                     // A-law-encoded samples
38};
39
40class Sound
41{
42public:
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
61private:
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
Note: See TracBrowser for help on using the repository browser.