mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-10 08:36:32 +01:00
Patch from colinf to allow the number of recent sessions to
be configured (#2207). git-svn-id: svn://localhost/ardour2/branches/3.0@11641 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
ec1e3a1f60
commit
f6ee63591d
3 changed files with 15 additions and 2 deletions
|
|
@ -919,6 +919,15 @@ RCOptionEditor::RCOptionEditor ()
|
||||||
sigc::mem_fun (*_rc_config, &RCConfiguration::set_default_session_parent_dir)
|
sigc::mem_fun (*_rc_config, &RCConfiguration::set_default_session_parent_dir)
|
||||||
));
|
));
|
||||||
|
|
||||||
|
add_option (_("Misc"),
|
||||||
|
new SpinOption<uint32_t> (
|
||||||
|
"max-recent-sessions",
|
||||||
|
_("Maximum number of recent sessions"),
|
||||||
|
sigc::mem_fun (*_rc_config, &RCConfiguration::get_max_recent_sessions),
|
||||||
|
sigc::mem_fun (*_rc_config, &RCConfiguration::set_max_recent_sessions),
|
||||||
|
0, 1000, 1, 20
|
||||||
|
));
|
||||||
|
|
||||||
add_option (_("Misc"), new OptionEditorHeading (_("Click")));
|
add_option (_("Misc"), new OptionEditorHeading (_("Click")));
|
||||||
|
|
||||||
add_option (_("Misc"), new ClickOptions (_rc_config, this));
|
add_option (_("Misc"), new ClickOptions (_rc_config, this));
|
||||||
|
|
|
||||||
|
|
@ -174,6 +174,7 @@ CONFIG_VARIABLE (bool, update_editor_during_summary_drag, "update-editor-during-
|
||||||
CONFIG_VARIABLE (bool, never_display_periodic_midi, "never-display-periodic-midi", true)
|
CONFIG_VARIABLE (bool, never_display_periodic_midi, "never-display-periodic-midi", true)
|
||||||
CONFIG_VARIABLE (bool, sound_midi_notes, "sound-midi-notes", false)
|
CONFIG_VARIABLE (bool, sound_midi_notes, "sound-midi-notes", false)
|
||||||
CONFIG_VARIABLE (bool, use_plugin_own_gui, "use-plugin-own-gui", true)
|
CONFIG_VARIABLE (bool, use_plugin_own_gui, "use-plugin-own-gui", true)
|
||||||
|
CONFIG_VARIABLE (uint32_t, max_recent_sessions, "max-recent-sessions", 10)
|
||||||
|
|
||||||
/* denormal management */
|
/* denormal management */
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,7 @@
|
||||||
#include "pbd/error.h"
|
#include "pbd/error.h"
|
||||||
|
|
||||||
#include "ardour/configuration.h"
|
#include "ardour/configuration.h"
|
||||||
|
#include "ardour/rc_configuration.h"
|
||||||
#include "ardour/filesystem_paths.h"
|
#include "ardour/filesystem_paths.h"
|
||||||
#include "ardour/recent_sessions.h"
|
#include "ardour/recent_sessions.h"
|
||||||
#include "ardour/utils.h"
|
#include "ardour/utils.h"
|
||||||
|
|
@ -130,8 +131,10 @@ ARDOUR::store_recent_sessions (string name, string path)
|
||||||
|
|
||||||
rs.push_front (newpair);
|
rs.push_front (newpair);
|
||||||
|
|
||||||
if (rs.size() > 10) {
|
uint32_t max_recent_sessions = Config->get_max_recent_sessions();
|
||||||
rs.erase(rs.begin()+10, rs.end());
|
|
||||||
|
if (rs.size() > max_recent_sessions) {
|
||||||
|
rs.erase(rs.begin()+max_recent_sessions, rs.end());
|
||||||
}
|
}
|
||||||
|
|
||||||
return ARDOUR::write_recent_sessions (rs);
|
return ARDOUR::write_recent_sessions (rs);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue