Use channel->SetFreq instead of creating and destroying the channel every time. Thus the mixer volume control for the Disney/Covox device remains available.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3787
This commit is contained in:
parent
82e8442fd9
commit
5caa85d19e
1 changed files with 7 additions and 5 deletions
|
@ -69,11 +69,9 @@ static void DISNEY_disable(Bitu) {
|
|||
if(disney.mo) {
|
||||
disney.chan->AddSilence();
|
||||
disney.chan->Enable(false);
|
||||
delete disney.mo;
|
||||
}
|
||||
disney.leader = 0;
|
||||
disney.last_used = 0;
|
||||
disney.mo = 0;
|
||||
disney.state = DS_IDLE;
|
||||
disney.interface_det = 0;
|
||||
disney.interface_det_ext = 0;
|
||||
|
@ -90,8 +88,7 @@ static void DISNEY_enable(Bitu freq) {
|
|||
if(disney.stereo) LOG(LOG_MISC,LOG_NORMAL)("disney enable %d Hz, stereo",freq);
|
||||
else LOG(LOG_MISC,LOG_NORMAL)("disney enable %d Hz, mono",freq);
|
||||
#endif
|
||||
disney.mo = new MixerObject();
|
||||
disney.chan=disney.mo->Install(&DISNEY_CallBack,freq,"DISNEY");
|
||||
disney.chan->SetFreq(freq);
|
||||
disney.chan->Enable(true);
|
||||
disney.state = DS_RUNNING;
|
||||
}
|
||||
|
@ -377,11 +374,16 @@ public:
|
|||
disney.control=0;
|
||||
disney.last_used=0;
|
||||
|
||||
disney.mo=0;
|
||||
disney.mo = new MixerObject();
|
||||
disney.chan=disney.mo->Install(&DISNEY_CallBack,10000,"DISNEY");
|
||||
DISNEY_disable(0);
|
||||
|
||||
|
||||
}
|
||||
~DISNEY(){
|
||||
DISNEY_disable(0);
|
||||
if (disney.mo)
|
||||
delete disney.mo;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue