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

« back to all changes in this revision

Viewing changes to mpeglib/lib/frame/floatFrame.cpp

  • 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
  stores frames as floats.
 
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
#include "floatFrame.h"
 
15
 
 
16
 
 
17
FloatFrame::FloatFrame(int size) {
 
18
  data=new float[size];
 
19
  len=0;
 
20
  this->size=size;
 
21
  this->sampleSize=sizeof(float)*8;
 
22
  this->lSigned=true;
 
23
  this->lBigEndian=AUDIOFRAME_BIGENDIAN;
 
24
  setFrameType(_FRAME_AUDIO_FLOAT);
 
25
}
 
26
 
 
27
 
 
28
FloatFrame::~FloatFrame() {
 
29
  delete data;
 
30
}
 
31
 
 
32
 
 
33
void FloatFrame::putFloatData(float* in,int lenCopy) {
 
34
  if ((len+lenCopy) > size) {
 
35
    cout << "cannot copy putFloatData. Does not fit"<<endl;
 
36
    exit(0);
 
37
  }
 
38
  memcpy(data+len,in,lenCopy*sizeof(float));
 
39
  len+=lenCopy;
 
40
 
 
41
 
 
42
}
 
43
 
 
44
 
 
45
void FloatFrame::putFloatData(float* left,float* right,int len) {
 
46
  cout << "not yet implemented"<<endl;
 
47
}