Example #1
0
 public Player_AppleII(ScummEngine scumm, IMixer mixer)
 {
     _mixer = mixer;
     _vm = scumm;
     _sampleConverter = new SampleConverter();
     ResetState();
     SetSampleRate(_mixer.OutputRate);
     _soundHandle = _mixer.PlayStream(SoundType.Plain, this, -1, Mixer.MaxChannelVolume, 0, false, true);
 }
        public void ConvertsFieldValueToNonValueType()
        {
            var valueTypeConverter = new SampleConverter();

            mapper = new NumericReflectionFieldMapper<Sample>(typeof(Sample).GetProperty("Complex"), StoreMode.Yes, valueTypeConverter, TypeDescriptor.GetConverter(typeof(int)), "Complex", 128, 1.0f);

            var result = mapper.ConvertFieldValue(new Field("Complex", "100", Field.Store.YES, Field.Index.NO));

            Assert.That(result, Is.InstanceOf<Complex>());
        }
        public void SortType_Complex()
        {
            var valueTypeConverter = new SampleConverter();

            mapper = new NumericReflectionFieldMapper<Sample>(typeof(Sample).GetProperty("Complex"), StoreMode.Yes, valueTypeConverter, TypeDescriptor.GetConverter(typeof(int)), "Complex", 128, 1.0f);

            Assert.That(mapper.CreateSortField(false).Type, Is.EqualTo(SortField.INT));
        }