85 lines
3.8 KiB
C
85 lines
3.8 KiB
C
//==============================================================================================
|
|
// FICHIER D'EN-TETE DU MODULE DE TRAITEMENT DE L'"ADPCM"
|
|
//
|
|
// Créer : 23 / 01 / 98
|
|
// Auteur : Nicolas Meyer
|
|
// Fichier : ApmVoice.h
|
|
//
|
|
// Descriptif: Définitions de la structure d'une voie ADPCM
|
|
//
|
|
//==============================================================================================
|
|
|
|
#ifndef _APMVOICE_H_
|
|
#define _APMVOICE_H_
|
|
|
|
/*********************************************************************************************************
|
|
// DEFINITION DE STRUCTURES
|
|
|
|
*/
|
|
// Structure décrivant les callbacks ADPCM
|
|
typedef struct _SND_tdstADPCMCallback {
|
|
SND_td_pfn_vSoundCallback pfnCallBack; // Pointeur callback
|
|
long lCallbackParam;
|
|
} SND_tdstADPCMCallback;
|
|
typedef SND_tdstADPCMCallback* lpSND_tdstADPCMCallback;
|
|
|
|
// Pointeur de fonction
|
|
typedef void ( * SND_td_pfn_vADPCMCallback )( lpSND_tdstADPCMCallback pstCall );
|
|
|
|
|
|
// Structure décrivant une voie ADPCM (188 octets)
|
|
typedef struct _SND_tdstADPCMVoice SND_tdstADPCMVoice;
|
|
typedef SND_tdstADPCMVoice* lpSND_tdstADPCMVoice;
|
|
typedef lpSND_tdstADPCMVoice* hSND_tdstADPCMVoice; //Handle
|
|
typedef struct _SND_tdstADPCMVoice {
|
|
unsigned short unChannels;
|
|
unsigned short unSamplesPerSec; // Fréquence d'enregistrement des samples
|
|
// Gestion des CallBack
|
|
SND_tdstADPCMCallback stCall;
|
|
// Flags statiques
|
|
ApmBool bVolable; // Flag volume
|
|
ApmBool bPanable; // Flag panoramique
|
|
ApmBool bPitchable; // Flag pitch
|
|
unsigned long ulStaticVolume; // Volume statique de la ressource
|
|
// Flags dynamique
|
|
ApmBool bPause; // Flag en pause
|
|
ApmBool bStream; // Flag stream
|
|
ApmBool bLoop; // Flag bouclage
|
|
// Gestion de la voie et du Fade
|
|
ApmBool bIsPlaying; // Flag voie en cours
|
|
ApmBool bFade; // Flag transition avec Fade
|
|
ApmBool bFadeIn; // Flag de fade ascendant ou descendant
|
|
ApmBool bCallbackDone; // Appel à la callback effectué
|
|
// Paramètres généraux
|
|
long lVolume; // Volume 0 < valeur < 127
|
|
long lPan; // Panoramique 0 < valeur < 127
|
|
unsigned long ulPitch; // Pitch réél 23_9
|
|
long lCoeffLeft; // Coefficient gauche
|
|
long lCoeffRight; // Coefficient droit
|
|
//( Mettre impérativement Right aprés Left pour les optimisations MMX )
|
|
unsigned long ulNbSample; // Nombre d'échantillons total
|
|
unsigned long ulBufferStart; // Contient le nombre de samples buffer à la création de la voie
|
|
unsigned long ulSampleStart; // Indice du sample vers lequel on doit reboucler
|
|
unsigned long ulSampleLength; // Taille de la boucle en sample
|
|
unsigned long ulSamplePos; // Position courante(décompression) du sample en tenant compte du pitch
|
|
// Gestion des données compressées en mémoire
|
|
char* pchBeginDatas; // Pointeur sur le début des données ADPCM
|
|
char* pchCurrentDatas; // Pointeur sur la donnée courante ADPCM
|
|
char* pchEndDatas; // Pointeur sur la dernière donnée ADPCM
|
|
tdhSndFile* phFile; // Pointeur sur une structure décrivant un stream
|
|
tduState uInitEnv; // Conditions initiales de décompression
|
|
tduState uEnv; // Etat de décompression de la voie
|
|
tduState uLoop; // Etat de décompression au point de bouclage
|
|
// Gestion des thèmes
|
|
lpSND_tdstADPCMVoice pstTheme; // Pointeur sur le prochain bloc thème
|
|
unsigned long ulNbSampleFade; // Indice de progression au cours du fade
|
|
unsigned long ulFadeStep; // Scale fade factor
|
|
tduRefRes uRefRes; // ressource associée
|
|
hSND_tdstADPCMVoice hstVoice; // Handle de la voie
|
|
ApmBool bTheme; // La voie courante est un théme
|
|
// Assynchronous buffer manage
|
|
ApmBool bIsFinishing; // Permit to the assynchronous buffer to end
|
|
unsigned long ulBufferEnd;
|
|
} SND_tdstADPCMVoice;
|
|
|
|
#endif // _APMVOICE_H_
|