Session::possible_states correctly filters files
and also directly returns sorted base-names.
We can remove the redundant `get_state_files_in_directory`
API now.
see also 193b35e885
This is consistent, since after handling the
`SaveSessionRequested` signal the session remains dirty
(which may be a bug). However since the signal is handled
by the GUI, rec-stop only saves the session if there is a GUI.
It is however somewhat dangerous. Record, quit + no-save (or
changing snapshots w/o saving first) will loose any references
to the recorded data (even though it is still on disk).
Note that "remove last capture" still saves the session
(to prevent references to non-existent sources).
For example, the following log text creates a markup error that results in
the session loading dialog being completely empty.
WARNING: VST3<C:\Program Files\Common Files\VST3\Plugins.VST.Someplugin.vst3\Contents\x86-win\Plugins.VST.Someplugin.vst3>: Invalid Module Path
...
Gtk-WARNING **: 16:46:28.447: Failed to set text from markup due to error parsing markup: Error on line 7 char 40: ?Files\Common? is not a valid name: ?\?
When plugins have not been scanned, and a session with
missing plugins is opened, ask to scan plugins.
This also consolidates translatable strings with plugin-selector.
Note that this is done at the GUI level, might need to double check if there are
other paths into a "save" that should be covered. Control surfaces use the action, but
Lua comes to mind
Dumping errors to stderr only is not very useful. Particularly not
on Windows and MacOS.
Even though a user may not be able to address the issue, this
can lead to better reports vs just printing "corrupt state".
There are various ways to cancel a dialog. Only checking for
RESPONSE_CANCEL is not sufficient. e.g. Esc causes a delete-event.
* Gtk::RESPONSE_CLOSE
* Gtk::RESPONSE_REJECT
* Gtk::RESPONSE_DELETE_EVENT
* Gtk::RESPONSE_CANCEL
* Gtk::RESPONSE_NO
Among others this fixes "Clicking session > open,
then hitting ESC opens the currently selected folder and session"
So far this is only used for MIDI, missing audio files are
already handled by asking a user to locate them.
The same approach doesn't work for MIDI, since there cannot be
externally referenced (embedded) .mid files (since MIDI is destructive).
When creating a session from the Editor (after Session > Close,
or directly via Session > New) the engine-dialog needs to be displayed
to allow configuring the sample-rate.
This also consolidates scripted session setup: meta_session_setup()
is now called from build_session(), instead of all callers.