likethebourbon/auralayer

Change the data structure for layers/segments?

Opened this issue · 1 comments

@brianedwardjarvis Refactoring idea: what if we stored timestamps of splits in layers instead of segment start/stop timestamps?

It seems to me that this would make it easier to move split locations, since there would only be one object to move instead of moving the end of one segment and the start of the next. A few questions to think about:

  • Do you think it's feasible to change the data structure in this way?
  • How much work would it be to change the app to use this kind of data structure?
  • What implications are there for segment functionality?

Thoughts on this?

@likethebourbon Is this to solve the issue of editing segment lengths? I think you're right that changing a single split value would be better than changing two segments, but because the data for each segments is stored individually, I think it would mean a rather large restructuring of the data structure.

I think changing the starting and ending point of each segment will be relatively straight forward, but changes will need to be limited to the end position of the next segment. For example, it shouldn't be possible for the first segment's width to be expanded past the next segment otherwise that segment would need to be deleted.

Original:
|    segment 1 |    segment 2 |    segment 3    |

Edit that stretches segment 1 past segment 2:
|            segment 1              | segment 3 |