Bug #1875

Does the Ruler layer really need a model?

Added by Chris Cannam about 5 years ago. Updated about 5 years ago.

Status:NewStart date:2019-02-27
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:-
Target version:-

Description

If you delete every vestige of an audio file from a session and then save it, you would reasonably expect the audio file not to be referenced in the saved session - and for it not to load and play when you reload it.

But if there is a ruler layer still extant that was created with reference to that file, then you'll be disappointed - the file will still be referred to in the session and may well be enabled for playback. This can be a very puzzling situation. Why do ruler layers have a model at all? Is it necessary to ensure that the right audio file gets played when the layer is active?

History

#1 Updated by Chris Cannam about 5 years ago

OK, it's a bit deeper than that (funny how you don't remember these things when you first reconsider them).

The session of course has a main model, and no matter how many other layers and models you add or remove, the main model remains the same unless you do something that explicitly replaces it. If you import another audio file, then delete the pane containing the first one, then save the session, the main model for the session will still be the audio file that was in the first pane, even though it is no longer visible anywhere.

Then there is a secondary problem, which is what prompted this report: if the second (now the only) pane contains a time ruler, it will have the main model as its model, and that model is the one that is no longer displayed. That model will therefore continue to play unless muted, and when you reload the session, if that audio file is missing, you'll be asked to find it.

It is quite bizarre to continue using the now-absent main model as the underlying model for a time ruler in another pane that has no connection to the main one any more. For this reason, to make the time ruler be no longer dependent on any model seems sensible. But it would be the only layer, I think, that ever subsists without a model, so we would need a special case of some sort in e.g. file loading (can't find the model? -> don't ignore the layer!).

#2 Updated by Chris Cannam about 5 years ago

And if we don't write out the model id with the time ruler layer in the session file, we lose backward compatibility - no previous version of SV will never display any time ruler layer saved like this when it loads the session, because it has no model associated with it.

The solution to that is to write out the model id (or some model id - could be whichever is the current main model at the time of saving) and then not use it when reloading, except to draw the sample rate from it and perhaps to remember it for writing out again. But how does that differ from what we do now? The difference we are looking for is really in how to manage whether a model gets played back or not - in some situations with multi-pane configurations we can end up with a model being audible even though it does not seem to be visible anywhere. Is this simply a bug? If we only have a time ruler as the only visible layer for a model, it is not supposed to be played (and at the moment this works correctly for the simple single-pane setup).

Also available in: Atom PDF