Exemplo n.º 1
0
        public void TestRevision4()
        {
            BehaviourContext behaviourContext = new BehaviourContext();

            behaviourContext.SetUserRevision(BehaviourContext.BaseRevisionMagic + BehaviourContext.Revision4);

            Assert.IsTrue(behaviourContext.IsAdpcmLoopContextBugFixed());
            Assert.IsTrue(behaviourContext.IsSplitterSupported());
            Assert.IsTrue(behaviourContext.IsLongSizePreDelaySupported());
            Assert.IsTrue(behaviourContext.IsAudioUsbDeviceOutputSupported());
            Assert.IsFalse(behaviourContext.IsFlushVoiceWaveBuffersSupported());
            Assert.IsFalse(behaviourContext.IsSplitterBugFixed());
            Assert.IsFalse(behaviourContext.IsElapsedFrameCountSupported());
            Assert.IsFalse(behaviourContext.IsDecodingBehaviourFlagSupported());
            Assert.IsFalse(behaviourContext.IsBiquadFilterEffectStateClearBugFixed());
            Assert.IsFalse(behaviourContext.IsMixInParameterDirtyOnlyUpdateSupported());
            Assert.IsFalse(behaviourContext.IsWaveBufferVersion2Supported());

            Assert.AreEqual(0.75f, behaviourContext.GetAudioRendererProcessingTimeLimit());
            Assert.AreEqual(1, behaviourContext.GetCommandProcessingTimeEstimatorVersion());
            Assert.AreEqual(1, behaviourContext.GetPerformanceMetricsDataFormat());
        }
Exemplo n.º 2
0
        /// <summary>
        /// Create a new <see cref="MixState"/>
        /// </summary>
        /// <param name="effectProcessingOrderArray"></param>
        /// <param name="behaviourContext"></param>
        public MixState(Memory <int> effectProcessingOrderArray, ref BehaviourContext behaviourContext) : this()
        {
            MixId = UnusedMixId;

            DistanceFromFinalMix = InvalidDistanceFromFinalMix;

            DestinationMixId = UnusedMixId;

            DestinationSplitterId = UnusedSplitterId;

            unsafe
            {
                // SAFETY: safe as effectProcessingOrderArray comes from the work buffer memory that is pinned.
                _effectProcessingOrderArrayPointer = (IntPtr)Unsafe.AsPointer(ref MemoryMarshal.GetReference(effectProcessingOrderArray.Span));
            }

            EffectProcessingOrderArrayMaxCount = (uint)effectProcessingOrderArray.Length;

            IsLongSizePreDelaySupported = behaviourContext.IsLongSizePreDelaySupported();

            ClearEffectProcessingOrder();
        }