Feature #148
Provide default session "template" for new audio files
| Status: | In Progress | Start date: | 2011-04-26 | |
|---|---|---|---|---|
| Priority: | High | Due date: | ||
| Assignee: | % Done: | 0% |
||
| Category: | - | |||
| Target version: | - |
Description
monongahela writes:
I'm a big fan of SV and have used it since 1.7.1 to study wildlife audio recordings. I've become very familiar with the tool and how to tune it to get the most out of the sound files I study. But I have one vexing issue that I sorely wish you would help me with.
I have my own preferences for what I need to see when I open a sound file in SV. But when SV starts up with its standard appearance, I am left with several minutes of configuration changes that I must repeatedly walk through, for every new audio file I open. Yes, I do save my settings to a unique session for each audio file before I close. But that doesn't solve the problem for all the new files I've yet to open. Over the course of a day I can open hundreds of new audio files, and have to repeat those "tweaks" repeatedly.
And yes, I have started to drag and drop each new audio file into a standard session that reflects the tuning I desire, but this is still a work around to what we truly need from SV. (Using this approach I have accidentally overwritten existing session files.)
NEEDED: A method to save an individual user's settings as the default view for how SV will open all future audio files, effectively establishing a new "default" setting. In addition to this, there should be a method of reverting to the standard SV settings, should the user desire to do so.
Can we PLEASE get something like this into the next minor release of SV. This is a great tool but that one niggling issue of saving user defaults has been a big pain when I try to convince other researchers of how "user friendly" this tool can be.
A persuasive case. Dan, is this request similar to the templating work that you did? I've lost track a bit of what the status was there.
Related issues
History
Updated by Dan Stowell about 2 years ago
Yes, very similar indeed! My plan was for fixed templates bundled with the app, rather than user-settable ones, though the mechanism could of course do either.
It's not something I'm currently pursuing (the project has gone in a bit of a different direction) but see the "templating" branch of both "svapp" and "sonic-visualiser" repositories. In the latter there's also a "macness_autotpl" branch where a template is automatically chosen according to genre, when a track is chosen from itunes' now-playing.
Updated by Chris Cannam about 2 years ago
- Status changed from New to In Progress
Thanks. So, the templating branch adds a template argument to openAudio() and looks for that as a bundled file. That's certainly a first step toward this.
What do we actually want this feature to do?
The basic feature is to be able to save a session, omitting its audio content (all of it? or just its primary audio file?) as "the current default template". Then, when opening a new audio file, to load the current default template as a session and import that audio file into it.
Currently there are (at least?) 7 ways to open an audio file:
- Use File -> Import Audio File
- Use File -> Import Secondary Audio File
- Supply its name on the command line or as a FileOpen system event
- Drag and drop the file from a file manager onto the running application
- Use File -> Open Location
- Use the Open button on the toolbar (this actually has no equivalent menu entry; it's called "openSomething" in the code)
- Select the file from the Recent Files list
Nos 1 and 2 are distinguished by the fact that the user tells the application to open an audio file rather than just a file. The others all involve a first step in which the application works out what sort of file to open.
If there is a session already loaded, nos 5, 6, and 7 (and no 3 if invoked after startup) will ask the user what to do with the new file -- either replace the existing main waveform or load into a new pane. Nos 1 and 4 (and no 3 for a single audio file provided at startup) will always replace the existing main waveform; no 2 will always load into a new pane. Arguably it is inconsistent that no 3 asks the user but no 4 always replaces.
Currently the templating branch code loads a new instance of the template whenever the desired mode is to replace the existing main model. This means that methods nos 1, 3 (at startup), and 4 will always make a new template session; 5, 6, and 7 will do so if the user says to replace the main model.
Updated by Chris Cannam about 2 years ago
Correction: drag and drop does not replace the main model, it replaces the model in the drop target pane. That makes sense.
Continuing. Replacing the main model probably shouldn't be the same thing as loading a new template. We need to distinguish between replacing the main model in an existing session, and replacing the entire session with a new one based on a template plus audio file.
That is, in addition to the current ReplaceMainModel CreateAdditionalModel ReplaceCurrentPane and AskUser we need a ReplaceSession, and AskUser should offer this option as well as the others.
Then the methods do as follows:
ReplaceSessionCreateAdditionalModelReplaceSession(on startup) orAskUser(after)ReplaceCurrentPane(if session open already) orReplaceSession(otherwise)AskUser(if session open already) orReplaceSession(otherwise)AskUser(if session open already) orReplaceSession(otherwise)AskUser(if session open already) orReplaceSession(otherwise)
Problem: if you have a session open, using the default template, with only one audio file in it, ReplaceSession and ReplaceMainModel become equivalent. We probably don't want to be asking the user to choose between three options two of which are functionally identical -- do we? But I don't think we can straightforwardly tell whether the options would be the same or not, since it depends on whether anything has been changed from the default template content.
Fundamental philosophical question: Is this too complicated?
Updated by Dan Stowell about 2 years ago
Yes it's too complicated.
I don't think "ReplaceSession" should be an explicit option. If the user wants to do it, they simply press Ctrl-N before they open their audio file. That should fit pretty well with a user's mental model: clear the decks and start again.
So this implies that ReplaceMainModel would need to detect if the session is blank, and if so load the template (if selected in preferences).
Updated by Chris Cannam about 2 years ago
You may be right. (Although I think I would keep ReplaceSession and ReplaceMainModel as distinct options in the code, because I find that a bit easier to reason about -- just omit one of them from the option dialog. Anyway that's an implementation detail)
I can't help thinking this should be an opportunity to figure out how to simplify things even further, though. After all, even without adding another new option it's still too complicated.
Updated by Chris Cannam about 2 years ago
As for how to determine what template to use: doing it in the preferences is one option of course. Here's an alternative possibility:
- A single menu as a sub-menu of File, entitled "Current Session Template ->"
This menu would just contain a series of radio-button options: "Default Session", one option for each of the bundled session templates, one option for each of the user's saved session templates. Finally, it would have an option "Save current session as template" which would save the current session omitting any audio from it (it would then be added to the list in the menu).
Advantages:
- Simple and obvious, makes the feature available without having to hunt for it (especially useful to people updating an existing SV version)
- Enables very quick switching amongst templates
Subtleties and questions:
- This gives no way to delete a saved template (though of course you'd be able to delete it externally, from the disc)
- Would the menu offer "a way to change the template that is used next time you load something", or "a way to change the current template"? In the latter case it could take the main audio file that is open in the current session and re-open it in a new session template. That might be useful, but it might also be confusing! Would have to be a bit careful with wording.
Updated by Chris Cannam about 2 years ago
As of a0d162a3f3a7 in sonic-visualiser and commit:e06a0124c662 in svapp we have the ReplaceSession mode in place -- at the moment that Do What? dialog is just presenting all three options.
Updated by Chris Cannam about 2 years ago
See #150 for related notes about menu actions.