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

📄 equalization.h

📁 使用软件的实现EQ均衡器算法
💻 H
字号:
// maEqualizer.h

/*
 * MoreAmp
 * Copyright (C) 2004-2006 pmisteli
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program 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 General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 *
 */

#ifndef __MAEQUALIZER_H__
#define __MAEQUALIZER_H__

typedef struct
{
	int infiletype;
	FILE *fp;
	char inpath[MAX_PATH];			// songfile path
	int nomem;						// don't use song mem
	void *threadplay;				// thread playing inpath
	void *pthreadplayid;			// pointer to MPTaskID on Mac, to HANDLE on win, to pthread_t on unix 
	int threadplayprilo;
	int threadplayprihi;
	int size;						// songfile size in bytes
	int duration;					// total playing time in ms
	int bitrate;					// average bitrate in kbps
	int position;					// current playing position in ms
	double mp3attenuation;			// mp3 attenuation when limiter is on
	int seek;						// seek target in ms, or -1
	int stop;						// stop flag
	int insamplerate;				// songfile samplerate
	int inchannels;					// songfile number of channels
	int inwordsbigendian;			// songfile decoded data
	int ininterleaved;				// songfile decoded data
	void *fsf;						// aif SNDFILE *
	void *psf;						// aif SF_PRIVATE *
} MASTATE;

MASTATE g_state;

#define EQBANDS31 31					// larger number of pcm equalizer bands (sliders)
#define EQBANDS10 10					// lesser number of pcm equalizer bands

#define EQSLIDERFIRST 0					// first pcm equalizer slider index
#define EQSLIDERLAST (EQBANDS31 - 1)	// last  pcm equalizer slider index
#define EQNAMELEN 32					// max length of name of equalizer preset
#define EQSLIDERMAX 64					// pcm equalizer slider limits
#define EQSLIDERMIN 0
#define EQNUMPRESETS 16					// sets of pcm equalizer slider values

#ifdef __cplusplus
extern "C"
{
#endif

typedef int magboolean;
typedef int magint;

typedef struct
{
	magint band_num;
	//magboolean use_xmms_original_freqs, use_independent_channels;
	magboolean equalizer_active;
	magboolean extra_filtering;
#ifdef EQUSEFIXED
	magboolean use_fixed;
#endif
	//magint freq;
	magboolean bits16;
}
EQConfig;

typedef struct
{
	int Enabled;
	char Levels[EQBANDS31];
} maEqualizerSettings;

extern maEqualizerSettings g_EqualizerSettings;
extern EQConfig eqcfg;

void maEqualizerReset(int bands, int bits16, int extra);
void maEqualizerSetLevels(int bands31, int dboffset);
void maEqualizeBlock(void* pcmblock, unsigned long pcmblocksize);

#ifdef __cplusplus
}
#endif

#endif // __MAEQUALIZER_H__

// eof

⌨️ 快捷键说明

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