qm-dsp  1.8
Framer.h
Go to the documentation of this file.
00001 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*-  vi:set ts=8 sts=4 sw=4: */
00002 
00003 /*
00004     QM DSP Library
00005 
00006     Centre for Digital Music, Queen Mary, University of London.
00007     This file 2005-2006 Christian Landone.
00008 
00009     This program is free software; you can redistribute it and/or
00010     modify it under the terms of the GNU General Public License as
00011     published by the Free Software Foundation; either version 2 of the
00012     License, or (at your option) any later version.  See the file
00013     COPYING included with this distribution for more information.
00014 */
00015 
00016 #ifndef FRAMER_H
00017 #define FRAMER_H
00018 
00019 //#include <io.h>
00020 #include <fcntl.h>
00021 #include <stdio.h>
00022 
00023 
00024 class Framer  
00025 {
00026 public:
00027     void setSource( double* src, unsigned int length );
00028     unsigned int getMaxNoFrames();
00029     void getFrame( double* dst );
00030     void configure( unsigned int frameLength, unsigned int hop );
00031     Framer();
00032     virtual ~Framer();
00033 
00034     void resetCounters();
00035 
00036 private:
00037 
00038     unsigned long       m_ulSampleLen;          // DataLength (samples)
00039     unsigned int        m_framesRead;           // Read Frames Index
00040 
00041     double*                     m_srcBuffer;
00042     double*                     m_dataFrame;            // Analysis Frame Buffer
00043     double*                     m_strideFrame;          // Stride Frame Buffer
00044     unsigned int        m_frameLength;          // Analysis Frame Length
00045     unsigned int        m_stepSize;             // Analysis Frame Stride
00046 
00047     unsigned int        m_maxFrames;
00048 
00049     unsigned long       m_ulSrcIndex;
00050 };
00051 
00052 #endif