Logo Search packages:      
Sourcecode: csound version File versions

diskin2.h

/*
    diskin2.h:

    Copyright (C) 2005 Istvan Varga

    This file is part of Csound.

    The Csound Library is free software; you can redistribute it
    and/or modify it under the terms of the GNU Lesser General Public
    License as published by the Free Software Foundation; either
    version 2.1 of the License, or (at your option) any later version.

    Csound is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public
    License along with Csound; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA
*/

#ifndef CSOUND_DISKIN2_H
#define CSOUND_DISKIN2_H

#include <sndfile.h>

#define DISKIN2_MAXCHN  24              /* for consistency with soundin   */
#define POS_FRAC_SHIFT  28              /* allows pitch accuracy of 2^-28 */
#define POS_FRAC_SCALE  0x10000000
#define POS_FRAC_MASK   0x0FFFFFFF

typedef struct {
    OPDS    h;
    MYFLT   *aOut[DISKIN2_MAXCHN];
    MYFLT   *iFileCode;
    MYFLT   *kTranspose;
    MYFLT   *iSkipTime;
    MYFLT   *iWrapMode;
    MYFLT   *iSampleFormat;
    MYFLT   *iWinSize;
    MYFLT   *iBufSize;
    MYFLT   *iSkipInit;
 /* ------------------------------------- */
    int     initDone;
    int     nChannels;
    int     bufSize;            /* in sample frames, power of two */
    int     wrapMode;
    int32    fileLength;         /* in sample frames */
    int32    bufStartPos;
    int64_t pos_frac;           /* type should be defined in sysdep.h */
    int64_t pos_frac_inc;
    int32    prvBufStartPos;
    int32    winSize;
    MYFLT   *buf;
    MYFLT   *prvBuf;
    MYFLT   prv_kTranspose;
    MYFLT   winFact;
    double  warpScale;
    SNDFILE *sf;
    FDCH    fdch;
    AUXCH   auxData;            /* for dynamically allocated buffers */
} DISKIN2;

int diskin2_init(CSOUND *csound, DISKIN2 *p);
int diskin2_perf(CSOUND *csound, DISKIN2 *p);

typedef struct {
    OPDS    h;
    MYFLT   *aOut[DISKIN2_MAXCHN];
    MYFLT   *iFileCode, *iSkipTime, *iSampleFormat, *iSkipInit, *iBufSize;
    int     nChannels;
    int     bufSize;            /* in sample frames (power of two) */
    int_least64_t   fileLength; /* in sample frames */
    int_least64_t   bufStartPos;
    int_least64_t   read_pos;   /* current sample frame being read */
    MYFLT   *buf;
    SNDFILE *sf;
    MYFLT   scaleFac;
    FDCH    fdch;
    AUXCH   auxData;            /* for dynamically allocated buffers */
} SOUNDIN_;

#endif      /* CSOUND_DISKIN2_H */


Generated by  Doxygen 1.6.0   Back to index