Ejemplo n.º 1
0
        internal InstrumentAudioExplorer(ILogger logger, ModuleAudio audio, string fileName) : this()
        {
            this.audio      = audio;
            this.logger     = logger;
            Title           = $"{Title} - {fileName}";
            capturesByGroup = audio.Captures.ToLookup(c => c.Instrument.Group);
            var allOutputDeviceNames = AudioDevices.GetOutputDeviceNames();

            outputDevice.ItemsSource = allOutputDeviceNames;

            // Assume that device 0 is the default. That will usually be the case.
            if (allOutputDeviceNames.Count > 0)
            {
                outputDevice.SelectedIndex = 0;
            }

            moduleId.Content    = audio.Schema.Identifier.Name;
            userSamples.Content = TextConversions.Format(capturesByGroup[null].Count());
            var format = audio.Format;

            audioFormat.Content       = $"Channels: {format.Channels}; Bits: {format.Bits}; Frequency: {format.Frequency}";
            timePerInstrument.Content = TextConversions.Format(audio.DurationPerInstrument.TotalSeconds);

            var groups = capturesByGroup.Select(c => new InstrumentGroupOrUserSample(c.Key)).Distinct();

            treeView.ItemsSource           = groups;
            instrumentsGroupBox.Visibility = Visibility.Collapsed;
        }
Ejemplo n.º 2
0
        internal InstrumentAudioExplorer(ILogger logger, ModuleAudio audio) : this()
        {
            this.audio               = audio;
            this.logger              = logger;
            capturesByGroup          = audio.Captures.ToLookup(c => c.Instrument.Group);
            outputDevice.ItemsSource = AudioDevices.GetOutputDeviceNames();

            moduleId.Content    = audio.Schema.Identifier.Name;
            userSamples.Content = TextConversions.Format(capturesByGroup[null].Count());
            var format = audio.Format;

            audioFormat.Content       = $"Channels: {format.Channels}; Bits: {format.Bits}; Frequency: {format.Frequency}";
            timePerInstrument.Content = TextConversions.Format(audio.DurationPerInstrument.TotalSeconds);

            var groups = capturesByGroup.Select(c => new InstrumentGroupOrUserSample(c.Key)).Distinct();

            treeView.ItemsSource           = groups;
            instrumentsGroupBox.Visibility = Visibility.Collapsed;
        }