Ejemplo n.º 1
0
        public void TestInterfaceMappings()
        {
            var adjustments = new AudioAdjustments();

            Assert.AreEqual(adjustments.AggregateVolume, adjustments.GetAggregate(AdjustableProperty.Volume));
            Assert.AreEqual(adjustments.AggregateBalance, adjustments.GetAggregate(AdjustableProperty.Balance));
            Assert.AreEqual(adjustments.AggregateFrequency, adjustments.GetAggregate(AdjustableProperty.Frequency));
            Assert.AreEqual(adjustments.AggregateTempo, adjustments.GetAggregate(AdjustableProperty.Tempo));
        }
Ejemplo n.º 2
0
        public void TestAddAdjustment([Values] AdjustableProperty type)
        {
            var adjustments = new AudioAdjustments();

            Assert.IsTrue(adjustments.GetAggregate(type).IsDefault);

            adjustments.AddAdjustment(type, new BindableDouble(0.5));

            Assert.IsFalse(adjustments.GetAggregate(type).IsDefault);
        }
Ejemplo n.º 3
0
        public void TestRemoveAllAdjustmentsRemovesExternalBindings([Values] AdjustableProperty type)
        {
            var adjustments = new AudioAdjustments();

            Assert.IsTrue(adjustments.GetAggregate(type).IsDefault);

            adjustments.AddAdjustment(type, new BindableDouble(0.5));
            adjustments.AddAdjustment(type, new BindableDouble(0.5));

            adjustments.RemoveAllAdjustments(type);

            Assert.IsTrue(adjustments.GetAggregate(type).IsDefault);
        }
Ejemplo n.º 4
0
        public void TestMultiplicativeComponent(AdjustableProperty type)
        {
            var adjustments = new AudioAdjustments();

            adjustments.AddAdjustment(type, new BindableDouble(0.5));
            adjustments.AddAdjustment(type, new BindableDouble(0.5));

            Assert.AreEqual(0.25, adjustments.GetAggregate(type).Value);
        }
Ejemplo n.º 5
0
        public void TestRemoveAllAdjustmentsPreservesInternalBinding()
        {
            var adjustments = new AudioAdjustments();

            adjustments.RemoveAllAdjustments(AdjustableProperty.Volume);

            adjustments.Volume.Value = 0.5;

            Assert.AreEqual(0.5, adjustments.GetAggregate(AdjustableProperty.Volume).Value);
        }
Ejemplo n.º 6
0
 public IBindable <double> GetAggregate(AdjustableProperty type) => adjustments.GetAggregate(type);