Exemplo n.º 1
0
        public bool RemoveOscillator(InstrumentOscillatorInfo osc)
        {
            if (osc == null)
            {
                return(false);
            }

            return(mOscillators.Remove(osc));
        }
Exemplo n.º 2
0
        public bool AddOscillator(InstrumentOscillatorInfo osc)
        {
            if (osc == null)
            {
                return(false);
            }

            if (mOscillators.Contains(osc))
            {
                return(false);
            }

            mOscillators.Add(osc);

            return(true);
        }
Exemplo n.º 3
0
        public bool IsEquivalentTo(InstrumentOscillatorInfo oscillator)
        {
            if (oscillator == null)
            {
                return(false);
            }

            if ((mTarget != oscillator.mTarget) ||
                (mRate != oscillator.mRate) ||
                (mWidth != oscillator.mWidth) ||
                (mBase != oscillator.mBase))
            {
                return(false);
            }

            if (mStartTable.Count != oscillator.mStartTable.Count)
            {
                return(false);
            }

            for (var i = 0; i < mStartTable.Count; ++i)
            {
                if (mStartTable[i] != oscillator.mStartTable[i])
                {
                    return(false);
                }
            }

            if (mReleaseTable.Count != oscillator.mReleaseTable.Count)
            {
                return(false);
            }

            for (var i = 0; i < mReleaseTable.Count; ++i)
            {
                if (mReleaseTable[i] != oscillator.mReleaseTable[i])
                {
                    return(false);
                }
            }

            return(true);
        }