Allow to customize parts of the main toolbar

This commit is contained in:
Robin Gareus 2016-12-20 03:11:21 +01:00
parent f6dc24b901
commit 73ad6b3766
8 changed files with 91 additions and 42 deletions

View file

@ -172,6 +172,7 @@ typedef uint64_t microseconds_t;
#include "startup.h"
#include "theme_manager.h"
#include "time_axis_view_item.h"
#include "time_info_box.h"
#include "timers.h"
#include "utils.h"
#include "video_server_dialog.h"
@ -278,6 +279,7 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], const char* localedir)
, auto_loop_controllable (new TransportControllable ("transport auto loop", *this, TransportControllable::AutoLoop))
, play_selection_controllable (new TransportControllable ("transport play selection", *this, TransportControllable::PlaySelection))
, rec_controllable (new TransportControllable ("transport rec-enable", *this, TransportControllable::RecordEnable))
, time_info_box (0)
, auto_return_button (ArdourButton::led_default_elements)
, follow_edits_button (ArdourButton::led_default_elements)
, auto_input_button (ArdourButton::led_default_elements)
@ -738,6 +740,7 @@ ARDOUR_UI::~ARDOUR_UI ()
delete primary_clock; primary_clock = 0;
delete secondary_clock; secondary_clock = 0;
delete _process_thread; _process_thread = 0;
delete time_info_box; time_info_box = 0;
delete meterbridge; meterbridge = 0;
delete luawindow; luawindow = 0;
delete editor; editor = 0;

View file

@ -76,6 +76,7 @@
#include "ardour_window.h"
#include "editing.h"
#include "enums.h"
#include "mini_timeline.h"
#include "shuttle_control.h"
#include "visibility_group.h"
#include "window_manager.h"
@ -128,7 +129,7 @@ class SaveAsDialog;
class SessionDialog;
class SessionOptionEditorWindow;
class Splash;
class MiniTimeline;
class TimeInfoBox;
class Meterbridge;
class LuaWindow;
class MidiTracer;
@ -253,7 +254,6 @@ public:
MainClock* secondary_clock;
void focus_on_clock ();
AudioClock* big_clock;
MiniTimeline* mini_timeline;
VideoTimeLine *video_timeline;
@ -478,6 +478,8 @@ private:
Gtk::Frame transport_frame;
Gtk::HBox transport_hbox;
void repack_transport_hbox ();
struct TransportControllable : public PBD::Controllable {
enum ToggleType {
Roll = 0,
@ -529,6 +531,8 @@ private:
void toggle_video_sync ();
ShuttleControl shuttle_box;
MiniTimeline mini_timeline;
TimeInfoBox *time_info_box;
ArdourButton auto_return_button;
ArdourButton follow_edits_button;

View file

@ -54,8 +54,8 @@
#include "mixer_ui.h"
#include "utils.h"
#include "theme_manager.h"
#include "time_info_box.h"
#include "midi_tracer.h"
#include "mini_timeline.h"
#include "global_port_matrix.h"
#include "location_ui.h"
#include "rc_option_editor.h"
@ -178,6 +178,42 @@ bool drag_failed (const Glib::RefPtr<Gdk::DragContext>& context, DragResult resu
return false;
}
void
ARDOUR_UI::repack_transport_hbox ()
{
if (time_info_box) {
if (time_info_box->get_parent()) {
transport_hbox.remove (*time_info_box);
}
if (UIConfiguration::instance().get_show_toolbar_selclock ()) {
transport_hbox.pack_start (*time_info_box, false, false);
time_info_box->show();
}
}
if (mini_timeline.get_parent()) {
transport_hbox.remove (mini_timeline);
}
if (UIConfiguration::instance().get_show_mini_timeline ()) {
transport_hbox.pack_start (mini_timeline, true, true);
mini_timeline.show();
}
if (editor_meter) {
if (meter_box.get_parent()) {
transport_hbox.remove (meter_box);
transport_hbox.remove (editor_meter_peak_display);
}
if (UIConfiguration::instance().get_show_editor_meter()) {
transport_hbox.pack_end (editor_meter_peak_display, false, false);
transport_hbox.pack_end (meter_box, false, false);
meter_box.show();
editor_meter_peak_display.show();
}
}
}
bool
ARDOUR_UI::transport_expose (GdkEventExpose* ev)
{
@ -394,8 +430,6 @@ ARDOUR_UI::setup_transport ()
punch_button_size_group->add_widget (punch_in_button);
punch_button_size_group->add_widget (punch_out_button);
mini_timeline = manage (new MiniTimeline);
/* and now the layout... */
/* top level packing */
@ -521,12 +555,9 @@ ARDOUR_UI::setup_transport ()
transport_table.attach (*(manage (new ArdourVSpacer ())), TCOL, 0, 2 , SHRINK, EXPAND|FILL, 3, 0);
++col;
/* editor-meter is in transport_hbox */
transport_hbox.set_spacing (PX_SCALE(1));
transport_table.attach (transport_hbox, TCOL, 0, 2, SHRINK, EXPAND|FILL, 2, 0);
++col;
transport_table.attach (*mini_timeline, TCOL, 0, 2, EXPAND|FILL, EXPAND|FILL, 1, 0);
/* editor-meter, mini-timeline and selection clock are options in the transport_hbox */
transport_hbox.set_spacing (3);
transport_table.attach (transport_hbox, TCOL, 0, 2, EXPAND|FILL, EXPAND|FILL, 2, 0);
++col;
/* lua script action buttons */
@ -537,6 +568,7 @@ ARDOUR_UI::setup_transport ()
transport_table.attach (mixer_visibility_button, TCOL, 1, 2 , FILL, SHRINK, 2, 0);
++col;
repack_transport_hbox ();
/* desensitize */
feedback_alert_button.set_sensitive (false);

View file

@ -43,6 +43,7 @@
#include "splash.h"
#include "rc_option_editor.h"
#include "route_params_ui.h"
#include "time_info_box.h"
#include "opts.h"
#include "utils.h"
@ -271,6 +272,7 @@ ARDOUR_UI::setup_windows ()
mixer->add_to_notebook (_tabs, _("Mixer"));
editor->add_to_notebook (_tabs, _("Editor"));
time_info_box = new TimeInfoBox (false);
/* all other dialogs are created conditionally */
we_have_dependents ();

View file

@ -68,6 +68,7 @@
#include "splash.h"
#include "sfdb_ui.h"
#include "theme_manager.h"
#include "time_info_box.h"
#include "timers.h"
#include "pbd/i18n.h"
@ -109,11 +110,12 @@ ARDOUR_UI::set_session (Session *s)
AutomationWatch::instance().set_session (s);
shuttle_box.set_session (s);
mini_timeline.set_session (s);
time_info_box->set_session (s);
primary_clock->set_session (s);
secondary_clock->set_session (s);
big_clock->set_session (s);
mini_timeline->set_session (s);
video_timeline->set_session (s);
/* sensitize menu bar options that are now valid */
@ -238,12 +240,7 @@ ARDOUR_UI::set_session (Session *s)
editor_meter_max_peak = -INFINITY;
editor_meter_peak_display.signal_button_release_event().connect (sigc::mem_fun(*this, &ARDOUR_UI::editor_meter_peak_button_release), false);
if (UIConfiguration::instance().get_show_editor_meter() && !ARDOUR::Profile->get_trx()) {
transport_hbox.pack_start (meter_box, false, false);
transport_hbox.pack_start (editor_meter_peak_display, false, false);
meter_box.show();
editor_meter_peak_display.show();
}
repack_transport_hbox ();
}
update_title ();

View file

@ -403,22 +403,12 @@ ARDOUR_UI::parameter_changed (std::string p)
}
} else if (p == "waveform-gradient-depth") {
ArdourCanvas::WaveView::set_global_gradient_depth (UIConfiguration::instance().get_waveform_gradient_depth());
} else if (p == "show-mini-timeline") {
repack_transport_hbox ();
} else if (p == "show-toolbar-selclock") {
repack_transport_hbox ();
} else if (p == "show-editor-meter") {
bool show = UIConfiguration::instance().get_show_editor_meter();
if (editor_meter) {
if (meter_box.get_parent()) {
transport_hbox.remove (meter_box);
transport_hbox.remove (editor_meter_peak_display);
}
if (show) {
transport_hbox.pack_start (meter_box, false, false);
transport_hbox.pack_start (editor_meter_peak_display, false, false);
meter_box.show();
editor_meter_peak_display.show();
}
}
repack_transport_hbox ();
} else if (p == "waveform-scale") {
ArdourCanvas::WaveView::set_global_logscaled (UIConfiguration::instance().get_waveform_scale() == Logarithmic);
} else if (p == "widget-prelight") {

View file

@ -2510,14 +2510,6 @@ RCOptionEditor::RCOptionEditor ()
sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_draggable_playhead)
));
add_option (_("Editor"),
new BoolOption (
"show-editor-meter",
_("Display master-meter in the toolbar"),
sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_show_editor_meter),
sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_show_editor_meter)
));
if (!Profile->get_mixbus()) {
add_option (_("Editor"),
new BoolOption (
@ -3487,7 +3479,33 @@ if (!ARDOUR::Profile->get_mixbus()) {
sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_default_narrow_ms)
));
add_option (S_("Preferences|GUI"),
add_option (_("GUI/Toolbar"), new OptionEditorHeading (_("Main Transport Items")));
add_option (_("GUI/Toolbar"),
new BoolOption (
"show-toolbar-selclock",
_("Display Selection Clock in the Toolbar"),
sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_show_toolbar_selclock),
sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_show_toolbar_selclock)
));
add_option (_("GUI/Toolbar"),
new BoolOption (
"show-mini-timeline",
_("Display Navigation Timeline in the Toolbar"),
sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_show_mini_timeline),
sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_show_mini_timeline)
));
add_option (_("GUI/Toolbar"),
new BoolOption (
"show-editor-meter",
_("Display Master Level Meter in the Toolbar"),
sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_show_editor_meter),
sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_show_editor_meter)
));
add_option (_("GUI/Toolbar"),
new ColumVisibilityOption (
"action-table-columns", _("Action Script Button Visibility"), 4,
sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_action_table_columns),
@ -3495,6 +3513,7 @@ if (!ARDOUR::Profile->get_mixbus()) {
)
);
add_option (S_("Preferences|Metering"), new OptionEditorHeading (_("Metering")));
ComboOption<float>* mht = new ComboOption<float> (

View file

@ -72,6 +72,8 @@ UI_CONFIG_VARIABLE (ARDOUR::MeterLineUp, meter_line_up_din, "meter-line-up-din",
UI_CONFIG_VARIABLE (float, meter_peak, "meter-peak", 0.0f)
UI_CONFIG_VARIABLE (bool, meter_style_led, "meter-style-led", false)
UI_CONFIG_VARIABLE (bool, show_editor_meter, "show-editor-meter", true)
UI_CONFIG_VARIABLE (bool, show_toolbar_selclock, "show-toolbar-selclock", false)
UI_CONFIG_VARIABLE (bool, show_mini_timeline, "show-mini-timeline", true)
UI_CONFIG_VARIABLE (double, waveform_clip_level, "waveform-clip-level", -0.0933967) /* units of dB */
UI_CONFIG_VARIABLE (bool, hiding_groups_deactivates_groups, "hiding-groups-deactivates-groups", true)
UI_CONFIG_VARIABLE (bool, no_new_session_dialog, "no-new-session-dialog", false)