#include "gtkmm2ext/actions.h"
-#include "ardour_ui.h"
#include "actions.h"
#include "i18n.h"
Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
if (tact) {
- bool x = (ARDOUR_UI::config()->*get)();
+ bool x = (UIConfiguration::instance().*get)();
if (x != tact->get_active()) {
- (ARDOUR_UI::config()->*set) (!x);
+ (UIConfiguration::instance().*set) (!x);
}
}
}
if (tact) {
- bool x = (ARDOUR_UI::config()->*get)();
+ bool x = (UIConfiguration::instance().*get)();
if (tact->get_active() != x) {
tact->set_active (x);
#include "gtkmm2ext/rgb_macros.h"
#include "gtkmm2ext/gui_thread.h"
-#include "ardour/rc_configuration.h" // for widget prelight preference
-
#include "canvas/utils.h"
#include "canvas/colors.h"
#include "ardour_button.h"
#include "ardour_ui.h"
+#include "ui_config.h"
#include "i18n.h"
, _update_colors (true)
, _pattern_height (0)
{
- UIConfiguration::ColorsChanged.connect (sigc::mem_fun (*this, &ArdourButton::color_handler));
+ UIConfiguration::instance().ColorsChanged.connect (sigc::mem_fun (*this, &ArdourButton::color_handler));
}
ArdourButton::ArdourButton (const std::string& str, Element e)
, _pattern_height (0)
{
set_text (str);
- UIConfiguration::ColorsChanged.connect (sigc::mem_fun (*this, &ArdourButton::color_handler));
- UIConfiguration::DPIReset.connect (sigc::mem_fun (*this, &ArdourButton::on_name_changed));
+ UIConfiguration::instance().ColorsChanged.connect (sigc::mem_fun (*this, &ArdourButton::color_handler));
+ UIConfiguration::instance().DPIReset.connect (sigc::mem_fun (*this, &ArdourButton::on_name_changed));
}
ArdourButton::~ArdourButton()
uint32_t text_color;
uint32_t led_color;
- const float corner_radius = std::max(2.f, _corner_radius * ARDOUR_UI::config()->get_ui_scale());
+ const float corner_radius = std::max(2.f, _corner_radius * UIConfiguration::instance().get_ui_scale());
if (_update_colors) {
set_colors ();
//black ring
cairo_set_source_rgb (cr, 0, 0, 0);
- cairo_arc (cr, 0, 0, _diameter * .5 - 1 * ARDOUR_UI::config()->get_ui_scale(), 0, 2 * M_PI);
+ cairo_arc (cr, 0, 0, _diameter * .5 - 1 * UIConfiguration::instance().get_ui_scale(), 0, 2 * M_PI);
cairo_fill(cr);
//led color
ArdourCanvas::set_source_rgba (cr, led_color);
- cairo_arc (cr, 0, 0, _diameter * .5 - 3 * ARDOUR_UI::config()->get_ui_scale(), 0, 2 * M_PI);
+ cairo_arc (cr, 0, 0, _diameter * .5 - 3 * UIConfiguration::instance().get_ui_scale(), 0, 2 * M_PI);
cairo_fill(cr);
cairo_restore (cr);
// a transparent overlay to indicate insensitivity
if ((visual_state() & Gtkmm2ext::Insensitive)) {
rounded_function (cr, 0, 0, get_width(), get_height(), corner_radius);
- uint32_t ins_color = ARDOUR_UI::config()->color ("gtk_background");
+ uint32_t ins_color = UIConfiguration::instance().color ("gtk_background");
ArdourCanvas::set_source_rgb_a (cr, ins_color, 0.6);
cairo_fill (cr);
}
// if requested, show hovering
- if (ARDOUR_UI::config()->get_widget_prelight()
+ if (UIConfiguration::instance().get_widget_prelight()
&& !((visual_state() & Gtkmm2ext::Insensitive))) {
if (_hovering) {
rounded_function (cr, 1, 1, get_width() - 2, get_height() - 2, corner_radius);
CairoWidget::on_size_request (req);
if (_diameter == 0) {
- const float newdia = rintf (11.f * ARDOUR_UI::config()->get_ui_scale());
+ const float newdia = rintf (11.f * UIConfiguration::instance().get_ui_scale());
if (_diameter != newdia) {
_pattern_height = 0;
_diameter = newdia;
std::string name = get_name();
bool failed = false;
- fill_active_color = ARDOUR_UI::config()->color (string_compose ("%1: fill active", name), &failed);
+ fill_active_color = UIConfiguration::instance().color (string_compose ("%1: fill active", name), &failed);
if (failed) {
- fill_active_color = ARDOUR_UI::config()->color ("generic button: fill active");
+ fill_active_color = UIConfiguration::instance().color ("generic button: fill active");
}
- fill_inactive_color = ARDOUR_UI::config()->color (string_compose ("%1: fill", name), &failed);
+ fill_inactive_color = UIConfiguration::instance().color (string_compose ("%1: fill", name), &failed);
if (failed) {
- fill_inactive_color = ARDOUR_UI::config()->color ("generic button: fill");
+ fill_inactive_color = UIConfiguration::instance().color ("generic button: fill");
}
text_active_color = ArdourCanvas::contrasting_text_color (fill_active_color);
text_inactive_color = ArdourCanvas::contrasting_text_color (fill_inactive_color);
- led_active_color = ARDOUR_UI::config()->color (string_compose ("%1: led active", name), &failed);
+ led_active_color = UIConfiguration::instance().color (string_compose ("%1: led active", name), &failed);
if (failed) {
- led_active_color = ARDOUR_UI::config()->color ("generic button: led active");
+ led_active_color = UIConfiguration::instance().color ("generic button: led active");
}
/* The inactive color for the LED is just a fairly dark version of the
{
_hovering = (_elements & Inactive) ? false : true;
- if (ARDOUR_UI::config()->get_widget_prelight()) {
+ if (UIConfiguration::instance().get_widget_prelight()) {
CairoWidget::set_dirty ();
}
{
_hovering = false;
- if (ARDOUR_UI::config()->get_widget_prelight()) {
+ if (UIConfiguration::instance().get_widget_prelight()) {
CairoWidget::set_dirty ();
}
#include <pangomm/layout.h>
#include "pbd/compose.h"
+#include "pbd/controllable.h"
#include "pbd/error.h"
#include "pbd/stacktrace.h"
#include "ardour/rc_configuration.h" // for widget prelight preference
#include "ardour_knob.h"
-#include "ardour_ui.h"
#include "timers.h"
+#include "ui_config.h"
#include "canvas/colors.h"
#include "canvas/utils.h"
, _flags (flags)
, _tooltip (this)
{
- UIConfiguration::ColorsChanged.connect (sigc::mem_fun (*this, &ArdourKnob::color_handler));
+ UIConfiguration::instance().ColorsChanged.connect (sigc::mem_fun (*this, &ArdourKnob::color_handler));
// watch automation :(
Timers::rapid_connect (sigc::mem_fun (*this, &ArdourKnob::controllable_changed));
cairo_translate (cr, xc, yc); //after this, everything is based on the center of the knob
//get the knob color from the theme
- ArdourCanvas::Color knob_color = ARDOUR_UI::config()->color (string_compose ("%1", get_name()));
+ ArdourCanvas::Color knob_color = UIConfiguration::instance().color (string_compose ("%1", get_name()));
float center_radius = 0.48*scale;
float border_width = 0.8;
//look up the arc colors from the config
double red_start, green_start, blue_start, unused;
- ArdourCanvas::Color arc_start_color = ARDOUR_UI::config()->color ( string_compose ("%1: arc start", get_name()));
+ ArdourCanvas::Color arc_start_color = UIConfiguration::instance().color ( string_compose ("%1: arc start", get_name()));
ArdourCanvas::color_to_rgba( arc_start_color, red_start, green_start, blue_start, unused );
double red_end, green_end, blue_end;
- ArdourCanvas::Color arc_end_color = ARDOUR_UI::config()->color ( string_compose ("%1: arc end", get_name()) );
+ ArdourCanvas::Color arc_end_color = UIConfiguration::instance().color ( string_compose ("%1: arc end", get_name()) );
ArdourCanvas::color_to_rgba( arc_end_color, red_end, green_end, blue_end, unused );
//vary the arc color over the travel of the knob
cairo_stroke (cr);
//highlight if grabbed or if mouse is hovering over me
- if (_tooltip.dragging() || (_hovering && ARDOUR_UI::config()->get_widget_prelight() ) ) {
+ if (_tooltip.dragging() || (_hovering && UIConfiguration::instance().get_widget_prelight() ) ) {
cairo_set_source_rgba (cr, 1,1,1, 0.12 );
cairo_arc (cr, 0, 0, center_radius, 0, 2.0*G_PI);
cairo_fill (cr);
//scale the adjustment based on keyboard modifiers & GUI size
- const float ui_scale = max (1.f, ARDOUR_UI::config()->get_ui_scale());
+ const float ui_scale = max (1.f, UIConfiguration::instance().get_ui_scale());
float scale = 0.0025 / ui_scale;
if (ev->state & Keyboard::GainFineScaleModifier) {
}
-ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], const char* localedir, UIConfiguration* uic)
+ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], const char* localedir)
: Gtkmm2ext::UI (PROGRAM_NAME, argcp, argvp)
- , ui_config (uic->post_gui_init ())
, session_loaded (false)
, gui_object_state (new GUIObjectState)
, primary_clock (new MainClock (X_("primary"), X_("transport"), true ))
{
Gtkmm2ext::init (localedir);
+ UIConfiguration::instance().post_gui_init ();
+
if (ARDOUR::handle_old_configuration_files (boost::bind (ask_about_configuration_copy, _1, _2, _3))) {
MessageDialog msg (string_compose (_("Your configuration files were copied. You can now restart %1."), PROGRAM_NAME), true);
msg.run ();
xmlSetGenericErrorFunc (this, libxml_generic_error_func);
xmlSetStructuredErrorFunc (this, libxml_structured_error_func);
-
- ui_config->ParameterChanged.connect (sigc::mem_fun (*this, &ARDOUR_UI::parameter_changed));
+
+ UIConfiguration::instance().ParameterChanged.connect (sigc::mem_fun (*this, &ARDOUR_UI::parameter_changed));
boost::function<void (string)> pc (boost::bind (&ARDOUR_UI::parameter_changed, this, _1));
- ui_config->map_parameters (pc);
+ UIConfiguration::instance().map_parameters (pc);
roll_button.set_controllable (roll_controllable);
stop_button.set_controllable (stop_controllable);
/* we don't like certain modifiers */
Bindings::set_ignored_state (GDK_LOCK_MASK|GDK_MOD2_MASK|GDK_MOD3_MASK);
- ARDOUR_UI::config()->reset_dpi ();
+ UIConfiguration::instance().reset_dpi ();
TimeAxisViewItem::set_constant_heights ();
/* Trigger setting up the color scheme and loading the GTK RC file */
- ARDOUR_UI::config()->load_rc_file (false);
-
+ UIConfiguration::instance().load_rc_file (false);
+
_process_thread = new ProcessThread ();
_process_thread->init ();
- UIConfiguration::DPIReset.connect (sigc::mem_fun (*this, &ARDOUR_UI::resize_text_widgets));
+ UIConfiguration::instance().DPIReset.connect (sigc::mem_fun (*this, &ARDOUR_UI::resize_text_widgets));
attach_to_engine ();
}
boost::function<void (string)> pc (boost::bind (&ARDOUR_UI::parameter_changed, this, _1));
Config->map_parameters (pc);
- ui_config->map_parameters (pc);
+ UIConfiguration::instance().map_parameters (pc);
}
}
ARDOUR_UI::~ARDOUR_UI ()
{
- ui_config->save_state();
+ UIConfiguration::instance().save_state();
stop_video_server();
{
// august 2007: actual update frequency: 25Hz (40ms), not 100Hz
- if (editor_meter && ARDOUR_UI::config()->get_show_editor_meter()) {
+ if (editor_meter && UIConfiguration::instance().get_show_editor_meter()) {
float mpeak = editor_meter->update_meters();
if (mpeak > editor_meter_max_peak) {
- if (mpeak >= ARDOUR_UI::config()->get_meter_peak()) {
+ if (mpeak >= UIConfiguration::instance().get_meter_peak()) {
editor_meter_peak_display.set_active_state ( Gtkmm2ext::ExplicitActive );
}
}
if (rolling) {
_session->request_stop (with_abort, true);
} else {
- if (ARDOUR_UI::config()->get_follow_edits() && ( editor->get_selection().time.front().start == _session->transport_frame() ) ) { //if playhead is exactly at the start of a range, we can assume it was placed there by follow_edits
+ if (UIConfiguration::instance().get_follow_edits() && ( editor->get_selection().time.front().start == _session->transport_frame() ) ) { //if playhead is exactly at the start of a range, we can assume it was placed there by follow_edits
_session->request_play_range (&editor->get_selection().time, true);
_session->set_requested_return_frame( editor->get_selection().time.front().start ); //force an auto-return here
}
auto_loop_button.set_active (false);
}
- if (ARDOUR_UI::config()->get_follow_edits()) {
+ if (UIConfiguration::instance().get_follow_edits()) {
/* light up both roll and play-selection if they are joined */
roll_button.set_active (true);
play_selection_button.set_active (true);
void
ARDOUR_UI::start_clocking ()
{
- if (ui_config->get_super_rapid_clock_update()) {
+ if (UIConfiguration::instance().get_super_rapid_clock_update()) {
clock_signal_connection = Timers::fps_connect (sigc::mem_fun(*this, &ARDOUR_UI::update_clocks));
} else {
clock_signal_connection = Timers::rapid_connect (sigc::mem_fun(*this, &ARDOUR_UI::update_clocks));
}
const bool cancelled = PluginManager::instance().cancelled();
- if (type != X_("closeme") && (!ui_config->get_show_plugin_scan_window()) && !_initial_verbose_plugin_scan) {
+ if (type != X_("closeme") && (!UIConfiguration::instance().get_show_plugin_scan_window()) && !_initial_verbose_plugin_scan) {
if (cancelled && scan_dlg->is_mapped()) {
scan_dlg->hide();
gui_idle_handler();
void
ARDOUR_UI::update_transport_clocks (framepos_t pos)
{
- if (ui_config->get_primary_clock_delta_edit_cursor()) {
+ if (UIConfiguration::instance().get_primary_clock_delta_edit_cursor()) {
primary_clock->set (pos, false, editor->get_preferred_edit_position (EDIT_IGNORE_PHEAD));
} else {
primary_clock->set (pos);
}
- if (ui_config->get_secondary_clock_delta_edit_cursor()) {
+ if (UIConfiguration::instance().get_secondary_clock_delta_edit_cursor()) {
secondary_clock->set (pos, false, editor->get_preferred_edit_position (EDIT_IGNORE_PHEAD));
} else {
secondary_clock->set (pos);
void
ARDOUR_UI::set_flat_buttons ()
{
- CairoWidget::set_flat_buttons( config()->get_flat_buttons() );
+ CairoWidget::set_flat_buttons( UIConfiguration::instance().get_flat_buttons() );
}
void
class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
{
- private:
- /* This must be the first data element because constructor ordering
- relies on it.
- */
- UIConfiguration* ui_config;
-
public:
- ARDOUR_UI (int *argcp, char **argvp[], const char* localedir, UIConfiguration*);
+ ARDOUR_UI (int *argcp, char **argvp[], const char* localedir);
~ARDOUR_UI();
bool run_startup (bool should_be_new, std::string load_template);
void save_state (const std::string & state_name = "", bool switch_to_it = false);
static ARDOUR_UI *instance () { return theArdourUI; }
- static UIConfiguration *config () { return theArdourUI->ui_config; }
PublicEditor& the_editor() { return *editor;}
Mixer_UI* the_mixer() { return mixer; }
return 0;
}
-#define PX_SCALE(px) std::max((float)px, rintf((float)px * ARDOUR_UI::config()->get_ui_scale()))
+#define PX_SCALE(px) std::max((float)px, rintf((float)px * UIConfiguration::instance().get_ui_scale()))
void
ARDOUR_UI::setup_transport ()
boost::function<void (string)> pc (boost::bind (&ARDOUR_UI::parameter_changed, this, _1));
Config->map_parameters (pc);
- ARDOUR_UI::config()->reset_dpi ();
+ UIConfiguration::instance().reset_dpi ();
}
void
RefPtr<ToggleAction> tact = RefPtr<ToggleAction>::cast_dynamic (act);
assert (tact);
- ui_config->set_follow_edits (tact->get_active ());
+ UIConfiguration::instance().set_follow_edits (tact->get_active ());
}
#include "actions.h"
#include "ardour_ui.h"
#include "public_editor.h"
+#include "meterbridge.h"
#include "mixer_ui.h"
#include "keyboard.h"
#include "splash.h"
#include "keyeditor.h"
#include "location_ui.h"
#include "main_clock.h"
+#include "meterbridge.h"
#include "meter_patterns.h"
#include "midi_tracer.h"
#include "mixer_ui.h"
editor_meter_peak_display.set_name ("meterbridge peakindicator");
editor_meter_peak_display.unset_flags (Gtk::CAN_FOCUS);
- editor_meter_peak_display.set_size_request (std::max(9.f, rintf(8.f * ARDOUR_UI::config()->get_ui_scale())), -1);
+ editor_meter_peak_display.set_size_request (std::max(9.f, rintf(8.f * UIConfiguration::instance().get_ui_scale())), -1);
editor_meter_peak_display.set_corner_radius (3.0);
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 (ARDOUR_UI::config()->get_show_editor_meter() && !ARDOUR::Profile->get_trx()) {
+ if (UIConfiguration::instance().get_show_editor_meter() && !ARDOUR::Profile->get_trx()) {
transport_tearoff_hbox.pack_start (meter_box, false, false);
transport_tearoff_hbox.pack_start (editor_meter_peak_display, false, false);
meter_box.show();
editor->show_window ();
editor->present ();
/* mixer should now be on top */
- if (ARDOUR_UI::config()->get_transients_follow_front()) {
+ if (UIConfiguration::instance().get_transients_follow_front()) {
WM::Manager::instance().set_transient_for (editor);
}
_mixer_on_top = false;
mixer->show_window ();
mixer->present ();
/* mixer should now be on top */
- if (ARDOUR_UI::config()->get_transients_follow_front()) {
+ if (UIConfiguration::instance().get_transients_follow_front()) {
WM::Manager::instance().set_transient_for (mixer);
}
_mixer_on_top = true;
#include "engine_dialog.h"
#include "editor.h"
#include "actions.h"
+#include "meterbridge.h"
#include "mixer_ui.h"
#include "startup.h"
#include "window_manager.h"
Config->save_state();
- ui_config->save_state ();
+ UIConfiguration::instance().save_state ();
XMLNode& enode (static_cast<Stateful*>(editor)->get_state());
XMLNode& mnode (mixer->get_state());
} else if (p == "show-track-meters") {
if (editor) editor->toggle_meter_updating();
} else if (p == "primary-clock-delta-edit-cursor") {
- if (ARDOUR_UI::config()->get_primary_clock_delta_edit_cursor()) {
+ if (UIConfiguration::instance().get_primary_clock_delta_edit_cursor()) {
primary_clock->set_is_duration (true);
primary_clock->set_editable (false);
primary_clock->set_widget_name ("transport delta");
primary_clock->set_widget_name ("transport");
}
} else if (p == "secondary-clock-delta-edit-cursor") {
- if (ARDOUR_UI::config()->get_secondary_clock_delta_edit_cursor()) {
+ if (UIConfiguration::instance().get_secondary_clock_delta_edit_cursor()) {
secondary_clock->set_is_duration (true);
secondary_clock->set_editable (false);
secondary_clock->set_widget_name ("secondary delta");
start_clocking ();
}
} else if (p == "waveform-gradient-depth") {
- ArdourCanvas::WaveView::set_global_gradient_depth (config()->get_waveform_gradient_depth());
+ ArdourCanvas::WaveView::set_global_gradient_depth (UIConfiguration::instance().get_waveform_gradient_depth());
} else if (p == "show-editor-meter") {
- bool show = ARDOUR_UI::config()->get_show_editor_meter();
+ bool show = UIConfiguration::instance().get_show_editor_meter();
if (editor_meter) {
if (meter_box.get_parent()) {
}
}
} else if (p == "waveform-scale") {
- ArdourCanvas::WaveView::set_global_logscaled (ARDOUR_UI::config()->get_waveform_scale() == Logarithmic);
+ ArdourCanvas::WaveView::set_global_logscaled (UIConfiguration::instance().get_waveform_scale() == Logarithmic);
} else if (p == "widget-prelight") {
- CairoWidget::set_widget_prelight( config()->get_widget_prelight() );
+ CairoWidget::set_widget_prelight (UIConfiguration::instance().get_widget_prelight());
} else if (p == "waveform-shape") {
- ArdourCanvas::WaveView::set_global_shape (ARDOUR_UI::config()->get_waveform_shape() == Rectified
+ ArdourCanvas::WaveView::set_global_shape (UIConfiguration::instance().get_waveform_shape() == Rectified
? ArdourCanvas::WaveView::Rectified : ArdourCanvas::WaveView::Normal);
} else if (p == "show-waveform-clipping") {
- ArdourCanvas::WaveView::set_global_show_waveform_clipping (ARDOUR_UI::config()->get_show_waveform_clipping());
+ ArdourCanvas::WaveView::set_global_show_waveform_clipping (UIConfiguration::instance().get_show_waveform_clipping());
} else if (p == "waveform-cache-size") {
/* GUI option has units of megabytes; image cache uses units of bytes */
- ArdourCanvas::WaveView::set_image_cache_size (ARDOUR_UI::config()->get_waveform_cache_size() * 1048576);
+ ArdourCanvas::WaveView::set_image_cache_size (UIConfiguration::instance().get_waveform_cache_size() * 1048576);
}
}
#include "ardour_window.h"
#include "ardour_ui.h"
+#include "ui_config.h"
#include "keyboard.h"
#include "utils.h"
vice versa.
*/
- if (ARDOUR_UI::config()->get_all_floating_windows_are_dialogs()) {
+ if (UIConfiguration::instance().get_all_floating_windows_are_dialogs()) {
set_type_hint (Gdk::WINDOW_TYPE_HINT_DIALOG);
} else {
set_type_hint (Gdk::WINDOW_TYPE_HINT_UTILITY);
#include "ardour/tempo.h"
#include "ardour/types.h"
-#include "ardour_ui.h"
#include "audio_clock.h"
#include "utils.h"
#include "keyboard.h"
#include "gui_thread.h"
+#include "ui_config.h"
#include "i18n.h"
using namespace ARDOUR;
clocks.push_back (this);
}
- UIConfiguration::ColorsChanged.connect (sigc::mem_fun (*this, &AudioClock::set_colors));
- UIConfiguration::DPIReset.connect (sigc::mem_fun (*this, &AudioClock::dpi_reset));
+ UIConfiguration::instance().ColorsChanged.connect (sigc::mem_fun (*this, &AudioClock::set_colors));
+ UIConfiguration::instance().DPIReset.connect (sigc::mem_fun (*this, &AudioClock::dpi_reset));
}
AudioClock::~AudioClock ()
uint32_t cursor_color;
if (active_state()) {
- bg_color = ARDOUR_UI::config()->color (string_compose ("%1 active: background", get_name()));
- text_color = ARDOUR_UI::config()->color (string_compose ("%1 active: text", get_name()));
- editing_color = ARDOUR_UI::config()->color (string_compose ("%1 active: edited text", get_name()));
- cursor_color = ARDOUR_UI::config()->color (string_compose ("%1 active: cursor", get_name()));
+ bg_color = UIConfiguration::instance().color (string_compose ("%1 active: background", get_name()));
+ text_color = UIConfiguration::instance().color (string_compose ("%1 active: text", get_name()));
+ editing_color = UIConfiguration::instance().color (string_compose ("%1 active: edited text", get_name()));
+ cursor_color = UIConfiguration::instance().color (string_compose ("%1 active: cursor", get_name()));
} else {
- bg_color = ARDOUR_UI::config()->color (string_compose ("%1: background", get_name()));
- text_color = ARDOUR_UI::config()->color (string_compose ("%1: text", get_name()));
- editing_color = ARDOUR_UI::config()->color (string_compose ("%1: edited text", get_name()));
- cursor_color = ARDOUR_UI::config()->color (string_compose ("%1: cursor", get_name()));
+ bg_color = UIConfiguration::instance().color (string_compose ("%1: background", get_name()));
+ text_color = UIConfiguration::instance().color (string_compose ("%1: text", get_name()));
+ editing_color = UIConfiguration::instance().color (string_compose ("%1: edited text", get_name()));
+ cursor_color = UIConfiguration::instance().color (string_compose ("%1: cursor", get_name()));
}
/* store for bg and cursor in render() */
#include "audio_time_axis.h"
#include "rgb_macros.h"
#include "gui_thread.h"
-#include "ardour_ui.h"
+#include "ui_config.h"
#include "i18n.h"
, trim_fade_in_drag_active(false)
, trim_fade_out_drag_active(false)
{
- ARDOUR_UI::config()->ParameterChanged.connect (sigc::mem_fun (*this, &AudioRegionView::parameter_changed));
+ UIConfiguration::instance().ParameterChanged.connect (sigc::mem_fun (*this, &AudioRegionView::parameter_changed));
}
AudioRegionView::AudioRegionView (ArdourCanvas::Container *parent, RouteTimeAxisView &tv, boost::shared_ptr<AudioRegion> r, double spu,
, trim_fade_in_drag_active(false)
, trim_fade_out_drag_active(false)
{
- ARDOUR_UI::config()->ParameterChanged.connect (sigc::mem_fun (*this, &AudioRegionView::parameter_changed));
+ UIConfiguration::instance().ParameterChanged.connect (sigc::mem_fun (*this, &AudioRegionView::parameter_changed));
}
AudioRegionView::AudioRegionView (const AudioRegionView& other, boost::shared_ptr<AudioRegion> other_region)
{
init (true);
- ARDOUR_UI::config()->ParameterChanged.connect (sigc::mem_fun (*this, &AudioRegionView::parameter_changed));
+ UIConfiguration::instance().ParameterChanged.connect (sigc::mem_fun (*this, &AudioRegionView::parameter_changed));
}
void
fade_in_handle = new ArdourCanvas::Rectangle (group);
CANVAS_DEBUG_NAME (fade_in_handle, string_compose ("fade in handle for %1", region()->name()));
fade_in_handle->set_outline_color (ArdourCanvas::rgba_to_color (0, 0, 0, 1.0));
- fade_in_handle->set_fill_color (ARDOUR_UI::config()->color ("inactive fade handle"));
+ fade_in_handle->set_fill_color (UIConfiguration::instance().color ("inactive fade handle"));
fade_in_handle->set_data ("regionview", this);
fade_in_handle->hide ();
fade_out_handle = new ArdourCanvas::Rectangle (group);
CANVAS_DEBUG_NAME (fade_out_handle, string_compose ("fade out handle for %1", region()->name()));
fade_out_handle->set_outline_color (ArdourCanvas::rgba_to_color (0, 0, 0, 1.0));
- fade_out_handle->set_fill_color (ARDOUR_UI::config()->color ("inactive fade handle"));
+ fade_out_handle->set_fill_color (UIConfiguration::instance().color ("inactive fade handle"));
fade_out_handle->set_data ("regionview", this);
fade_out_handle->hide ();
fade_in_trim_handle = new ArdourCanvas::Rectangle (group);
CANVAS_DEBUG_NAME (fade_in_handle, string_compose ("fade in trim handle for %1", region()->name()));
fade_in_trim_handle->set_outline_color (ArdourCanvas::rgba_to_color (0, 0, 0, 1.0));
- fade_in_trim_handle->set_fill_color (ARDOUR_UI::config()->color ("inactive fade handle"));
+ fade_in_trim_handle->set_fill_color (UIConfiguration::instance().color ("inactive fade handle"));
fade_in_trim_handle->set_data ("regionview", this);
fade_in_trim_handle->hide ();
fade_out_trim_handle = new ArdourCanvas::Rectangle (group);
CANVAS_DEBUG_NAME (fade_out_handle, string_compose ("fade out trim handle for %1", region()->name()));
fade_out_trim_handle->set_outline_color (ArdourCanvas::rgba_to_color (0, 0, 0, 1.0));
- fade_out_trim_handle->set_fill_color (ARDOUR_UI::config()->color ("inactive fade handle"));
+ fade_out_trim_handle->set_fill_color (UIConfiguration::instance().color ("inactive fade handle"));
fade_out_trim_handle->set_data ("regionview", this);
fade_out_trim_handle->hide ();
}
if (audio_region()->fade_in_active()) {
start_xfade_rect->set_fill (false);
} else {
- start_xfade_rect->set_fill_color (ARDOUR_UI::config()->color_mod ("inactive crossfade", "inactive crossfade"));
+ start_xfade_rect->set_fill_color (UIConfiguration::instance().color_mod ("inactive crossfade", "inactive crossfade"));
start_xfade_rect->set_fill (true);
}
}
if (audio_region()->fade_out_active()) {
end_xfade_rect->set_fill (false);
} else {
- end_xfade_rect->set_fill_color (ARDOUR_UI::config()->color_mod ("inactive crossfade", "inactive crossfade"));
+ end_xfade_rect->set_fill_color (UIConfiguration::instance().color_mod ("inactive crossfade", "inactive crossfade"));
end_xfade_rect->set_fill (true);
}
}
gdouble ht;
- if (!ARDOUR_UI::config()->get_show_name_highlight() || (height < NAME_HIGHLIGHT_THRESH)) {
+ if (!UIConfiguration::instance().get_show_name_highlight() || (height < NAME_HIGHLIGHT_THRESH)) {
ht = height / (double) wcnt;
} else {
ht = (height - NAME_HIGHLIGHT_SIZE) / (double) wcnt;
effective_height = _height;
- if (ARDOUR_UI::config()->get_show_name_highlight() && effective_height >= NAME_HIGHLIGHT_THRESH) {
+ if (UIConfiguration::instance().get_show_name_highlight() && effective_height >= NAME_HIGHLIGHT_THRESH) {
effective_height -= NAME_HIGHLIGHT_SIZE;
}
if (!start_xfade_curve) {
start_xfade_curve = new ArdourCanvas::XFadeCurve (group, ArdourCanvas::XFadeCurve::Start);
CANVAS_DEBUG_NAME (start_xfade_curve, string_compose ("xfade start out line for %1", region()->name()));
- start_xfade_curve->set_fill_color (ARDOUR_UI::config()->color_mod ("active crossfade", "crossfade alpha"));
- start_xfade_curve->set_outline_color (ARDOUR_UI::config()->color ("crossfade line"));
+ start_xfade_curve->set_fill_color (UIConfiguration::instance().color_mod ("active crossfade", "crossfade alpha"));
+ start_xfade_curve->set_outline_color (UIConfiguration::instance().color ("crossfade line"));
start_xfade_curve->set_ignore_events (true);
}
if (!start_xfade_rect) {
start_xfade_rect = new ArdourCanvas::Rectangle (group);
CANVAS_DEBUG_NAME (start_xfade_rect, string_compose ("xfade start rect for %1", region()->name()));
- start_xfade_rect->set_outline_color (ARDOUR_UI::config()->color ("crossfade line"));
+ start_xfade_rect->set_outline_color (UIConfiguration::instance().color ("crossfade line"));
start_xfade_rect->set_fill (false);
start_xfade_rect->set_outline (false);
start_xfade_rect->Event.connect (sigc::bind (sigc::mem_fun (PublicEditor::instance(), &PublicEditor::canvas_start_xfade_event), start_xfade_rect, this));
if (!end_xfade_curve) {
end_xfade_curve = new ArdourCanvas::XFadeCurve (group, ArdourCanvas::XFadeCurve::End);
CANVAS_DEBUG_NAME (end_xfade_curve, string_compose ("xfade end out line for %1", region()->name()));
- end_xfade_curve->set_fill_color (ARDOUR_UI::config()->color_mod ("active crossfade", "crossfade alpha"));
- end_xfade_curve->set_outline_color (ARDOUR_UI::config()->color ("crossfade line"));
+ end_xfade_curve->set_fill_color (UIConfiguration::instance().color_mod ("active crossfade", "crossfade alpha"));
+ end_xfade_curve->set_outline_color (UIConfiguration::instance().color ("crossfade line"));
end_xfade_curve->set_ignore_events (true);
}
if (!end_xfade_rect) {
end_xfade_rect = new ArdourCanvas::Rectangle (group);
CANVAS_DEBUG_NAME (end_xfade_rect, string_compose ("xfade end rect for %1", region()->name()));
- end_xfade_rect->set_outline_color (ARDOUR_UI::config()->color ("crossfade line"));
+ end_xfade_rect->set_outline_color (UIConfiguration::instance().color ("crossfade line"));
end_xfade_rect->set_fill (false);
end_xfade_rect->set_outline (false);
end_xfade_rect->Event.connect (sigc::bind (sigc::mem_fun (PublicEditor::instance(), &PublicEditor::canvas_end_xfade_event), end_xfade_rect, this));
{
RegionView::set_samples_per_pixel (fpp);
- if (ARDOUR_UI::config()->get_show_waveforms ()) {
+ if (UIConfiguration::instance().get_show_waveforms ()) {
for (uint32_t n = 0; n < waves.size(); ++n) {
waves[n]->set_samples_per_pixel (fpp);
}
if (gain_line) {
gain_line->set_line_color (audio_region()->envelope_active() ?
- ARDOUR_UI::config()->color ("gain line") :
- ARDOUR_UI::config()->color_mod ("gain line inactive", "gain line inactive"));
+ UIConfiguration::instance().color ("gain line") :
+ UIConfiguration::instance().color_mod ("gain line inactive", "gain line inactive"));
}
set_waveform_colors ();
if (start_xfade_curve) {
- start_xfade_curve->set_fill_color (ARDOUR_UI::config()->color_mod ("active crossfade", "crossfade alpha"));
- start_xfade_curve->set_outline_color (ARDOUR_UI::config()->color ("crossfade line"));
+ start_xfade_curve->set_fill_color (UIConfiguration::instance().color_mod ("active crossfade", "crossfade alpha"));
+ start_xfade_curve->set_outline_color (UIConfiguration::instance().color ("crossfade line"));
}
if (end_xfade_curve) {
- end_xfade_curve->set_fill_color (ARDOUR_UI::config()->color_mod ("active crossfade", "crossfade alpha"));
- end_xfade_curve->set_outline_color (ARDOUR_UI::config()->color ("crossfade line"));
+ end_xfade_curve->set_fill_color (UIConfiguration::instance().color_mod ("active crossfade", "crossfade alpha"));
+ end_xfade_curve->set_outline_color (UIConfiguration::instance().color ("crossfade line"));
}
if (start_xfade_rect) {
- start_xfade_rect->set_outline_color (ARDOUR_UI::config()->color ("crossfade line"));
+ start_xfade_rect->set_outline_color (UIConfiguration::instance().color ("crossfade line"));
}
if (end_xfade_rect) {
- end_xfade_rect->set_outline_color (ARDOUR_UI::config()->color ("crossfade line"));
+ end_xfade_rect->set_outline_color (UIConfiguration::instance().color ("crossfade line"));
}
}
void
AudioRegionView::setup_waveform_visibility ()
{
- if (ARDOUR_UI::config()->get_show_waveforms ()) {
+ if (UIConfiguration::instance().get_show_waveforms ()) {
for (uint32_t n = 0; n < waves.size(); ++n) {
/* make sure the zoom level is correct, since we don't update
this when waveforms are hidden.
if (trackview.editor().current_mouse_mode() == Editing::MouseDraw || trackview.editor().current_mouse_mode() == Editing::MouseContent ) {
gain_line->set_visibility (AutomationLine::VisibleAspects(AutomationLine::ControlPoints|AutomationLine::Line));
gain_line->canvas_group().raise_to_top ();
- } else if (ARDOUR_UI::config()->get_show_region_gain() || trackview.editor().current_mouse_mode() == Editing::MouseRange ) {
+ } else if (UIConfiguration::instance().get_show_region_gain() || trackview.editor().current_mouse_mode() == Editing::MouseRange ) {
gain_line->set_visibility (AutomationLine::VisibleAspects(AutomationLine::Line));
gain_line->canvas_group().raise_to_top ();
} else {
wave->set_height (ht);
wave->set_samples_per_pixel (samples_per_pixel);
wave->set_show_zero_line (true);
- wave->set_clip_level (ARDOUR_UI::config()->get_waveform_clip_level ());
+ wave->set_clip_level (UIConfiguration::instance().get_waveform_clip_level ());
wave->set_start_shift (1.0);
wave->Event.connect (sigc::bind (sigc::mem_fun (PublicEditor::instance(), &PublicEditor::canvas_wave_view_event), wave, this));
- switch (ARDOUR_UI::config()->get_waveform_shape()) {
+ switch (UIConfiguration::instance().get_waveform_shape()) {
case Rectified:
wave->set_shape (WaveView::Rectified);
break;
wave->set_shape (WaveView::Normal);
}
- wave->set_logscaled (ARDOUR_UI::config()->get_waveform_scale() == Logarithmic);
+ wave->set_logscaled (UIConfiguration::instance().get_waveform_scale() == Logarithmic);
vector<ArdourCanvas::WaveView*> v;
v.push_back (wave);
set_some_waveform_colors (v);
- if (!ARDOUR_UI::config()->get_show_waveforms ()) {
+ if (!UIConfiguration::instance().get_show_waveforms ()) {
wave->hide();
}
{
if (gain_line) {
gain_line->set_line_color (audio_region()->envelope_active() ?
- ARDOUR_UI::config()->color ("gain line") :
- ARDOUR_UI::config()->color_mod ("gain line inactive", "gain line inactive"));
+ UIConfiguration::instance().color ("gain line") :
+ UIConfiguration::instance().color_mod ("gain line inactive", "gain line inactive"));
update_envelope_visibility ();
}
}
{
ArdourCanvas::Color fill;
ArdourCanvas::Color outline;
- ArdourCanvas::Color clip = ARDOUR_UI::config()->color ("clipped waveform");
- ArdourCanvas::Color zero = ARDOUR_UI::config()->color ("zero line");
+ ArdourCanvas::Color clip = UIConfiguration::instance().color ("clipped waveform");
+ ArdourCanvas::Color zero = UIConfiguration::instance().color ("zero line");
if (_selected) {
if (_region->muted()) {
/* hide outline with zero alpha */
- outline = UINT_RGBA_CHANGE_A(ARDOUR_UI::config()->color ("selected waveform outline"), 0);
- fill = UINT_RGBA_CHANGE_A(ARDOUR_UI::config()->color ("selected waveform fill"), MUTED_ALPHA);
+ outline = UINT_RGBA_CHANGE_A(UIConfiguration::instance().color ("selected waveform outline"), 0);
+ fill = UINT_RGBA_CHANGE_A(UIConfiguration::instance().color ("selected waveform fill"), MUTED_ALPHA);
} else {
- outline = ARDOUR_UI::config()->color ("selected waveform outline");
- fill = ARDOUR_UI::config()->color ("selected waveform fill");
+ outline = UIConfiguration::instance().color ("selected waveform outline");
+ fill = UIConfiguration::instance().color ("selected waveform fill");
}
} else {
if (_recregion) {
- outline = ARDOUR_UI::config()->color ("recording waveform outline");
- fill = ARDOUR_UI::config()->color ("recording waveform fill");
+ outline = UIConfiguration::instance().color ("recording waveform outline");
+ fill = UIConfiguration::instance().color ("recording waveform fill");
} else {
if (_region->muted()) {
/* hide outline with zero alpha */
- outline = UINT_RGBA_CHANGE_A(ARDOUR_UI::config()->color ("waveform outline"), 0);
- fill = UINT_RGBA_CHANGE_A(ARDOUR_UI::config()->color ("waveform fill"), MUTED_ALPHA);
+ outline = UINT_RGBA_CHANGE_A(UIConfiguration::instance().color ("waveform outline"), 0);
+ fill = UINT_RGBA_CHANGE_A(UIConfiguration::instance().color ("waveform fill"), MUTED_ALPHA);
} else {
- outline = ARDOUR_UI::config()->color ("waveform outline");
- fill = ARDOUR_UI::config()->color ("waveform fill");
+ outline = UIConfiguration::instance().color ("waveform outline");
+ fill = UIConfiguration::instance().color ("waveform fill");
}
}
}
#include "region_gain_line.h"
#include "selection.h"
#include "public_editor.h"
-#include "ardour_ui.h"
#include "rgb_macros.h"
#include "gui_thread.h"
+#include "ui_config.h"
#include "i18n.h"
if (!rec_active &&
_trackview.session()->record_status() == Session::Recording &&
_trackview.track()->record_enabled()) {
- if (_trackview.audio_track()->mode() == Normal && ARDOUR_UI::config()->get_show_waveforms_while_recording() && rec_regions.size() == rec_rects.size()) {
+ if (_trackview.audio_track()->mode() == Normal && UIConfiguration::instance().get_show_waveforms_while_recording() && rec_regions.size() == rec_rects.size()) {
/* add a new region, but don't bother if they set show-waveforms-while-recording mid-record */
void
AudioStreamView::update_rec_regions (framepos_t start, framecnt_t cnt)
{
- if (!ARDOUR_UI::config()->get_show_waveforms_while_recording ()) {
+ if (!UIConfiguration::instance().get_show_waveforms_while_recording ()) {
return;
}
{
//case cAudioTrackBase:
if (_trackview.is_track()) {
- canvas_rect->set_fill_color (ARDOUR_UI::config()->color_mod ("audio track base", "audio track base"));
+ canvas_rect->set_fill_color (UIConfiguration::instance().color_mod ("audio track base", "audio track base"));
}
//case cAudioBusBase:
if (!_trackview.is_track()) {
if (Profile->get_sae() && _trackview.route()->is_master()) {
- canvas_rect->set_fill_color (ARDOUR_UI::config()->color ("audio master bus base"));
+ canvas_rect->set_fill_color (UIConfiguration::instance().color ("audio master bus base"));
} else {
- canvas_rect->set_fill_color (ARDOUR_UI::config()->color_mod ("audio bus base", "audio bus base"));
+ canvas_rect->set_fill_color (UIConfiguration::instance().color_mod ("audio bus base", "audio bus base"));
}
}
}
#include "control_point.h"
#include "gui_thread.h"
#include "rgb_macros.h"
-#include "ardour_ui.h"
#include "public_editor.h"
#include "selection.h"
#include "time_axis_view.h"
#include "point_selection.h"
#include "automation_time_axis.h"
+#include "ui_config.h"
#include "ardour/event_type_map.h"
#include "ardour/session.h"
void
AutomationLine::set_colors ()
{
- set_line_color (ARDOUR_UI::config()->color ("automation line"));
+ set_line_color (UIConfiguration::instance().color ("automation line"));
for (vector<ControlPoint*>::iterator i = control_points.begin(); i != control_points.end(); ++i) {
(*i)->set_color ();
}
#include "gtkmm2ext/keyboard.h"
-#include "ardour_ui.h"
#include "automation_region_view.h"
#include "editing.h"
#include "editor.h"
#include "gui_thread.h"
#include "midi_automation_line.h"
#include "public_editor.h"
+#include "ui_config.h"
#include "i18n.h"
trackview.editor().internal_editing() ? "editable region" :
"midi frame base");
if (_selected) {
- return ARDOUR_UI::config()->color_mod ("selected region base", mod_name);
- } else if (high_enough_for_name || !ARDOUR_UI::config()->get_color_regions_using_track_color()) {
- return ARDOUR_UI::config()->color_mod ("midi frame base", mod_name);
+ return UIConfiguration::instance().color_mod ("selected region base", mod_name);
+ } else if (high_enough_for_name || !UIConfiguration::instance().get_color_regions_using_track_color()) {
+ return UIConfiguration::instance().color_mod ("midi frame base", mod_name);
}
- return ARDOUR_UI::config()->color_mod (fill_color, mod_name);
+ return UIConfiguration::instance().color_mod (fill_color, mod_name);
}
void
#include "ardour/midi_region.h"
#include "ardour/midi_source.h"
-#include "ardour_ui.h"
#include "automation_region_view.h"
#include "automation_streamview.h"
#include "automation_time_axis.h"
#include "region_view.h"
#include "rgb_macros.h"
#include "selection.h"
+#include "ui_config.h"
#include "i18n.h"
color_handler ();
- UIConfiguration::ColorsChanged.connect(sigc::mem_fun(*this, &AutomationStreamView::color_handler));
+ UIConfiguration::instance().ColorsChanged.connect(sigc::mem_fun(*this, &AutomationStreamView::color_handler));
}
AutomationStreamView::~AutomationStreamView ()
AutomationStreamView::color_handler ()
{
if (_trackview.is_midi_track()) {
- canvas_rect->set_fill_color (ARDOUR_UI::config()->color_mod ("midi track base", "midi track base"));
+ canvas_rect->set_fill_color (UIConfiguration::instance().color_mod ("midi track base", "midi track base"));
} else {
- canvas_rect->set_fill_color (ARDOUR_UI::config()->color ("midi bus base"));
+ canvas_rect->set_fill_color (UIConfiguration::instance().color ("midi bus base"));
}
}
#include "control_point.h"
#include "utils.h"
#include "item_counts.h"
+#include "ui_config.h"
#include "i18n.h"
CANVAS_DEBUG_NAME (_base_rect, string_compose ("base rect for %1", _name));
_base_rect->set_x1 (ArdourCanvas::COORD_MAX);
_base_rect->set_outline (false);
- _base_rect->set_fill_color (ARDOUR_UI::config()->color_mod (fill_color_name, "automation track fill"));
+ _base_rect->set_fill_color (UIConfiguration::instance().color_mod (fill_color_name, "automation track fill"));
_base_rect->set_data ("trackview", this);
_base_rect->Event.connect (sigc::bind (sigc::mem_fun (_editor, &PublicEditor::canvas_automation_track_event), _base_rect, this));
if (!a) {
)
);
- line->set_line_color (ARDOUR_UI::config()->color ("processor automation line"));
+ line->set_line_color (UIConfiguration::instance().color ("processor automation line"));
line->queue_reset ();
add_line (line);
}
/* make sure labels etc. are correct */
automation_state_changed ();
- UIConfiguration::ColorsChanged.connect (sigc::mem_fun (*this, &AutomationTimeAxisView::color_handler));
+ UIConfiguration::instance().ColorsChanged.connect (sigc::mem_fun (*this, &AutomationTimeAxisView::color_handler));
_route->DropReferences.connect (
_route_connections, invalidator (*this), boost::bind (&AutomationTimeAxisView::route_going_away, this), gui_context ()
#include "ardour_ui.h"
#include "button_joiner.h"
+#include "ui_config.h"
using namespace Gtk;
uint32_t border_color;
uint32_t r, g, b, a;
- border_color = ARDOUR_UI::config()->color (string_compose ("%1: border end", name));
+ border_color = UIConfiguration::instance().color (string_compose ("%1: border end", name));
UINT_TO_RGBA (border_color, &r, &g, &b, &a);
border_r = r/255.0;
active_fill_pattern = cairo_pattern_create_linear (0.0, 0.0, 0.0, get_height());
inactive_fill_pattern = cairo_pattern_create_linear (0.0, 0.0, 0.0, get_height());
- start_color = ARDOUR_UI::config()->color (string_compose ("%1: fill start", name));
- end_color = ARDOUR_UI::config()->color (string_compose ("%1: fill end", name));
+ start_color = UIConfiguration::instance().color (string_compose ("%1: fill start", name));
+ end_color = UIConfiguration::instance().color (string_compose ("%1: fill end", name));
UINT_TO_RGBA (start_color, &r, &g, &b, &a);
cairo_pattern_add_color_stop_rgba (inactive_fill_pattern, 0, r/255.0,g/255.0,b/255.0, a/255.0);
UINT_TO_RGBA (end_color, &r, &g, &b, &a);
cairo_pattern_add_color_stop_rgba (inactive_fill_pattern, 1, r/255.0,g/255.0,b/255.0, a/255.0);
- start_color = ARDOUR_UI::config()->color (string_compose ("%1: fill start active", name));
- end_color = ARDOUR_UI::config()->color (string_compose ("%1: fill end active", name));
+ start_color = UIConfiguration::instance().color (string_compose ("%1: fill start active", name));
+ end_color = UIConfiguration::instance().color (string_compose ("%1: fill end active", name));
UINT_TO_RGBA (start_color, &r, &g, &b, &a);
cairo_pattern_add_color_stop_rgba (active_fill_pattern, 0, r/255.0,g/255.0,b/255.0, a/255.0);
UINT_TO_RGBA (end_color, &r, &g, &b, &a);
#include "control_point.h"
#include "automation_line.h"
-#include "ardour_ui.h"
#include "public_editor.h"
+#include "ui_config.h"
#include "canvas/rectangle.h"
_item = new ArdourCanvas::Rectangle (&_line.canvas_group());
_item->set_fill (true);
- _item->set_fill_color (ARDOUR_UI::config()->color ("control point fill"));
- _item->set_outline_color (ARDOUR_UI::config()->color ("control point outline"));
+ _item->set_fill_color (UIConfiguration::instance().color ("control point fill"));
+ _item->set_outline_color (UIConfiguration::instance().color ("control point outline"));
_item->set_data ("control_point", this);
_item->Event.connect (sigc::mem_fun (this, &ControlPoint::event_handler));
_item = new ArdourCanvas::Rectangle (&_line.canvas_group());
_item->set_fill (true);
- _item->set_outline_color (ARDOUR_UI::config()->color ("control point outline"));
+ _item->set_outline_color (UIConfiguration::instance().color ("control point outline"));
/* NOTE: no event handling in copied ControlPoints */
ControlPoint::set_color ()
{
if (_selected) {
- _item->set_outline_color(ARDOUR_UI::config()->color ("control point selected outline"));;
- _item->set_fill_color(ARDOUR_UI::config()->color ("control point selected fill"));
+ _item->set_outline_color(UIConfiguration::instance().color ("control point selected outline"));;
+ _item->set_fill_color(UIConfiguration::instance().color ("control point selected fill"));
} else {
- _item->set_outline_color(ARDOUR_UI::config()->color ("control point outline"));
- _item->set_fill_color(ARDOUR_UI::config()->color ("control point fill"));
+ _item->set_outline_color(UIConfiguration::instance().color ("control point outline"));
+ _item->set_fill_color(UIConfiguration::instance().color ("control point fill"));
}
}
toplevel = new ArdourCanvas::Rectangle (canvas->root());
toplevel->set (ArdourCanvas::Rect (0, 0, 10, 10));
toplevel->set_fill (true);
- toplevel->set_fill_color (ARDOUR_UI::config()->get_CrossfadeEditorBase());
+ toplevel->set_fill_color (UIConfiguration::instance().get_CrossfadeEditorBase());
toplevel->set_outline (false);
toplevel->Event.connect (sigc::mem_fun (*this, &CrossfadeEditor::canvas_event));
fade[Out].line = new ArdourCanvas::PolyLine (canvas->root());
- fade[Out].line->set_outline_color (ARDOUR_UI::config()->get_CrossfadeEditorLine());
+ fade[Out].line->set_outline_color (UIConfiguration::instance().get_CrossfadeEditorLine());
fade[Out].shading = new ArdourCanvas::Polygon (canvas->root());
- fade[Out].shading->set_fill_color (ARDOUR_UI::config()->get_CrossfadeEditorLineShading());
+ fade[Out].shading->set_fill_color (UIConfiguration::instance().get_CrossfadeEditorLineShading());
fade[In].line = new ArdourCanvas::PolyLine (canvas->root());
- fade[In].line->set_outline_color (ARDOUR_UI::config()->get_CrossfadeEditorLine());
+ fade[In].line->set_outline_color (UIConfiguration::instance().get_CrossfadeEditorLine());
fade[In].shading = new ArdourCanvas::Polygon (canvas->root());
- fade[In].shading->set_fill_color (ARDOUR_UI::config()->get_CrossfadeEditorLineShading());
+ fade[In].shading->set_fill_color (UIConfiguration::instance().get_CrossfadeEditorLineShading());
fade[In].shading->Event.connect (sigc::mem_fun (*this, &CrossfadeEditor::canvas_event));
fade[In].line->Event.connect (sigc::mem_fun (*this, &CrossfadeEditor::curve_event));
p->box = new ArdourCanvas::Rectangle (canvas->root());
p->box->set_fill (true);
- p->box->set_fill_color (ARDOUR_UI::config()->get_CrossfadeEditorPointFill());
- p->box->set_outline_color (ARDOUR_UI::config()->get_CrossfadeEditorPointOutline());
+ p->box->set_fill_color (UIConfiguration::instance().get_CrossfadeEditorPointFill());
+ p->box->set_outline_color (UIConfiguration::instance().get_CrossfadeEditorPointOutline());
p->curve = fade[current].line;
if (wf == In) {
for (vector<ArdourCanvas::WaveView*>::iterator i = fade[In].waves.begin(); i != fade[In].waves.end(); ++i) {
- (*i)->set_outline_color (ARDOUR_UI::config()->get_SelectedCrossfadeEditorWave());
- (*i)->set_fill_color (ARDOUR_UI::config()->get_SelectedCrossfadeEditorWave());
+ (*i)->set_outline_color (UIConfiguration::instance().get_SelectedCrossfadeEditorWave());
+ (*i)->set_fill_color (UIConfiguration::instance().get_SelectedCrossfadeEditorWave());
}
for (vector<ArdourCanvas::WaveView*>::iterator i = fade[Out].waves.begin(); i != fade[Out].waves.end(); ++i) {
- (*i)->set_outline_color (ARDOUR_UI::config()->get_CrossfadeEditorWave());
- (*i)->set_fill_color (ARDOUR_UI::config()->get_CrossfadeEditorWave());
+ (*i)->set_outline_color (UIConfiguration::instance().get_CrossfadeEditorWave());
+ (*i)->set_fill_color (UIConfiguration::instance().get_CrossfadeEditorWave());
}
- fade[In].line->set_outline_color (ARDOUR_UI::config()->get_SelectedCrossfadeEditorLine());
- fade[Out].line->set_outline_color (ARDOUR_UI::config()->get_CrossfadeEditorLine());
+ fade[In].line->set_outline_color (UIConfiguration::instance().get_SelectedCrossfadeEditorLine());
+ fade[Out].line->set_outline_color (UIConfiguration::instance().get_CrossfadeEditorLine());
fade[Out].shading->hide();
fade[In].shading->show();
} else {
for (vector<ArdourCanvas::WaveView*>::iterator i = fade[In].waves.begin(); i != fade[In].waves.end(); ++i) {
- (*i)->set_outline_color (ARDOUR_UI::config()->get_CrossfadeEditorWave());
- (*i)->set_fill_color (ARDOUR_UI::config()->get_CrossfadeEditorWave());
+ (*i)->set_outline_color (UIConfiguration::instance().get_CrossfadeEditorWave());
+ (*i)->set_fill_color (UIConfiguration::instance().get_CrossfadeEditorWave());
}
for (vector<ArdourCanvas::WaveView*>::iterator i = fade[Out].waves.begin(); i != fade[Out].waves.end(); ++i) {
- (*i)->set_outline_color (ARDOUR_UI::config()->get_SelectedCrossfadeEditorWave());
- (*i)->set_fill_color (ARDOUR_UI::config()->get_SelectedCrossfadeEditorWave());
+ (*i)->set_outline_color (UIConfiguration::instance().get_SelectedCrossfadeEditorWave());
+ (*i)->set_fill_color (UIConfiguration::instance().get_SelectedCrossfadeEditorWave());
}
- fade[Out].line->set_outline_color (ARDOUR_UI::config()->get_SelectedCrossfadeEditorLine());
- fade[In].line->set_outline_color (ARDOUR_UI::config()->get_CrossfadeEditorLine());
+ fade[Out].line->set_outline_color (UIConfiguration::instance().get_SelectedCrossfadeEditorLine());
+ fade[In].line->set_outline_color (UIConfiguration::instance().get_CrossfadeEditorLine());
fade[In].shading->hide();
fade[Out].shading->show();
double spu;
if (which == In) {
- color = ARDOUR_UI::config()->get_SelectedCrossfadeEditorWave();
+ color = UIConfiguration::instance().get_SelectedCrossfadeEditorWave();
} else {
- color = ARDOUR_UI::config()->get_CrossfadeEditorWave();
+ color = UIConfiguration::instance().get_CrossfadeEditorWave();
}
ht = canvas->get_allocation().get_height() / (double) nchans;
#include "tempo_lines.h"
#include "time_axis_view.h"
#include "timers.h"
+#include "ui_config.h"
#include "utils.h"
#include "verbose_cursor.h"
sfbrowser = 0;
- location_marker_color = ARDOUR_UI::config()->color ("location marker");
- location_range_color = ARDOUR_UI::config()->color ("location range");
- location_cd_marker_color = ARDOUR_UI::config()->color ("location cd marker");
- location_loop_color = ARDOUR_UI::config()->color ("location loop");
- location_punch_color = ARDOUR_UI::config()->color ("location punch");
+ location_marker_color = UIConfiguration::instance().color ("location marker");
+ location_range_color = UIConfiguration::instance().color ("location range");
+ location_cd_marker_color = UIConfiguration::instance().color ("location cd marker");
+ location_loop_color = UIConfiguration::instance().color ("location loop");
+ location_punch_color = UIConfiguration::instance().color ("location punch");
zoom_focus = ZoomFocusPlayhead;
_edit_point = EditAtMouse;
samples_per_pixel = 2048; /* too early to use reset_zoom () */
- timebar_height = std::max(12., ceil (15. * ARDOUR_UI::config()->get_ui_scale()));
+ timebar_height = std::max(12., ceil (15. * UIConfiguration::instance().get_ui_scale()));
TimeAxisView::setup_sizes ();
ArdourMarker::setup_sizes (timebar_height);
controls_layout.signal_scroll_event().connect (sigc::mem_fun(*this, &Editor::control_layout_scroll), false);
_cursors = new MouseCursors;
- _cursors->set_cursor_set (ARDOUR_UI::config()->get_icon_set());
- cerr << "Set cursor set to " << ARDOUR_UI::config()->get_icon_set() << endl;
+ _cursors->set_cursor_set (UIConfiguration::instance().get_icon_set());
+ cerr << "Set cursor set to " << UIConfiguration::instance().get_icon_set() << endl;
/* Push default cursor to ever-present bottom of cursor stack. */
push_canvas_cursor(_cursors->grabber);
Session::AskAboutPlaylistDeletion.connect_same_thread (*this, boost::bind (&Editor::playlist_deletion_dialog, this, _1));
Config->ParameterChanged.connect (*this, invalidator (*this), boost::bind (&Editor::parameter_changed, this, _1), gui_context());
- ARDOUR_UI::config()->ParameterChanged.connect (sigc::mem_fun (*this, &Editor::ui_parameter_changed));
+ UIConfiguration::instance().ParameterChanged.connect (sigc::mem_fun (*this, &Editor::ui_parameter_changed));
TimeAxisView::CatchDeletion.connect (*this, invalidator (*this), boost::bind (&Editor::timeaxisview_deleted, this, _1), gui_context());
/* grab current parameter state */
boost::function<void (string)> pc (boost::bind (&Editor::ui_parameter_changed, this, _1));
- ARDOUR_UI::config()->map_parameters (pc);
+ UIConfiguration::instance().map_parameters (pc);
setup_fade_images ();
Window::on_realize ();
Realized ();
- if (ARDOUR_UI::config()->get_lock_gui_after_seconds()) {
+ if (UIConfiguration::instance().get_lock_gui_after_seconds()) {
start_lock_event_timing ();
}
timersub (&now, &last_event_time, &delta);
- if (delta.tv_sec > (time_t) ARDOUR_UI::config()->get_lock_gui_after_seconds()) {
+ if (delta.tv_sec > (time_t) UIConfiguration::instance().get_lock_gui_after_seconds()) {
lock ();
/* don't call again. Returning false will effectively
disconnect us from the timer callback.
void
Editor::update_tearoff_visibility()
{
- bool visible = ARDOUR_UI::config()->get_keep_tearoffs();
+ bool visible = UIConfiguration::instance().get_keep_tearoffs();
_mouse_mode_tearoff->set_visible (visible);
_tools_tearoff->set_visible (visible);
if (_zoom_tearoff) {
while (!_cursor_stack.empty()) {
_cursor_stack.pop_back();
}
- _cursors->set_cursor_set (ARDOUR_UI::config()->get_icon_set());
+ _cursors->set_cursor_set (UIConfiguration::instance().get_icon_set());
_cursor_stack.push_back(_cursors->grabber);
} else if (parameter == "draggable-playhead") {
if (_verbose_cursor) {
- playhead_cursor->set_sensitive (ARDOUR_UI::config()->get_draggable_playhead());
+ playhead_cursor->set_sensitive (UIConfiguration::instance().get_draggable_playhead());
}
}
}
#include "editor.h"
#include "gui_thread.h"
#include "time_axis_view.h"
+#include "ui_config.h"
#include "utils.h"
#include "i18n.h"
#include "audio_time_axis.h"
Glib::RefPtr<Action> act = ActionManager::get_action (X_("Editor"), X_("sound-midi-notes"));
if (act) {
- bool s = ARDOUR_UI::config()->get_sound_midi_notes();
+ bool s = UIConfiguration::instance().get_sound_midi_notes();
Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
if (tact->get_active () != s) {
- ARDOUR_UI::config()->set_sound_midi_notes (tact->get_active());
+ UIConfiguration::instance().set_sound_midi_notes (tact->get_active());
}
}
}
update_just_timecode ();
} else if (p == "show-zoom-tools") {
if (_zoom_tearoff) {
- _zoom_tearoff->set_visible (ARDOUR_UI::config()->get_show_zoom_tools(), true);
+ _zoom_tearoff->set_visible (UIConfiguration::instance().get_show_zoom_tools(), true);
}
} else if (p == "sound-midi-notes") {
Glib::RefPtr<Action> act = ActionManager::get_action (X_("Editor"), X_("sound-midi-notes"));
if (act) {
- bool s = ARDOUR_UI::config()->get_sound_midi_notes();
+ bool s = UIConfiguration::instance().get_sound_midi_notes();
Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
if (tact->get_active () != s) {
tact->set_active (s);
/* this doesn't really belong here but it has to go somewhere */
- if (ARDOUR_UI::config()->get_use_tooltips()) {
+ if (UIConfiguration::instance().get_use_tooltips()) {
Gtkmm2ext::enable_tooltips ();
} else {
Gtkmm2ext::disable_tooltips ();
#include "canvas/canvas.h"
-#include "ardour_ui.h"
#include "editor.h"
#include "editing.h"
#include "audio_time_axis.h"
#include "route_time_axis.h"
#include "audio_region_view.h"
#include "selection.h"
+#include "ui_config.h"
#include "i18n.h"
Editor::toggle_meter_updating()
{
DisplaySuspender ds;
- if (ARDOUR_UI::config()->get_show_track_meters()) {
+ if (UIConfiguration::instance().get_show_track_meters()) {
start_updating_meters ();
} else {
stop_updating_meters ();
#include "keyboard.h"
#include "editor_cursors.h"
#include "mouse_cursors.h"
+#include "ui_config.h"
#include "verbose_cursor.h"
#include "i18n.h"
_track_canvas_viewport = new ArdourCanvas::GtkCanvasViewport (horizontal_adjustment, vertical_adjustment);
_track_canvas = _track_canvas_viewport->canvas ();
- _track_canvas->set_background_color (ARDOUR_UI::config()->color ("arrange base"));
+ _track_canvas->set_background_color (UIConfiguration::instance().color ("arrange base"));
/* scroll group for items that should not automatically scroll
* (e.g verbose cursor). It shares the canvas coordinate space.
initialize_rulers ();
- UIConfiguration::ColorsChanged.connect (sigc::mem_fun (*this, &Editor::color_handler));
+ UIConfiguration::instance().ColorsChanged.connect (sigc::mem_fun (*this, &Editor::color_handler));
color_handler();
}
InstrumentSelector is; // instantiation builds instrument-list and sets default.
do_import (midi_paths, Editing::ImportDistinctFiles, ImportAsTrack, SrcBest, frame, is.selected_instrument());
- if (Profile->get_sae() || ARDOUR_UI::config()->get_only_copy_imported_files() || copy) {
+ if (Profile->get_sae() || UIConfiguration::instance().get_only_copy_imported_files() || copy) {
do_import (audio_paths, Editing::ImportDistinctFiles, Editing::ImportAsTrack, SrcBest, frame);
} else {
do_embed (audio_paths, Editing::ImportDistinctFiles, ImportAsTrack, frame);
do_import (midi_paths, Editing::ImportSerializeFiles, ImportToTrack, SrcBest, frame);
- if (Profile->get_sae() || ARDOUR_UI::config()->get_only_copy_imported_files() || copy) {
+ if (Profile->get_sae() || UIConfiguration::instance().get_only_copy_imported_files() || copy) {
do_import (audio_paths, Editing::ImportSerializeFiles, Editing::ImportToTrack, SrcBest, frame);
} else {
do_embed (audio_paths, Editing::ImportSerializeFiles, ImportToTrack, frame);
void
Editor::maybe_autoscroll (bool allow_horiz, bool allow_vert, bool from_headers)
{
- if (!ARDOUR_UI::config()->get_autoscroll_editor () || autoscroll_active ()) {
+ if (!UIConfiguration::instance().get_autoscroll_editor () || autoscroll_active ()) {
return;
}
void
Editor::color_handler()
{
- ArdourCanvas::Color base = ARDOUR_UI::config()->color ("ruler base");
- ArdourCanvas::Color text = ARDOUR_UI::config()->color ("ruler text");
+ ArdourCanvas::Color base = UIConfiguration::instance().color ("ruler base");
+ ArdourCanvas::Color text = UIConfiguration::instance().color ("ruler text");
timecode_ruler->set_fill_color (base);
timecode_ruler->set_outline_color (text);
minsec_ruler->set_fill_color (base);
bbt_ruler->set_fill_color (base);
bbt_ruler->set_outline_color (text);
- playhead_cursor->set_color (ARDOUR_UI::config()->color ("play head"));
+ playhead_cursor->set_color (UIConfiguration::instance().color ("play head"));
- meter_bar->set_fill_color (ARDOUR_UI::config()->color_mod ("meter bar", "marker bar"));
- meter_bar->set_outline_color (ARDOUR_UI::config()->color ("marker bar separator"));
+ meter_bar->set_fill_color (UIConfiguration::instance().color_mod ("meter bar", "marker bar"));
+ meter_bar->set_outline_color (UIConfiguration::instance().color ("marker bar separator"));
- tempo_bar->set_fill_color (ARDOUR_UI::config()->color_mod ("tempo bar", "marker bar"));
- tempo_bar->set_outline_color (ARDOUR_UI::config()->color ("marker bar separator"));
+ tempo_bar->set_fill_color (UIConfiguration::instance().color_mod ("tempo bar", "marker bar"));
+ tempo_bar->set_outline_color (UIConfiguration::instance().color ("marker bar separator"));
- marker_bar->set_fill_color (ARDOUR_UI::config()->color_mod ("marker bar", "marker bar"));
- marker_bar->set_outline_color (ARDOUR_UI::config()->color ("marker bar separator"));
+ marker_bar->set_fill_color (UIConfiguration::instance().color_mod ("marker bar", "marker bar"));
+ marker_bar->set_outline_color (UIConfiguration::instance().color ("marker bar separator"));
- cd_marker_bar->set_fill_color (ARDOUR_UI::config()->color_mod ("cd marker bar", "marker bar"));
- cd_marker_bar->set_outline_color (ARDOUR_UI::config()->color ("marker bar separator"));
+ cd_marker_bar->set_fill_color (UIConfiguration::instance().color_mod ("cd marker bar", "marker bar"));
+ cd_marker_bar->set_outline_color (UIConfiguration::instance().color ("marker bar separator"));
- range_marker_bar->set_fill_color (ARDOUR_UI::config()->color_mod ("range marker bar", "marker bar"));
- range_marker_bar->set_outline_color (ARDOUR_UI::config()->color ("marker bar separator"));
+ range_marker_bar->set_fill_color (UIConfiguration::instance().color_mod ("range marker bar", "marker bar"));
+ range_marker_bar->set_outline_color (UIConfiguration::instance().color ("marker bar separator"));
- transport_marker_bar->set_fill_color (ARDOUR_UI::config()->color_mod ("transport marker bar", "marker bar"));
- transport_marker_bar->set_outline_color (ARDOUR_UI::config()->color ("marker bar separator"));
+ transport_marker_bar->set_fill_color (UIConfiguration::instance().color_mod ("transport marker bar", "marker bar"));
+ transport_marker_bar->set_outline_color (UIConfiguration::instance().color ("marker bar separator"));
- cd_marker_bar_drag_rect->set_fill_color (ARDOUR_UI::config()->color ("range drag bar rect"));
- cd_marker_bar_drag_rect->set_outline_color (ARDOUR_UI::config()->color ("range drag bar rect"));
+ cd_marker_bar_drag_rect->set_fill_color (UIConfiguration::instance().color ("range drag bar rect"));
+ cd_marker_bar_drag_rect->set_outline_color (UIConfiguration::instance().color ("range drag bar rect"));
- range_bar_drag_rect->set_fill_color (ARDOUR_UI::config()->color ("range drag bar rect"));
- range_bar_drag_rect->set_outline_color (ARDOUR_UI::config()->color ("range drag bar rect"));
+ range_bar_drag_rect->set_fill_color (UIConfiguration::instance().color ("range drag bar rect"));
+ range_bar_drag_rect->set_outline_color (UIConfiguration::instance().color ("range drag bar rect"));
- transport_bar_drag_rect->set_fill_color (ARDOUR_UI::config()->color ("transport drag rect"));
- transport_bar_drag_rect->set_outline_color (ARDOUR_UI::config()->color ("transport drag rect"));
+ transport_bar_drag_rect->set_fill_color (UIConfiguration::instance().color ("transport drag rect"));
+ transport_bar_drag_rect->set_outline_color (UIConfiguration::instance().color ("transport drag rect"));
- transport_loop_range_rect->set_fill_color (ARDOUR_UI::config()->color_mod ("transport loop rect", "loop rectangle"));
- transport_loop_range_rect->set_outline_color (ARDOUR_UI::config()->color ("transport loop rect"));
+ transport_loop_range_rect->set_fill_color (UIConfiguration::instance().color_mod ("transport loop rect", "loop rectangle"));
+ transport_loop_range_rect->set_outline_color (UIConfiguration::instance().color ("transport loop rect"));
- transport_punch_range_rect->set_fill_color (ARDOUR_UI::config()->color ("transport punch rect"));
- transport_punch_range_rect->set_outline_color (ARDOUR_UI::config()->color ("transport punch rect"));
+ transport_punch_range_rect->set_fill_color (UIConfiguration::instance().color ("transport punch rect"));
+ transport_punch_range_rect->set_outline_color (UIConfiguration::instance().color ("transport punch rect"));
- transport_punchin_line->set_outline_color (ARDOUR_UI::config()->color ("punch line"));
- transport_punchout_line->set_outline_color (ARDOUR_UI::config()->color ("punch line"));
+ transport_punchin_line->set_outline_color (UIConfiguration::instance().color ("punch line"));
+ transport_punchout_line->set_outline_color (UIConfiguration::instance().color ("punch line"));
- rubberband_rect->set_outline_color (ARDOUR_UI::config()->color ("rubber band rect"));
- rubberband_rect->set_fill_color (ARDOUR_UI::config()->color_mod ("rubber band rect", "selection rect"));
+ rubberband_rect->set_outline_color (UIConfiguration::instance().color ("rubber band rect"));
+ rubberband_rect->set_fill_color (UIConfiguration::instance().color_mod ("rubber band rect", "selection rect"));
- location_marker_color = ARDOUR_UI::config()->color ("location marker");
- location_range_color = ARDOUR_UI::config()->color ("location range");
- location_cd_marker_color = ARDOUR_UI::config()->color ("location cd marker");
- location_loop_color = ARDOUR_UI::config()->color ("location loop");
- location_punch_color = ARDOUR_UI::config()->color ("location punch");
+ location_marker_color = UIConfiguration::instance().color ("location marker");
+ location_range_color = UIConfiguration::instance().color ("location range");
+ location_cd_marker_color = UIConfiguration::instance().color ("location cd marker");
+ location_loop_color = UIConfiguration::instance().color ("location loop");
+ location_punch_color = UIConfiguration::instance().color ("location punch");
refresh_location_display ();
/* redraw the whole thing */
- _track_canvas->set_background_color (ARDOUR_UI::config()->color ("arrange base"));
+ _track_canvas->set_background_color (UIConfiguration::instance().color ("arrange base"));
_track_canvas->queue_draw ();
/*
#include "editor.h"
#include "keyboard.h"
#include "public_editor.h"
-#include "ardour_ui.h"
#include "audio_region_view.h"
#include "audio_streamview.h"
#include "audio_time_axis.h"
#include "editor_drag.h"
#include "midi_time_axis.h"
#include "editor_regions.h"
+#include "ui_config.h"
#include "verbose_cursor.h"
#include "i18n.h"
* TODO: check if file is audio/midi, allow drops on same track-type only,
* currently: if audio is dropped on a midi-track, it is only added to the region-list
*/
- if (Profile->get_sae() || ARDOUR_UI::config()->get_only_copy_imported_files()) {
+ if (Profile->get_sae() || UIConfiguration::instance().get_only_copy_imported_files()) {
context->drag_status(Gdk::ACTION_COPY, time);
} else {
if ((context->get_actions() & (Gdk::ACTION_COPY | Gdk::ACTION_LINK | Gdk::ACTION_MOVE)) == Gdk::ACTION_COPY) {
#include "mouse_cursors.h"
#include "note_base.h"
#include "patch_change.h"
+#include "ui_config.h"
#include "verbose_cursor.h"
using namespace std;
_marker = new MeterMarker (
*_editor,
*_editor->meter_group,
- ARDOUR_UI::config()->color ("meter marker"),
+ UIConfiguration::instance().color ("meter marker"),
name,
*new MeterSection (_marker->meter())
);
_marker = new TempoMarker (
*_editor,
*_editor->tempo_group,
- ARDOUR_UI::config()->color ("tempo marker"),
+ UIConfiguration::instance().color ("tempo marker"),
name,
*new TempoSection (_marker->tempo())
);
RubberbandSelectDrag::start_grab (GdkEvent* event, Gdk::Cursor *)
{
Drag::start_grab (event);
- show_verbose_cursor_time (adjusted_current_frame (event, ARDOUR_UI::config()->get_rubberbanding_snaps_to_grid()));
+ show_verbose_cursor_time (adjusted_current_frame (event, UIConfiguration::instance().get_rubberbanding_snaps_to_grid()));
}
void
double y1;
double y2;
- framepos_t const pf = adjusted_current_frame (event, ARDOUR_UI::config()->get_rubberbanding_snaps_to_grid());
+ framepos_t const pf = adjusted_current_frame (event, UIConfiguration::instance().get_rubberbanding_snaps_to_grid());
framepos_t grab = grab_frame ();
- if (ARDOUR_UI::config()->get_rubberbanding_snaps_to_grid ()) {
+ if (UIConfiguration::instance().get_rubberbanding_snaps_to_grid ()) {
_editor->snap_to_with_modifier (grab, event);
} else {
grab = raw_grab_frame ();
framepos_t grab = grab_frame ();
framepos_t lpf = last_pointer_frame ();
- if (!ARDOUR_UI::config()->get_rubberbanding_snaps_to_grid ()) {
+ if (!UIConfiguration::instance().get_rubberbanding_snaps_to_grid ()) {
grab = raw_grab_frame ();
lpf = _editor->pixel_to_sample_from_event (last_pointer_x());
}
if (s->get_play_range() && s->transport_rolling()) {
s->request_play_range (&_editor->selection->time, true);
} else {
- if (ARDOUR_UI::config()->get_follow_edits() && !s->transport_rolling()) {
+ if (UIConfiguration::instance().get_follow_edits() && !s->transport_rolling()) {
if (_operation == SelectionEndTrim)
_editor->maybe_locate_with_edit_preroll( _editor->get_selection().time.end_frame());
else
physical_screen_height (_editor->get_window())));
_drag_rect->hide ();
- _drag_rect->set_fill_color (ARDOUR_UI::config()->color ("range drag rect"));
- _drag_rect->set_outline_color (ARDOUR_UI::config()->color ("range drag rect"));
+ _drag_rect->set_fill_color (UIConfiguration::instance().color ("range drag rect"));
+ _drag_rect->set_outline_color (UIConfiguration::instance().color ("range drag rect"));
}
RangeMarkerBarDrag::~RangeMarkerBarDrag()
#include "canvas/colors.h"
-#include "ardour_ui.h"
#include "editor.h"
#include "editor_group_tabs.h"
#include "editor_route_groups.h"
#include "editor_routes.h"
#include "rgb_macros.h"
#include "route_time_axis.h"
+#include "ui_config.h"
#include "utils.h"
#include "i18n.h"
if (tab.group && tab.group->is_active()) {
ArdourCanvas::color_to_rgba (tab.color, r, g, b, a);
} else {
- ArdourCanvas::color_to_rgba (ARDOUR_UI::config()->color ("inactive group tab"), r, g, b, a);
+ ArdourCanvas::color_to_rgba (UIConfiguration::instance().color ("inactive group tab"), r, g, b, a);
}
a = 1.0;
#include "mixer_strip.h"
#include "mixer_ui.h"
#include "selection.h"
+#include "ui_config.h"
#include "i18n.h"
}
//not rolling, range mode click + join_play_range : locate the PH here
- if ( !_drags->active () && _session && !_session->transport_rolling() && ( effective_mouse_mode() == MouseRange ) && ARDOUR_UI::config()->get_follow_edits() ) {
+ if ( !_drags->active () && _session && !_session->transport_rolling() && ( effective_mouse_mode() == MouseRange ) && UIConfiguration::instance().get_follow_edits() ) {
framepos_t where = canvas_event_sample (event);
snap_to(where);
_session->request_locate (where, false);
if (mouse_mode == MouseDraw) {
ArdourCanvas::Line *line = dynamic_cast<ArdourCanvas::Line *> (item);
if (line) {
- line->set_outline_color (ARDOUR_UI::config()->color ("entered gain line"));
+ line->set_outline_color (UIConfiguration::instance().color ("entered gain line"));
}
}
break;
if (mouse_mode == MouseDraw || mouse_mode == MouseObject) {
ArdourCanvas::Line *line = dynamic_cast<ArdourCanvas::Line *> (item);
if (line) {
- line->set_outline_color (ARDOUR_UI::config()->color ("entered automation line"));
+ line->set_outline_color (UIConfiguration::instance().color ("entered automation line"));
}
}
break;
break;
}
entered_marker = marker;
- marker->set_color_rgba (ARDOUR_UI::config()->color ("entered marker"));
+ marker->set_color_rgba (UIConfiguration::instance().color ("entered marker"));
// fall through
case MeterMarkerItem:
case TempoMarkerItem:
{
ArdourCanvas::Rectangle *rect = dynamic_cast<ArdourCanvas::Rectangle *> (item);
if (rect) {
- rect->set_fill_color (ARDOUR_UI::config()->color ("inactive fade handle"));
+ rect->set_fill_color (UIConfiguration::instance().color ("inactive fade handle"));
}
}
break;
case FeatureLineItem:
{
ArdourCanvas::Line *line = dynamic_cast<ArdourCanvas::Line *> (item);
- line->set_outline_color (ARDOUR_UI::config()->color ("zero line"));
+ line->set_outline_color (UIConfiguration::instance().color ("zero line"));
}
break;
entered_route_view->canvas_display()->canvas_to_item (cx, cy);
double track_height = entered_route_view->view()->child_height();
- if (ARDOUR_UI::config()->get_show_name_highlight()) {
+ if (UIConfiguration::instance().get_show_name_highlight()) {
track_height -= TimeAxisViewItem::NAME_HIGHLIGHT_SIZE;
}
double const c = cy / track_height;
#include "canvas/canvas.h"
#include "actions.h"
-#include "ardour_ui.h"
#include "audio_region_view.h"
#include "audio_streamview.h"
#include "audio_time_axis.h"
#include "time_axis_view.h"
#include "transpose_dialog.h"
#include "transform_dialog.h"
+#include "ui_config.h"
#include "i18n.h"
bool
Editor::choose_new_marker_name(string &name) {
- if (!ARDOUR_UI::config()->get_name_new_markers()) {
+ if (!UIConfiguration::instance().get_name_new_markers()) {
/* don't prompt user for a new name */
return true;
}
void
Editor::maybe_locate_with_edit_preroll ( framepos_t location )
{
- if ( _session->transport_rolling() || !ARDOUR_UI::config()->get_follow_edits() || _ignore_follow_edits )
+ if ( _session->transport_rolling() || !UIConfiguration::instance().get_follow_edits() || _ignore_follow_edits )
return;
location -= get_preroll();
}
}
- if (ARDOUR_UI::config()->get_follow_edits()) {
+ if (UIConfiguration::instance().get_follow_edits()) {
cancel_time_selection();
}
}
delete _main_menu_disabler;
- if (ARDOUR_UI::config()->get_lock_gui_after_seconds()) {
+ if (UIConfiguration::instance().get_lock_gui_after_seconds()) {
start_lock_event_timing ();
}
}
#include "editor_regions.h"
#include "editor_drag.h"
#include "main_clock.h"
+#include "ui_config.h"
#include "i18n.h"
if (missing_source) {
// c.set_rgb(65535,0,0); // FIXME: error color from style
- set_color_from_rgba (c, ARDOUR_UI::config()->color ("region list missing source"));
+ set_color_from_rgba (c, UIConfiguration::instance().color ("region list missing source"));
} else if (region->automatic()){
// c.set_rgb(0,65535,0); // FIXME: error color from style
- set_color_from_rgba (c, ARDOUR_UI::config()->color ("region list automatic"));
+ set_color_from_rgba (c, UIConfiguration::instance().color ("region list automatic"));
} else {
- set_color_from_rgba (c, ARDOUR_UI::config()->color ("region list whole file"));
+ set_color_from_rgba (c, UIConfiguration::instance().color ("region list whole file"));
}
row[_columns.color_] = c;
framepos_t pos = 0;
bool copy = ((context->get_actions() & (Gdk::ACTION_COPY | Gdk::ACTION_LINK | Gdk::ACTION_MOVE)) == Gdk::ACTION_COPY);
- if (Profile->get_sae() || ARDOUR_UI::config()->get_only_copy_imported_files() || copy) {
+ if (Profile->get_sae() || UIConfiguration::instance().get_only_copy_imported_files() || copy) {
_editor->do_import (paths, Editing::ImportDistinctFiles, Editing::ImportAsRegion, SrcBest, pos);
} else {
_editor->do_embed (paths, Editing::ImportDistinctFiles, ImportAsRegion, pos);
#include "time_axis_view.h"
#include "editor_drag.h"
#include "editor_cursors.h"
+#include "ui_config.h"
#include "i18n.h"
{
ruler_grabbed_widget = 0;
- Pango::FontDescription font (ARDOUR_UI::config()->get_SmallerFont());
+ Pango::FontDescription font (UIConfiguration::instance().get_SmallerFont());
_timecode_metric = new TimecodeMetric (this);
_bbt_metric = new BBTMetric (this);
#include "canvas/debug.h"
-#include "ardour_ui.h"
#include "time_axis_view.h"
#include "streamview.h"
#include "editor_summary.h"
#include "editor_cursors.h"
#include "mouse_cursors.h"
#include "route_time_axis.h"
+#include "ui_config.h"
using namespace std;
using namespace ARDOUR;
add_events (Gdk::POINTER_MOTION_MASK|Gdk::KEY_PRESS_MASK|Gdk::KEY_RELEASE_MASK|Gdk::ENTER_NOTIFY_MASK|Gdk::LEAVE_NOTIFY_MASK);
set_flags (get_flags() | Gtk::CAN_FOCUS);
- ARDOUR_UI::config()->ParameterChanged.connect (sigc::mem_fun (*this, &EditorSummary::parameter_changed));
+ UIConfiguration::instance().ParameterChanged.connect (sigc::mem_fun (*this, &EditorSummary::parameter_changed));
}
EditorSummary::~EditorSummary ()
bool
EditorSummary::suspending_editor_updates () const
{
- return (!ARDOUR_UI::config()->get_update_editor_during_summary_drag () && (_zoom_dragging || _move_dragging));
+ return (!UIConfiguration::instance().get_update_editor_during_summary_drag () && (_zoom_dragging || _move_dragging));
}
/** Fill in x and y with the editor's current viewable area in summary coordinates */
#include "rgb_macros.h"
#include "gui_thread.h"
#include "time_axis_view.h"
-#include "ardour_ui.h"
#include "tempo_lines.h"
+#include "ui_config.h"
#include "i18n.h"
if ((ms = dynamic_cast<const MeterSection*>(*i)) != 0) {
snprintf (buf, sizeof(buf), "%g/%g", ms->divisions_per_bar(), ms->note_divisor ());
- metric_marks.push_back (new MeterMarker (*this, *meter_group, ARDOUR_UI::config()->color ("meter marker"), buf,
+ metric_marks.push_back (new MeterMarker (*this, *meter_group, UIConfiguration::instance().color ("meter marker"), buf,
*(const_cast<MeterSection*>(ms))));
} else if ((ts = dynamic_cast<const TempoSection*>(*i)) != 0) {
- if (ARDOUR_UI::config()->get_allow_non_quarter_pulse()) {
+ if (UIConfiguration::instance().get_allow_non_quarter_pulse()) {
snprintf (buf, sizeof (buf), "%.2f/%.0f", ts->beats_per_minute(), ts->note_type());
} else {
snprintf (buf, sizeof (buf), "%.2f", ts->beats_per_minute());
}
- metric_marks.push_back (new TempoMarker (*this, *tempo_group, ARDOUR_UI::config()->color ("tempo marker"), buf,
+ metric_marks.push_back (new TempoMarker (*this, *tempo_group, UIConfiguration::instance().color ("tempo marker"), buf,
*(const_cast<TempoSection*>(ts))));
}
#include "utils.h"
#include "meter_patterns.h"
#include "timers.h"
+#include "ui_config.h"
#include "ardour/session.h"
#include "ardour/route.h"
next_release_selects = false;
_width = Wide;
- fader_length = rint (fader_length * ARDOUR_UI::config()->get_ui_scale());
- fader_girth = rint (fader_girth * ARDOUR_UI::config()->get_ui_scale());
+ fader_length = rint (fader_length * UIConfiguration::instance().get_ui_scale());
+ fader_girth = rint (fader_girth * UIConfiguration::instance().get_ui_scale());
if (horizontal) {
gain_slider = manage (new HSliderController (&gain_adjustment, boost::shared_ptr<PBD::Controllable>(), fader_length, fader_girth));
RedrawMetrics.connect (sigc::mem_fun(*this, &GainMeterBase::redraw_metrics));
UI::instance()->theme_changed.connect (sigc::mem_fun(*this, &GainMeterBase::on_theme_changed));
- UIConfiguration::ColorsChanged.connect (sigc::bind(sigc::mem_fun (*this, &GainMeterBase::color_handler), false));
- UIConfiguration::DPIReset.connect (sigc::bind(sigc::mem_fun (*this, &GainMeterBase::color_handler), true));
+ UIConfiguration::instance().ColorsChanged.connect (sigc::bind(sigc::mem_fun (*this, &GainMeterBase::color_handler), false));
+ UIConfiguration::instance().DPIReset.connect (sigc::bind(sigc::mem_fun (*this, &GainMeterBase::color_handler), true));
}
GainMeterBase::~GainMeterBase ()
peak_display.set_text (buf);
}
}
- if (mpeak >= ARDOUR_UI::config()->get_meter_peak()) {
+ if (mpeak >= UIConfiguration::instance().get_meter_peak()) {
peak_display.set_name ("MixerStripPeakDisplayPeak");
}
}
meter_ticks2_area.queue_draw ();
}
-#define PX_SCALE(pxmin, dflt) rint(std::max((double)pxmin, (double)dflt * ARDOUR_UI::config()->get_ui_scale()))
+#define PX_SCALE(pxmin, dflt) rint(std::max((double)pxmin, (double)dflt * UIConfiguration::instance().get_ui_scale()))
GainMeter::GainMeter (Session* s, int fader_length)
: GainMeterBase (s, false, fader_length, 24)
#include "gui_thread.h"
#include "automation_controller.h"
#include "timers.h"
+#include "ui_config.h"
#include "i18n.h"
0xcccc00ff, 0xcccc00ff,
0xffaa00ff, 0xffaa00ff,
0xff0000ff,
- ARDOUR_UI::config()->color ("meter background bottom"),
- ARDOUR_UI::config()->color ("meter background top")
+ UIConfiguration::instance().color ("meter background bottom"),
+ UIConfiguration::instance().color ("meter background top")
);
info->min_unbound = desc.min_unbound;
*/
+#include "ardour/parameter_descriptor.h"
+
#include "evoral/Note.hpp"
#include "canvas/container.h"
#include "canvas/polygon.h"
#include "canvas/wave_view.h"
#include "canvas/debug.h"
-#include "ardour_ui.h"
#include "automation_time_axis.h"
#include "ghostregion.h"
#include "midi_streamview.h"
#include "rgb_macros.h"
#include "note.h"
#include "hit.h"
+#include "ui_config.h"
using namespace std;
using namespace Editing;
GhostRegion::set_colors ()
{
if (is_automation_ghost()) {
- base_rect->set_fill_color (ARDOUR_UI::config()->color_mod ("ghost track base", "ghost track base"));
+ base_rect->set_fill_color (UIConfiguration::instance().color_mod ("ghost track base", "ghost track base"));
}
}
guint fill_color;
if (is_automation_ghost()) {
- fill_color = ARDOUR_UI::config()->color ("ghost track wave fill");
+ fill_color = UIConfiguration::instance().color ("ghost track wave fill");
}
else {
fill_color = source_track_color(200);
}
for (uint32_t n=0; n < waves.size(); ++n) {
- waves[n]->set_outline_color (ARDOUR_UI::config()->color ("ghost track wave"));
+ waves[n]->set_outline_color (UIConfiguration::instance().color ("ghost track wave"));
waves[n]->set_fill_color (fill_color);
- waves[n]->set_clip_color (ARDOUR_UI::config()->color ("ghost track wave clip"));
- waves[n]->set_zero_color (ARDOUR_UI::config()->color ("ghost track zero line"));
+ waves[n]->set_clip_color (UIConfiguration::instance().color ("ghost track wave clip"));
+ waves[n]->set_zero_color (UIConfiguration::instance().color ("ghost track zero line"));
}
}
GhostRegion::set_colors();
for (EventList::iterator it = events.begin(); it != events.end(); ++it) {
- (*it)->item->set_fill_color (ARDOUR_UI::config()->color_mod((*it)->event->base_color(), "ghost track midi fill"));
- (*it)->item->set_outline_color (ARDOUR_UI::config()->color ("ghost track midi outline"));
+ (*it)->item->set_fill_color (UIConfiguration::instance().color_mod((*it)->event->base_color(), "ghost track midi fill"));
+ (*it)->item->set_outline_color (UIConfiguration::instance().color ("ghost track midi outline"));
}
}
GhostEvent* event = new GhostEvent (n, group);
events.push_back (event);
- event->item->set_fill_color (ARDOUR_UI::config()->color_mod(n->base_color(), "ghost track midi fill"));
- event->item->set_outline_color (ARDOUR_UI::config()->color ("ghost track midi outline"));
+ event->item->set_fill_color (UIConfiguration::instance().color_mod(n->base_color(), "ghost track midi fill"));
+ event->item->set_outline_color (UIConfiguration::instance().color ("ghost track midi outline"));
MidiStreamView* mv = midi_view();
, _dragging_new_tab (0)
{
add_events (Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK|Gdk::POINTER_MOTION_MASK);
- UIConfiguration::ColorsChanged.connect (sigc::mem_fun (*this, &GroupTabs::queue_draw));
+ UIConfiguration::instance().ColorsChanged.connect (sigc::mem_fun (*this, &GroupTabs::queue_draw));
}
GroupTabs::~GroupTabs ()
#include <gtkmm2ext/utils.h>
#include "pbd/fastlog.h"
-#include "ardour_ui.h"
#include "level_meter.h"
#include "utils.h"
#include "logmeter.h"
#include "gui_thread.h"
#include "keyboard.h"
#include "public_editor.h"
+#include "ui_config.h"
#include "i18n.h"
set_session (s);
Config->ParameterChanged.connect (_parameter_connection, parent_invalidator, boost::bind (&LevelMeterBase::parameter_changed, this, _1), gui_context());
- ARDOUR_UI::config()->ParameterChanged.connect (sigc::mem_fun(*this, &LevelMeterBase::parameter_changed));
- UIConfiguration::ColorsChanged.connect (sigc::mem_fun (*this, &LevelMeterBase::color_handler));
+ UIConfiguration::instance().ParameterChanged.connect (sigc::mem_fun(*this, &LevelMeterBase::parameter_changed));
+ UIConfiguration::instance().ColorsChanged.connect (sigc::mem_fun (*this, &LevelMeterBase::color_handler));
}
LevelMeterBase::~LevelMeterBase ()
}
static float meter_lineup(float offset) {
- return meter_lineup_cfg (ARDOUR_UI::config()->get_meter_line_up_level(), offset);
+ return meter_lineup_cfg (UIConfiguration::instance().get_meter_line_up_level(), offset);
}
static float vu_standard() {
// note - default meter config is +2dB (france)
- switch (ARDOUR_UI::config()->get_meter_vu_standard()) {
+ switch (UIConfiguration::instance().get_meter_vu_standard()) {
default:
case MeteringVUfrench: // 0VU = -2dBu
return 0;
const float mpeak = _meter->meter_level(n, MeterMaxPeak);
if (mpeak > (*i).max_peak) {
(*i).max_peak = mpeak;
- (*i).meter->set_highlight(mpeak >= ARDOUR_UI::config()->get_meter_peak());
+ (*i).meter->set_highlight(mpeak >= UIConfiguration::instance().get_meter_peak());
}
if (mpeak > max_peak) {
max_peak = mpeak;
} else if (meter_type == MeterIEC1NOR) {
(*i).meter->set (meter_deflect_nordic (peak + meter_lineup(0)));
} else if (meter_type == MeterIEC1DIN) {
- (*i).meter->set (meter_deflect_din (peak + meter_lineup_cfg(ARDOUR_UI::config()->get_meter_line_up_din(), 3.0)));
+ (*i).meter->set (meter_deflect_din (peak + meter_lineup_cfg(UIConfiguration::instance().get_meter_line_up_din(), 3.0)));
} else if (meter_type == MeterIEC2BBC || meter_type == MeterIEC2EBU) {
(*i).meter->set (meter_deflect_ppm (peak + meter_lineup(0)));
} else if (meter_type == MeterVU) {
uint32_t n;
for (n = 0, i = meters.begin(); i != meters.end(); ++i, ++n) {
- (*i).meter->set_hold_count ((uint32_t) floor(ARDOUR_UI::config()->get_meter_hold()));
+ (*i).meter->set_hold_count ((uint32_t) floor(UIConfiguration::instance().get_meter_hold()));
}
}
else if (p == "meter-line-up-level") {
width = thin_meter_width;
}
- width = rint (width * ARDOUR_UI::config()->get_ui_scale());
+ width = rint (width * UIConfiguration::instance().get_ui_scale());
if ( meters.size() > 0
&& nmeters == visible_meter_count
uint32_t c[10];
uint32_t b[4];
float stp[4];
- int styleflags = ARDOUR_UI::config()->get_meter_style_led() ? 3 : 1;
- b[0] = ARDOUR_UI::config()->color ("meter background bottom");
- b[1] = ARDOUR_UI::config()->color ("meter background top");
+ int styleflags = UIConfiguration::instance().get_meter_style_led() ? 3 : 1;
+ b[0] = UIConfiguration::instance().color ("meter background bottom");
+ b[1] = UIConfiguration::instance().color ("meter background top");
b[2] = 0x991122ff; // red highlight gradient Bot
b[3] = 0x551111ff; // red highlight gradient Top
if (n < nmidi) {
- c[0] = ARDOUR_UI::config()->color ("midi meter color0");
- c[1] = ARDOUR_UI::config()->color ("midi meter color1");
- c[2] = ARDOUR_UI::config()->color ("midi meter color2");
- c[3] = ARDOUR_UI::config()->color ("midi meter color3");
- c[4] = ARDOUR_UI::config()->color ("midi meter color4");
- c[5] = ARDOUR_UI::config()->color ("midi meter color5");
- c[6] = ARDOUR_UI::config()->color ("midi meter color6");
- c[7] = ARDOUR_UI::config()->color ("midi meter color7");
- c[8] = ARDOUR_UI::config()->color ("midi meter color8");
- c[9] = ARDOUR_UI::config()->color ("midi meter color9");
+ c[0] = UIConfiguration::instance().color ("midi meter color0");
+ c[1] = UIConfiguration::instance().color ("midi meter color1");
+ c[2] = UIConfiguration::instance().color ("midi meter color2");
+ c[3] = UIConfiguration::instance().color ("midi meter color3");
+ c[4] = UIConfiguration::instance().color ("midi meter color4");
+ c[5] = UIConfiguration::instance().color ("midi meter color5");
+ c[6] = UIConfiguration::instance().color ("midi meter color6");
+ c[7] = UIConfiguration::instance().color ("midi meter color7");
+ c[8] = UIConfiguration::instance().color ("midi meter color8");
+ c[9] = UIConfiguration::instance().color ("midi meter color9");
stp[0] = 115.0 * 32.0 / 128.0;
stp[1] = 115.0 * 64.0 / 128.0;
stp[2] = 115.0 * 100.0 / 128.0;
stp[3] = 115.0 * 112.0 / 128.0;
} else {
- c[0] = ARDOUR_UI::config()->color ("meter color0");
- c[1] = ARDOUR_UI::config()->color ("meter color1");
- c[2] = ARDOUR_UI::config()->color ("meter color2");
- c[3] = ARDOUR_UI::config()->color ("meter color3");
- c[4] = ARDOUR_UI::config()->color ("meter color4");
- c[5] = ARDOUR_UI::config()->color ("meter color5");
- c[6] = ARDOUR_UI::config()->color ("meter color6");
- c[7] = ARDOUR_UI::config()->color ("meter color7");
- c[8] = ARDOUR_UI::config()->color ("meter color8");
- c[9] = ARDOUR_UI::config()->color ("meter color9");
+ c[0] = UIConfiguration::instance().color ("meter color0");
+ c[1] = UIConfiguration::instance().color ("meter color1");
+ c[2] = UIConfiguration::instance().color ("meter color2");
+ c[3] = UIConfiguration::instance().color ("meter color3");
+ c[4] = UIConfiguration::instance().color ("meter color4");
+ c[5] = UIConfiguration::instance().color ("meter color5");
+ c[6] = UIConfiguration::instance().color ("meter color6");
+ c[7] = UIConfiguration::instance().color ("meter color7");
+ c[8] = UIConfiguration::instance().color ("meter color8");
+ c[9] = UIConfiguration::instance().color ("meter color9");
switch (meter_type) {
case MeterK20:
break;
case MeterIEC2BBC:
c[0] = c[1] = c[2] = c[3] = c[4] = c[5] = c[6] = c[7] = c[8] = c[9] =
- ARDOUR_UI::config()->color ("meter color BBC");
+ UIConfiguration::instance().color ("meter color BBC");
stp[0] = stp[1] = stp[2] = stp[3] = 115.0;
break;
case MeterIEC2EBU:
stp[1] = 89.125; // 115.0 * log_meter0dB(-9);
stp[2] = 106.375; // 115.0 * log_meter0dB(-3);
stp[3] = 115.0; // 115.0 * log_meter0dB(0);
- switch (ARDOUR_UI::config()->get_meter_line_up_level()) {
+ switch (UIConfiguration::instance().get_meter_line_up_level()) {
case MeteringLineUp24:
stp[0] = 115.0 * log_meter0dB(-24);
break;
stp[1] = 77.5; // 115 * log_meter(-9)
stp[2] = 92.5; // 115 * log_meter(-3)
stp[3] = 100.0; // 115 * log_meter(0)
- switch (ARDOUR_UI::config()->get_meter_line_up_level()) {
+ switch (UIConfiguration::instance().get_meter_line_up_level()) {
case MeteringLineUp24:
stp[0] = 42.0;
break;
bool hl = meters[n].meter ? meters[n].meter->get_highlight() : false;
meters[n].packed = false;
delete meters[n].meter;
- meters[n].meter = new FastMeter ((uint32_t) floor (ARDOUR_UI::config()->get_meter_hold()), width, _meter_orientation, len,
+ meters[n].meter = new FastMeter ((uint32_t) floor (UIConfiguration::instance().get_meter_hold()), width, _meter_orientation, len,
c[0], c[1], c[2], c[3], c[4],
c[5], c[6], c[7], c[8], c[9],
b[0], b[1], b[2], b[3],
#include "prompter.h"
#include "utils.h"
#include "public_editor.h"
+#include "ui_config.h"
#include "i18n.h"
framepos_t where = _session->audible_frame();
_session->locations()->next_available_name(markername,"mark");
Location *location = new Location (*_session, where, where, markername, Location::IsMark);
- if (ARDOUR_UI::config()->get_name_new_markers()) {
+ if (UIConfiguration::instance().get_name_new_markers()) {
newest_location = location;
}
PublicEditor::instance().begin_reversible_command (_("add marker"));
#ifndef __ardour_gtk_log_meter_h__
#define __ardour_gtk_log_meter_h__
+#include "ardour/dB.h"
+
#if 1
static inline float
_log_meter (float power, double lower_db, double upper_db, double non_linearity)
}
#endif
- UIConfiguration* ui_config = new UIConfiguration;
-
- if (ui_config->pre_gui_init ()) {
+ if (UIConfiguration::instance().pre_gui_init ()) {
error << _("Could not complete pre-GUI initialization") << endmsg;
exit (1);
}
try {
- ui = new ARDOUR_UI (&argc, &argv, localedir.c_str(), ui_config);
+ ui = new ARDOUR_UI (&argc, &argv, localedir.c_str());
} catch (failed_constructor& err) {
error << string_compose (_("could not create %1 GUI"), PROGRAM_NAME) << endmsg;
exit (1);
*/
-#include "ardour_ui.h"
#include "main_clock.h"
#include "public_editor.h"
+#include "ui_config.h"
+
#include "i18n.h"
#include "ardour/tempo.h"
ops_items.push_back (CheckMenuElem (_("Display delta to edit cursor"), sigc::mem_fun (*this, &MainClock::display_delta_to_edit_cursor)));
Gtk::CheckMenuItem* c = dynamic_cast<Gtk::CheckMenuItem *> (&ops_items.back());
if (_primary) {
- if (ARDOUR_UI::config()->get_primary_clock_delta_edit_cursor ()) {
- ARDOUR_UI::config()->set_primary_clock_delta_edit_cursor (false);
+ if (UIConfiguration::instance().get_primary_clock_delta_edit_cursor ()) {
+ UIConfiguration::instance().set_primary_clock_delta_edit_cursor (false);
c->set_active (true);
}
} else {
- if (ARDOUR_UI::config()->get_secondary_clock_delta_edit_cursor ()) {
- ARDOUR_UI::config()->set_secondary_clock_delta_edit_cursor (false);
+ if (UIConfiguration::instance().get_secondary_clock_delta_edit_cursor ()) {
+ UIConfiguration::instance().set_secondary_clock_delta_edit_cursor (false);
c->set_active (true);
}
}
MainClock::display_delta_to_edit_cursor ()
{
if (_primary) {
- ARDOUR_UI::config()->set_primary_clock_delta_edit_cursor (!ARDOUR_UI::config()->get_primary_clock_delta_edit_cursor ());
+ UIConfiguration::instance().set_primary_clock_delta_edit_cursor (!UIConfiguration::instance().get_primary_clock_delta_edit_cursor ());
} else {
- ARDOUR_UI::config()->set_secondary_clock_delta_edit_cursor (!ARDOUR_UI::config()->get_secondary_clock_delta_edit_cursor ());
+ UIConfiguration::instance().set_secondary_clock_delta_edit_cursor (!UIConfiguration::instance().get_secondary_clock_delta_edit_cursor ());
}
}
#include "canvas/scroll_group.h"
#include "canvas/debug.h"
-#include "ardour_ui.h"
+#include "ui_config.h"
/*
* ardour_ui.h include was moved to the top of the list
* due to a conflicting definition of 'Rect' between
* Apple's MacTypes.h and GTK.
+ *
+ * Now that we are including ui_config.h and not ardour_ui.h
+ * the above comment may no longer apply and this comment
+ * can be removed and ui_config.h inclusion moved.
*/
#include "marker.h"
{
const double MH = marker_height - 1;
- const double M3 = std::max(1.f, rintf(3.f * ARDOUR_UI::config()->get_ui_scale()));
- const double M6 = std::max(2.f, rintf(6.f * ARDOUR_UI::config()->get_ui_scale()));
+ const double M3 = std::max(1.f, rintf(3.f * UIConfiguration::instance().get_ui_scale()));
+ const double M6 = std::max(2.f, rintf(6.f * UIConfiguration::instance().get_ui_scale()));
/* Shapes we use:
*
if (_track_canvas_line == 0) {
_track_canvas_line = new ArdourCanvas::Line (editor.get_hscroll_group());
- _track_canvas_line->set_outline_color (ARDOUR_UI::config()->color ("edit point"));
+ _track_canvas_line->set_outline_color (UIConfiguration::instance().color ("edit point"));
_track_canvas_line->Event.connect (sigc::bind (sigc::mem_fun (editor, &PublicEditor::canvas_marker_event), group, this));
}
_track_canvas_line->set_x1 (d.x);
_track_canvas_line->set_y0 (d.y);
_track_canvas_line->set_y1 (ArdourCanvas::COORD_MAX);
- _track_canvas_line->set_outline_color (_selected ? ARDOUR_UI::config()->color ("edit point") : _color);
+ _track_canvas_line->set_outline_color (_selected ? UIConfiguration::instance().color ("edit point") : _color);
_track_canvas_line->raise_to_top ();
_track_canvas_line->show ();
limit = _right_label_limit;
}
- const float padding = std::max(2.f, rintf(2.f * ARDOUR_UI::config()->get_ui_scale()));
+ const float padding = std::max(2.f, rintf(2.f * UIConfiguration::instance().get_ui_scale()));
/* Work out how wide the name can be */
int name_width = min ((double) pixel_width (_name, name_font) + padding, limit);
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include <gtkmm/drawingarea.h>
+
#include <gtkmm2ext/cairo_widget.h>
#include <gtkmm2ext/gtk_ui.h>
#include <gtkmm2ext/utils.h>
#include <gtkmm2ext/rgb_macros.h>
#include <ardour/rc_configuration.h>
-#include "ardour_ui.h"
#include "utils.h"
#include "logmeter.h"
#include "meter_patterns.h"
+#include "ui_config.h"
#include "i18n.h"
double r,g,b,a;
switch(type) {
case MeterVU:
- ArdourCanvas::color_to_rgba (ARDOUR_UI::config()->color ("meterstrip vu bg"), r, g, b, a);
+ ArdourCanvas::color_to_rgba (UIConfiguration::instance().color ("meterstrip vu bg"), r, g, b, a);
break;
case MeterIEC1DIN:
case MeterIEC1NOR:
case MeterIEC2BBC:
case MeterIEC2EBU:
- ArdourCanvas::color_to_rgba (ARDOUR_UI::config()->color ("meterstrip ppm bg"), r, g, b, a);
+ ArdourCanvas::color_to_rgba (UIConfiguration::instance().color ("meterstrip ppm bg"), r, g, b, a);
break;
case MeterK12:
case MeterK14:
case MeterK20:
- ArdourCanvas::color_to_rgba (ARDOUR_UI::config()->color ("meterstrip dpm bg"), r, g, b, a);
+ ArdourCanvas::color_to_rgba (UIConfiguration::instance().color ("meterstrip dpm bg"), r, g, b, a);
break;
default:
{
double r,g,b,a;
switch(type) {
case MeterVU:
- ArdourCanvas::color_to_rgba (ARDOUR_UI::config()->color ("meterstrip vu fg"), r, g, b, a);
+ ArdourCanvas::color_to_rgba (UIConfiguration::instance().color ("meterstrip vu fg"), r, g, b, a);
break;
case MeterIEC1DIN:
case MeterIEC1NOR:
case MeterIEC2BBC:
case MeterIEC2EBU:
- ArdourCanvas::color_to_rgba (ARDOUR_UI::config()->color ("meterstrip ppm fg"), r, g, b, a);
+ ArdourCanvas::color_to_rgba (UIConfiguration::instance().color ("meterstrip ppm fg"), r, g, b, a);
break;
default:
- ArdourCanvas::color_to_rgba (ARDOUR_UI::config()->color ("meterstrip dpm fg"), r, g, b, a);
+ ArdourCanvas::color_to_rgba (UIConfiguration::instance().color ("meterstrip dpm fg"), r, g, b, a);
break;
}
c->set_rgb_p (r, g, b);
float box_l=0;
float box_w=0;
-#define PX_SCALE(pxmin, dflt) rint(std::max((double)pxmin, (double)dflt * ARDOUR_UI::config()->get_ui_scale()))
+#define PX_SCALE(pxmin, dflt) rint(std::max((double)pxmin, (double)dflt * UIConfiguration::instance().get_ui_scale()))
if (tickleft) {
if (w.get_name().substr(0, 3) == "Bar") {
box_w = PX_SCALE(2, 2);
cairo_fill (cr);
height = min(max_pattern_metric_size, height);
- uint32_t peakcolor = ARDOUR_UI::config()->color ("meterbridge peaklabel");
+ uint32_t peakcolor = UIConfiguration::instance().color ("meterbridge peaklabel");
for (vector<DataType>::const_iterator i = types.begin(); i != types.end(); ++i) {
points.insert (std::pair<float,float>(-50, 1.0));
points.insert (std::pair<float,float>(-40, 1.0));
points.insert (std::pair<float,float>(-30, 1.0));
- if (ARDOUR_UI::config()->get_meter_line_up_level() == MeteringLineUp24) {
+ if (UIConfiguration::instance().get_meter_line_up_level() == MeteringLineUp24) {
points.insert (std::pair<float,float>(-24, 1.0));
} else {
points.insert (std::pair<float,float>(-25, 1.0));
Pango::AttrFontDesc* font_attr;
Pango::FontDescription font;
- font = Pango::FontDescription (ARDOUR_UI::config()->get_SmallMonospaceFont());
+ font = Pango::FontDescription (UIConfiguration::instance().get_SmallMonospaceFont());
#ifdef __APPLE__
const double fixfontsize = 1.0;
#else
// counter-act global font-scaling.
- const double fixfontsize = std::min(1.0, 0.9 / sqrtf(ARDOUR_UI::config()->get_ui_scale()));
+ const double fixfontsize = std::min(1.0, 0.9 / sqrtf(UIConfiguration::instance().get_ui_scale()));
#endif
font.set_weight (Pango::WEIGHT_NORMAL);
cairo_set_line_width (cr, 1.0);
height = min(max_pattern_metric_size, height);
- uint32_t peakcolor = ARDOUR_UI::config()->color ("meterbridge peaklabel");
+ uint32_t peakcolor = UIConfiguration::instance().color ("meterbridge peaklabel");
Gdk::Color c; // default text color
for (vector<DataType>::const_iterator i = types.begin(); i != types.end(); ++i) {
points.insert (std::pair<float,string>(-30.0f, "-30"));
points.insert (std::pair<float,string>(-20.0f, "-20"));
if (types.size() == 1) {
- if (ARDOUR_UI::config()->get_meter_line_up_level() == MeteringLineUp24) {
+ if (UIConfiguration::instance().get_meter_line_up_level() == MeteringLineUp24) {
points.insert (std::pair<float,string>(-24.0f, "-24"));
} else {
points.insert (std::pair<float,string>(-25.0f, "-25"));
#include <sigc++/signal.h>
+namespace ARDOUR {
+ class Route;
+ class RouteGroup;
+}
+
namespace ArdourMeter {
extern sigc::signal<void> ResetAllPeakDisplays;
#include "logmeter.h"
#include "gui_thread.h"
#include "ardour_window.h"
+#include "ui_config.h"
#include "utils.h"
#include "meterbridge.h"
PBD::Signal0<void> MeterStrip::MetricChanged;
PBD::Signal0<void> MeterStrip::ConfigurationChanged;
-#define PX_SCALE(pxmin, dflt) rint(std::max((double)pxmin, (double)dflt * ARDOUR_UI::config()->get_ui_scale()))
+#define PX_SCALE(pxmin, dflt) rint(std::max((double)pxmin, (double)dflt * UIConfiguration::instance().get_ui_scale()))
MeterStrip::MeterStrip (int metricmode, MeterType mt)
: AxisView(0)
nfo_vbox.show();
UI::instance()->theme_changed.connect (sigc::mem_fun(*this, &MeterStrip::on_theme_changed));
- UIConfiguration::ColorsChanged.connect (sigc::mem_fun (*this, &MeterStrip::on_theme_changed));
- UIConfiguration::DPIReset.connect (sigc::mem_fun (*this, &MeterStrip::on_theme_changed));
+ UIConfiguration::instance().ColorsChanged.connect (sigc::mem_fun (*this, &MeterStrip::on_theme_changed));
+ UIConfiguration::instance().DPIReset.connect (sigc::mem_fun (*this, &MeterStrip::on_theme_changed));
}
MeterStrip::MeterStrip (Session* sess, boost::shared_ptr<ARDOUR::Route> rt)
name_label.signal_button_release_event().connect (sigc::mem_fun(*this, &MeterStrip::name_label_button_release), false);
UI::instance()->theme_changed.connect (sigc::mem_fun(*this, &MeterStrip::on_theme_changed));
- UIConfiguration::ColorsChanged.connect (sigc::mem_fun (*this, &MeterStrip::on_theme_changed));
- UIConfiguration::DPIReset.connect (sigc::mem_fun (*this, &MeterStrip::on_theme_changed));
+ UIConfiguration::instance().ColorsChanged.connect (sigc::mem_fun (*this, &MeterStrip::on_theme_changed));
+ UIConfiguration::instance().DPIReset.connect (sigc::mem_fun (*this, &MeterStrip::on_theme_changed));
Config->ParameterChanged.connect (*this, invalidator (*this), ui_bind (&MeterStrip::parameter_changed, this, _1), gui_context());
sess->config.ParameterChanged.connect (*this, invalidator (*this), ui_bind (&MeterStrip::parameter_changed, this, _1), gui_context());
float mpeak = level_meter->update_meters();
if (mpeak > max_peak) {
max_peak = mpeak;
- if (mpeak >= ARDOUR_UI::config()->get_meter_peak()) {
+ if (mpeak >= UIConfiguration::instance().get_meter_peak()) {
peak_display.set_active_state ( Gtkmm2ext::ExplicitActive );
}
}
tnh = 4 + std::max(2u, _session->track_number_decimals()) * 8; // TODO 8 = max_with_of_digit_0_to_9()
}
- nh *= ARDOUR_UI::config()->get_ui_scale();
- tnh *= ARDOUR_UI::config()->get_ui_scale();
+ nh *= UIConfiguration::instance().get_ui_scale();
+ tnh *= UIConfiguration::instance().get_ui_scale();
int prev_height, ignored;
bool need_relayout = false;
}
const int tnh = 4 + std::max(2u, _session->track_number_decimals()) * 8; // TODO 8 = max_width_of_digit_0_to_9()
// NB numbers are rotated 90deg. on the meterbridge -> use height
- number_label.set_size_request(PX_SCALE(18, 18), tnh * ARDOUR_UI::config()->get_ui_scale());
+ number_label.set_size_request(PX_SCALE(18, 18), tnh * UIConfiguration::instance().get_ui_scale());
} else {
number_label.hide();
}
viewport->set_border_width(0);
UI::instance()->theme_changed.connect (sigc::mem_fun(*this, &Meterbridge::on_theme_changed));
- UIConfiguration::ColorsChanged.connect (sigc::mem_fun (*this, &Meterbridge::on_theme_changed));
- UIConfiguration::DPIReset.connect (sigc::mem_fun (*this, &Meterbridge::on_theme_changed));
+ UIConfiguration::instance().ColorsChanged.connect (sigc::mem_fun (*this, &Meterbridge::on_theme_changed));
+ UIConfiguration::instance().DPIReset.connect (sigc::mem_fun (*this, &Meterbridge::on_theme_changed));
}
Meterbridge::~Meterbridge ()
#include "gtkmm2ext/keyboard.h"
#include "gtkmm2ext/actions.h"
-#include "ardour_ui.h"
#include "midi_list_editor.h"
#include "note_player.h"
+#include "ui_config.h"
#include "i18n.h"
void
MidiListEditor::selection_changed ()
{
- if (!ARDOUR_UI::config()->get_sound_midi_notes()) {
+ if (!UIConfiguration::instance().get_sound_midi_notes()) {
return;
}
#include "streamview.h"
#include "patch_change_dialog.h"
#include "verbose_cursor.h"
-#include "ardour_ui.h"
#include "note.h"
#include "hit.h"
#include "patch_change.h"
#include "sys_ex.h"
+#include "ui_config.h"
#include "i18n.h"
bool have_periodic_system_messages = false;
bool display_periodic_messages = true;
- if (!ARDOUR_UI::config()->get_never_display_periodic_midi()) {
+ if (!UIConfiguration::instance().get_never_display_periodic_midi()) {
for (MidiModel::SysExes::const_iterator i = _model->sysexes().begin(); i != _model->sysexes().end(); ++i) {
const boost::shared_ptr<const Evoral::MIDIEvent<Evoral::Beats> > mev =
void
MidiRegionView::play_midi_note(boost::shared_ptr<NoteType> note)
{
- if (_no_sound_notes || !ARDOUR_UI::config()->get_sound_midi_notes()) {
+ if (_no_sound_notes || !UIConfiguration::instance().get_sound_midi_notes()) {
return;
}
void
MidiRegionView::start_playing_midi_chord (vector<boost::shared_ptr<NoteType> > notes)
{
- if (_no_sound_notes || !ARDOUR_UI::config()->get_sound_midi_notes()) {
+ if (_no_sound_notes || !UIConfiguration::instance().get_sound_midi_notes()) {
return;
}
(*i)->move_event(dx, dy);
}
- if (dy && !_selection.empty() && !_no_sound_notes && ARDOUR_UI::config()->get_sound_midi_notes()) {
+ if (dy && !_selection.empty() && !_no_sound_notes && UIConfiguration::instance().get_sound_midi_notes()) {
if (to_play.size() > 1) {
// calculate the colors: get the color settings
uint32_t fill_color = UINT_RGBA_CHANGE_A(
- ARDOUR_UI::config()->color ("midi note selected"),
+ UIConfiguration::instance().color ("midi note selected"),
128);
// make the resize preview notes more transparent and bright
0.85));
resize_rect->set_outline_color (NoteBase::calculate_outline (
- ARDOUR_UI::config()->color ("midi note selected")));
+ UIConfiguration::instance().color ("midi note selected")));
resize_data->resize_rect = resize_rect;
_resize_data.push_back(resize_data);
trackview.editor().internal_editing() ? "editable region" :
"midi frame base");
if (_selected) {
- return ARDOUR_UI::config()->color_mod ("selected region base", mod_name);
- } else if ((!ARDOUR_UI::config()->get_show_name_highlight() || high_enough_for_name) &&
- !ARDOUR_UI::config()->get_color_regions_using_track_color()) {
- return ARDOUR_UI::config()->color_mod ("midi frame base", mod_name);
+ return UIConfiguration::instance().color_mod ("selected region base", mod_name);
+ } else if ((!UIConfiguration::instance().get_show_name_highlight() || high_enough_for_name) &&
+ !UIConfiguration::instance().get_color_regions_using_track_color()) {
+ return UIConfiguration::instance().color_mod ("midi frame base", mod_name);
}
- return ARDOUR_UI::config()->color_mod (fill_color, mod_name);
+ return UIConfiguration::instance().color_mod (fill_color, mod_name);
}
void
#include "ardour/session.h"
#include "ardour/smf_source.h"
-#include "ardour_ui.h"
#include "gui_thread.h"
#include "midi_region_view.h"
#include "midi_streamview.h"
#include "region_view.h"
#include "rgb_macros.h"
#include "selection.h"
+#include "ui_config.h"
#include "utils.h"
#include "i18n.h"
color_handler ();
- UIConfiguration::ColorsChanged.connect(sigc::mem_fun(*this, &MidiStreamView::color_handler));
+ UIConfiguration::instance().ColorsChanged.connect(sigc::mem_fun(*this, &MidiStreamView::color_handler));
note_range_adjustment.set_page_size(_highest_note - _lowest_note);
note_range_adjustment.set_value(_lowest_note);
*/
if (i <= highest_note()) {
- _note_lines->add (y, 1.0, ARDOUR_UI::config()->color ("piano roll black outline"));
+ _note_lines->add (y, 1.0, UIConfiguration::instance().color ("piano roll black outline"));
}
/* now add a thicker line/bar which covers the entire vertical
case 6:
case 8:
case 10:
- color = ARDOUR_UI::config()->color_mod ("piano roll black", "piano roll black");
+ color = UIConfiguration::instance().color_mod ("piano roll black", "piano roll black");
break;
default:
- color = ARDOUR_UI::config()->color_mod ("piano roll white", "piano roll white");
+ color = UIConfiguration::instance().color_mod ("piano roll white", "piano roll white");
break;
}
_trackview.session()->record_status() == Session::Recording &&
_trackview.track()->record_enabled()) {
- if (ARDOUR_UI::config()->get_show_waveforms_while_recording() && rec_regions.size() == rec_rects.size()) {
+ if (UIConfiguration::instance().get_show_waveforms_while_recording() && rec_regions.size() == rec_rects.size()) {
/* add a new region, but don't bother if they set show-waveforms-while-recording mid-record */
draw_note_lines ();
if (_trackview.is_midi_track()) {
- canvas_rect->set_fill_color (ARDOUR_UI::config()->color_mod ("midi track base", "midi track base"));
+ canvas_rect->set_fill_color (UIConfiguration::instance().color_mod ("midi track base", "midi track base"));
} else {
- canvas_rect->set_fill_color (ARDOUR_UI::config()->color ("midi bus base"));
+ canvas_rect->set_fill_color (UIConfiguration::instance().color ("midi bus base"));
}
}
#include "canvas/colors.h"
-#include "ardour_ui.h"
#include "mixer_group_tabs.h"
#include "mixer_strip.h"
#include "mixer_ui.h"
#include "rgb_macros.h"
#include "route_group_dialog.h"
+#include "ui_config.h"
#include "utils.h"
#include "i18n.h"
if (tab.group && tab.group->is_active()) {
ArdourCanvas::color_to_rgba (tab.color, r, g, b, a);
} else {
- ArdourCanvas::color_to_rgba (ARDOUR_UI::config()->color ("inactive group tab"), r, g, b, a);
+ ArdourCanvas::color_to_rgba (UIConfiguration::instance().color ("inactive group tab"), r, g, b, a);
}
a = 1.0;
#include "gui_thread.h"
#include "route_group_menu.h"
#include "meter_patterns.h"
+#include "ui_config.h"
#include "i18n.h"
_comment_button.signal_clicked.connect (sigc::mem_fun (*this, &RouteUI::toggle_comment_editor));
// TODO implement ArdourKnob::on_size_request properly
-#define PX_SCALE(px) std::max((float)px, rintf((float)px * ARDOUR_UI::config()->get_ui_scale()))
+#define PX_SCALE(px) std::max((float)px, rintf((float)px * UIConfiguration::instance().get_ui_scale()))
trim_control.set_size_request (PX_SCALE(19), PX_SCALE(19));
#undef PX_SCALE
trim_control.set_tooltip_prefix (_("Trim: "));
_visibility.add (&_comment_button, X_("Comments"), _("Comments"), false);
parameter_changed (X_("mixer-element-visibility"));
- ARDOUR_UI::config()->ParameterChanged.connect (sigc::mem_fun (*this, &MixerStrip::parameter_changed));
+ UIConfiguration::instance().ParameterChanged.connect (sigc::mem_fun (*this, &MixerStrip::parameter_changed));
Config->ParameterChanged.connect (_config_connection, MISSING_INVALIDATOR, boost::bind (&MixerStrip::parameter_changed, this, _1), gui_context());
_session->config.ParameterChanged.connect (_config_connection, MISSING_INVALIDATOR, boost::bind (&MixerStrip::parameter_changed, this, _1), gui_context());
set_button_names ();
- const float scale = std::max(1.f, ARDOUR_UI::config()->get_ui_scale());
+ const float scale = std::max(1.f, UIConfiguration::instance().get_ui_scale());
switch (w) {
case Wide:
/* The user has made changes to the mixer strip visibility, so get
our VisibilityGroup to reflect these changes in our widgets.
*/
- _visibility.set_state (ARDOUR_UI::config()->get_mixer_strip_visibility ());
+ _visibility.set_state (UIConfiguration::instance().get_mixer_strip_visibility ());
}
else if (p == "track-name-number") {
name_changed ();
#include "gui_thread.h"
#include "mixer_group_tabs.h"
#include "timers.h"
+#include "ui_config.h"
#include "i18n.h"
, track_menu (0)
, _monitor_section (0)
, _plugin_selector (0)
- , _strip_width (ARDOUR_UI::config()->get_default_narrow_ms() ? Narrow : Wide)
+ , _strip_width (UIConfiguration::instance().get_default_narrow_ms() ? Narrow : Wide)
, ignore_reorder (false)
, _in_group_rebuild_or_clear (false)
, _route_deletion_in_progress (false)
strip = new MixerStrip (*this, _session, route);
strips.push_back (strip);
- ARDOUR_UI::config()->get_default_narrow_ms() ? _strip_width = Narrow : _strip_width = Wide;
+ UIConfiguration::instance().get_default_narrow_ms() ? _strip_width = Narrow : _strip_width = Wide;
if (strip->width_owner() != strip) {
strip->set_width_enum (_strip_width, this);
_group_tabs->hide ();
}
} else if (p == "default-narrow_ms") {
- bool const s = ARDOUR_UI::config()->get_default_narrow_ms ();
+ bool const s = UIConfiguration::instance().get_default_narrow_ms ();
for (list<MixerStrip*>::iterator i = strips.begin(); i != strips.end(); ++i) {
(*i)->set_width_enum (s ? Narrow : Wide, this);
}
Glib::RefPtr<ActionGroup> MonitorSection::monitor_actions;
-#define PX_SCALE(px) std::max((float)px, rintf((float)px * ARDOUR_UI::config()->get_ui_scale()))
+#define PX_SCALE(px) std::max((float)px, rintf((float)px * UIConfiguration::instance().get_ui_scale()))
MonitorSection::MonitorSection (Session* s)
: AxisView (s)
#include "ardour/panner.h"
#include "ardour/panner_shell.h"
-#include "ardour_ui.h"
#include "mono_panner.h"
#include "mono_panner_editor.h"
#include "rgb_macros.h"
+#include "ui_config.h"
#include "utils.h"
#include "i18n.h"
if (!have_font) {
Pango::FontDescription font;
Pango::AttrFontDesc* font_attr;
- font = Pango::FontDescription (ARDOUR_UI::config()->get_SmallBoldMonospaceFont());
+ font = Pango::FontDescription (UIConfiguration::instance().get_SmallBoldMonospaceFont());
font_attr = new Pango::AttrFontDesc (Pango::Attribute::create_attr_font_desc (font));
panner_font_attributes.change(*font_attr);
delete font_attr;
_panner_shell->Changed.connect (panshell_connections, invalidator (*this), boost::bind (&MonoPanner::bypass_handler, this), gui_context());
_panner_shell->PannableChanged.connect (panshell_connections, invalidator (*this), boost::bind (&MonoPanner::pannable_handler, this), gui_context());
- UIConfiguration::ColorsChanged.connect (sigc::mem_fun (*this, &MonoPanner::color_handler));
+ UIConfiguration::instance().ColorsChanged.connect (sigc::mem_fun (*this, &MonoPanner::color_handler));
set_tooltip ();
}
const int lr_box_size = height - 2 * step_down;
const int pos_box_size = (int)(rint(step_down * .8)) | 1;
const int top_step = step_down - pos_box_size;
- const double corner_radius = 5 * ARDOUR_UI::config()->get_ui_scale();
+ const double corner_radius = 5 * UIConfiguration::instance().get_ui_scale();
o = colors.outline;
f = colors.fill;
}
if (_send_mode) {
- b = ARDOUR_UI::config()->color ("send bg");
+ b = UIConfiguration::instance().color ("send bg");
}
/* background */
context->set_source_rgba (UINT_RGBA_R_FLT(b), UINT_RGBA_G_FLT(b), UINT_RGBA_B_FLT(b), UINT_RGBA_A_FLT(b));
context->set_line_width (2.0);
context->move_to (spos + (pos_box_size/2.0), top_step); /* top right */
context->rel_line_to (0.0, pos_box_size); /* lower right */
- context->rel_line_to (-pos_box_size/2.0, 4.0 * ARDOUR_UI::config()->get_ui_scale()); /* bottom point */
- context->rel_line_to (-pos_box_size/2.0, -4.0 * ARDOUR_UI::config()->get_ui_scale()); /* lower left */
+ context->rel_line_to (-pos_box_size/2.0, 4.0 * UIConfiguration::instance().get_ui_scale()); /* bottom point */
+ context->rel_line_to (-pos_box_size/2.0, -4.0 * UIConfiguration::instance().get_ui_scale()); /* lower left */
context->rel_line_to (0.0, -pos_box_size); /* upper left */
context->close_path ();
/* marker line */
context->set_line_width (1.0);
- context->move_to (spos, 1 + top_step + pos_box_size + 4.0 * ARDOUR_UI::config()->get_ui_scale());
+ context->move_to (spos, 1 + top_step + pos_box_size + 4.0 * UIConfiguration::instance().get_ui_scale());
context->line_to (spos, half_lr_box + step_down + lr_box_size - 1);
context->set_source_rgba (UINT_RGBA_R_FLT(po), UINT_RGBA_G_FLT(po), UINT_RGBA_B_FLT(po), UINT_RGBA_A_FLT(po));
context->stroke ();
void
MonoPanner::set_colors ()
{
- colors.fill = ARDOUR_UI::config()->color_mod ("mono panner fill", "panner fill");
- colors.outline = ARDOUR_UI::config()->color ("mono panner outline");
- colors.text = ARDOUR_UI::config()->color ("mono panner text");
- colors.background = ARDOUR_UI::config()->color ("mono panner bg");
- colors.pos_outline = ARDOUR_UI::config()->color ("mono panner position outline");
- colors.pos_fill = ARDOUR_UI::config()->color_mod ("mono panner position fill", "mono panner position fill");
+ colors.fill = UIConfiguration::instance().color_mod ("mono panner fill", "panner fill");
+ colors.outline = UIConfiguration::instance().color ("mono panner outline");
+ colors.text = UIConfiguration::instance().color ("mono panner text");
+ colors.background = UIConfiguration::instance().color ("mono panner bg");
+ colors.pos_outline = UIConfiguration::instance().color ("mono panner position outline");
+ colors.pos_fill = UIConfiguration::instance().color_mod ("mono panner position fill", "mono panner position fill");
}
void
if (!_text) {
_text = new Text (_item->parent ());
_text->set_ignore_events (true);
- _text->set_color (ARDOUR_UI::config()->color_mod ("midi note velocity text", "midi note velocity text"));
+ _text->set_color (UIConfiguration::instance().color_mod ("midi note velocity text", "midi note velocity text"));
_text->set_alignment (Pango::ALIGN_CENTER);
}
{
// make note change its color if its channel is not marked active
if ( (selection & (1 << _note->channel())) == 0 ) {
- set_fill_color(ARDOUR_UI::config()->color ("midi note inactive channel"));
- set_outline_color(calculate_outline(ARDOUR_UI::config()->color ("midi note inactive channel"),
+ set_fill_color(UIConfiguration::instance().color ("midi note inactive channel"));
+ set_outline_color(calculate_outline(UIConfiguration::instance().color ("midi note inactive channel"),
_selected));
} else {
// set the color according to the notes selection state
{
uint32_t color = _region.midi_stream_view()->get_region_color();
return UINT_INTERPOLATE (UINT_RGBA_CHANGE_A (color, opacity),
- ARDOUR_UI::config()->color ("midi note selected"),
+ UIConfiguration::instance().color ("midi note selected"),
0.5);
}
case ChannelColors:
return UINT_INTERPOLATE (UINT_RGBA_CHANGE_A (NoteBase::midi_channel_colors[_note->channel()], opacity),
- ARDOUR_UI::config()->color ("midi note selected"), 0.5);
+ UIConfiguration::instance().color ("midi note selected"), 0.5);
default:
return meter_style_fill_color(_note->velocity(), selected());
#include "evoral/types.hpp"
#include "rgb_macros.h"
-#include "ardour_ui.h"
#include "ui_config.h"
class Editor;
inline static uint32_t meter_style_fill_color(uint8_t vel, bool selected) {
if (selected) {
- return ARDOUR_UI::config()->color_mod ("midi note selected", "midi note");
+ return UIConfiguration::instance().color_mod ("midi note selected", "midi note");
} else if (vel < 64) {
return UINT_INTERPOLATE(
- ARDOUR_UI::config()->color_mod ("midi note min", "midi note"),
- ARDOUR_UI::config()->color_mod ("midi note mid", "midi note"),
+ UIConfiguration::instance().color_mod ("midi note min", "midi note"),
+ UIConfiguration::instance().color_mod ("midi note mid", "midi note"),
(vel / (double)63.0));
} else {
return UINT_INTERPOLATE(
- ARDOUR_UI::config()->color_mod ("midi note mid", "midi note"),
- ARDOUR_UI::config()->color_mod ("midi note max", "midi note"),
+ UIConfiguration::instance().color_mod ("midi note mid", "midi note"),
+ UIConfiguration::instance().color_mod ("midi note max", "midi note"),
((vel-64) / (double)63.0));
}
}
/// calculate outline colors from fill colors of notes
inline static uint32_t calculate_outline(uint32_t color, bool selected=false) {
if (selected) {
- return ARDOUR_UI::config()->color ("midi note selected outline");
+ return UIConfiguration::instance().color ("midi note selected outline");
} else {
return UINT_INTERPOLATE(color, 0x000000ff, 0.5);
}
#include "canvas/colors.h"
-#include "ardour_ui.h"
#include "panner2d.h"
#include "keyboard.h"
#include "gui_thread.h"
#include "rgb_macros.h"
#include "utils.h"
#include "public_editor.h"
+#include "ui_config.h"
#include "i18n.h"
have_colors = true;
}
- UIConfiguration::ColorsChanged.connect (sigc::mem_fun (*this, &Panner2d::color_handler));
+ UIConfiguration::instance().ColorsChanged.connect (sigc::mem_fun (*this, &Panner2d::color_handler));
panner_shell->Changed.connect (panshell_connections, invalidator (*this), boost::bind (&Panner2d::handle_state_change, this), gui_context());
Panner2d::set_colors ()
{
// TODO get all colors from theme, resolve dups
- colors.background = ARDOUR_UI::config()->color ("mono panner bg");
+ colors.background = UIConfiguration::instance().color ("mono panner bg");
colors.crosshairs = 0x4884a9ff; // 0.282, 0.517, 0.662, 1.0
colors.signalcircle_border = 0x84c5e1ff; // 0.517, 0.772, 0.882, 1.0
colors.signalcircle = 0x4884a9ff; // 0.282, 0.517, 0.662, 1.0 // also used with a = 0.9
uint32_t bg = colors.background;
if (_send_mode) {
- bg = ARDOUR_UI::config()->color ("send bg");
+ bg = UIConfiguration::instance().color ("send bg");
}
if (!panner_shell->bypassed()) {
return;
}
- const float scale = std::max (1.f, ARDOUR_UI::config()->get_ui_scale());
+ const float scale = std::max (1.f, UIConfiguration::instance().get_ui_scale());
if (_current_uri == "http://ardour.org/plugin/panner_2in2out#ui")
{
#include "canvas/debug.h"
-#include "ardour_ui.h"
#include "editor.h"
#include "editor_drag.h"
#include "midi_region_view.h"
#include "patch_change.h"
+#include "ui_config.h"
using namespace MIDI::Name;
using namespace std;
_flag = new ArdourCanvas::Flag (
parent,
height,
- ARDOUR_UI::config()->color ("midi patch change outline"),
- ARDOUR_UI::config()->color_mod ("midi patch change fill", "midi patch change fill"),
+ UIConfiguration::instance().color ("midi patch change outline"),
+ UIConfiguration::instance().color_mod ("midi patch change fill", "midi patch change fill"),
ArdourCanvas::Duple (x, y),
true);
CANVAS_DEBUG_NAME (_flag, text);
_flag->Event.connect (sigc::mem_fun (*this, &PatchChange::event_handler));
- _flag->set_font_description (ARDOUR_UI::config()->get_SmallFont());
+ _flag->set_font_description (UIConfiguration::instance().get_SmallFont());
_flag->set_text(text);
}
#include "ardour/audio_buffer.h"
#include "ardour/data_type.h"
#include "ardour/chan_mapping.h"
+#include "ardour/plugin_insert.h"
#include "ardour/session.h"
#include "plugin_eq_gui.h"
ProcessorEntry::Control::Control (boost::shared_ptr<AutomationControl> c, string const & n)
: _control (c)
, _adjustment (gain_to_slider_position_with_max (1.0, Config->get_max_gain()), 0, 1, 0.01, 0.1)
- , _slider (&_adjustment, boost::shared_ptr<PBD::Controllable>(), 0, max(13.f, rintf(13.f * ARDOUR_UI::config()->get_ui_scale())))
+ , _slider (&_adjustment, boost::shared_ptr<PBD::Controllable>(), 0, max(13.f, rintf(13.f * UIConfiguration::instance().get_ui_scale())))
, _slider_persistant_tooltip (&_slider)
, _button (ArdourButton::led_default_elements)
, _ignore_ui_adjustment (false)
if (_plugin_insert->splitting () || in != sinks)
{
- _routing_icon.set_size_request (-1, std::max (7.f, rintf(7.f * ARDOUR_UI::config()->get_ui_scale())));
+ _routing_icon.set_size_request (-1, std::max (7.f, rintf(7.f * UIConfiguration::instance().get_ui_scale())));
_routing_icon.set_visible(true);
_input_icon.show();
} else {
ProcessorEntry::PortIcon::PortIcon(bool input) {
_input = input;
_ports = ARDOUR::ChanCount(ARDOUR::DataType::AUDIO, 1);
- set_size_request (-1, std::max (2.f, rintf(2.f * ARDOUR_UI::config()->get_ui_scale())));
+ set_size_request (-1, std::max (2.f, rintf(2.f * UIConfiguration::instance().get_ui_scale())));
}
bool
cairo_rectangle (cr, 0, 0, width, height);
cairo_fill (cr);
- const double dx = rint(max(2., 2. * ARDOUR_UI::config()->get_ui_scale()));
+ const double dx = rint(max(2., 2. * UIConfiguration::instance().get_ui_scale()));
if (_ports.n_total() > 1) {
for (uint32_t i = 0; i < _ports.n_total(); ++i) {
if (i < _ports.n_midi()) {
cairo_rectangle (cr, ev->area.x, ev->area.y, ev->area.width, ev->area.height);
cairo_clip (cr);
- cairo_set_line_width (cr, max (1.f, ARDOUR_UI::config()->get_ui_scale()));
+ cairo_set_line_width (cr, max (1.f, UIConfiguration::instance().get_ui_scale()));
cairo_set_line_cap (cr, CAIRO_LINE_CAP_ROUND);
Gtk::Allocation a = get_allocation();
cairo_curve_to (cr, si_x, 0, si_x0, height, si_x0, 0);
cairo_stroke (cr);
} else if (midi_sources == 0 && midi_sinks == 1) {
- const double dx = 1 + rint(max(2., 2. * ARDOUR_UI::config()->get_ui_scale()));
+ const double dx = 1 + rint(max(2., 2. * UIConfiguration::instance().get_ui_scale()));
// draw "T"
// TODO connect back to track-input of last midi-out if any, otherwise draw "X"
const float si_x = rintf(width * .2f) + .5f;
#include "canvas/wave_view.h"
-#include "ardour_ui.h"
#include "ardour_window.h"
#include "ardour_dialog.h"
#include "gui_thread.h"
class FontScalingOptions : public OptionEditorBox
{
public:
- FontScalingOptions (UIConfiguration* uic) :
- _ui_config (uic),
+ FontScalingOptions () :
_dpi_adjustment (100, 50, 250, 1, 5),
_dpi_slider (_dpi_adjustment)
{
- _dpi_adjustment.set_value (_ui_config->get_font_scale() / 1024.);
+ _dpi_adjustment.set_value (UIConfiguration::instance().get_font_scale() / 1024.);
Label* l = manage (new Label (_("GUI and Font scaling:")));
l->set_name ("OptionsLabel");
void parameter_changed (string const & p)
{
if (p == "font-scale") {
- _dpi_adjustment.set_value (_ui_config->get_font_scale() / 1024.);
+ _dpi_adjustment.set_value (UIConfiguration::instance().get_font_scale() / 1024.);
}
}
void dpi_changed ()
{
- _ui_config->set_font_scale ((long) floor (_dpi_adjustment.get_value() * 1024.));
+ UIConfiguration::instance().set_font_scale ((long) floor (_dpi_adjustment.get_value() * 1024.));
/* XXX: should be triggered from the parameter changed signal */
- _ui_config->reset_dpi ();
+ UIConfiguration::instance().reset_dpi ();
}
- UIConfiguration* _ui_config;
Adjustment _dpi_adjustment;
HScale _dpi_slider;
};
class ClipLevelOptions : public OptionEditorBox
{
public:
- ClipLevelOptions (UIConfiguration* c)
- : _ui_config (c)
- , _clip_level_adjustment (-.5, -50.0, 0.0, 0.1, 1.0) /* units of dB */
+ ClipLevelOptions ()
+ : _clip_level_adjustment (-.5, -50.0, 0.0, 0.1, 1.0) /* units of dB */
, _clip_level_slider (_clip_level_adjustment)
{
- _clip_level_adjustment.set_value (_ui_config->get_waveform_clip_level ());
+ _clip_level_adjustment.set_value (UIConfiguration::instance().get_waveform_clip_level ());
Label* l = manage (new Label (_("Waveform Clip Level (dBFS):")));
l->set_name ("OptionsLabel");
void parameter_changed (string const & p)
{
if (p == "waveform-clip-level") {
- _clip_level_adjustment.set_value (_ui_config->get_waveform_clip_level());
+ _clip_level_adjustment.set_value (UIConfiguration::instance().get_waveform_clip_level());
}
}
void clip_level_changed ()
{
- _ui_config->set_waveform_clip_level (_clip_level_adjustment.get_value());
+ UIConfiguration::instance().set_waveform_clip_level (_clip_level_adjustment.get_value());
/* XXX: should be triggered from the parameter changed signal */
ArdourCanvas::WaveView::set_clip_level (_clip_level_adjustment.get_value());
}
- UIConfiguration* _ui_config;
Adjustment _clip_level_adjustment;
HScale _clip_level_slider;
};
class PluginOptions : public OptionEditorBox
{
public:
- PluginOptions (RCConfiguration* c, UIConfiguration* uic)
+ PluginOptions (RCConfiguration* c)
: _rc_config (c)
- , _ui_config (uic)
, _display_plugin_scan_progress (_("Always Display Plugin Scan Progress"))
, _discover_vst_on_start (_("Scan for [new] VST Plugins on Application Start"))
, _discover_au_on_start (_("Scan for AudioUnit Plugins on Application Start"))
void parameter_changed (string const & p) {
if (p == "show-plugin-scan-window") {
- bool const x = _ui_config->get_show_plugin_scan_window();
+ bool const x = UIConfiguration::instance().get_show_plugin_scan_window();
_display_plugin_scan_progress.set_active (x);
}
else if (p == "discover-vst-on-start") {
private:
RCConfiguration* _rc_config;
- UIConfiguration* _ui_config;
CheckButton _display_plugin_scan_progress;
CheckButton _discover_vst_on_start;
CheckButton _discover_au_on_start;
void display_plugin_scan_progress_toggled () {
bool const x = _display_plugin_scan_progress.get_active();
- _ui_config->set_show_plugin_scan_window(x);
+ UIConfiguration::instance().set_show_plugin_scan_window(x);
}
void discover_vst_on_start_toggled () {
RCOptionEditor::RCOptionEditor ()
: OptionEditor (Config, string_compose (_("%1 Preferences"), PROGRAM_NAME))
, _rc_config (Config)
- , _ui_config (ARDOUR_UI::config())
, _mixer_strip_visibility ("mixer-element-visibility")
{
/* MISC */
new BoolOption (
"only-copy-imported-files",
_("Always copy imported files"),
- sigc::mem_fun (*_ui_config, &UIConfiguration::get_only_copy_imported_files),
- sigc::mem_fun (*_ui_config, &UIConfiguration::set_only_copy_imported_files)
+ sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_only_copy_imported_files),
+ sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_only_copy_imported_files)
));
add_option (_("Misc"), new DirectoryOption (
new BoolOption (
"draggable-playhead",
_("Allow dragging of playhead"),
- sigc::mem_fun (*ARDOUR_UI::config(), &UIConfiguration::get_draggable_playhead),
- sigc::mem_fun (*ARDOUR_UI::config(), &UIConfiguration::set_draggable_playhead)
+ sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_draggable_playhead),
+ sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_draggable_playhead)
));
add_option (_("Editor"),
new BoolOption (
"show-track-meters",
_("Show meters on tracks in the editor"),
- sigc::mem_fun (*_ui_config, &UIConfiguration::get_show_track_meters),
- sigc::mem_fun (*_ui_config, &UIConfiguration::set_show_track_meters)
+ sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_show_track_meters),
+ sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_show_track_meters)
));
add_option (_("Editor"),
new BoolOption (
"show-editor-meter",
_("Display master-meter in the toolbar"),
- sigc::mem_fun (*_ui_config, &UIConfiguration::get_show_editor_meter),
- sigc::mem_fun (*_ui_config, &UIConfiguration::set_show_editor_meter)
+ sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_show_editor_meter),
+ sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_show_editor_meter)
));
ComboOption<FadeShape>* fadeshape = new ComboOption<FadeShape> (
new BoolOption (
"rubberbanding-snaps-to-grid",
_("Make rubberband selection rectangle snap to the grid"),
- sigc::mem_fun (*_ui_config, &UIConfiguration::get_rubberbanding_snaps_to_grid),
- sigc::mem_fun (*_ui_config, &UIConfiguration::set_rubberbanding_snaps_to_grid)
+ sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_rubberbanding_snaps_to_grid),
+ sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_rubberbanding_snaps_to_grid)
));
add_option (_("Editor"),
new BoolOption (
"show-waveforms",
_("Show waveforms in regions"),
- sigc::mem_fun (*_ui_config, &UIConfiguration::get_show_waveforms),
- sigc::mem_fun (*_ui_config, &UIConfiguration::set_show_waveforms)
+ sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_show_waveforms),
+ sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_show_waveforms)
));
add_option (_("Editor"),
_("Show gain envelopes in audio regions"),
_("in all modes"),
_("only in Draw and Internal Edit modes"),
- sigc::mem_fun (*_ui_config, &UIConfiguration::get_show_region_gain),
- sigc::mem_fun (*_ui_config, &UIConfiguration::set_show_region_gain)
+ sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_show_region_gain),
+ sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_show_region_gain)
));
ComboOption<WaveformScale>* wfs = new ComboOption<WaveformScale> (
"waveform-scale",
_("Waveform scale"),
- sigc::mem_fun (*_ui_config, &UIConfiguration::get_waveform_scale),
- sigc::mem_fun (*_ui_config, &UIConfiguration::set_waveform_scale)
+ sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_waveform_scale),
+ sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_waveform_scale)
);
wfs->add (Linear, _("linear"));
ComboOption<WaveformShape>* wfsh = new ComboOption<WaveformShape> (
"waveform-shape",
_("Waveform shape"),
- sigc::mem_fun (*_ui_config, &UIConfiguration::get_waveform_shape),
- sigc::mem_fun (*_ui_config, &UIConfiguration::set_waveform_shape)
+ sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_waveform_shape),
+ sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_waveform_shape)
);
wfsh->add (Traditional, _("traditional"));
add_option (_("Editor"), wfsh);
- add_option (_("Editor"), new ClipLevelOptions (_ui_config));
+ add_option (_("Editor"), new ClipLevelOptions ());
add_option (_("Editor"),
new BoolOption (
"show-waveforms-while-recording",
_("Show waveforms for audio while it is being recorded"),
- sigc::mem_fun (*_ui_config, &UIConfiguration::get_show_waveforms_while_recording),
- sigc::mem_fun (*_ui_config, &UIConfiguration::set_show_waveforms_while_recording)
+ sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_show_waveforms_while_recording),
+ sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_show_waveforms_while_recording)
));
add_option (_("Editor"),
new BoolOption (
"show-zoom-tools",
_("Show zoom toolbar"),
- sigc::mem_fun (*_ui_config, &UIConfiguration::get_show_zoom_tools),
- sigc::mem_fun (*_ui_config, &UIConfiguration::set_show_zoom_tools)
+ sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_show_zoom_tools),
+ sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_show_zoom_tools)
));
add_option (_("Editor"),
new BoolOption (
"update-editor-during-summary-drag",
_("Update editor window during drags of the summary"),
- sigc::mem_fun (*_ui_config, &UIConfiguration::get_update_editor_during_summary_drag),
- sigc::mem_fun (*_ui_config, &UIConfiguration::set_update_editor_during_summary_drag)
+ sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_update_editor_during_summary_drag),
+ sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_update_editor_during_summary_drag)
));
bo = new BoolOption (
"name-new-markers",
_("Name new markers"),
- sigc::mem_fun (*_ui_config, &UIConfiguration::get_name_new_markers),
- sigc::mem_fun (*_ui_config, &UIConfiguration::set_name_new_markers)
+ sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_name_new_markers),
+ sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_name_new_markers)
);
add_option (_("Editor"), bo);
new BoolOption (
"autoscroll-editor",
_("Auto-scroll editor window when dragging near its edges"),
- sigc::mem_fun (*_ui_config, &UIConfiguration::get_autoscroll_editor),
- sigc::mem_fun (*_ui_config, &UIConfiguration::set_autoscroll_editor)
+ sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_autoscroll_editor),
+ sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_autoscroll_editor)
));
ComboOption<RegionSelectionAfterSplit> *rsas = new ComboOption<RegionSelectionAfterSplit> (
new BoolOption (
"never-display-periodic-midi",
_("Never display periodic MIDI messages (MTC, MIDI Clock)"),
- sigc::mem_fun (*_ui_config, &UIConfiguration::get_never_display_periodic_midi),
- sigc::mem_fun (*_ui_config, &UIConfiguration::set_never_display_periodic_midi)
+ sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_never_display_periodic_midi),
+ sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_never_display_periodic_midi)
));
add_option (_("MIDI"),
new BoolOption (
"sound-midi-notes",
_("Sound MIDI notes as they are selected"),
- sigc::mem_fun (*_ui_config, &UIConfiguration::get_sound_midi_notes),
- sigc::mem_fun (*_ui_config, &UIConfiguration::set_sound_midi_notes)
+ sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_sound_midi_notes),
+ sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_sound_midi_notes)
));
add_option (_("MIDI"), new OptionEditorHeading (_("Midi Audition")));
#if (defined WINDOWS_VST_SUPPORT || defined LXVST_SUPPORT || defined AUDIOUNIT_SUPPORT)
/* Plugin options (currrently VST only) */
- add_option (_("Plugins"), new PluginOptions (_rc_config, _ui_config));
+ add_option (_("Plugins"), new PluginOptions (_rc_config));
#endif
/* INTERFACE */
BoolOption* bgc = new BoolOption (
"cairo-image-surface",
_("Disable Graphics Hardware Acceleration (requires restart)"),
- sigc::mem_fun (*_ui_config, &UIConfiguration::get_cairo_image_surface),
- sigc::mem_fun (*_ui_config, &UIConfiguration::set_cairo_image_surface)
+ sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_cairo_image_surface),
+ sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_cairo_image_surface)
);
Gtkmm2ext::UI::instance()->set_tip (bgc->tip_widget(), string_compose (
BoolOption* bgo = new BoolOption (
"buggy-gradients",
_("Possibly improve slow graphical performance (requires restart)"),
- sigc::mem_fun (*_ui_config, &UIConfiguration::get_buggy_gradients),
- sigc::mem_fun (*_ui_config, &UIConfiguration::set_buggy_gradients)
+ sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_buggy_gradients),
+ sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_buggy_gradients)
);
Gtkmm2ext::UI::instance()->set_tip (bgo->tip_widget(), string_compose (_("Disables hardware gradient rendering on buggy video drivers (\"buggy gradients patch\").\nThis requires restarting %1 before having an effect"), PROGRAM_NAME));
new BoolOption (
"widget-prelight",
_("Graphically indicate mouse pointer hovering over various widgets"),
- sigc::mem_fun (*_ui_config, &UIConfiguration::get_widget_prelight),
- sigc::mem_fun (*_ui_config, &UIConfiguration::set_widget_prelight)
+ sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_widget_prelight),
+ sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_widget_prelight)
));
#ifdef TOOLTIPS_GOT_FIXED
new BoolOption (
"use-tooltips",
_("Show tooltips if mouse hovers over a control"),
- sigc::mem_fun (*_ui_config, &UIConfiguration::get_use_tooltips),
- sigc::mem_fun (*_ui_config, &UIConfiguration::set_use_tooltips)
+ sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_use_tooltips),
+ sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_use_tooltips)
));
#endif
new BoolOption (
"show-name-highlight",
_("Use name highlight bars in region displays (requires a restart)"),
- sigc::mem_fun (*_ui_config, &UIConfiguration::get_show_name_highlight),
- sigc::mem_fun (*_ui_config, &UIConfiguration::set_show_name_highlight)
+ sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_show_name_highlight),
+ sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_show_name_highlight)
));
#ifndef GTKOSX
/* font scaling does nothing with GDK/Quartz */
- add_option (S_("Preferences|GUI"), new FontScalingOptions (_ui_config));
+ add_option (S_("Preferences|GUI"), new FontScalingOptions ());
#endif
add_option (S_("GUI"),
new BoolOption (
"super-rapid-clock-update",
_("update transport clock display at FPS instead of every 100ms"),
- sigc::mem_fun (*_ui_config, &UIConfiguration::get_super_rapid_clock_update),
- sigc::mem_fun (*_ui_config, &UIConfiguration::set_super_rapid_clock_update)
+ sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_super_rapid_clock_update),
+ sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_super_rapid_clock_update)
));
HSliderOption *sics = new HSliderOption("waveform-cache-size",
_("Waveform image cache size (megabytes)"),
ics,
- sigc::mem_fun (*ARDOUR_UI::config(), &UIConfiguration::get_waveform_cache_size),
- sigc::mem_fun (*ARDOUR_UI::config(), &UIConfiguration::set_waveform_cache_size)
+ sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_waveform_cache_size),
+ sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_waveform_cache_size)
);
sics->scale().set_digits (0);
Gtkmm2ext::UI::instance()->set_tip
HSliderOption *slts = new HSliderOption("lock-gui-after-seconds",
_("Lock timeout (seconds)"),
lts,
- sigc::mem_fun (*ARDOUR_UI::config(), &UIConfiguration::get_lock_gui_after_seconds),
- sigc::mem_fun (*ARDOUR_UI::config(), &UIConfiguration::set_lock_gui_after_seconds)
+ sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_lock_gui_after_seconds),
+ sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_lock_gui_after_seconds)
);
slts->scale().set_digits (0);
Gtkmm2ext::UI::instance()->set_tip
new VisibilityOption (
_("Mixer Strip"),
&_mixer_strip_visibility,
- sigc::mem_fun (*_ui_config, &UIConfiguration::get_mixer_strip_visibility),
- sigc::mem_fun (*_ui_config, &UIConfiguration::set_mixer_strip_visibility)
+ sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_mixer_strip_visibility),
+ sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_mixer_strip_visibility)
)
);
new BoolOption (
"default-narrow_ms",
_("Use narrow strips in the mixer by default"),
- sigc::mem_fun (*_ui_config, &UIConfiguration::get_default_narrow_ms),
- sigc::mem_fun (*_ui_config, &UIConfiguration::set_default_narrow_ms)
+ sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_default_narrow_ms),
+ sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_default_narrow_ms)
));
add_option (S_("Preferences|Metering"), new OptionEditorHeading (_("Metering")));
ComboOption<float>* mht = new ComboOption<float> (
"meter-hold",
_("Peak hold time"),
- sigc::mem_fun (*_ui_config, &UIConfiguration::get_meter_hold),
- sigc::mem_fun (*_ui_config, &UIConfiguration::set_meter_hold)
+ sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_meter_hold),
+ sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_meter_hold)
);
mht->add (MeterHoldOff, _("off"));
ComboOption<MeterLineUp>* mlu = new ComboOption<MeterLineUp> (
"meter-line-up-level",
_("Meter line-up level; 0dBu"),
- sigc::mem_fun (*_ui_config, &UIConfiguration::get_meter_line_up_level),
- sigc::mem_fun (*_ui_config, &UIConfiguration::set_meter_line_up_level)
+ sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_meter_line_up_level),
+ sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_meter_line_up_level)
);
mlu->add (MeteringLineUp24, _("-24dBFS (SMPTE US: 4dBu = -20dBFS)"));
ComboOption<MeterLineUp>* mld = new ComboOption<MeterLineUp> (
"meter-line-up-din",
_("IEC1/DIN Meter line-up level; 0dBu"),
- sigc::mem_fun (*_ui_config, &UIConfiguration::get_meter_line_up_din),
- sigc::mem_fun (*_ui_config, &UIConfiguration::set_meter_line_up_din)
+ sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_meter_line_up_din),
+ sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_meter_line_up_din)
);
mld->add (MeteringLineUp24, _("-24dBFS (SMPTE US: 4dBu = -20dBFS)"));
ComboOption<VUMeterStandard>* mvu = new ComboOption<VUMeterStandard> (
"meter-vu-standard",
_("VU Meter standard"),
- sigc::mem_fun (*_ui_config, &UIConfiguration::get_meter_vu_standard),
- sigc::mem_fun (*_ui_config, &UIConfiguration::set_meter_vu_standard)
+ sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_meter_vu_standard),
+ sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_meter_vu_standard)
);
mvu->add (MeteringVUfrench, _("0VU = -2dBu (France)"));
HSliderOption *mpks = new HSliderOption("meter-peak",
_("Peak threshold [dBFS]"),
mpk,
- sigc::mem_fun (*_ui_config, &UIConfiguration::get_meter_peak),
- sigc::mem_fun (*_ui_config, &UIConfiguration::set_meter_peak)
+ sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_meter_peak),
+ sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_meter_peak)
);
new BoolOption (
"meter-style-led",
_("LED meter style"),
- sigc::mem_fun (*_ui_config, &UIConfiguration::get_meter_style_led),
- sigc::mem_fun (*_ui_config, &UIConfiguration::set_meter_style_led)
+ sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_meter_style_led),
+ sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_meter_style_led)
));
/* and now the theme manager */
void parameter_changed (std::string const &);
void ltc_generator_volume_changed ();
ARDOUR::RCConfiguration* _rc_config;
- UIConfiguration* _ui_config;
BoolOption* _solo_control_is_listen_control;
ComboOption<ARDOUR::ListenPosition>* _listen_position;
VisibilityGroup _mixer_strip_visibility;
#include "canvas/utils.h"
#include "canvas/colors.h"
-#include "ardour_ui.h"
#include "streamview.h"
#include "region_view.h"
#include "automation_region_view.h"
set_colors ();
- UIConfiguration::ColorsChanged.connect (sigc::mem_fun (*this, &RegionView::color_handler));
+ UIConfiguration::instance().ColorsChanged.connect (sigc::mem_fun (*this, &RegionView::color_handler));
/* XXX sync mark drag? */
}
return;
}
- uint32_t const color = ARDOUR_UI::config()->color_mod ("silence", "silence");
+ uint32_t const color = UIConfiguration::instance().color_mod ("silence", "silence");
for (AudioIntervalResult::const_iterator i = silences.begin(); i != silences.end(); ++i) {
_silence_text = new ArdourCanvas::Text (group);
_silence_text->set_ignore_events (true);
_silence_text->set_font_description (get_font_for_style (N_("SilenceText")));
- _silence_text->set_color (ARDOUR_UI::config()->color ("silence text"));
+ _silence_text->set_color (UIConfiguration::instance().color ("silence text"));
/* both positions are relative to the region start offset in source */
RegionView::set_sync_mark_color ()
{
if (sync_mark) {
- ArdourCanvas::Color c = ARDOUR_UI::config()->color ("sync mark");
+ ArdourCanvas::Color c = UIConfiguration::instance().color ("sync mark");
sync_mark->set_fill_color (c);
sync_mark->set_outline_color (c);
sync_line->set_outline_color (c);
modname = "transparent region base";
}
- return HSV(f).mod (ARDOUR_UI::config()->modifier (modname)).color ();
+ return HSV(f).mod (UIConfiguration::instance().modifier (modname)).color ();
}
void
bool me = false;
/* the color that will be used to show parts of regions that will not be heard */
- uint32_t const non_playing_color = ARDOUR_UI::config()->color_mod ("covered region", "covered region base");
+ uint32_t const non_playing_color = UIConfiguration::instance().color_mod ("covered region", "covered region base");
while (t < end) {
#include "rgb_macros.h"
#include "selection.h"
#include "streamview.h"
+#include "ui_config.h"
#include "utils.h"
#include "route_group_menu.h"
}
_editor.ZoomChanged.connect (sigc::mem_fun(*this, &RouteTimeAxisView::reset_samples_per_pixel));
- UIConfiguration::ColorsChanged.connect (sigc::mem_fun (*this, &RouteTimeAxisView::color_handler));
+ UIConfiguration::instance().ColorsChanged.connect (sigc::mem_fun (*this, &RouteTimeAxisView::color_handler));
PropertyList* plist = new PropertyList();
if (timestretch_rect == 0) {
timestretch_rect = new ArdourCanvas::Rectangle (canvas_display ());
- timestretch_rect->set_fill_color (ArdourCanvas::HSV (ARDOUR_UI::config()->color ("time stretch fill")).mod (ARDOUR_UI::config()->modifier ("time stretch fill")).color());
- timestretch_rect->set_outline_color (ARDOUR_UI::config()->color ("time stretch outline"));
+ timestretch_rect->set_fill_color (ArdourCanvas::HSV (UIConfiguration::instance().color ("time stretch fill")).mod (UIConfiguration::instance().modifier ("time stretch fill")).color());
+ timestretch_rect->set_outline_color (UIConfiguration::instance().color ("time stretch outline"));
}
timestretch_rect->show ();
{
//case cTimeStretchOutline:
if (timestretch_rect) {
- timestretch_rect->set_outline_color (ARDOUR_UI::config()->color ("time stretch outline"));
+ timestretch_rect->set_outline_color (UIConfiguration::instance().color ("time stretch outline"));
}
//case cTimeStretchFill:
if (timestretch_rect) {
- timestretch_rect->set_fill_color (ARDOUR_UI::config()->color ("time stretch fill"));
+ timestretch_rect->set_fill_color (UIConfiguration::instance().color ("time stretch fill"));
}
reset_meter();
void
RouteTimeAxisView::reset_meter ()
{
- if (ARDOUR_UI::config()->get_show_track_meters()) {
+ if (UIConfiguration::instance().get_show_track_meters()) {
int meter_width = 3;
if (_route && _route->shared_peak_meter()->input_streams().n_total() == 1) {
meter_width = 6;
{
ENSURE_GUI_THREAD (*this, &RouteTimeAxisView::meter_changed)
reset_meter();
- if (_route && !no_redraw && ARDOUR_UI::config()->get_show_track_meters()) {
+ if (_route && !no_redraw && UIConfiguration::instance().get_show_track_meters()) {
request_redraw ();
}
// reset peak when meter point changes
#include "route_time_axis.h"
#include "group_tabs.h"
#include "timers.h"
+#include "ui_config.h"
#include "ardour/audio_track.h"
#include "ardour/audioengine.h"
rec_enable_button->set_icon (ArdourIcon::RecButton);
UI::instance()->set_tip (rec_enable_button, _("Enable recording on this track"), "");
- if (ARDOUR_UI::config()->get_blink_rec_arm()) {
+ if (UIConfiguration::instance().get_blink_rec_arm()) {
rec_blink_connection = Timers::blink_connect (sigc::mem_fun (*this, &RouteUI::blink_rec_display));
}
update_mute_display ();
update_solo_display ();
- if (!ARDOUR_UI::config()->get_blink_rec_arm()) {
+ if (!UIConfiguration::instance().get_blink_rec_arm()) {
blink_rec_display(true); // set initial rec-en button state
}
case Session::Disabled:
case Session::Enabled:
- if ( ARDOUR_UI::config()->get_blink_rec_arm() )
+ if ( UIConfiguration::instance().get_blink_rec_arm() )
rec_enable_button->set_active_state ( blinkOn ? Gtkmm2ext::ExplicitActive : Gtkmm2ext::Off );
else
rec_enable_button->set_active_state ( ImplicitActive );
} else if (p == "auto-input") {
update_monitoring_display ();
} else if (p == "blink-rec-arm") {
- if (ARDOUR_UI::config()->get_blink_rec_arm()) {
+ if (UIConfiguration::instance().get_blink_rec_arm()) {
rec_blink_connection.disconnect ();
rec_blink_connection = Timers::blink_connect (sigc::mem_fun (*this, &RouteUI::blink_rec_display));
} else {
#include "main_clock.h"
#include "public_editor.h"
#include "timers.h"
+#include "ui_config.h"
#include "sfdb_freesound_mootcher.h"
to do embedding (or if we are importing a MIDI file).
*/
- if (ARDOUR_UI::config()->get_only_copy_imported_files()) {
+ if (UIConfiguration::instance().get_only_copy_imported_files()) {
copy_files_btn.set_sensitive (false);
} else {
copy_files_btn.set_sensitive (false);
* or any file if we are under nsm control */
bool const must_copy = _session->get_nsm_state() || have_a_midi_file || notebook.get_current_page() == 2;
- if (ARDOUR_UI::config()->get_only_copy_imported_files()) {
+ if (UIConfiguration::instance().get_only_copy_imported_files()) {
if (selection_can_be_embedded_with_links && !must_copy) {
copy_files_btn.set_sensitive (true);
//background
pattern = cairo_pattern_create_linear (0, 0, 0, alloc.get_height());
- uint32_t col = ARDOUR_UI::config()->color ("shuttle");
+ uint32_t col = UIConfiguration::instance().color ("shuttle");
int r,b,g,a;
UINT_TO_RGBA(col, &r, &g, &b, &a);
cairo_pattern_add_color_stop_rgb (pattern, 0.0, r/400.0, g/400.0, b/400.0);
cairo_move_to (cr, get_width() - (fabs(extents.x_advance) + 5), text_ypos);
cairo_show_text (cr, buf);
- if (ARDOUR_UI::config()->get_widget_prelight()) {
+ if (UIConfiguration::instance().get_widget_prelight()) {
if (_hovering) {
rounded_rectangle (cr, 1, 1, get_width()-2, get_height()-2, 4.0);
cairo_set_source_rgba (cr, 1, 1, 1, 0.2);
{
_hovering = true;
- if (ARDOUR_UI::config()->get_widget_prelight()) {
+ if (UIConfiguration::instance().get_widget_prelight()) {
queue_draw ();
}
{
_hovering = false;
- if (ARDOUR_UI::config()->get_widget_prelight()) {
+ if (UIConfiguration::instance().get_widget_prelight()) {
queue_draw ();
}
#include "canvas/colors.h"
-#include "ardour_ui.h"
#include "stereo_panner.h"
#include "stereo_panner_editor.h"
#include "rgb_macros.h"
#include "utils.h"
+#include "ui_config.h"
#include "i18n.h"
if (!have_font) {
Pango::FontDescription font;
Pango::AttrFontDesc* font_attr;
- font = Pango::FontDescription (ARDOUR_UI::config()->get_SmallBoldMonospaceFont());
+ font = Pango::FontDescription (UIConfiguration::instance().get_SmallBoldMonospaceFont());
font_attr = new Pango::AttrFontDesc (Pango::Attribute::create_attr_font_desc (font));
panner_font_attributes.change(*font_attr);
delete font_attr;
_panner_shell->Changed.connect (panshell_connections, invalidator (*this), boost::bind (&StereoPanner::bypass_handler, this), gui_context());
_panner_shell->PannableChanged.connect (panshell_connections, invalidator (*this), boost::bind (&StereoPanner::pannable_handler, this), gui_context());
- UIConfiguration::ColorsChanged.connect (sigc::mem_fun (*this, &StereoPanner::color_handler));
+ UIConfiguration::instance().ColorsChanged.connect (sigc::mem_fun (*this, &StereoPanner::color_handler));
set_tooltip ();
}
height = get_height ();
const int step_down = rint(height / 3.5);
- const double corner_radius = 5.0 * ARDOUR_UI::config()->get_ui_scale();
+ const double corner_radius = 5.0 * UIConfiguration::instance().get_ui_scale();
const int lr_box_size = height - 2 * step_down;
const int pos_box_size = (int)(rint(step_down * .8)) | 1;
const int top_step = step_down - pos_box_size;
}
if (_send_mode) {
- b = ARDOUR_UI::config()->color ("send bg");
+ b = UIConfiguration::instance().color ("send bg");
// b = rgba_from_style("SendStripBase",
// UINT_RGBA_R(b), UINT_RGBA_G(b), UINT_RGBA_B(b), 255,
// "fg");
void
StereoPanner::set_colors ()
{
- colors[Normal].fill = ARDOUR_UI::config()->color_mod ("stereo panner fill", "panner fill");
- // colors[Normal].outline = ARDOUR_UI::config()->color ("stereo panner outline");
+ colors[Normal].fill = UIConfiguration::instance().color_mod ("stereo panner fill", "panner fill");
+ // colors[Normal].outline = UIConfiguration::instance().color ("stereo panner outline");
colors[Normal].outline = ArdourCanvas::HSV (colors[Normal].fill).outline().color ();
- colors[Normal].text = ARDOUR_UI::config()->color ("stereo panner text");
- colors[Normal].background = ARDOUR_UI::config()->color ("stereo panner bg");
- colors[Normal].rule = ARDOUR_UI::config()->color ("stereo panner rule");
-
- colors[Mono].fill = ARDOUR_UI::config()->color ("stereo panner mono fill");
- colors[Mono].outline = ARDOUR_UI::config()->color ("stereo panner mono outline");
- colors[Mono].text = ARDOUR_UI::config()->color ("stereo panner mono text");
- colors[Mono].background = ARDOUR_UI::config()->color ("stereo panner mono bg");
- colors[Mono].rule = ARDOUR_UI::config()->color ("stereo panner rule");
-
- colors[Inverted].fill = ARDOUR_UI::config()->color_mod ("stereo panner inverted fill", "stereo panner inverted");
- colors[Inverted].outline = ARDOUR_UI::config()->color ("stereo panner inverted outline");
- colors[Inverted].text = ARDOUR_UI::config()->color ("stereo panner inverted text");
- colors[Inverted].background = ARDOUR_UI::config()->color_mod ("stereo panner inverted bg", "stereo panner inverted bg");
- colors[Inverted].rule = ARDOUR_UI::config()->color ("stereo panner rule");
+ colors[Normal].text = UIConfiguration::instance().color ("stereo panner text");
+ colors[Normal].background = UIConfiguration::instance().color ("stereo panner bg");
+ colors[Normal].rule = UIConfiguration::instance().color ("stereo panner rule");
+
+ colors[Mono].fill = UIConfiguration::instance().color ("stereo panner mono fill");
+ colors[Mono].outline = UIConfiguration::instance().color ("stereo panner mono outline");
+ colors[Mono].text = UIConfiguration::instance().color ("stereo panner mono text");
+ colors[Mono].background = UIConfiguration::instance().color ("stereo panner mono bg");
+ colors[Mono].rule = UIConfiguration::instance().color ("stereo panner rule");
+
+ colors[Inverted].fill = UIConfiguration::instance().color_mod ("stereo panner inverted fill", "stereo panner inverted");
+ colors[Inverted].outline = UIConfiguration::instance().color ("stereo panner inverted outline");
+ colors[Inverted].text = UIConfiguration::instance().color ("stereo panner inverted text");
+ colors[Inverted].background = UIConfiguration::instance().color_mod ("stereo panner inverted bg", "stereo panner inverted bg");
+ colors[Inverted].rule = UIConfiguration::instance().color ("stereo panner rule");
}
void
#include "region_selection.h"
#include "selection.h"
#include "public_editor.h"
-#include "ardour_ui.h"
#include "timers.h"
#include "rgb_macros.h"
#include "gui_thread.h"
+#include "ui_config.h"
#include "utils.h"
#include "i18n.h"
_trackview.session()->RecordStateChanged.connect (*this, invalidator (*this), boost::bind (&StreamView::sess_rec_enable_changed, this), gui_context());
}
- UIConfiguration::ColorsChanged.connect (sigc::mem_fun (*this, &StreamView::color_handler));
+ UIConfiguration::instance().ColorsChanged.connect (sigc::mem_fun (*this, &StreamView::color_handler));
}
StreamView::~StreamView ()
{
const double xstart = _trackview.editor().sample_to_pixel(frame_pos);
const double xend = xstart + width;
- const uint32_t fill_color = ARDOUR_UI::config()->color_mod("recording rect", "recording_rect");
+ const uint32_t fill_color = UIConfiguration::instance().color_mod("recording rect", "recording_rect");
ArdourCanvas::Rectangle* rec_rect = new ArdourCanvas::Rectangle(_canvas_group);
rec_rect->set_x0(xstart);
rec_rect->set_x1(xend);
rec_rect->set_y1(child_height ());
rec_rect->set_outline_what(ArdourCanvas::Rectangle::What(0));
- rec_rect->set_outline_color(ARDOUR_UI::config()->color("recording rect"));
+ rec_rect->set_outline_color(UIConfiguration::instance().color("recording rect"));
rec_rect->set_fill_color(fill_color);
rec_rect->lower_to_bottom();
#include <iostream>
#include "canvas/flag.h"
-#include "ardour_ui.h"
#include "sys_ex.h"
+#include "ui_config.h"
using namespace std;
_flag = new ArdourCanvas::Flag (
parent,
height,
- ARDOUR_UI::config()->color ("midi sysex outline"),
- ARDOUR_UI::config()->color_mod ("midi sysex fill", "midi sysex fill"),
+ UIConfiguration::instance().color ("midi sysex outline"),
+ UIConfiguration::instance().color_mod ("midi sysex fill", "midi sysex fill"),
ArdourCanvas::Duple (x, y)
);
#include "gtkmm2ext/utils.h"
-#include "ardour_ui.h"
#include "tempo_dialog.h"
+#include "ui_config.h"
#include "i18n.h"
Table* table;
- if (ARDOUR_UI::config()->get_allow_non_quarter_pulse()) {
+ if (UIConfiguration::instance().get_allow_non_quarter_pulse()) {
table = manage (new Table (5, 5));
} else {
table = manage (new Table (5, 4));
table->attach (*bpm_label, 0, 1, 0, 1);
table->attach (bpm_spinner, 1, 5, 0, 1);
- if (ARDOUR_UI::config()->get_allow_non_quarter_pulse()) {
+ if (UIConfiguration::instance().get_allow_non_quarter_pulse()) {
table->attach (pulse_selector_label, 0, 1, 1, 2);
table->attach (pulse_selector, 1, 5, 1, 2);
row = 2;
#include "canvas/canvas.h"
#include "canvas/debug.h"
-#include "ardour_ui.h"
+#include "tempo_lines.h"
#include "public_editor.h"
#include "rgb_macros.h"
-#include "tempo_lines.h"
+#include "ui_config.h"
using namespace std;
framecnt_t frame_rate)
{
const double fpb = b->tempo->frames_per_beat(frame_rate);
- const uint32_t base = ARDOUR_UI::config()->color_mod("measure line beat", "measure line beat");
+ const uint32_t base = UIConfiguration::instance().color_mod("measure line beat", "measure line beat");
for (unsigned l = 1; l < divisions; ++l) {
/* find the coarsest division level this tick falls on */
for (i = begin; i != end; ++i) {
if ((*i).is_bar()) {
- color = ARDOUR_UI::config()->color ("measure line bar");
+ color = UIConfiguration::instance().color ("measure line bar");
} else {
if (beat_density > 0.3) {
continue; /* only draw beat lines if the gaps between beats are large. */
}
- color = ARDOUR_UI::config()->color_mod ("measure line beat", "measure line beat");
+ color = UIConfiguration::instance().color_mod ("measure line beat", "measure line beat");
}
ArdourCanvas::Coord xpos = PublicEditor::instance().sample_to_pixel_unrounded ((*i).frame);
void draw (const ARDOUR::TempoMap::BBTPointList::const_iterator& begin,
const ARDOUR::TempoMap::BBTPointList::const_iterator& end,
unsigned divisions,
- framecnt_t leftmost_frame,
- framecnt_t frame_rate);
+ ARDOUR::framecnt_t leftmost_frame,
+ ARDOUR::framecnt_t frame_rate);
void show();
void hide();
private:
void draw_ticks (const ARDOUR::TempoMap::BBTPointList::const_iterator& b,
unsigned divisions,
- framecnt_t leftmost_frame,
- framecnt_t frame_rate);
+ ARDOUR::framecnt_t leftmost_frame,
+ ARDOUR::framecnt_t frame_rate);
ArdourCanvas::LineSet lines;
};
#include "ardour_dialog.h"
#include "theme_manager.h"
#include "rgb_macros.h"
-#include "ardour_ui.h"
+#include "ui_config.h"
#include "utils.h"
#include "i18n.h"
if (icon_sets.size() > 1) {
Gtkmm2ext::set_popdown_strings (icon_set_dropdown, icon_sets);
- icon_set_dropdown.set_active_text (ARDOUR_UI::config()->get_icon_set());
+ icon_set_dropdown.set_active_text (UIConfiguration::instance().get_icon_set());
hbox = Gtk::manage (new Gtk::HBox());
hbox->set_spacing (6);
setup_aliases ();
setup_modifiers ();
- UIConfiguration::ColorsChanged.connect (sigc::mem_fun (*this, &ThemeManager::colors_changed));
+ UIConfiguration::instance().ColorsChanged.connect (sigc::mem_fun (*this, &ThemeManager::colors_changed));
}
ThemeManager::~ThemeManager()
void
ThemeManager::setup_modifiers ()
{
- UIConfiguration* uic (ARDOUR_UI::config());
+ UIConfiguration* uic (&UIConfiguration::instance());
UIConfiguration::Modifiers& modifiers (uic->modifiers);
Gtk::HBox* mod_hbox;
Gtk::Label* mod_label;
double alpha = range->get_value();
SVAModifier svam (SVAModifier::Assign, -1.0, -1.0, alpha);
- ARDOUR_UI::config()->set_modifier (name, svam);
+ UIConfiguration::instance().set_modifier (name, svam);
}
void
void
ThemeManager::on_flat_buttons_toggled ()
{
- ARDOUR_UI::config()->set_flat_buttons (flat_buttons.get_active());
+ UIConfiguration::instance().set_flat_buttons (flat_buttons.get_active());
ArdourButton::set_flat_buttons (flat_buttons.get_active());
/* force a redraw */
gtk_rc_reset_styles (gtk_settings_get_default());
void
ThemeManager::on_blink_rec_arm_toggled ()
{
- ARDOUR_UI::config()->set_blink_rec_arm (blink_rec_button.get_active());
- ARDOUR::Config->ParameterChanged("blink-rec-arm");
+ UIConfiguration::instance().set_blink_rec_arm (blink_rec_button.get_active());
+ UIConfiguration::instance().ParameterChanged("blink-rec-arm");
}
void
ThemeManager::on_region_color_toggled ()
{
- ARDOUR_UI::config()->set_color_regions_using_track_color (region_color_button.get_active());
+ UIConfiguration::instance().set_color_regions_using_track_color (region_color_button.get_active());
}
void
ThemeManager::on_show_clip_toggled ()
{
- ARDOUR_UI::config()->set_show_waveform_clipping (show_clipping_button.get_active());
+ UIConfiguration::instance().set_show_waveform_clipping (show_clipping_button.get_active());
// "show-waveform-clipping" was a session config key
- ArdourCanvas::WaveView::set_global_show_waveform_clipping (ARDOUR_UI::config()->get_show_waveform_clipping());
+ ArdourCanvas::WaveView::set_global_show_waveform_clipping (UIConfiguration::instance().get_show_waveform_clipping());
}
void
ThemeManager::on_all_dialogs_toggled ()
{
- ARDOUR_UI::config()->set_all_floating_windows_are_dialogs (all_dialogs.get_active());
+ UIConfiguration::instance().set_all_floating_windows_are_dialogs (all_dialogs.get_active());
}
void
ThemeManager::on_transients_follow_front_toggled ()
{
- ARDOUR_UI::config()->set_transients_follow_front (transients_follow_front.get_active());
+ UIConfiguration::instance().set_transients_follow_front (transients_follow_front.get_active());
}
void
{
double v = waveform_gradient_depth.get_value();
- ARDOUR_UI::config()->set_waveform_gradient_depth (v);
+ UIConfiguration::instance().set_waveform_gradient_depth (v);
ArdourCanvas::WaveView::set_global_gradient_depth (v);
}
{
double v = timeline_item_gradient_depth.get_value();
- ARDOUR_UI::config()->set_timeline_item_gradient_depth (v);
+ UIConfiguration::instance().set_timeline_item_gradient_depth (v);
}
void
ThemeManager::on_icon_set_changed ()
{
string new_set = icon_set_dropdown.get_active_text();
- ARDOUR_UI::config()->set_icon_set (new_set);
+ UIConfiguration::instance().set_icon_set (new_set);
}
void
{
if (!dark_button.get_active()) return;
- UIConfiguration* uic (ARDOUR_UI::config());
+ UIConfiguration* uic (&UIConfiguration::instance());
uic->set_color_file("dark");
}
{
if (!light_button.get_active()) return;
- UIConfiguration* uic (ARDOUR_UI::config());
+ UIConfiguration* uic (&UIConfiguration::instance());
uic->set_color_file("light");
}
* hence a common combined update function suffices
*/
- if (ARDOUR_UI::config()->get_color_file() == "light") {
+ if (UIConfiguration::instance().get_color_file() == "light") {
light_button.set_active(true);
} else {
dark_button.set_active(true);
/* there is no need to block signal handlers, here,
* all elements check if the value has changed and ignore NOOPs
*/
- all_dialogs.set_active (ARDOUR_UI::config()->get_all_floating_windows_are_dialogs());
- transients_follow_front.set_active (ARDOUR_UI::config()->get_transients_follow_front());
- flat_buttons.set_active (ARDOUR_UI::config()->get_flat_buttons());
- blink_rec_button.set_active (ARDOUR_UI::config()->get_blink_rec_arm());
- region_color_button.set_active (ARDOUR_UI::config()->get_color_regions_using_track_color());
- show_clipping_button.set_active (ARDOUR_UI::config()->get_show_waveform_clipping());
- waveform_gradient_depth.set_value(ARDOUR_UI::config()->get_waveform_gradient_depth());
- timeline_item_gradient_depth.set_value(ARDOUR_UI::config()->get_timeline_item_gradient_depth());
+ all_dialogs.set_active (UIConfiguration::instance().get_all_floating_windows_are_dialogs());
+ transients_follow_front.set_active (UIConfiguration::instance().get_transients_follow_front());
+ flat_buttons.set_active (UIConfiguration::instance().get_flat_buttons());
+ blink_rec_button.set_active (UIConfiguration::instance().get_blink_rec_arm());
+ region_color_button.set_active (UIConfiguration::instance().get_color_regions_using_track_color());
+ show_clipping_button.set_active (UIConfiguration::instance().get_show_waveform_clipping());
+ waveform_gradient_depth.set_value(UIConfiguration::instance().get_waveform_gradient_depth());
+ timeline_item_gradient_depth.set_value(UIConfiguration::instance().get_timeline_item_gradient_depth());
}
void
string basename;
basename = "my-";
- basename += ARDOUR_UI::config()->get_color_file();
+ basename += UIConfiguration::instance().get_color_file();
basename += ".colors";
if (find_file (ardour_config_search_path(), basename, cfile)) {
/* don't really care if it fails */
}
- ARDOUR_UI::config()->load_defaults();
- ARDOUR_UI::config()->save_state ();
+ UIConfiguration::instance().load_defaults();
+ UIConfiguration::instance().save_state ();
set_ui_to_state();
}
/* we want the colors sorted by hue, with their name */
- UIConfiguration::Colors& colors (ARDOUR_UI::config()->colors);
+ UIConfiguration::Colors& colors (UIConfiguration::instance().colors);
vector<NamedColor> nc;
for (UIConfiguration::Colors::const_iterator x = colors.begin(); x != colors.end(); ++x) {
nc.push_back (NamedColor (x->first, HSV (x->second)));
void
ThemeManager::palette_size_request (Gtk::Requisition* req)
{
- uint32_t ncolors = ARDOUR_UI::config()->colors.size();
+ uint32_t ncolors = UIConfiguration::instance().colors.size();
const int box_size = 20;
double c = sqrt ((double)ncolors);
{
using namespace ArdourCanvas;
double r,g, b, a;
- UIConfiguration* uic (ARDOUR_UI::config());
+ UIConfiguration* uic (&UIConfiguration::instance());
ArdourCanvas::Color c = uic->color (name);
Gdk::Color gdkcolor;
color_dialog_connection.disconnect ();
- UIConfiguration* uic (ARDOUR_UI::config());
+ UIConfiguration* uic (&UIConfiguration::instance());
Gdk::Color gdkcolor;
double r,g, b, a;
{
switch (ev->type) {
case GDK_BUTTON_RELEASE:
- ARDOUR_UI::config()->set_alias (target_name, new_alias);
+ UIConfiguration::instance().set_alias (target_name, new_alias);
return true;
break;
default:
case GTK_RESPONSE_REJECT:
/* revert choice */
- ARDOUR_UI::config()->set_alias (target_name, old_alias);
+ UIConfiguration::instance().set_alias (target_name, old_alias);
break;
default:
void
ThemeManager::choose_color_from_palette (string const & name)
{
- UIConfiguration* uic (ARDOUR_UI::config());
+ UIConfiguration* uic (&UIConfiguration::instance());
UIConfiguration::ColorAliases::iterator i = uic->color_aliases.find (name);
if (i == uic->color_aliases.end()) {
{
using namespace ArdourCanvas;
- UIConfiguration* uic (ARDOUR_UI::config());
+ UIConfiguration* uic (&UIConfiguration::instance());
UIConfiguration::ColorAliases& aliases (uic->color_aliases);
alias_list->clear ();
#include "streamview.h"
#include "editor_drag.h"
#include "editor.h"
+#include "ui_config.h"
#include "i18n.h"
void
TimeAxisView::setup_sizes()
{
- name_width_px = ceilf (100.f * ARDOUR_UI::config()->get_ui_scale());
+ name_width_px = ceilf (100.f * UIConfiguration::instance().get_ui_scale());
}
TimeAxisView::TimeAxisView (ARDOUR::Session* sess, PublicEditor& ed, TimeAxisView* rent, Canvas& /*canvas*/)
time_axis_hbox.show();
top_hbox.pack_start (scroomer_placeholder, false, false); // OR pack_end to move after meters ?
- UIConfiguration::ColorsChanged.connect (sigc::mem_fun (*this, &TimeAxisView::color_handler));
+ UIConfiguration::instance().ColorsChanged.connect (sigc::mem_fun (*this, &TimeAxisView::color_handler));
GhostRegion::CatchDeletion.connect (*this, invalidator (*this), boost::bind (&TimeAxisView::erase_ghost, this, _1), gui_context());
}
rect->rect = new ArdourCanvas::Rectangle (selection_group);
CANVAS_DEBUG_NAME (rect->rect, "selection rect");
rect->rect->set_outline (false);
- rect->rect->set_fill_color (ARDOUR_UI::config()->color_mod ("selection rect", "selection rect"));
+ rect->rect->set_fill_color (UIConfiguration::instance().color_mod ("selection rect", "selection rect"));
rect->start_trim = new ArdourCanvas::Rectangle (selection_group);
CANVAS_DEBUG_NAME (rect->start_trim, "selection rect start trim");
for (list<SelectionRect*>::iterator i = used_selection_rects.begin(); i != used_selection_rects.end(); ++i) {
- (*i)->rect->set_fill_color (ARDOUR_UI::config()->color_mod ("selection rect", "selection rect"));
- (*i)->rect->set_outline_color (ARDOUR_UI::config()->color ("selection"));
+ (*i)->rect->set_fill_color (UIConfiguration::instance().color_mod ("selection rect", "selection rect"));
+ (*i)->rect->set_outline_color (UIConfiguration::instance().color ("selection"));
- (*i)->start_trim->set_fill_color (ARDOUR_UI::config()->color ("selection"));
- (*i)->start_trim->set_outline_color (ARDOUR_UI::config()->color ("selection"));
+ (*i)->start_trim->set_fill_color (UIConfiguration::instance().color ("selection"));
+ (*i)->start_trim->set_outline_color (UIConfiguration::instance().color ("selection"));
- (*i)->end_trim->set_fill_color (ARDOUR_UI::config()->color ("selection"));
- (*i)->end_trim->set_outline_color (ARDOUR_UI::config()->color ("selection"));
+ (*i)->end_trim->set_fill_color (UIConfiguration::instance().color ("selection"));
+ (*i)->end_trim->set_outline_color (UIConfiguration::instance().color ("selection"));
}
for (list<SelectionRect*>::iterator i = free_selection_rects.begin(); i != free_selection_rects.end(); ++i) {
- (*i)->rect->set_fill_color (ARDOUR_UI::config()->color_mod ("selection rect", "selection rect"));
- (*i)->rect->set_outline_color (ARDOUR_UI::config()->color ("selection"));
+ (*i)->rect->set_fill_color (UIConfiguration::instance().color_mod ("selection rect", "selection rect"));
+ (*i)->rect->set_outline_color (UIConfiguration::instance().color ("selection"));
- (*i)->start_trim->set_fill_color (ARDOUR_UI::config()->color ("selection"));
- (*i)->start_trim->set_outline_color (ARDOUR_UI::config()->color ("selection"));
+ (*i)->start_trim->set_fill_color (UIConfiguration::instance().color ("selection"));
+ (*i)->start_trim->set_outline_color (UIConfiguration::instance().color ("selection"));
- (*i)->end_trim->set_fill_color (ARDOUR_UI::config()->color ("selection"));
- (*i)->end_trim->set_outline_color (ARDOUR_UI::config()->color ("selection"));
+ (*i)->end_trim->set_fill_color (UIConfiguration::instance().color ("selection"));
+ (*i)->end_trim->set_outline_color (UIConfiguration::instance().color ("selection"));
}
}
#include "ardour/profile.h"
-#include "ardour_ui.h"
-/*
- * ardour_ui.h was moved up in the include list
- * due to a conflicting definition of 'Rect' between
- * Apple's MacTypes.h file and GTK
- */
-
#include "public_editor.h"
#include "time_axis_view_item.h"
#include "time_axis_view.h"
+#include "ui_config.h"
#include "utils.h"
#include "rgb_macros.h"
void
TimeAxisViewItem::set_constant_heights ()
{
- NAME_FONT = Pango::FontDescription (ARDOUR_UI::config()->get_SmallFont());
+ NAME_FONT = Pango::FontDescription (UIConfiguration::instance().get_SmallFont());
Gtk::Window win;
Gtk::Label foo;
Y_OFFSET is measured from the top of the time axis view item.
*/
- if (ARDOUR_UI::config()->get_show_name_highlight()) {
+ if (UIConfiguration::instance().get_show_name_highlight()) {
NAME_Y_OFFSET = height + 1;
NAME_HIGHLIGHT_SIZE = height + 2;
} else {
CANVAS_DEBUG_NAME (frame, string_compose ("frame for %1", get_item_name()));
if (_recregion) {
- frame->set_outline_color (ARDOUR_UI::config()->color ("recording rect"));
+ frame->set_outline_color (UIConfiguration::instance().color ("recording rect"));
} else {
- frame->set_outline_color (ARDOUR_UI::config()->color ("time axis frame"));
+ frame->set_outline_color (UIConfiguration::instance().color ("time axis frame"));
}
}
- if (ARDOUR_UI::config()->get_show_name_highlight() && (visibility & ShowNameHighlight)) {
+ if (UIConfiguration::instance().get_show_name_highlight() && (visibility & ShowNameHighlight)) {
/* rectangle size will be set in ::manage_name_highlight() */
name_highlight = new ArdourCanvas::Rectangle (group);
if (visibility & ShowNameText) {
name_text = new ArdourCanvas::Text (group);
CANVAS_DEBUG_NAME (name_text, string_compose ("name text for %1", get_item_name()));
- if (ARDOUR_UI::config()->get_show_name_highlight()) {
+ if (UIConfiguration::instance().get_show_name_highlight()) {
name_text->set_position (ArdourCanvas::Duple (NAME_X_OFFSET, trackview.current_height() - NAME_Y_OFFSET));
} else {
name_text->set_position (ArdourCanvas::Duple (NAME_X_OFFSET, NAME_Y_OFFSET));
set_position (start, this);
Config->ParameterChanged.connect (*this, invalidator (*this), boost::bind (&TimeAxisViewItem::parameter_changed, this, _1), gui_context ());
- ARDOUR_UI::config()->ParameterChanged.connect (sigc::mem_fun (*this, &TimeAxisViewItem::parameter_changed));
+ UIConfiguration::instance().ParameterChanged.connect (sigc::mem_fun (*this, &TimeAxisViewItem::parameter_changed));
}
TimeAxisViewItem::~TimeAxisViewItem()
if (!selection_frame) {
selection_frame = new ArdourCanvas::Rectangle (group);
selection_frame->set_fill (false);
- selection_frame->set_outline_color (ARDOUR_UI::config()->color ("selected time axis frame"));
+ selection_frame->set_outline_color (UIConfiguration::instance().color ("selected time axis frame"));
selection_frame->set_ignore_events (true);
}
selection_frame->set (frame->get().shrink (1.0));
manage_name_highlight ();
if (visibility & ShowNameText) {
- if (ARDOUR_UI::config()->get_show_name_highlight()) {
+ if (UIConfiguration::instance().get_show_name_highlight()) {
name_text->set_y_position (height - NAME_Y_OFFSET);
} else {
name_text->set_y_position (NAME_Y_OFFSET);
uint32_t f;
- if (ARDOUR_UI::config()->get_show_name_highlight()) {
+ if (UIConfiguration::instance().get_show_name_highlight()) {
/* name text will always be on top of name highlight, which
will always use our fill color.
*/
const std::string mod_name = (_dragging ? "dragging region" : fill_color_name);
if (_selected) {
- return ARDOUR_UI::config()->color_mod ("selected region base", mod_name);
+ return UIConfiguration::instance().color_mod ("selected region base", mod_name);
} else if (_recregion) {
- return ARDOUR_UI::config()->color ("recording rect");
- } else if ((!ARDOUR_UI::config()->get_show_name_highlight() || high_enough_for_name) &&
- !ARDOUR_UI::config()->get_color_regions_using_track_color()) {
- return ARDOUR_UI::config()->color_mod (fill_color_name, mod_name);
+ return UIConfiguration::instance().color ("recording rect");
+ } else if ((!UIConfiguration::instance().get_show_name_highlight() || high_enough_for_name) &&
+ !UIConfiguration::instance().get_color_regions_using_track_color()) {
+ return UIConfiguration::instance().color_mod (fill_color_name, mod_name);
}
- return ARDOUR_UI::config()->color_mod (fill_color, mod_name);
+ return UIConfiguration::instance().color_mod (fill_color, mod_name);
}
/**
set_frame_gradient ();
if (!_recregion) {
- frame->set_outline_color (ARDOUR_UI::config()->color ("time axis frame"));
+ frame->set_outline_color (UIConfiguration::instance().color ("time axis frame"));
}
}
void
TimeAxisViewItem::set_frame_gradient ()
{
- if (ARDOUR_UI::config()->get_timeline_item_gradient_depth() == 0.0) {
+ if (UIConfiguration::instance().get_timeline_item_gradient_depth() == 0.0) {
frame->set_gradient (ArdourCanvas::Fill::StopList (), 0);
return;
}
ArdourCanvas::color_to_hsv (f, h, s, v);
- v = min (1.0, v * (1.0 - ARDOUR_UI::config()->get_timeline_item_gradient_depth()));
+ v = min (1.0, v * (1.0 - UIConfiguration::instance().get_timeline_item_gradient_depth()));
ArdourCanvas::Color darker = ArdourCanvas::hsva_to_color (h, s, v, a);
stops.push_back (std::make_pair (1.0, darker));
#else
if (frame_handle_start) {
if (position_locked) {
- frame_handle_start->set_fill_color (ARDOUR_UI::config()->get_TrimHandleLocked());
- frame_handle_end->set_fill_color (ARDOUR_UI::config()->get_TrimHandleLocked());
+ frame_handle_start->set_fill_color (UIConfiguration::instance().get_TrimHandleLocked());
+ frame_handle_end->set_fill_color (UIConfiguration::instance().get_TrimHandleLocked());
} else {
- frame_handle_start->set_fill_color (ARDOUR_UI::config()->get_TrimHandle());
- frame_handle_end->set_fill_color (ARDOUR_UI::config()->get_TrimHandle());
+ frame_handle_start->set_fill_color (UIConfiguration::instance().get_TrimHandle());
+ frame_handle_end->set_fill_color (UIConfiguration::instance().get_TrimHandle());
}
}
#endif
if (!vestigial_frame) {
vestigial_frame = new ArdourCanvas::Rectangle (group, ArdourCanvas::Rect (0.0, 0.0, 2.0, trackview.current_height()));
CANVAS_DEBUG_NAME (vestigial_frame, string_compose ("vestigial frame for %1", get_item_name()));
- vestigial_frame->set_outline_color (ARDOUR_UI::config()->color ("vestigial frame"));
- vestigial_frame->set_fill_color (ARDOUR_UI::config()->color ("vestigial frame"));
+ vestigial_frame->set_outline_color (UIConfiguration::instance().color ("vestigial frame"));
+ vestigial_frame->set_fill_color (UIConfiguration::instance().color ("vestigial frame"));
vestigial_frame->set_outline_what (ArdourCanvas::Rectangle::What (ArdourCanvas::Rectangle::LEFT|ArdourCanvas::Rectangle::RIGHT));
}
static const char* ui_config_file_name = "ui_config";
static const char* default_ui_config_file_name = "default_ui_config";
-UIConfiguration* UIConfiguration::_instance = 0;
static const double hue_width = 18.0;
-sigc::signal<void> UIConfiguration::ColorsChanged;
-
-sigc::signal<void> UIConfiguration::DPIReset;
+UIConfiguration&
+UIConfiguration::instance ()
+{
+ static UIConfiguration s_instance;
+ return s_instance;
+}
UIConfiguration::UIConfiguration ()
:
modifiers_modified (false),
block_save (0)
{
- _instance = this;
-
load_state();
ColorsChanged.connect (boost::bind (&UIConfiguration::colors_changed, this));
class UIConfiguration : public PBD::Stateful
{
- public:
+private:
UIConfiguration();
~UIConfiguration();
- static UIConfiguration* instance() { return _instance; }
+ public:
+ static UIConfiguration& instance();
void load_rc_file (bool themechange, bool allow_own = true);
ArdourCanvas::HSV color_hsv (const std::string&) const;
ArdourCanvas::SVAModifier modifier (const std::string&) const;
- static sigc::signal<void> ColorsChanged;
+ sigc::signal<void> ColorsChanged;
void reset_dpi ();
void set_pango_fontsize ();
float get_ui_scale ();
- static sigc::signal<void> DPIReset;
+ sigc::signal<void> DPIReset;
sigc::signal<void,std::string> ParameterChanged;
void map_parameters (boost::function<void (std::string)>&);
bool colors_modified;
bool modifiers_modified;
- static UIConfiguration* _instance;
-
int store_color_theme ();
void load_color_aliases (XMLNode const &);
void load_colors (XMLNode const &);
#include "canvas/item.h"
#include "canvas/utils.h"
-#include "ardour_ui.h"
#include "debug.h"
#include "public_editor.h"
#include "keyboard.h"
#include "i18n.h"
#include "rgb_macros.h"
#include "gui_thread.h"
+#include "ui_config.h"
using namespace std;
using namespace Gtk;
#include "canvas/scroll_group.h"
#include "canvas/tracking_text.h"
-#include "ardour_ui.h"
#include "audio_clock.h"
#include "editor.h"
#include "editor_drag.h"
#include "main_clock.h"
#include "verbose_cursor.h"
+#include "ardour_ui.h"
+#include "ui_config.h"
#include "i18n.h"
{
_canvas_item = new ArdourCanvas::TrackingText (_editor->get_noscroll_group());
CANVAS_DEBUG_NAME (_canvas_item, "verbose canvas cursor");
- _canvas_item->set_font_description (Pango::FontDescription (ARDOUR_UI::config()->get_LargerBoldFont()));
+ _canvas_item->set_font_description (Pango::FontDescription (UIConfiguration::instance().get_LargerBoldFont()));
color_handler ();
- UIConfiguration::ColorsChanged.connect (sigc::mem_fun (*this, &VerboseCursor::color_handler));
+ UIConfiguration::instance().ColorsChanged.connect (sigc::mem_fun (*this, &VerboseCursor::color_handler));
}
void
VerboseCursor::color_handler ()
{
- _canvas_item->set_color (ARDOUR_UI::config()->color_mod ("verbose canvas cursor", "verbose canvas cursor"));
+ _canvas_item->set_color (UIConfiguration::instance().color_mod ("verbose canvas cursor", "verbose canvas cursor"));
}
ArdourCanvas::Item *