- added a gme_stereodepth CVAR.

This commit is contained in:
Christoph Oelckers 2017-02-26 14:04:30 +01:00
parent 3412bdf5dc
commit 03ac816e83
3 changed files with 27 additions and 0 deletions

View file

@ -279,6 +279,10 @@ void MusInfo::TimidityVolumeChanged()
{
}
void MusInfo::GMEDepthChanged(float val)
{
}
void MusInfo::FluidSettingInt(const char *, int)
{
}

View file

@ -84,6 +84,7 @@ public:
virtual void FluidSettingNum(const char *setting, double value); // "
virtual void FluidSettingStr(const char *setting, const char *value); // "
virtual void WildMidiSetOption(int opt, int set);
virtual void GMEDepthChanged(float val);
void Start(bool loop, float rel_vol = -1.f, int subsong = 0);

View file

@ -43,6 +43,7 @@
#include <gme/gme.h>
#include "v_text.h"
#include "files.h"
#include "templates.h"
// MACROS ------------------------------------------------------------------
@ -67,6 +68,7 @@ protected:
bool StartTrack(int track, bool getcritsec=true);
bool GetTrackInfo();
int CalcSongLength();
void GMEDepthChanged(float val);
static bool Read(SoundStream *stream, void *buff, int len, void *userdata);
};
@ -84,6 +86,12 @@ protected:
// Currently not used.
CVAR (Float, spc_amp, 1.875f, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
CUSTOM_CVAR(Float, gme_stereodepth, 0.f, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
{
if (currSong != nullptr)
currSong->GMEDepthChanged(self);
}
// PRIVATE DATA DEFINITIONS ------------------------------------------------
// CODE --------------------------------------------------------------------
@ -146,6 +154,7 @@ MusInfo *GME_OpenSong(FileReader &reader, const char *fmt)
reader.Seek(fpos, SEEK_SET);
return NULL;
}
gme_set_stereo_depth(emu, clamp(*gme_stereodepth, 0.f, 1.f));
return new GMESong(emu, sample_rate);
}
@ -189,6 +198,19 @@ GMESong::~GMESong()
}
//==========================================================================
//
// GMESong :: GMEDepthChanged
//
//==========================================================================
void GMESong::GMEDepthChanged(float val)
{
if (Emu != nullptr)
gme_set_stereo_depth(Emu, clamp(val, 0.f, 1.f));
}
//==========================================================================
//
// GMESong :: Play