instrmnt.cpp

来自「Mobile STK for Symbian OS V0.1」· C++ 代码 · 共 88 行

CPP
88
字号
/***************************************************//*! \class Instrmnt    \brief STK instrument abstract base class.    This class provides a common interface for    all STK instruments.    by Perry R. Cook and Gary P. Scavone, 1995 - 2005.*//***************************************************/#include "Instrmnt.h"Instrmnt :: Instrmnt(){}Instrmnt :: ~Instrmnt(){}void Instrmnt :: setFrequency(StkFloat frequency){#if !defined(SYMBIAN)  errorString_ << "Instrmnt::setFrequency: virtual setFrequency function call!";  handleError( StkError::WARNING );#endif}StkFloat Instrmnt :: lastOut() const{  return lastOutput_;}// Support for stereo output:StkFloat Instrmnt :: lastOutLeft(void) const{  return 0.5 * lastOutput_;}                                                                                StkFloat Instrmnt :: lastOutRight(void) const{  return 0.5 * lastOutput_;}StkFloat Instrmnt :: tick( void ){  return computeSample();}StkFrames& Instrmnt :: tick( StkFrames& frames, unsigned int channel ){  if ( channel >= frames.channels() ) {#if !defined(SYMBIAN)    errorString_ << "Instrmnt::tick(): channel and StkFrames arguments are incompatible!";    handleError( StkError::FUNCTION_ARGUMENT );#endif  }  if ( frames.channels() == 1 ) {    for ( unsigned int i=0; i<frames.frames(); i++ )      frames[i] = tick();  }  else if ( frames.interleaved() ) {    unsigned int hop = frames.channels();    unsigned int index = channel;    for ( unsigned int i=0; i<frames.frames(); i++ ) {      frames[index] = tick();      index += hop;    }  }  else {    unsigned int iStart = channel * frames.frames();    for ( unsigned int i=0; i<frames.frames(); i++, iStart++ )      frames[iStart] = tick();  }  return frames;}void Instrmnt :: controlChange(int number, StkFloat value){#if !defined(SYMBIAN)  errorString_ << "Instrmnt::controlChange: virtual function call!";  handleError( StkError::WARNING );#endif}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?