44        enum ChannelCallbackStatus
 
   46            CALLBACK_STATUS_STOPPED,
 
   48            CALLBACK_STATUS_FINISH,
 
   49            CALLBACK_STATUS_CANCEL,
 
   62        typedef void Callback(Channel *dropChannel,
 
   63                              ChannelCallbackStatus status,
 
   71        static Channel *AllocChannel(
int voiceChannelCount, 
int voiceOutCount,
 
   72                                     int priority, Callback *callback,
 
   75        static void FreeChannel(Channel *channel);
 
   78        void InitParam(Callback *callback, ulong callbackData);
 
   79        void Start(
WaveInfo const &waveParam, 
int length, ulong startOffset);
 
   87        bool IsRelease()
 const 
   89            return mEnvelope.GetStatus() == EnvGenerator::STATUS_RELEASE;
 
   91        bool IsPause()
 const { 
return mPauseFlag != 
false; }
 
   92        bool IsActive()
 const { 
return mActiveFlag; }
 
   93        bool IsAutoUpdateSweep()
 const { 
return mAutoSweep; }
 
   94        f32 GetSweepValue() 
const;
 
   95        s32 GetLength()
 const { 
return mLength; }
 
   96        int GetAlternateAssignId()
 const { 
return mAlternateAssign; }
 
   97        Voice *GetVoice()
 const { 
return mVoice; }
 
   98        Channel *GetNextTrackChannel()
 const { 
return mNextLink; }
 
  100        void SetDecay(
int decay) { mEnvelope.SetDecay(decay); }
 
  101        void SetRelease(
int release) { mEnvelope.SetRelease(release); }
 
  102        void SetAttack(
int attack) { mEnvelope.SetAttack(attack); }
 
  103        void SetSustain(
int sustain) { mEnvelope.SetSustain(sustain); }
 
  104        void SetHold(
int hold) { mEnvelope.SetHold(hold); }
 
  105        void SetLfoParam(
LfoParam const ¶m) { mLfo.SetParam(param); }
 
  106        void SetLfoTarget(LfoTarget type) { mLfoTarget = type; }
 
  107        void SetReleasePriorityFix(
bool fix) { mReleasePriorityFixFlag = fix; }
 
  108        void SetReleaseIgnore(
bool ignore) { mReleaseIgnoreFlag = ignore; }
 
  109        void SetBiquadFilter(
int type, f32 value);
 
  110        void SetRemoteFilter(
int filter) { mRemoteFilter = filter; }
 
  111        void SetUserVolume(f32 volume) { mUserVolume = volume; }
 
  112        void SetUserPitchRatio(f32 pitchRatio) { mUserPitchRatio = pitchRatio; }
 
  113        void SetUserPan(f32 pan) { mUserPan = pan; }
 
  114        void SetUserSurroundPan(f32 surroundPan)
 
  116            mUserSurroundPan = surroundPan;
 
  118        void SetRemoteOutVolume(
int channel, f32 volume)
 
  120            mRemoteOutVolume[channel] = volume;
 
  122        void SetUserLpfFreq(f32 lpfFreq) { mUserLpfFreq = lpfFreq; }
 
  123        void SetOutputLine(
int lineFlag) { mOutputLineFlag = lineFlag; }
 
  124        void SetMainOutVolume(f32 volume) { mMainOutVolume = volume; }
 
  125        void SetMainSend(f32 send) { mMainSend = send; }
 
  126        void SetFxSend(AuxBus bus, f32 send) { mFxSend[bus] = send; }
 
  127        void SetUserPitch(f32 pitch) { mUserPitch = pitch; }
 
  128        void SetSweepParam(f32 sweepPitch, 
int sweepTime, 
bool autoUpdate);
 
  129        void SetInitVolume(f32 volume) { mInitVolume = volume; }
 
  130        void SetInitPan(f32 pan) { mInitPan = pan; }
 
  131        void SetInitSurroundPan(f32 surroundPan)
 
  133            mInitSurroundPan = surroundPan;
 
  135        void SetTune(f32 tune) { mTune = tune; }
 
  136        void SetSilence(
bool silenceFlag, 
int fadeTimes)
 
  138            NW4RAssertHeaderClampedLRValue_Line(138, fadeTimes, 0, USHRT_MAX);
 
  140            mSilenceVolume.SetTarget(silenceFlag ? SILENCE_VOLUME_MIN
 
  141                                                 : SILENCE_VOLUME_MAX,
 
  144        void SetKey(
int key) { mKey = key; }
 
  145        void SetOriginalKey(
int key) { mOriginalKey = key; }
 
  146        void SetLength(s32 length) { mLength = length; }
 
  147        void SetPanMode(PanMode panMode) { mPanMode = panMode; }
 
  148        void SetPanCurve(PanCurve panCurve) { mPanCurve = panCurve; }
 
  149        void SetAlternateAssignId(
int id) { mAlternateAssign = id; }
 
  153            mWaveDataLocationCallback = callback;
 
  154            mWaveInfo = waveInfo;
 
  158            mVoice->SetVoiceOutParam(index, param);
 
  160        void SetNextTrackChannel(Channel *channel) { mNextLink = channel; }
 
  162        void Update(
bool doPeriodicProc);
 
  163        void UpdateSweep(
int count);
 
  173        static void VoiceCallbackFunc(
Voice *voice,
 
  174                                      Voice::VoiceCallbackStatus status,
 
  179        static u8 
const SILENCE_VOLUME_MIN = 0;
 
  180        static u8 
const SILENCE_VOLUME_MAX = 255;
 
  182        static int const ORIGINAL_KEY_INIT = 60;
 
  183        static int const KEY_INIT = 60;
 
  185        static int const PRIORITY_RELEASE = 1;
 
  187        static int const CHANNEL_MAX = Voice::CHANNEL_MAX;
 
  188        static int const CHANNEL_MIN = 1;
 
  189        static int const CHANNEL_NUM;
 
  200        bool                        mReleasePriorityFixFlag;    
 
  201        u8                          mReleaseIgnoreFlag;         
 
  208        f32                         mUserSurroundPan;           
 
  214        f32                         mFxSend[AUX_BUS_NUM];       
 
  215        f32                         mRemoteOutVolume[4];
 
  222        f32                         mInitSurroundPan;           
 
  231        int                         mAlternateAssign;           
 
  244        template <
class> 
friend class InstancePool;