1
0
mirror of https://github.com/blupi-games/planetblupi synced 2024-12-30 10:15:36 +01:00
planetblupi/sound.h

63 lines
1.3 KiB
C
Raw Normal View History

2017-01-21 17:27:46 +01:00
// sound.h
//
#pragma once
#include <stdio.h>
2017-02-04 18:01:56 +01:00
#include <Windows.h>
#include <SDL_mixer.h>
2017-01-21 17:27:46 +01:00
/////////////////////////////////////////////////////////////////////////////
#define MAXSOUND 100
#define MAXVOLUME 20
#define MAXBLUPI 100
class CSound
{
public:
CSound();
~CSound();
bool Create();
void SetState(bool bState);
bool GetEnable();
2017-01-21 17:27:46 +01:00
void SetAudioVolume(int volume);
int GetAudioVolume();
void SetMidiVolume(int volume);
int GetMidiVolume();
void CacheAll();
bool Cache(int channel, char *pFilename);
2017-01-21 17:27:46 +01:00
void Flush(int channel);
bool Play(int channel, int volume=0, Uint8 panLeft = 255, Uint8 panRight = 255);
bool PlayImage(int channel, POINT pos, int rank=-1);
2017-02-04 18:01:56 +01:00
bool PlayMusic(LPSTR lpszMIDIFilename);
bool RestartMusic();
2017-01-21 17:27:46 +01:00
void SuspendMusic();
void StopMusic();
bool IsPlayingMusic();
bool IsStoppedOnDemand ();
2017-01-21 17:27:46 +01:00
void AdaptVolumeMusic();
void SetSuspendSkip(int nb);
bool StopAllSounds();
2017-01-21 17:27:46 +01:00
protected:
bool m_bEnable;
bool m_bState;
bool m_bStopped;
Mix_Music *m_pMusic;
Mix_Chunk *m_lpSDL[MAXSOUND];
2017-01-21 17:27:46 +01:00
short m_channelBlupi[MAXBLUPI];
char m_MIDIFilename[50];
int m_audioVolume;
int m_midiVolume;
int m_lastMidiVolume;
int m_nbSuspendSkip;
};
/////////////////////////////////////////////////////////////////////////////