Move DPIReset and ColorsChanged signals into UIConfiguration

This commit is contained in:
Tim Mayberry 2015-01-04 21:18:48 +07:00 committed by Paul Davis
parent 0fd1aa3808
commit fc1e7dbb55
28 changed files with 45 additions and 97 deletions

View File

@ -38,7 +38,6 @@
#include "ardour_button.h"
#include "ardour_ui.h"
#include "global_signals.h"
#include "i18n.h"
@ -96,7 +95,7 @@ ArdourButton::ArdourButton (Element e)
, _update_colors (true)
, _pattern_height (0)
{
ARDOUR_UI_UTILS::ColorsChanged.connect (sigc::mem_fun (*this, &ArdourButton::color_handler));
UIConfiguration::ColorsChanged.connect (sigc::mem_fun (*this, &ArdourButton::color_handler));
}
ArdourButton::ArdourButton (const std::string& str, Element e)
@ -135,8 +134,8 @@ ArdourButton::ArdourButton (const std::string& str, Element e)
, _pattern_height (0)
{
set_text (str);
ARDOUR_UI_UTILS::ColorsChanged.connect (sigc::mem_fun (*this, &ArdourButton::color_handler));
ARDOUR_UI_UTILS::DPIReset.connect (sigc::mem_fun (*this, &ArdourButton::on_name_changed));
UIConfiguration::ColorsChanged.connect (sigc::mem_fun (*this, &ArdourButton::color_handler));
UIConfiguration::DPIReset.connect (sigc::mem_fun (*this, &ArdourButton::on_name_changed));
}
ArdourButton::~ArdourButton()

View File

@ -36,7 +36,6 @@
#include "ardour_display.h"
#include "ardour_ui.h"
#include "global_signals.h"
#include "i18n.h"

View File

@ -35,7 +35,6 @@
#include "ardour_dropdown.h"
#include "ardour_ui.h"
#include "global_signals.h"
#include "i18n.h"

View File

@ -36,7 +36,6 @@
#include "ardour_knob.h"
#include "ardour_ui.h"
#include "global_signals.h"
#include "timers.h"
#include "canvas/colors.h"
@ -66,7 +65,7 @@ ArdourKnob::ArdourKnob (Element e, Flags flags)
, _flags (flags)
, _tooltip (this)
{
ARDOUR_UI_UTILS::ColorsChanged.connect (sigc::mem_fun (*this, &ArdourKnob::color_handler));
UIConfiguration::ColorsChanged.connect (sigc::mem_fun (*this, &ArdourKnob::color_handler));
// watch automation :(
Timers::rapid_connect (sigc::mem_fun (*this, &ArdourKnob::controllable_changed));

View File

@ -115,7 +115,6 @@ typedef uint64_t microseconds_t;
#include "export_video_dialog.h"
#include "export_video_infobox.h"
#include "gain_meter.h"
#include "global_signals.h"
#include "global_port_matrix.h"
#include "gui_object.h"
#include "gui_thread.h"
@ -445,7 +444,7 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], const char* localedir, UIConfi
_process_thread = new ProcessThread ();
_process_thread->init ();
DPIReset.connect (sigc::mem_fun (*this, &ARDOUR_UI::resize_text_widgets));
UIConfiguration::DPIReset.connect (sigc::mem_fun (*this, &ARDOUR_UI::resize_text_widgets));
attach_to_engine ();
}

View File

@ -39,7 +39,6 @@
#include "ardour_ui.h"
#include "audio_clock.h"
#include "global_signals.h"
#include "utils.h"
#include "keyboard.h"
#include "gui_thread.h"
@ -121,8 +120,8 @@ AudioClock::AudioClock (const string& clock_name, bool transient, const string&
clocks.push_back (this);
}
ColorsChanged.connect (sigc::mem_fun (*this, &AudioClock::set_colors));
DPIReset.connect (sigc::mem_fun (*this, &AudioClock::dpi_reset));
UIConfiguration::ColorsChanged.connect (sigc::mem_fun (*this, &AudioClock::set_colors));
UIConfiguration::DPIReset.connect (sigc::mem_fun (*this, &AudioClock::dpi_reset));
}
AudioClock::~AudioClock ()

View File

@ -34,7 +34,6 @@
#include "automation_region_view.h"
#include "automation_streamview.h"
#include "automation_time_axis.h"
#include "global_signals.h"
#include "gui_thread.h"
#include "public_editor.h"
#include "region_selection.h"
@ -61,7 +60,7 @@ AutomationStreamView::AutomationStreamView (AutomationTimeAxisView& tv)
color_handler ();
ColorsChanged.connect(sigc::mem_fun(*this, &AutomationStreamView::color_handler));
UIConfiguration::ColorsChanged.connect(sigc::mem_fun(*this, &AutomationStreamView::color_handler));
}
AutomationStreamView::~AutomationStreamView ()

View File

@ -39,7 +39,6 @@
#include "ardour_ui.h"
#include "automation_time_axis.h"
#include "automation_streamview.h"
#include "global_signals.h"
#include "gui_thread.h"
#include "route_time_axis.h"
#include "automation_line.h"
@ -276,7 +275,7 @@ AutomationTimeAxisView::AutomationTimeAxisView (
/* make sure labels etc. are correct */
automation_state_changed ();
ColorsChanged.connect (sigc::mem_fun (*this, &AutomationTimeAxisView::color_handler));
UIConfiguration::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 ()

View File

@ -39,7 +39,6 @@
#include "ardour_ui.h"
#include "automation_time_axis.h"
#include "editor.h"
#include "global_signals.h"
#include "editing.h"
#include "rgb_macros.h"
#include "utils.h"
@ -273,7 +272,7 @@ Editor::initialize_canvas ()
initialize_rulers ();
ColorsChanged.connect (sigc::mem_fun (*this, &Editor::color_handler));
UIConfiguration::ColorsChanged.connect (sigc::mem_fun (*this, &Editor::color_handler));
color_handler();
}

View File

@ -36,7 +36,6 @@
#include "ardour_ui.h"
#include "gain_meter.h"
#include "global_signals.h"
#include "logmeter.h"
#include "gui_thread.h"
#include "keyboard.h"
@ -171,8 +170,8 @@ GainMeterBase::GainMeterBase (Session* s, bool horizontal, int fader_length, int
RedrawMetrics.connect (sigc::mem_fun(*this, &GainMeterBase::redraw_metrics));
UI::instance()->theme_changed.connect (sigc::mem_fun(*this, &GainMeterBase::on_theme_changed));
ColorsChanged.connect (sigc::bind(sigc::mem_fun (*this, &GainMeterBase::color_handler), false));
DPIReset.connect (sigc::bind(sigc::mem_fun (*this, &GainMeterBase::color_handler), true));
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));
}
GainMeterBase::~GainMeterBase ()

View File

@ -1,30 +0,0 @@
/*
Copyright (C) 2012 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef __gtk_ardour_global_signals_h__
#define __gtk_ardour_global_signals_h__
#include <sigc++/signal.h>
namespace ARDOUR_UI_UTILS {
extern sigc::signal<void> ColorsChanged;
extern sigc::signal<void> DPIReset;
} // namespace
#endif /* __gtk_ardour_global_signals_h__ */

View File

@ -24,7 +24,6 @@
#include "gui_thread.h"
#include "route_group_dialog.h"
#include "global_signals.h"
#include "group_tabs.h"
#include "keyboard.h"
#include "i18n.h"
@ -46,7 +45,7 @@ GroupTabs::GroupTabs ()
, _dragging_new_tab (0)
{
add_events (Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK|Gdk::POINTER_MOTION_MASK);
ColorsChanged.connect (sigc::mem_fun (*this, &GroupTabs::queue_draw));
UIConfiguration::ColorsChanged.connect (sigc::mem_fun (*this, &GroupTabs::queue_draw));
}
GroupTabs::~GroupTabs ()

View File

@ -25,7 +25,6 @@
#include "pbd/fastlog.h"
#include "ardour_ui.h"
#include "global_signals.h"
#include "level_meter.h"
#include "utils.h"
#include "logmeter.h"
@ -59,7 +58,7 @@ LevelMeterBase::LevelMeterBase (Session* s, PBD::EventLoop::InvalidationRecord*
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));
ColorsChanged.connect (sigc::mem_fun (*this, &LevelMeterBase::color_handler));
UIConfiguration::ColorsChanged.connect (sigc::mem_fun (*this, &LevelMeterBase::color_handler));
}
LevelMeterBase::~LevelMeterBase ()

View File

@ -35,7 +35,6 @@
#include <gtkmm2ext/rgb_macros.h>
#include "ardour_ui.h"
#include "global_signals.h"
#include "logmeter.h"
#include "gui_thread.h"
#include "ardour_window.h"
@ -112,8 +111,8 @@ MeterStrip::MeterStrip (int metricmode, MeterType mt)
nfo_vbox.show();
UI::instance()->theme_changed.connect (sigc::mem_fun(*this, &MeterStrip::on_theme_changed));
ColorsChanged.connect (sigc::mem_fun (*this, &MeterStrip::on_theme_changed));
DPIReset.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));
}
MeterStrip::MeterStrip (Session* sess, boost::shared_ptr<ARDOUR::Route> rt)
@ -300,8 +299,8 @@ 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));
ColorsChanged.connect (sigc::mem_fun (*this, &MeterStrip::on_theme_changed));
DPIReset.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));
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());

View File

@ -52,7 +52,6 @@
#include "route_sorter.h"
#include "actions.h"
#include "gui_thread.h"
#include "global_signals.h"
#include "meter_patterns.h"
#include "timers.h"
@ -174,8 +173,8 @@ Meterbridge::Meterbridge ()
viewport->set_border_width(0);
UI::instance()->theme_changed.connect (sigc::mem_fun(*this, &Meterbridge::on_theme_changed));
ColorsChanged.connect (sigc::mem_fun (*this, &Meterbridge::on_theme_changed));
DPIReset.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));
}
Meterbridge::~Meterbridge ()

View File

@ -35,7 +35,6 @@
#include "ardour/smf_source.h"
#include "ardour_ui.h"
#include "global_signals.h"
#include "gui_thread.h"
#include "midi_region_view.h"
#include "midi_streamview.h"
@ -86,7 +85,7 @@ MidiStreamView::MidiStreamView (MidiTimeAxisView& tv)
color_handler ();
ColorsChanged.connect(sigc::mem_fun(*this, &MidiStreamView::color_handler));
UIConfiguration::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);

View File

@ -39,7 +39,6 @@
#include "ardour/panner_shell.h"
#include "ardour_ui.h"
#include "global_signals.h"
#include "mono_panner.h"
#include "mono_panner_editor.h"
#include "rgb_macros.h"
@ -87,7 +86,7 @@ MonoPanner::MonoPanner (boost::shared_ptr<ARDOUR::PannerShell> p)
_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());
ColorsChanged.connect (sigc::mem_fun (*this, &MonoPanner::color_handler));
UIConfiguration::ColorsChanged.connect (sigc::mem_fun (*this, &MonoPanner::color_handler));
set_tooltip ();
}

View File

@ -36,7 +36,6 @@
#include "canvas/colors.h"
#include "ardour_ui.h"
#include "global_signals.h"
#include "panner2d.h"
#include "keyboard.h"
#include "gui_thread.h"
@ -91,7 +90,7 @@ Panner2d::Panner2d (boost::shared_ptr<PannerShell> p, int32_t h)
have_colors = true;
}
ColorsChanged.connect (sigc::mem_fun (*this, &Panner2d::color_handler));
UIConfiguration::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());

View File

@ -22,7 +22,6 @@
#include "gtkmm2ext/persistent_tooltip.h"
#include "panner_interface.h"
#include "panner_editor.h"
#include "global_signals.h"
#include "i18n.h"

View File

@ -36,7 +36,6 @@
#include "canvas/colors.h"
#include "ardour_ui.h"
#include "global_signals.h"
#include "streamview.h"
#include "region_view.h"
#include "automation_region_view.h"
@ -191,7 +190,7 @@ RegionView::init (bool wfd)
set_colors ();
ColorsChanged.connect (sigc::mem_fun (*this, &RegionView::color_handler));
UIConfiguration::ColorsChanged.connect (sigc::mem_fun (*this, &RegionView::color_handler));
/* XXX sync mark drag? */
}

View File

@ -61,7 +61,6 @@
#include "ardour_button.h"
#include "audio_streamview.h"
#include "debug.h"
#include "global_signals.h"
#include "route_time_axis.h"
#include "automation_time_axis.h"
#include "enums.h"
@ -308,7 +307,7 @@ RouteTimeAxisView::set_route (boost::shared_ptr<Route> rt)
}
_editor.ZoomChanged.connect (sigc::mem_fun(*this, &RouteTimeAxisView::reset_samples_per_pixel));
ColorsChanged.connect (sigc::mem_fun (*this, &RouteTimeAxisView::color_handler));
UIConfiguration::ColorsChanged.connect (sigc::mem_fun (*this, &RouteTimeAxisView::color_handler));
PropertyList* plist = new PropertyList();

View File

@ -40,7 +40,6 @@
#include "canvas/colors.h"
#include "ardour_ui.h"
#include "global_signals.h"
#include "stereo_panner.h"
#include "stereo_panner_editor.h"
#include "rgb_macros.h"
@ -97,7 +96,7 @@ StereoPanner::StereoPanner (boost::shared_ptr<PannerShell> p)
_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());
ColorsChanged.connect (sigc::mem_fun (*this, &StereoPanner::color_handler));
UIConfiguration::ColorsChanged.connect (sigc::mem_fun (*this, &StereoPanner::color_handler));
set_tooltip ();
}

View File

@ -34,7 +34,6 @@
#include "canvas/debug.h"
#include "streamview.h"
#include "global_signals.h"
#include "region_view.h"
#include "route_time_axis.h"
#include "region_selection.h"
@ -86,7 +85,7 @@ StreamView::StreamView (RouteTimeAxisView& tv, ArdourCanvas::Container* canvas_g
_trackview.session()->RecordStateChanged.connect (*this, invalidator (*this), boost::bind (&StreamView::sess_rec_enable_changed, this), gui_context());
}
ColorsChanged.connect (sigc::mem_fun (*this, &StreamView::color_handler));
UIConfiguration::ColorsChanged.connect (sigc::mem_fun (*this, &StreamView::color_handler));
}
StreamView::~StreamView ()

View File

@ -48,7 +48,6 @@
#include "theme_manager.h"
#include "rgb_macros.h"
#include "ardour_ui.h"
#include "global_signals.h"
#include "utils.h"
#include "i18n.h"
@ -59,10 +58,6 @@ using namespace PBD;
using namespace ARDOUR;
using namespace ARDOUR_UI_UTILS;
namespace ARDOUR_UI_UTILS {
sigc::signal<void> ColorsChanged;
}
ThemeManager::ThemeManager()
: dark_button (_("Dark Theme"))
, light_button (_("Light Theme"))
@ -206,7 +201,7 @@ ThemeManager::ThemeManager()
setup_aliases ();
setup_modifiers ();
ARDOUR_UI_UTILS::ColorsChanged.connect (sigc::mem_fun (*this, &ThemeManager::colors_changed));
UIConfiguration::ColorsChanged.connect (sigc::mem_fun (*this, &ThemeManager::colors_changed));
}
ThemeManager::~ThemeManager()

View File

@ -43,7 +43,6 @@
#include "ardour_ui.h"
#include "ardour_dialog.h"
#include "global_signals.h"
#include "gui_thread.h"
#include "public_editor.h"
#include "time_axis_view.h"
@ -220,7 +219,7 @@ TimeAxisView::TimeAxisView (ARDOUR::Session* sess, PublicEditor& ed, TimeAxisVie
time_axis_hbox.show();
top_hbox.pack_start (scroomer_placeholder, false, false); // OR pack_end to move after meters ?
ColorsChanged.connect (sigc::mem_fun (*this, &TimeAxisView::color_handler));
UIConfiguration::ColorsChanged.connect (sigc::mem_fun (*this, &TimeAxisView::color_handler));
GhostRegion::CatchDeletion.connect (*this, invalidator (*this), boost::bind (&TimeAxisView::erase_ghost, this, _1), gui_context());
}

View File

@ -48,7 +48,6 @@
#include "ardour/filesystem_paths.h"
#include "ardour_ui.h"
#include "global_signals.h"
#include "ui_config.h"
#include "i18n.h"
@ -64,6 +63,10 @@ UIConfiguration* UIConfiguration::_instance = 0;
static const double hue_width = 18.0;
sigc::signal<void> UIConfiguration::ColorsChanged;
sigc::signal<void> UIConfiguration::DPIReset;
UIConfiguration::UIConfiguration ()
:
#undef UI_CONFIG_VARIABLE
@ -84,7 +87,7 @@ UIConfiguration::UIConfiguration ()
load_state();
ARDOUR_UI_UTILS::ColorsChanged.connect (boost::bind (&UIConfiguration::colors_changed, this));
ColorsChanged.connect (boost::bind (&UIConfiguration::colors_changed, this));
ParameterChanged.connect (sigc::mem_fun (*this, &UIConfiguration::parameter_changed));
}
@ -155,7 +158,7 @@ UIConfiguration::reset_dpi ()
gtk_settings_set_long_property (gtk_settings_get_default(),
"gtk-xft-dpi", val, "ardour");
ARDOUR_UI_UTILS::DPIReset(); //Emit Signal
DPIReset(); //Emit Signal
}
void
@ -236,7 +239,7 @@ UIConfiguration::load_defaults ()
if (ret == 0) {
/* reload color theme */
load_color_theme (false);
ARDOUR_UI_UTILS::ColorsChanged (); /* EMIT SIGNAL */
ColorsChanged (); /* EMIT SIGNAL */
}
return ret;
@ -284,7 +287,7 @@ UIConfiguration::load_color_theme (bool allow_own)
return -1;
}
ARDOUR_UI_UTILS::ColorsChanged ();
ColorsChanged ();
} else {
warning << string_compose (_("Color file %1 not found"), basename) << endmsg;
}
@ -676,7 +679,7 @@ UIConfiguration::set_color (string const& name, ArdourCanvas::Color color)
i->second = color;
colors_modified = true;
ARDOUR_UI_UTILS::ColorsChanged (); /* EMIT SIGNAL */
ColorsChanged (); /* EMIT SIGNAL */
}
void
@ -690,7 +693,7 @@ UIConfiguration::set_alias (string const & name, string const & alias)
i->second = alias;
aliases_modified = true;
ARDOUR_UI_UTILS::ColorsChanged (); /* EMIT SIGNAL */
ColorsChanged (); /* EMIT SIGNAL */
}
void
@ -705,7 +708,7 @@ UIConfiguration::set_modifier (string const & name, SVAModifier svam)
m->second = svam;
modifiers_modified = true;
ARDOUR_UI_UTILS::ColorsChanged (); /* EMIT SIGNAL */
ColorsChanged (); /* EMIT SIGNAL */
}
void

View File

@ -76,9 +76,13 @@ class UIConfiguration : public PBD::Stateful
ArdourCanvas::HSV color_hsv (const std::string&) const;
ArdourCanvas::SVAModifier modifier (const std::string&) const;
static sigc::signal<void> ColorsChanged;
void reset_dpi ();
void set_pango_fontsize ();
static sigc::signal<void> DPIReset;
sigc::signal<void,std::string> ParameterChanged;
void map_parameters (boost::function<void (std::string)>&);

View File

@ -30,7 +30,6 @@
#include "audio_clock.h"
#include "editor.h"
#include "editor_drag.h"
#include "global_signals.h"
#include "main_clock.h"
#include "verbose_cursor.h"
@ -47,7 +46,7 @@ VerboseCursor::VerboseCursor (Editor* editor)
_canvas_item->set_font_description (Pango::FontDescription (ARDOUR_UI::config()->get_LargerBoldFont()));
color_handler ();
ARDOUR_UI_UTILS::ColorsChanged.connect (sigc::mem_fun (*this, &VerboseCursor::color_handler));
UIConfiguration::ColorsChanged.connect (sigc::mem_fun (*this, &VerboseCursor::color_handler));
}
void