mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-09-28 17:27:23 +02:00
8e02b90b76
This wrapper function is for (a) future-proofing (b) proactive prevention of future copy-pasting (c) to clarify that we never actually halt music in the SDL_mixer sense, we only pause it, so to check if the music is halted we actually check if the music is paused instead. This is important because Mix_PlayingMusic() does not check if the music is paused and Mix_PausedMusic() does not check if the music is halted.
81 lines
1.6 KiB
C++
81 lines
1.6 KiB
C++
#ifndef MUSIC_H
|
|
#define MUSIC_H
|
|
|
|
#include <vector>
|
|
|
|
#include "BinaryBlob.h"
|
|
#include "SoundSystem.h"
|
|
|
|
#define musicroom(rx, ry) ((rx) + ((ry) * 20))
|
|
|
|
/* The amount of "space" for the scale of the user-set volume. */
|
|
#define USER_VOLUME_MAX 256
|
|
|
|
/* It is advised that USER_VOLUME_MAX be divisible by this. */
|
|
#define USER_VOLUME_STEP 32
|
|
|
|
class musicclass
|
|
{
|
|
public:
|
|
musicclass(void);
|
|
void init(void);
|
|
void destroy(void);
|
|
|
|
void play(int t);
|
|
void resume();
|
|
void resumefade(const int fadein_ms);
|
|
void pause(void);
|
|
void haltdasmusik(void);
|
|
void silencedasmusik(void);
|
|
void fadeMusicVolumeIn(int ms);
|
|
void fadeMusicVolumeOut(const int fadeout_ms);
|
|
void fadeout(const bool quick_fade_ = true);
|
|
void fadein(void);
|
|
void processmusicfadein(void);
|
|
void processmusicfadeout(void);
|
|
void processmusic(void);
|
|
void niceplay(int t);
|
|
|
|
void changemusicarea(int x, int y);
|
|
|
|
int currentsong;
|
|
|
|
void playef(int t);
|
|
void pauseef(void);
|
|
void resumeef(void);
|
|
|
|
bool halted(void);
|
|
|
|
std::vector<SoundTrack> soundTracks;
|
|
std::vector<MusicTrack> musicTracks;
|
|
SoundSystem soundSystem;
|
|
bool safeToProcessMusic;
|
|
|
|
int nicechange; // -1 if no song queued
|
|
bool nicefade;
|
|
|
|
bool m_doFadeInVol;
|
|
bool m_doFadeOutVol;
|
|
int musicVolume;
|
|
|
|
/* 0..USER_VOLUME_MAX */
|
|
int user_music_volume;
|
|
int user_sound_volume;
|
|
|
|
bool quick_fade;
|
|
|
|
// MMMMMM mod settings
|
|
bool mmmmmm;
|
|
bool usingmmmmmm;
|
|
|
|
binaryBlob pppppp_blob;
|
|
binaryBlob mmmmmm_blob;
|
|
int num_pppppp_tracks;
|
|
int num_mmmmmm_tracks;
|
|
};
|
|
|
|
#ifndef MUSIC_DEFINITION
|
|
extern musicclass music;
|
|
#endif
|
|
|
|
#endif /* MUSIC_H */
|