Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature] disable studio sounds #52

Open
willbr opened this issue Aug 12, 2023 · 5 comments
Open

[feature] disable studio sounds #52

willbr opened this issue Aug 12, 2023 · 5 comments

Comments

@willbr
Copy link

willbr commented Aug 12, 2023

PlayUISound is used to play tool sound effects e.g. while rotating an actor.

/***************************************************************************
The movie engine is using the tool, now play the sound
***************************************************************************/
void STDIO::PlayUISound(long tool, long grfcust)

@willbr
Copy link
Author

willbr commented Aug 12, 2023

Tooltip sounds are triggered via scripts:

// -----------------------------------------------------
// For playing tooltip sounds
// -----------------------------------------------------
SCRIPTCHUNK("Playing other sounds", kidPlayToolTipSounds)
If(_parm[0] == 0);
fMZAudio = GetProp( kpridMcZeeAudio ) & kflgMcZeeAudio;
If (._cnoSound != cnoNil && !fMZAudio);
StopSoundClass(0, sclHelpSoundClass);
PlaySoundGob(GidParThis(), ._ctgSound, ._cnoSound, ksqnNone, 0x10000, 1, 0, sclHelpSoundClass);
End;
End;
ENDCHUNK

case kopPlaySoundGob:
hid = _LwPop();
// fall through
case kopPlaySoundThis:
lw1 = siiNil;
if (!_fError)
{
pgob = (hidNil == hid) ? pvNil : _PgobFromHid(hid);
if (pvNil != pgob && pgob->FIs(kclsGOK))
{
if (pvNil != (qrglw = _QlwGet(7)))
{
lw1 = ((PGOK)pgob)
->SiiPlaySound(qrglw[6], qrglw[5], qrglw[4], qrglw[3], qrglw[2], 0, qrglw[1], qrglw[0]);
}
}
else
{

@willbr
Copy link
Author

willbr commented Aug 12, 2023

ADOPT_WAVE is used to link sounds to mouse click events for toolbar buttons

Clicking the Scene cover

ADOPT_WAVE(kcnoCoverWav, CHID(kstClosed, krepClicked))

Clicking secondary tools

ADOPT_WAVE(kcnoSecToolWav, CHID(kstDefault, krepMouseDnOn))

@mdtauk
Copy link

mdtauk commented Aug 12, 2023

Can these be made into a user preference at some point in the future. We are a long way off from the modern version with new renderer, higher resolutions, etc - but there is a settings dialog of a sort, the options could go there...
image

@willbr
Copy link
Author

willbr commented Aug 12, 2023

Sure.

As an example, Better Speed is saved in the registry.

/***************************************************************************
Sets _fSlowCPU if this is a slow CPU. It tests the graphics,
fixed-point math, and memory copying speed, and if any of them are
slower than a threshold, _fSlowCPU is set.
***************************************************************************/
bool APP::_FDetermineIfSlowCPU(void)
{
AssertBaseThis(0);
bool fSlowCPU;
// If user has a saved preference, read and use that
if (FGetSetRegKey(kszBetterSpeedValue, &fSlowCPU, size(bool), fregNil))
{
_fSlowCPU = fSlowCPU;
return fTrue;
}
_fSlowCPU = fFalse;

@willbr
Copy link
Author

willbr commented Aug 14, 2023

It also saves a small blob of binary data as UserData

This includes a flag kflgMcZeeAudio for disabling McZee tooltips.

3DMMForever/inc/stdiodef.h

Lines 885 to 911 in 79b3010

// kprids for user's data (bio pages, etc)
#define kpridUserDataBase 0x23500
// these two are used for BIO PAGES
#define kpridUserData0 0x23500
#define kpridUserData1 0x23501
// this one is used for Studio information
#define kpridStudioFlags 0x23502
#define kpridUserData2 0x23502
// this one is used for maintaing audio help on /off status
#define kpridMcZeeAudio 0x23503
#define kpridUserData3 0x23503
// bit flags for suppressing the above audio,
#define kflgMcZeeAudio 0x01
#define kflgMelAudio 0x02
#define kpridUserData4 0x23504
#define kpridUserData5 0x23505
#define kpridUserData6 0x23506
#define kpridUserData7 0x23507
#define kcpridUserData 8
#define kpridFirstTimeUser 0x23510
#define kidStudioLim 0x23600

// -----------------------------------------------------
// For playing tooltip sounds
// -----------------------------------------------------
SCRIPTCHUNK("Playing other sounds", kidPlayToolTipSounds)
If(_parm[0] == 0);
fMZAudio = GetProp( kpridMcZeeAudio ) & kflgMcZeeAudio;
If (._cnoSound != cnoNil && !fMZAudio);
StopSoundClass(0, sclHelpSoundClass);
PlaySoundGob(GidParThis(), ._ctgSound, ._cnoSound, ksqnNone, 0x10000, 1, 0, sclHelpSoundClass);
End;
End;
ENDCHUNK

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants