private void SetAudioTrack(AudioTrack audioTrack) { UnsetAudioTrack(); this.audioTrack = audioTrack; audioStream = AudioStreamFactory.FromAudioTrackForGUI(audioTrack); audioStream.WaveformChanged += OnAudioStreamWaveformChanged; audioTrack.LengthChanged += OnAudioTrackLengthChanged; audioTrack.VolumeChanged += OnAudioTrackVolumeChanged; audioTrack.BalanceChanged += OnAudioTrackBalanceChanged; }
private void SetAudioTrack(AudioTrack audioTrack) { UnsetAudioTrack(); // init renderers waveformBitmapRenderers = new WaveformBitmapRenderer[audioTrack.SourceProperties.Channels]; for (int i = 0; i < waveformBitmapRenderers.Length; i++) { waveformBitmapRenderers[i] = new WaveformBitmapRenderer(); } waveformGeometryRenderers = new WaveformGeometryRenderer[audioTrack.SourceProperties.Channels]; for (int i = 0; i < waveformGeometryRenderers.Length; i++) { waveformGeometryRenderers[i] = new WaveformGeometryRenderer(); } this.audioTrack = audioTrack; audioStream = AudioStreamFactory.FromAudioTrackForGUI(audioTrack); audioStream.WaveformChanged += OnAudioStreamWaveformChanged; audioTrack.LengthChanged += OnAudioTrackLengthChanged; audioTrack.VolumeChanged += OnAudioTrackVolumeChanged; audioTrack.BalanceChanged += OnAudioTrackBalanceChanged; }