⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 symbmath.h

📁 Mobile STK for Symbian OS V0.1
💻 H
字号:
#ifndef __SYMBMATH_H_
#define __SYMBMATH_H_

#include <e32math.h>
#define SYMB_ANSIMATH
#ifdef SYMB_ANSIMATH
#include <math.h>
#endif
#include <stdlib.h>
#include "Stk.h"
#include "ADSR.h"
#include "WaveLoop.h"
#include "FileWvIn.h"
//#include "Granulate.h"

#define FLT_EPSILON 1.192092896e-07F
#ifndef SYMB_ANSIMATH
//#define RAND_MAX KMaxTUint32
//KMaxTInt


TReal cos(TReal);
TReal sin(TReal);
TReal sqrt(TReal);
TReal pow(TReal,TReal);
TReal exp(TReal);
TReal fabs(TReal);
TReal floor(TReal);
TReal ceil(TReal);
TReal atan2(TReal, TReal);
TReal log(TReal);
TUint32 rand();
TInt srand(unsigned int &aSeed);

#endif

class FloatVector
{
public:
	FloatVector();
	FloatVector(int size, TReal init=0.0);
	~FloatVector();
	void push_back(const TReal &t);
	const int size();
	void resize(int size);
	void clear();
	TReal& operator[] ( unsigned long idx );
private:
	int _size;
	int _pos;
	TReal *_vector;
	TReal iErr;
	int dcnt;

};

class IntVector
{
public:
	IntVector();
	IntVector(int size, TInt init=0.0);
	~IntVector();
	void push_back(const TInt &t);
	const int size();
	void resize(int size);
	void clear();
	TInt& operator[] ( unsigned long idx );
private:
	int _size;
	int _pos;
	TInt *_vector;
	TInt iErr;
	int dcnt;

};

class ADSRVector
{
public:
	ADSRVector();
	ADSRVector(int size, ADSR * init=0);
	~ADSRVector();
	void push_back(ADSR *t);
	const int size();
	void resize(int size);
//	void clear();
	ADSR*& operator[] ( unsigned long idx );
private:
	int _size;
	int _pos;
	ADSR **_vector;
	ADSR *iErr;
	int dcnt;

};

class WaveLoopVector
{
public:
	WaveLoopVector();
	WaveLoopVector(int size, WaveLoop * init=0);
	~WaveLoopVector();
	void push_back(WaveLoop *t);
	const int size();
	void resize(int size);
//	void clear();
	WaveLoop*& operator[] ( unsigned long idx );
private:
	int _size;
	int _pos;
	WaveLoop **_vector;
	WaveLoop *iErr;
	int dcnt;

};

class FileWvInVector
{
public:
	FileWvInVector();
	FileWvInVector(int size, FileWvIn * init=0);
	~FileWvInVector();
	void push_back(FileWvIn *t);
	const int size();
	void resize(int size);
//	void clear();
	FileWvIn*& operator[] ( unsigned long idx );
private:
	int _size;
	int _pos;
	FileWvIn **_vector;
	FileWvIn *iErr;
	int dcnt;

};

//#if defined(SYMBIAN)enum GrainState {    GRAIN_STOPPED,    GRAIN_FADEIN,    GRAIN_SUSTAIN,    GRAIN_FADEOUT  };struct Grain {    StkFloat eScaler;    StkFloat eRate;    unsigned long attackCount;    unsigned long sustainCount;    unsigned long decayCount;    unsigned long delayCount;    unsigned long counter;    unsigned long pointer;    unsigned long startPointer;    unsigned int repeats;    GrainState state;    // Default constructor.    Grain()      :eScaler(0.0), eRate(0.0), attackCount(0), sustainCount(0), decayCount(0),       delayCount(0), counter(0), pointer(0), startPointer(0), repeats(0), state(GRAIN_STOPPED) {}};//#endif

class GrainVector
{
public:
	GrainVector();
	GrainVector(int size, Grain &init);
	~GrainVector();
	void push_back(Grain &t);
	const int size();
	void resize(int size);
//	void clear();
	Grain& operator[] ( unsigned long idx );
private:
	int _size;
	int _pos;
	Grain *_vector;
	Grain iErr;
	int dcnt;

};


/*
class SYMBFILE
{
public:
	SYMBFILE();
	~SYMBFILE();
	int open();
	int seek();
	long read();
	long write();
	long tell();
private:
	RFs	iRFs;
	RFile iFile;
	long _pos;
}; 

int fclose( SYMBFILE *stream );
int fseek( SYMBFILE *stream, long offset, int origin );
size_t fread( void *buffer, size_t size, size_t count, SYMBFILE *stream );
size_t fwrite( const void *buffer, size_t size, size_t count, SYMBFILE *stream );
long ftell( SYMBFILE *stream );
SYMBFILE *fopen( const char *filename, const char *mode );
*/
#endif __SYMBMATH_H_

⌨️ 快捷键说明

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