Week 5 Report: June 26th to July 2nd
- PR was up for review but we didn’t manage to get it merged (@iss was working in person with the rest of the Blender team).
- Chatted with @iss about the next steps:
- The sequencer draw code already only requests waveforms for strips that are already visible, so there’s nothing there we can improve
- The best option to improve things regarding visibility would be to determine how much (%) of the strip is visible and only read enough samples to render that part of the waveform.
I toyed with the idea of having a struct like this associated with each stripe:
struct WaveformSpanData {
struct WaveformSpanData* next;
void* waveformData;
uint8_t spanStart;
uint8_t spanEnd;
};
Every time we need to re-draw the strip we do the following:
- Determine what “span” of the strip is visible
- Check the if the current span overlaps with any existing ones
- If the span overlaps:
- If the span is entirely contained within an existing span, we just draw the waveform.
- If the span is not entirely contained, we merge the overlapping spans and only read the missing waveform data.
- If there are no overlapping spans, issue the read for this new span and push it to the
WaveformSpanData
list
I’m still working on the implementation.
I need to figure out how to deal with AUD_readSound.
I’m not totally sure if I can arbitrarily seek to a position in the AUD_Sound object. If I can, then it should be fairly easy to just seek the audio to a position before requesting the new waveform data.
NOTE: Span start/end are tracked as uint8_t since a span only goes from 0% to 100% of the of the strip. We’ll require that spans start/end percentages be integers (instead of floating point).
Next step
- Get the proof of concept working and see if it is worth the extra complexity.
- Check with @iss if the PR from last week is good to be merged