~ubuntu-branches/ubuntu/hoary/kdemultimedia/hoary

« back to all changes in this revision

Viewing changes to mpeglib/lib/frame/audioFrame.h

  • Committer: Bazaar Package Importer
  • Author(s): Martin Schulze
  • Date: 2003-01-22 15:00:51 UTC
  • Revision ID: james.westby@ubuntu.com-20030122150051-uihwkdoxf15mi1tn
Tags: upstream-2.2.2
ImportĀ upstreamĀ versionĀ 2.2.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
  abstract definition of an audio frame
 
3
  Copyright (C) 2001  Martin Vogt
 
4
 
 
5
  This program is free software; you can redistribute it and/or modify
 
6
  it under the terms of the GNU Library General Public License as published by
 
7
  the Free Software Foundation.
 
8
 
 
9
  For more information look at the file COPYRIGHT in this package
 
10
 
 
11
 */
 
12
 
 
13
 
 
14
 
 
15
 
 
16
#ifndef __AUDIOFRAME_H
 
17
#define __AUDIOFRAME_H
 
18
 
 
19
 
 
20
#ifdef HAVE_CONFIG_H
 
21
#include "config.h"
 
22
#endif
 
23
 
 
24
#ifndef WORDS_BIGENDIAN
 
25
#define AUDIOFRAME_BIGENDIAN 1
 
26
#else
 
27
#define AUDIOFRAME_BIGENDIAN 0
 
28
#endif
 
29
 
 
30
#include "frame.h"
 
31
 
 
32
#define SCALFACTOR           SHRT_MAX
 
33
#define MP3FRAMESIZE         (2*2*2*32*18)
 
34
 
 
35
 
 
36
class AudioFrame : public Frame {
 
37
 
 
38
  int stereo;
 
39
  int frequencyHZ;
 
40
  
 
41
 public:
 
42
  AudioFrame();
 
43
  virtual ~AudioFrame();
 
44
 
 
45
  // info about "import" data
 
46
  void setFrameFormat(int stereo,int freq);
 
47
 
 
48
  inline int getStereo()      { return stereo;      }
 
49
  inline int getFrequenceHZ() { return frequencyHZ; }
 
50
 
 
51
  // these return values depend on the implementation
 
52
  // how the data is stored internally after "import"
 
53
  inline int getSampleSize()  { return sampleSize;  }
 
54
  inline int getBigEndian()   { return lBigEndian;  }
 
55
  inline int getSigned()      { return lSigned;     }
 
56
 
 
57
  // info about output
 
58
  virtual int getLen();
 
59
  virtual void setLen(int len);
 
60
  virtual int getSize();
 
61
  virtual void clearrawdata();
 
62
 
 
63
  // data import
 
64
  virtual void putFloatData(float* data,int len);
 
65
  virtual void putFloatData(float* left,float* right,int len);
 
66
 
 
67
 
 
68
  int isFormatEqual(AudioFrame* compare);
 
69
  // Note: this can only be called with _real_ AudioFrame's as dest
 
70
  void copyFormat(AudioFrame* dest);
 
71
 
 
72
  void print(const char* msg);
 
73
 
 
74
 protected:
 
75
  int sampleSize;
 
76
  int lBigEndian;
 
77
  int lSigned;
 
78
 
 
79
};
 
80
 
 
81
 
 
82
#endif