Closed filoe closed 7 years ago
I added the sleep, which only gets figured in at higher resolutions so that, the drawing of the waveform was not choppy. If you remove the sleep and crank up the Resolution to 4096, you will not see it progressively drawn. Instead it takes several seconds and then the whole waveform is drawn at once. I am open to other suggestions but this was a quick way to get the desired result that I was after.
@tjscience , for draw progressively , remove Thread.Sleep
from source.cs
and change _source_SourcePropertyChangedEvent
(in waveform.cs) like this:
` private void _source_SourcePropertyChangedEvent(object sender, SourcePropertyChangedEventArgs e)
{
if (e.Property == Source.Property.WaveformData)
{
// Dispatcher.BeginInvoke((Action)delegate
// {
// UpdateWaveform();
// });
Dispatcher.Invoke((Action)delegate { UpdateWaveform(); }, System.Windows.Threading.DispatcherPriority.ApplicationIdle, null);
}
}`
With these changes, it will be much more speed and will also progressively waveform is drawn.
(sorry for my bad English)
Thanks for the suggestions! I will try them out. I am currently going through and refactoring a ton so these changes will be welcome.
Why do you slow down the loading process of the waveform by adding
Thread.Sleep
? https://github.com/tjscience/audion/blob/master/Audion/Source.cs#L209