mirror of
https://github.com/Ardour/ardour.git
synced 2026-01-08 14:45:43 +01:00
[Summary] Added new drop-down menus in preference panel for AUTO SAVE TIMER and PRE RECORD BUFFER
[Reviewed] GZharun
This commit is contained in:
parent
09aeb8416c
commit
fb7c6dabf1
6 changed files with 111 additions and 9 deletions
|
|
@ -94,6 +94,8 @@ TracksControlPanel::TracksControlPanel ()
|
|||
, _frame_rate_combo (get_combo_box_text ("frame_rate_combo"))
|
||||
, _browse_button(get_waves_button("browse_default_folder"))
|
||||
, _auto_lock_timer_combo(get_combo_box_text("auto_lock_timer_combo"))
|
||||
, _auto_save_timer_combo(get_combo_box_text("auto_save_timer_combo"))
|
||||
, _pre_record_buffer_combo(get_combo_box_text("pre_record_buffer_combo"))
|
||||
, _have_control (false)
|
||||
, _ignore_changes (0)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -75,6 +75,8 @@ class TracksControlPanel : public WavesDialog, public PBD::ScopedConnectionList
|
|||
Gtk::ComboBoxText& _bit_depth_combo;
|
||||
Gtk::ComboBoxText& _frame_rate_combo;
|
||||
Gtk::ComboBoxText& _auto_lock_timer_combo;
|
||||
Gtk::ComboBoxText& _auto_save_timer_combo;
|
||||
Gtk::ComboBoxText& _pre_record_buffer_combo;
|
||||
Gtk::Label& _latency_label;
|
||||
Gtk::Label& _default_open_path;
|
||||
|
||||
|
|
|
|||
|
|
@ -153,6 +153,8 @@ TracksControlPanel::init ()
|
|||
populate_bit_depth_combo();
|
||||
populate_frame_rate_combo();
|
||||
populate_auto_lock_timer_combo();
|
||||
populate_save_lock_timer_combo();
|
||||
populate_pre_record_buffer_combo();
|
||||
|
||||
_audio_settings_tab_button.set_active(true);
|
||||
}
|
||||
|
|
@ -585,6 +587,49 @@ TracksControlPanel::populate_auto_lock_timer_combo()
|
|||
_auto_lock_timer_combo.set_active_text( str_time );
|
||||
}
|
||||
|
||||
void
|
||||
TracksControlPanel::populate_save_lock_timer_combo()
|
||||
{
|
||||
using namespace std;
|
||||
|
||||
vector<string> save_time_strings;
|
||||
save_time_strings.push_back("0 Min");
|
||||
save_time_strings.push_back("1 Min");
|
||||
save_time_strings.push_back("3 Min");
|
||||
save_time_strings.push_back("5 Min");
|
||||
save_time_strings.push_back("10 Min");
|
||||
save_time_strings.push_back("15 Min");
|
||||
|
||||
int time = ARDOUR_UI::config()->get_auto_save_timer();
|
||||
stringstream ss;
|
||||
ss << time;
|
||||
string str_time = ss.str() + " Min";
|
||||
|
||||
set_popdown_strings (_auto_save_timer_combo, save_time_strings);
|
||||
_auto_save_timer_combo.set_sensitive (save_time_strings.size() > 1);
|
||||
_auto_save_timer_combo.set_active_text( str_time );
|
||||
}
|
||||
|
||||
void
|
||||
TracksControlPanel::populate_pre_record_buffer_combo()
|
||||
{
|
||||
using namespace std;
|
||||
|
||||
vector<string> pre_record_buffer_strings;
|
||||
pre_record_buffer_strings.push_back("0 Min");
|
||||
pre_record_buffer_strings.push_back("1 Min");
|
||||
pre_record_buffer_strings.push_back("2 Min");
|
||||
|
||||
int time = ARDOUR_UI::config()->get_pre_record_buffer();
|
||||
stringstream ss;
|
||||
ss << time;
|
||||
string str_time = ss.str() + " Min";
|
||||
|
||||
set_popdown_strings (_pre_record_buffer_combo, pre_record_buffer_strings);
|
||||
_pre_record_buffer_combo.set_sensitive (pre_record_buffer_strings.size() > 1);
|
||||
_pre_record_buffer_combo.set_active_text( str_time );
|
||||
}
|
||||
|
||||
void
|
||||
TracksControlPanel::refresh_session_settings_info()
|
||||
{
|
||||
|
|
@ -1270,15 +1315,28 @@ TracksControlPanel::save_default_session_path()
|
|||
void
|
||||
TracksControlPanel::save_auto_lock_time()
|
||||
{
|
||||
using namespace std;
|
||||
|
||||
string s = _auto_lock_timer_combo.get_active_text();
|
||||
|
||||
char * pEnd;
|
||||
int time = strtol( s.c_str(), &pEnd, 10 );
|
||||
|
||||
ARDOUR_UI::config()->set_auto_lock_timer(time);
|
||||
ARDOUR_UI::config()->save_state();
|
||||
}
|
||||
|
||||
void
|
||||
TracksControlPanel::save_auto_save_time()
|
||||
{
|
||||
string s = _auto_save_timer_combo.get_active_text();
|
||||
char * pEnd;
|
||||
int time = strtol( s.c_str(), &pEnd, 10 );
|
||||
ARDOUR_UI::config()->set_auto_save_timer(time);
|
||||
}
|
||||
|
||||
void
|
||||
TracksControlPanel::save_pre_record_buffer()
|
||||
{
|
||||
string s = _pre_record_buffer_combo.get_active_text();
|
||||
char * pEnd;
|
||||
int time = strtol( s.c_str(), &pEnd, 10 );
|
||||
ARDOUR_UI::config()->set_pre_record_buffer(time);
|
||||
}
|
||||
|
||||
void TracksControlPanel::update_session_config ()
|
||||
|
|
@ -1307,6 +1365,10 @@ TracksControlPanel::update_configs()
|
|||
// update global config
|
||||
save_default_session_path();
|
||||
save_auto_lock_time();
|
||||
save_auto_save_time();
|
||||
save_pre_record_buffer();
|
||||
// save ARDOUR_UI::config to disk persistently
|
||||
ARDOUR_UI::config()->save_state();
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -1324,7 +1386,33 @@ void
|
|||
TracksControlPanel::on_cancel (WavesButton*)
|
||||
{
|
||||
hide();
|
||||
response(Gtk::RESPONSE_CANCEL);
|
||||
response(Gtk::RESPONSE_CANCEL);
|
||||
|
||||
// restore previous value in combo-boxes
|
||||
stringstream ss;
|
||||
int temp;
|
||||
string str;
|
||||
temp = ARDOUR_UI::config()->get_auto_lock_timer();
|
||||
ss.str(string(""));
|
||||
ss.clear();
|
||||
ss << temp;
|
||||
str = ss.str() + " Min";
|
||||
_auto_lock_timer_combo.set_active_text(str);
|
||||
|
||||
temp = ARDOUR_UI::config()->get_auto_save_timer();
|
||||
ss.str(string(""));
|
||||
ss.clear();
|
||||
ss << temp;
|
||||
str = ss.str() + " Min";
|
||||
_auto_save_timer_combo.set_active_text(str);
|
||||
|
||||
temp = ARDOUR_UI::config()->get_pre_record_buffer();
|
||||
ss.str(string(""));
|
||||
ss.clear();
|
||||
ss << temp;
|
||||
str = ss.str() + " Min";
|
||||
_pre_record_buffer_combo.set_active_text(str);
|
||||
|
||||
_default_open_path.set_text(Config->get_default_session_parent_dir());
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -56,6 +56,8 @@
|
|||
void on_browse_button (WavesButton*);
|
||||
void save_default_session_path();
|
||||
void save_auto_lock_time();
|
||||
void save_auto_save_time();
|
||||
void save_pre_record_buffer();
|
||||
void on_ok(WavesButton*);
|
||||
void on_cancel(WavesButton*);
|
||||
void on_apply(WavesButton*);
|
||||
|
|
@ -101,6 +103,8 @@
|
|||
void populate_bit_depth_combo();
|
||||
void populate_frame_rate_combo();
|
||||
void populate_auto_lock_timer_combo();
|
||||
void populate_save_lock_timer_combo();
|
||||
void populate_pre_record_buffer_combo();
|
||||
|
||||
// Engine State update callback handlers
|
||||
void on_port_registration_update();
|
||||
|
|
|
|||
|
|
@ -240,14 +240,18 @@
|
|||
<ComboBoxText style="generic_control" id="frame_rate_combo" x="215" y="100" width="150" height="20" />
|
||||
<Label style="generic_control" text="AUTO LOCK TIMER" x="24" y="175"/>
|
||||
<ComboBoxText style="generic_control" id="auto_lock_timer_combo" x="215" y="175" width="150" height="20" />
|
||||
<Label style="generic_control" text="AUTO SAVE TIMER" x="24" y="205"/>
|
||||
<ComboBoxText style="generic_control" id="auto_save_timer_combo" x="215" y="205" width="150" height="20" />
|
||||
<Label style="generic_control" text="PRE RECORD BUFFER" x="24" y="235"/>
|
||||
<ComboBoxText style="generic_control" id="pre_record_buffer_combo" x="215" y="235" width="150" height="20" />
|
||||
|
||||
<Label style="generic_control" text="DEFAULT FOLDER FOR NEW SESSION" x = "24" y = "230" />
|
||||
<Label style="generic_control" text="DEFAULT FOLDER FOR NEW SESSION" x = "24" y = "290" />
|
||||
<Button
|
||||
id = "browse_default_folder"
|
||||
text = "Browse"
|
||||
style = "generic_button"
|
||||
x = "24" y = "250" width = "100" height = "28"/>
|
||||
<Label id="default_open_path" style="generic_control" text="" x = "135" y = "255" />
|
||||
x = "24" y = "310" width = "100" height = "28"/>
|
||||
<Label id="default_open_path" style="generic_control" text="" x = "135" y = "315" />
|
||||
</Layout>
|
||||
</Layout>
|
||||
</Dialog>
|
||||
|
|
|
|||
|
|
@ -25,4 +25,6 @@ UI_CONFIG_VARIABLE(bool, all_floating_windows_are_dialogs, "all-floating-windows
|
|||
UI_CONFIG_VARIABLE (bool, color_regions_using_track_color, "color-regions-using-track-color", false)
|
||||
UI_CONFIG_VARIABLE (bool, show_waveform_clipping, "show-waveform-clipping", true)
|
||||
UI_CONFIG_VARIABLE (int, auto_lock_timer, "auto-lock-timer", 0)
|
||||
UI_CONFIG_VARIABLE (int, auto_save_timer, "auto-save-timer", 0)
|
||||
UI_CONFIG_VARIABLE (int, pre_record_buffer, "pre-record-buffer", 0)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue