mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-24 07:27:44 +01:00
[Summary] Added HDD buffering drop down to the tracks control panel and connected required functionality to it.
This commit is contained in:
parent
451a3e8c7c
commit
0aee0aab3e
7 changed files with 65 additions and 83 deletions
|
|
@ -78,8 +78,7 @@ TracksControlPanel::TracksControlPanel ()
|
|||
, _waveform_shape_dropdown (get_waves_dropdown ("waveform_shape_dropdown"))
|
||||
, _peak_hold_time_dropdown (get_waves_dropdown ("peak_hold_time_dropdown"))
|
||||
, _dpm_fall_off_dropdown (get_waves_dropdown ("dpm_fall_off_dropdown"))
|
||||
, _recording_seconds_dropdown (get_waves_dropdown ("recording_seconds_dropdown"))
|
||||
, _playback_seconds_dropdown (get_waves_dropdown ("playback_seconds_dropdown"))
|
||||
, _hard_disk_buffering_dropdown (get_waves_dropdown ("hard_disk_buffering_dropdown"))
|
||||
|
||||
, _have_control (false)
|
||||
, _ignore_changes (0)
|
||||
|
|
|
|||
|
|
@ -94,8 +94,7 @@ class TracksControlPanel : public WavesDialog, public PBD::ScopedConnectionList
|
|||
WavesDropdown& _waveform_shape_dropdown;
|
||||
WavesDropdown& _peak_hold_time_dropdown;
|
||||
WavesDropdown& _dpm_fall_off_dropdown;
|
||||
WavesDropdown& _recording_seconds_dropdown;
|
||||
WavesDropdown& _playback_seconds_dropdown;
|
||||
WavesDropdown& _hard_disk_buffering_dropdown;
|
||||
|
||||
Gtk::Label& _latency_label;
|
||||
Gtk::Label& _default_open_path;
|
||||
|
|
|
|||
|
|
@ -1023,42 +1023,26 @@ TracksControlPanel::display_meter_falloff ()
|
|||
}
|
||||
|
||||
void
|
||||
TracksControlPanel::display_audio_capture_buffer_seconds ()
|
||||
TracksControlPanel::display_hdd_buffering ()
|
||||
{
|
||||
long period = Config->get_audio_capture_buffer_seconds ();
|
||||
BufferingPreset preset = Config->get_buffering_preset ();
|
||||
int selected_item = 0;
|
||||
|
||||
if (period <= 5) {
|
||||
selected_item = 0;
|
||||
} else if (period <= 10) {
|
||||
selected_item = 1;
|
||||
} else if (period <= 15) {
|
||||
selected_item = 2;
|
||||
} else {
|
||||
selected_item = 3;
|
||||
}
|
||||
_recording_seconds_dropdown.set_current_item (selected_item);
|
||||
switch (preset) {
|
||||
case Small:
|
||||
selected_item = 0;
|
||||
break;
|
||||
case Medium:
|
||||
selected_item = 1;
|
||||
break;
|
||||
case Large:
|
||||
selected_item = 2;
|
||||
break;
|
||||
}
|
||||
|
||||
_hard_disk_buffering_dropdown.set_current_item (selected_item);
|
||||
}
|
||||
|
||||
void
|
||||
TracksControlPanel::display_audio_playback_buffer_seconds ()
|
||||
{
|
||||
long period = Config->get_audio_playback_buffer_seconds ();
|
||||
int selected_item = 0;
|
||||
|
||||
if (period <= 5) {
|
||||
selected_item = 0;
|
||||
} else if (period <= 10) {
|
||||
selected_item = 1;
|
||||
} else if (period <= 15) {
|
||||
selected_item = 2;
|
||||
} else {
|
||||
selected_item = 3;
|
||||
}
|
||||
|
||||
_playback_seconds_dropdown.set_current_item (selected_item);
|
||||
}
|
||||
|
||||
void
|
||||
TracksControlPanel::display_mmc_control ()
|
||||
{
|
||||
|
|
@ -1114,8 +1098,7 @@ TracksControlPanel::display_general_preferences ()
|
|||
display_waveform_color_fader ();
|
||||
display_meter_hold ();
|
||||
display_meter_falloff ();
|
||||
display_audio_capture_buffer_seconds ();
|
||||
display_audio_playback_buffer_seconds ();
|
||||
display_hdd_buffering ();
|
||||
display_mmc_control ();
|
||||
display_send_mmc ();
|
||||
display_mmc_send_device_id ();
|
||||
|
|
@ -1222,8 +1205,7 @@ TracksControlPanel::save_general_preferences ()
|
|||
Config->set_history_depth (_limit_undo_history_spinbutton.get_value ());
|
||||
Config->set_saved_history_depth (_save_undo_history_spinbutton.get_value ());
|
||||
Config->set_save_history (_save_undo_history_spinbutton.get_value () > 0);
|
||||
Config->set_audio_capture_buffer_seconds (PBD::atoi (_recording_seconds_dropdown.get_text ()));
|
||||
Config->set_audio_playback_buffer_seconds (PBD::atoi (_playback_seconds_dropdown.get_text()));
|
||||
Config->set_buffering_preset (string_to_hdd_buffering_preset (_hard_disk_buffering_dropdown.get_text ()));
|
||||
}
|
||||
|
||||
void TracksControlPanel::on_engine_dropdown_item_clicked (WavesDropdown*, int)
|
||||
|
|
@ -1786,9 +1768,7 @@ TracksControlPanel::on_parameter_changed (const std::string& parameter_name)
|
|||
} else if (parameter_name == "meter-falloff") {
|
||||
display_meter_falloff ();
|
||||
} else if (parameter_name == "capture-buffer-seconds") {
|
||||
display_audio_capture_buffer_seconds ();
|
||||
} else if (parameter_name == "playback-buffer-seconds") {
|
||||
display_audio_playback_buffer_seconds ();
|
||||
display_hdd_buffering ();
|
||||
} else if (parameter_name == "mmc-control") {
|
||||
display_mmc_control ();
|
||||
} else if (parameter_name == "send-mmc") {
|
||||
|
|
|
|||
|
|
@ -133,8 +133,7 @@
|
|||
void display_waveform_shape ();
|
||||
void display_meter_hold ();
|
||||
void display_meter_falloff ();
|
||||
void display_audio_capture_buffer_seconds ();
|
||||
void display_audio_playback_buffer_seconds ();
|
||||
void display_hdd_buffering ();
|
||||
void display_mmc_control ();
|
||||
void display_send_mmc ();
|
||||
void display_mmc_send_device_id ();
|
||||
|
|
|
|||
|
|
@ -922,9 +922,9 @@
|
|||
</HBox>
|
||||
<HBox>
|
||||
<Label style="parameter_label"
|
||||
text="Playback (Seconds of Buffering)"/>
|
||||
text="Drive Buffering"/>
|
||||
<VBox style="parameter_spacing"/>
|
||||
<Dropdown id="playback_seconds_dropdown"
|
||||
<Dropdown id="hard_disk_buffering_dropdown"
|
||||
style="preferences_tab_dropdown">
|
||||
<HBox>
|
||||
<VBox width="10"/>
|
||||
|
|
@ -933,46 +933,15 @@
|
|||
width="117"/>
|
||||
</HBox>
|
||||
<DropdownMenu style="generic_dropdown_menu">
|
||||
<DropdownItem title="5"
|
||||
<DropdownItem title="Small"
|
||||
horzalignment="start"
|
||||
data="0"/>
|
||||
<DropdownItem title="10"
|
||||
data="Small"/>
|
||||
<DropdownItem title="Medium"
|
||||
horzalignment="start"
|
||||
data="1"/>
|
||||
<DropdownItem title="15"
|
||||
data="Medium"/>
|
||||
<DropdownItem title="Large"
|
||||
horzalignment="start"
|
||||
data="2"/>
|
||||
<DropdownItem title="20"
|
||||
horzalignment="start"
|
||||
data="3"/>
|
||||
</DropdownMenu>
|
||||
</Dropdown>
|
||||
</HBox>
|
||||
<HBox>
|
||||
<Label style="parameter_label"
|
||||
text="Recording (Seconds of Buffering)"/>
|
||||
<VBox style="parameter_spacing"/>
|
||||
<Dropdown id="recording_seconds_dropdown"
|
||||
style="preferences_tab_dropdown">
|
||||
<HBox>
|
||||
<VBox width="10"/>
|
||||
<Label style="generic_control"
|
||||
horzalignment="start"
|
||||
width="117"/>
|
||||
</HBox>
|
||||
<DropdownMenu style="generic_dropdown_menu">
|
||||
<DropdownItem title="5"
|
||||
horzalignment="start"
|
||||
data="0"/>
|
||||
<DropdownItem title="10"
|
||||
horzalignment="start"
|
||||
data="1"/>
|
||||
<DropdownItem title="15"
|
||||
horzalignment="start"
|
||||
data="2"/>
|
||||
<DropdownItem title="20"
|
||||
horzalignment="start"
|
||||
data="3"/>
|
||||
data="Large"/>
|
||||
</DropdownMenu>
|
||||
</Dropdown>
|
||||
</HBox>
|
||||
|
|
|
|||
|
|
@ -75,6 +75,9 @@ LIBARDOUR_API ARDOUR::SyncSource string_to_sync_source (std::string str);
|
|||
|
||||
LIBARDOUR_API const char* edit_mode_to_string (ARDOUR::EditMode);
|
||||
LIBARDOUR_API ARDOUR::EditMode string_to_edit_mode (std::string);
|
||||
|
||||
LIBARDOUR_API ARDOUR::BufferingPreset string_to_hdd_buffering_preset (const std::string& str);
|
||||
LIBARDOUR_API const char* hdd_buffering_preset_to_string (BufferingPreset preset);
|
||||
|
||||
#undef OLD_GAIN_MATH
|
||||
#define OLD_GAIN_MATH
|
||||
|
|
|
|||
|
|
@ -504,6 +504,39 @@ ARDOUR::sync_source_to_string (SyncSource src, bool sh)
|
|||
return _("JACK");
|
||||
}
|
||||
|
||||
BufferingPreset
|
||||
ARDOUR::string_to_hdd_buffering_preset (const string& str)
|
||||
{
|
||||
if (str == _("Small")) {
|
||||
return Small;
|
||||
} else if (str == _("Medium")) {
|
||||
return Medium;
|
||||
} else if (str == _("Large")) {
|
||||
return Large;
|
||||
}
|
||||
|
||||
fatal << string_compose (_("programming error: unknown buffering preset \"%1\""), str) << endmsg;
|
||||
/*NOTREACHED*/
|
||||
return Small;
|
||||
}
|
||||
|
||||
const char*
|
||||
ARDOUR::hdd_buffering_preset_to_string (BufferingPreset preset)
|
||||
{
|
||||
switch (preset) {
|
||||
case Small:
|
||||
return _("Small");
|
||||
|
||||
case Medium:
|
||||
return _("Medium");
|
||||
|
||||
case Large:
|
||||
return _("Large");
|
||||
}
|
||||
/* GRRRR .... stupid, stupid gcc - you can't get here from there, all enum values are handled */
|
||||
return _("Small");
|
||||
}
|
||||
|
||||
float
|
||||
ARDOUR::meter_falloff_to_float (MeterFalloff falloff)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue