Пример #1
0
 public PureToneSource(IPitchGenerator generator, TimeSpan sampleLength, PauseDuration pauseDuration)
 {
     pitchGenerator     = generator;
     timer.Interval     = sampleLength;
     timer.Tick        += TimerOnTick;
     this.pauseDuration = pauseDuration;
 }
 public void Handle(Events.HearingTest.PitchGeneratorChanged message)
 {
     pitchGenerator = message.PitchGenerator;
     Media.SetSource(new PureToneSource(pitchGenerator, TimeSpan.FromSeconds(1),
                                        new PauseDuration(TimeSpan.FromMilliseconds(100),
                                                          TimeSpan.FromMilliseconds(1200))));
     Media.Pause();
 }
        public HearingTestViewModel(INavigationService navigationService,
                                    IAsyncXmlFileManager fileManager,
                                    ISettings settings,
                                    IEventAggregator eventAggregator,
                                    IPitchGenerator pitchGenerator) : base(navigationService)
        {
            this.settings        = settings;
            this.pitchGenerator  = pitchGenerator;
            this.eventAggregator = eventAggregator;
            this.fileManager     = fileManager;

            IsPlaying            = false;
            IsLeftChannelChecked = true;
            results = new Dictionary <Channel, ISet <HearingResult> >(2);
            results[Channel.Right] = new HashSet <HearingResult>(new FrequencyResultComparer());
            results[Channel.Left]  = new HashSet <HearingResult>(new FrequencyResultComparer());
            PresetItems            = new ReadOnlyTraversableList <PresetItemViewModel>();
        }
Пример #4
0
 public PureToneSource(IPitchGenerator generator, TimeSpan sampleLength, PauseDuration pauseDuration)
 {
     pitchGenerator = generator;
     timer.Interval = sampleLength;
     timer.Tick += TimerOnTick;
     this.pauseDuration = pauseDuration;
 }
Пример #5
0
 public PitchGeneratorChanged(IPitchGenerator newGenerator)
 {
     pitchGenerator = newGenerator;
 }
        public HearingTestViewModel(INavigationService navigationService, 
            IAsyncXmlFileManager fileManager, 
            ISettings settings,
            IEventAggregator eventAggregator, 
            IPitchGenerator pitchGenerator) : base(navigationService)
        {
            this.settings = settings;
            this.pitchGenerator = pitchGenerator;
            this.eventAggregator = eventAggregator;
            this.fileManager = fileManager;

            IsPlaying = false;
            IsLeftChannelChecked = true;
            results = new Dictionary<Channel, ISet<HearingResult>>(2);
            results[Channel.Right] = new HashSet<HearingResult>(new FrequencyResultComparer());
            results[Channel.Left] = new HashSet<HearingResult>(new FrequencyResultComparer());            
            PresetItems = new ReadOnlyTraversableList<PresetItemViewModel>();
        }
Пример #7
0
 public PitchGeneratorChanged(IPitchGenerator newGenerator)
 {
     pitchGenerator = newGenerator;
 }