You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

60 lines
1.2 KiB

/**
* @file sound.h
*
* Interface of functions setting up the audio pipeline.
*/
#pragma once
#include <cstdint>
#include "miniwin/miniwin.h"
#include "utils/soundsample.h"
namespace devilution {
#define VOLUME_MIN -1600
#define VOLUME_MAX 0
enum _music_id : uint8_t {
TMUSIC_TOWN,
TMUSIC_L1,
TMUSIC_L2,
TMUSIC_L3,
TMUSIC_L4,
TMUSIC_L5,
TMUSIC_L6,
TMUSIC_INTRO,
NUM_MUSIC,
};
struct TSnd {
const char *sound_path;
/** Used for streamed audio */
HANDLE file_handle;
SoundSample *DSB;
Uint32 start_tc;
};
extern bool gbSndInited;
void snd_update(bool bStopAll);
void snd_stop_snd(TSnd *pSnd);
bool snd_playing(TSnd *pSnd);
void snd_play_snd(TSnd *pSnd, int lVolume, int lPan);
TSnd *sound_file_load(const char *path, bool stream = false);
void sound_file_cleanup(TSnd *sound_file);
void snd_init();
void snd_deinit();
void music_stop();
void music_start(uint8_t nTrack);
void sound_disable_music(bool disable);
int sound_get_or_set_music_volume(int volume);
int sound_get_or_set_sound_volume(int volume);
/* data */
extern bool gbMusicOn;
extern bool gbSoundOn;
extern bool gbDupSounds;
} // namespace devilution