summaryrefslogtreecommitdiffstats
path: root/mpeglib/lib/output/audioTime.h
blob: 3b16bb028a4f6b4fbf690cf8b1af8acaa607352c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/*
  defines the format of an audio stream
  Copyright (C) 1999  Martin Vogt

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU Library General Public License as published by
  the Free Software Foundation.

  For more information look at the file COPYRIGHT in this package

 */




#ifndef __AUDIOTIME_H
#define __AUDIOTIME_H

#include "../util/timeWrapper.h"

class AudioTime  {

  int stereo;
  int samplesize;
  int speed;
  int _sign;
  int _bigendian;
  float time;

 public:
  AudioTime();
  ~AudioTime();

  //cd-quality:true,16,44100
  void setFormat(int stereo,int samplesize,int speed,int sign=true, int bigendian=false);

  int getStereo();
  int getSampleSize();
  int getSpeed();
  int getSign();
  int getBigendian();

  void setStereo(int stereo);
  void setSampleSize(int samplesize);
  void setSpeed(int speed);
  void setSign(int sign);
  void setBigendian(int bigendian);


  float getTime();
  void setTime(float time);
  void forwardTime(int bytes);

  // do not modify the internal time
  float calculateTime(int bytes);
  int calculateBytes(float time);

  void sleepWrite(int size);

  
  void copyTo(AudioTime* audioTime);
  void print();
  
};



#endif