- Added an alternate module replay engine that uses foo_dumb's replayer, a
heavily customized version of DUMB (Dynamic Universal Music Bibliotheque).
It has been slightly modified by me:
* Added support for Ogg Vorbis-compressed samples in XM files ala FMOD.
* Removed excessive mallocs from the replay core.
* Rerolled the loops in resample.c. Unrolling them made the object file
~250k large while providing little benefit. Even at ~100k, I think it's
still larger than it ought to be, but I'll live with it for now.
Other than that, it's essentially the same thing you'd hear in foobar2000,
minus some subsong detection features. Release builds of the library look
like they might even be slightly faster than FMOD, which is a plus.
- Fixed: Timidity::font_add() did not release the file reader it created.
- Fixed: The SF2 loader did not free the sample headers in its destructor.
SVN r995 (trunk)
This commit is contained in:
parent
1dc9528b43
commit
01f59fa85f
125 changed files with 38137 additions and 43 deletions
|
|
@ -1147,6 +1147,7 @@ EXTERN_CVAR (Int, snd_mididevice)
|
|||
|
||||
static void MakeSoundChanges ();
|
||||
static void AdvSoundOptions ();
|
||||
static void ModReplayerOptions ();
|
||||
|
||||
static value_t SampleRates[] =
|
||||
{
|
||||
|
|
@ -1257,6 +1258,7 @@ static menuitem_t SoundItems[] =
|
|||
|
||||
{ redtext, " ", {NULL}, {0.0}, {0.0}, {0.0}, {NULL} },
|
||||
{ more, "Advanced options", {NULL}, {0.0}, {0.0}, {0.0}, {(value_t *)AdvSoundOptions} },
|
||||
{ more, "Module replayer options", {NULL}, {0.0}, {0.0}, {0.0}, {(value_t *)ModReplayerOptions} },
|
||||
};
|
||||
|
||||
static menu_t SoundMenu =
|
||||
|
|
@ -1297,6 +1299,68 @@ static menu_t AdvSoundMenu =
|
|||
AdvSoundItems,
|
||||
};
|
||||
|
||||
/*=======================================
|
||||
*
|
||||
* Module Replayer Options Menu
|
||||
*
|
||||
*=======================================*/
|
||||
|
||||
EXTERN_CVAR(Bool, mod_dumb)
|
||||
EXTERN_CVAR(Int, mod_samplerate)
|
||||
EXTERN_CVAR(Int, mod_volramp)
|
||||
EXTERN_CVAR(Int, mod_interp)
|
||||
EXTERN_CVAR(Bool, mod_autochip)
|
||||
EXTERN_CVAR(Int, mod_autochip_size_force)
|
||||
EXTERN_CVAR(Int, mod_autochip_size_scan)
|
||||
EXTERN_CVAR(Int, mod_autochip_scan_threshold)
|
||||
|
||||
static value_t ModReplayers[] =
|
||||
{
|
||||
{ 0.0, "FMOD" },
|
||||
{ 1.0, "foo_dumb" }
|
||||
};
|
||||
|
||||
static value_t ModInterpolations[] =
|
||||
{
|
||||
{ 0.0, "None" },
|
||||
{ 1.0, "Linear" },
|
||||
{ 2.0, "Cubic" }
|
||||
};
|
||||
|
||||
static value_t ModVolumeRamps[] =
|
||||
{
|
||||
{ 0.0, "None" },
|
||||
{ 1.0, "Logarithmic" },
|
||||
{ 2.0, "Linear" },
|
||||
{ 3.0, "XM=lin, else none" },
|
||||
{ 4.0, "XM=lin, else log" }
|
||||
};
|
||||
|
||||
static menuitem_t ModReplayerItems[] =
|
||||
{
|
||||
{ discrete, "Replayer engine", {&mod_dumb}, {2.0}, {0.0}, {0.0}, {ModReplayers} },
|
||||
{ redtext, " ", {NULL}, {0.0}, {0.0}, {0.0}, {NULL} },
|
||||
{ discrete, "Sample rate", {&mod_samplerate}, {8.0}, {0.0}, {0.0}, {SampleRates} },
|
||||
{ discrete, "Interpolation", {&mod_interp}, {3.0}, {0.0}, {0.0}, {ModInterpolations} },
|
||||
{ discrete, "Volume ramping", {&mod_volramp}, {5.0}, {0.0}, {0.0}, {ModVolumeRamps} },
|
||||
{ redtext, " ", {NULL}, {0.0}, {0.0}, {0.0}, {NULL} },
|
||||
{ discrete, "Chip-o-matic", {&mod_autochip}, {2.0}, {0.0}, {0.0}, {OnOff} },
|
||||
// TODO if the menu system is ever rewritten: Provide a decent
|
||||
// mechanism to edit the chip-o-matic settings like you can with
|
||||
// the foo_dumb preferences in foobar2000.
|
||||
};
|
||||
|
||||
static menu_t ModReplayerMenu =
|
||||
{
|
||||
"MODULE REPLAYER OPTIONS",
|
||||
0,
|
||||
countof(ModReplayerItems),
|
||||
0,
|
||||
ModReplayerItems,
|
||||
};
|
||||
|
||||
|
||||
//===========================================================================
|
||||
static void ActivateConfirm (const char *text, void (*func)())
|
||||
{
|
||||
ConfirmItems[0].label = text;
|
||||
|
|
@ -1580,6 +1644,7 @@ void M_OptDrawer ()
|
|||
int y, width, i, x, ytop, fontheight;
|
||||
menuitem_t *item;
|
||||
UCVarValue value;
|
||||
DWORD overlay;
|
||||
int labelofs;
|
||||
|
||||
if (!CurrentMenu->DontDim)
|
||||
|
|
@ -1633,6 +1698,7 @@ void M_OptDrawer ()
|
|||
}
|
||||
|
||||
item = CurrentMenu->items + i;
|
||||
overlay = 0;
|
||||
|
||||
if (item->type != screenres)
|
||||
{
|
||||
|
|
@ -1672,13 +1738,20 @@ void M_OptDrawer ()
|
|||
color = MoreColor;
|
||||
break;
|
||||
|
||||
case discrete:
|
||||
if (item->d.graycheck != NULL && !(**item->d.graycheck))
|
||||
{
|
||||
overlay = MAKEARGB(128,0,0,0);
|
||||
}
|
||||
// Intentional fall-through
|
||||
|
||||
default:
|
||||
x = CurrentMenu->indent - width;
|
||||
color = (item->type == control && menuactive == MENU_WaitKey && i == CurrentItem)
|
||||
? CR_YELLOW : LabelColor;
|
||||
break;
|
||||
}
|
||||
screen->DrawText (color, x, y, item->label, DTA_Clean, true, TAG_DONE);
|
||||
screen->DrawText (color, x, y, item->label, DTA_Clean, true, DTA_ColorOverlay, overlay, TAG_DONE);
|
||||
|
||||
switch (item->type)
|
||||
{
|
||||
|
|
@ -1725,6 +1798,7 @@ void M_OptDrawer ()
|
|||
{
|
||||
int v, vals;
|
||||
|
||||
overlay = 0;
|
||||
value = item->a.cvar->GetGenericRep (CVAR_Float);
|
||||
if (item->type == inverter)
|
||||
{
|
||||
|
|
@ -1743,18 +1817,25 @@ void M_OptDrawer ()
|
|||
{
|
||||
v = M_FindCurVal (value.Float, item->e.valuestrings, vals);
|
||||
}
|
||||
if (item->type == discrete)
|
||||
{
|
||||
if (item->d.graycheck != NULL && !(**item->d.graycheck))
|
||||
{
|
||||
overlay = MAKEARGB(96,48,0,0);
|
||||
}
|
||||
}
|
||||
|
||||
if (v == vals)
|
||||
{
|
||||
screen->DrawText (ValueColor, CurrentMenu->indent + 14, y, "Unknown",
|
||||
DTA_Clean, true, TAG_DONE);
|
||||
DTA_Clean, true, DTA_ColorOverlay, overlay, TAG_DONE);
|
||||
}
|
||||
else
|
||||
{
|
||||
screen->DrawText (item->type == cdiscrete ? v : ValueColor,
|
||||
CurrentMenu->indent + 14, y,
|
||||
item->type != discretes ? item->e.values[v].name : item->e.valuestrings[v].name.GetChars(),
|
||||
DTA_Clean, true, TAG_DONE);
|
||||
DTA_Clean, true, DTA_ColorOverlay, overlay, TAG_DONE);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -3010,6 +3091,25 @@ static void MakeSoundChanges (void)
|
|||
AddCommandString (snd_reset);
|
||||
}
|
||||
|
||||
static void ModReplayerOptions()
|
||||
{
|
||||
for (size_t i = 2; i < countof(ModReplayerItems); ++i)
|
||||
{
|
||||
if (ModReplayerItems[i].type == discrete)
|
||||
{
|
||||
ModReplayerItems[i].d.graycheck = &mod_dumb;
|
||||
}
|
||||
}
|
||||
M_SwitchMenu(&ModReplayerMenu);
|
||||
}
|
||||
|
||||
CCMD (menu_modreplayer)
|
||||
{
|
||||
M_StartControlPanel(true);
|
||||
OptionsActive = true;
|
||||
ModReplayerOptions();
|
||||
}
|
||||
|
||||
static void VideoOptions (void)
|
||||
{
|
||||
InitCrosshairsList();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue