mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-21 14:16:31 +01:00
[Summary] Updated Auto Lock Timer according to PRD
[Reviewed] GZharun
This commit is contained in:
parent
65035584c9
commit
68b323a1a7
6 changed files with 37 additions and 27 deletions
|
|
@ -1183,7 +1183,7 @@ Editor::lock_timeout_callback ()
|
|||
if( !ARDOUR_UI::instance()->screen_lock_is_allowed() )
|
||||
return false; // Returning false will effectively disconnect us from the timer callback.
|
||||
|
||||
if (delta.tv_sec > ARDOUR_UI::config()->get_auto_lock_timer ())
|
||||
if (delta.tv_sec >= 60 * ARDOUR_UI::config()->get_auto_lock_timer ())
|
||||
{
|
||||
lock ();
|
||||
/* don't call again. Returning false will effectively
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ TracksControlPanel::TracksControlPanel ()
|
|||
, _bit_depth_combo (get_combo_box_text ("bit_depth_combo"))
|
||||
, _frame_rate_combo (get_combo_box_text ("frame_rate_combo"))
|
||||
, _browse_button(get_waves_button("browse_default_folder"))
|
||||
, _auto_lock_timer_spin_button(get_spin_button("auto_lock_timer_spin_button"))
|
||||
, _auto_lock_timer_combo(get_combo_box_text("auto_lock_timer_combo"))
|
||||
, _have_control (false)
|
||||
, _ignore_changes (0)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -74,9 +74,9 @@ class TracksControlPanel : public WavesDialog, public PBD::ScopedConnectionList
|
|||
Gtk::ComboBoxText& _file_type_combo;
|
||||
Gtk::ComboBoxText& _bit_depth_combo;
|
||||
Gtk::ComboBoxText& _frame_rate_combo;
|
||||
Gtk::Label& _latency_label;
|
||||
Gtk::ComboBoxText& _auto_lock_timer_combo;
|
||||
Gtk::Label& _latency_label;
|
||||
Gtk::Label& _default_open_path;
|
||||
Gtk::SpinButton& _auto_lock_timer_spin_button;
|
||||
|
||||
#include "tracks_control_panel.logic.h"
|
||||
};
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@
|
|||
*/
|
||||
#include <stdlib.h>
|
||||
#include <string>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "tracks_control_panel.h"
|
||||
#include "waves_button.h"
|
||||
|
|
@ -47,6 +48,7 @@ using namespace Gtk;
|
|||
using namespace Gtkmm2ext;
|
||||
using namespace PBD;
|
||||
using namespace Glib;
|
||||
using namespace std;
|
||||
|
||||
#define dbg_msg(a) MessageDialog (a, PROGRAM_NAME).run();
|
||||
|
||||
|
|
@ -150,7 +152,7 @@ TracksControlPanel::init ()
|
|||
populate_file_type_combo();
|
||||
populate_bit_depth_combo();
|
||||
populate_frame_rate_combo();
|
||||
populate_auto_lock_timer();
|
||||
populate_auto_lock_timer_combo();
|
||||
|
||||
_audio_settings_tab_button.set_active(true);
|
||||
}
|
||||
|
|
@ -560,6 +562,29 @@ TracksControlPanel::populate_frame_rate_combo()
|
|||
return;
|
||||
}
|
||||
|
||||
void
|
||||
TracksControlPanel::populate_auto_lock_timer_combo()
|
||||
{
|
||||
using namespace std;
|
||||
|
||||
vector<string> lock_time_strings;
|
||||
lock_time_strings.push_back("0 Min");
|
||||
lock_time_strings.push_back("1 Min");
|
||||
lock_time_strings.push_back("3 Min");
|
||||
lock_time_strings.push_back("5 Min");
|
||||
lock_time_strings.push_back("10 Min");
|
||||
lock_time_strings.push_back("15 Min");
|
||||
|
||||
int time = ARDOUR_UI::config()->get_auto_lock_timer();
|
||||
stringstream ss;
|
||||
ss << time;
|
||||
string str_time = ss.str() + " Min";
|
||||
|
||||
set_popdown_strings (_auto_lock_timer_combo, lock_time_strings);
|
||||
_auto_lock_timer_combo.set_sensitive (lock_time_strings.size() > 1);
|
||||
_auto_lock_timer_combo.set_active_text( str_time );
|
||||
}
|
||||
|
||||
void
|
||||
TracksControlPanel::refresh_session_settings_info()
|
||||
{
|
||||
|
|
@ -575,23 +600,6 @@ TracksControlPanel::refresh_session_settings_info()
|
|||
_frame_rate_combo.set_active_text( TimecodeFormat_to_string(session->config.get_timecode_format()) );
|
||||
}
|
||||
|
||||
void
|
||||
TracksControlPanel::populate_auto_lock_timer()
|
||||
{
|
||||
using namespace std;
|
||||
using namespace Gtk;
|
||||
|
||||
_auto_lock_timer_spin_button.set_max_length(3);
|
||||
_auto_lock_timer_spin_button.set_numeric(true);
|
||||
|
||||
_auto_lock_timer_spin_button.set_update_policy(UPDATE_ALWAYS);
|
||||
_auto_lock_timer_spin_button.set_range(0, 999);
|
||||
_auto_lock_timer_spin_button.set_increments(1,1);
|
||||
|
||||
int time = ARDOUR_UI::config()->get_auto_lock_timer();
|
||||
_auto_lock_timer_spin_button.set_value(time);
|
||||
}
|
||||
|
||||
void
|
||||
TracksControlPanel::populate_default_session_path()
|
||||
{
|
||||
|
|
@ -1264,8 +1272,10 @@ TracksControlPanel::save_auto_lock_time()
|
|||
{
|
||||
using namespace std;
|
||||
|
||||
string s = _auto_lock_timer_spin_button.get_text();
|
||||
int time = atoi(s);
|
||||
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();
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@
|
|||
void populate_file_type_combo();
|
||||
void populate_bit_depth_combo();
|
||||
void populate_frame_rate_combo();
|
||||
void populate_auto_lock_timer();
|
||||
void populate_auto_lock_timer_combo();
|
||||
|
||||
// Engine State update callback handlers
|
||||
void on_port_registration_update();
|
||||
|
|
|
|||
|
|
@ -239,8 +239,8 @@
|
|||
<Label style="generic_control" text="SESSION FRAME RATE" x="24" y="100"/>
|
||||
<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"/>
|
||||
<SpinButton style="generic_control" id="auto_lock_timer_spin_button" x="215" y="175" width="150" height="20" />
|
||||
|
||||
<ComboBoxText style="generic_control" id="auto_lock_timer_combo" x="215" y="175" width="150" height="20" />
|
||||
|
||||
<Label style="generic_control" text="DEFAULT FOLDER FOR NEW SESSION" x = "24" y = "230" />
|
||||
<Button
|
||||
id = "browse_default_folder"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue