mirror of https://github.com/jorio/Pomme.git
Sound: implement reInitCmd (initNoInterp only for now)
This commit is contained in:
parent
b3393c89f6
commit
de0725ae16
|
@ -146,6 +146,12 @@ public:
|
|||
source.Clear();
|
||||
}
|
||||
|
||||
void SetInitializationParameters(long initBits)
|
||||
{
|
||||
interpolate = !(initBits & initNoInterp);
|
||||
source.SetInterpolation(interpolate);
|
||||
}
|
||||
|
||||
void ApplyParametersToSource(uint32_t mask, bool evenIfInactive = false)
|
||||
{
|
||||
if (!evenIfInactive && !source.active)
|
||||
|
@ -343,7 +349,7 @@ OSErr SndNewChannel(SndChannelPtr* macChanPtr, short synth, long init, SndCallBa
|
|||
(**macChanPtr).callBack = userRoutine;
|
||||
auto channelImpl = new ChannelImpl(*macChanPtr, transferMacChannelOwnership);
|
||||
|
||||
channelImpl->interpolate = !(init & initNoInterp);
|
||||
channelImpl->SetInitializationParameters(init);
|
||||
|
||||
//---------------------------
|
||||
// Done
|
||||
|
@ -579,6 +585,10 @@ OSErr SndDoImmediate(SndChannelPtr chan, const SndCommand* cmd)
|
|||
impl.ApplyParametersToSource(kApplyParameters_Pitch);
|
||||
break;
|
||||
|
||||
case reInitCmd:
|
||||
impl.SetInitializationParameters(cmd->param2);
|
||||
break;
|
||||
|
||||
case pommeSetLoopCmd:
|
||||
impl.loop = cmd->param1;
|
||||
impl.ApplyParametersToSource(kApplyParameters_Loop);
|
||||
|
|
Loading…
Reference in New Issue