Mixxx

/home/maxime/Projets/Mixxx/1.10/mixxx/src/engine/enginebufferscalelinear.h

Go to the documentation of this file.
00001 /***************************************************************************
00002                           enginebufferscalelinear.h  -  description
00003                              -------------------
00004     begin                : Mon Apr 14 2003
00005     copyright            : (C) 2003 by Tue & Ken Haste Andersen
00006     email                : haste@diku.dk
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017 
00018 #ifndef ENGINEBUFFERSCALELINEAR_H
00019 #define ENGINEBUFFERSCALELINEAR_H
00020 
00021 #include "enginebufferscale.h"
00022 #include "readaheadmanager.h"
00023 
00030 const int kiLinearScaleReadAheadLength = 10240;
00031 
00032 
00033 class EngineBufferScaleLinear : public EngineBufferScale  {
00034 public:
00035     EngineBufferScaleLinear(ReadAheadManager *pReadAheadManager);
00036     ~EngineBufferScaleLinear();
00037     CSAMPLE *scale(double playpos, unsigned long buf_size,
00038                    CSAMPLE* pBase, unsigned long iBaseLength);
00039 
00040     void setBaseRate(double dBaseRate);
00041     double setTempo(double dTempo);
00042     void clear();
00043 
00044 private:
00045     CSAMPLE *do_scale(CSAMPLE* buf, unsigned long buf_size,
00046                       CSAMPLE* pBase, unsigned long iBaseLength,
00047                       int *samples_read);
00048 
00050     bool m_bBackwards;
00051     bool m_bClear;
00052     float m_fOldTempo;          
00055     float m_fOldBaseRate;       
00057     CSAMPLE *buffer_int;
00058     int buffer_int_size;
00059     CSAMPLE m_fPrevSample[2];
00060     // The read-ahead manager that we use to fetch samples
00061     ReadAheadManager* m_pReadAheadManager;
00062     double m_dCurSampleIndex;
00063     double m_dNextSampleIndex;
00064 
00065     /*QFile df;
00066     QTextStream writer;
00067     int buffer_count;*/
00068 };
00069 
00070 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines