more waveform drawing/coloring changes
* move color-regions-using-track color into UI config, not RC config * consolidate all waveform coloring into AudioRegionView::set_one_waveform_color()
This commit is contained in:
parent
144fdfbbd0
commit
7a7e937d8e
|
@ -1184,36 +1184,6 @@ AudioRegionView::create_one_wave (uint32_t which, bool /*direct*/)
|
||||||
wave->set_y_position (yoff);
|
wave->set_y_position (yoff);
|
||||||
wave->set_height (ht);
|
wave->set_height (ht);
|
||||||
wave->set_samples_per_pixel (samples_per_pixel);
|
wave->set_samples_per_pixel (samples_per_pixel);
|
||||||
|
|
||||||
if (_recregion) {
|
|
||||||
wave->set_outline_color (_region->muted() ? UINT_RGBA_CHANGE_A(ARDOUR_UI::config()->get_canvasvar_RecWaveForm(), MUTED_ALPHA) : ARDOUR_UI::config()->get_canvasvar_RecWaveForm());
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
wave->set_fill_color (ARDOUR_UI::config()->get_canvasvar_RecWaveFormFill());
|
|
||||||
} else {
|
|
||||||
wave->set_outline_color (_region->muted() ? UINT_RGBA_CHANGE_A(ARDOUR_UI::config()->get_canvasvar_WaveForm(), MUTED_ALPHA) : ARDOUR_UI::config()->get_canvasvar_WaveForm());
|
|
||||||
|
|
||||||
/* wave color is a saturated, whiter version of the frame's
|
|
||||||
* fill color
|
|
||||||
*/
|
|
||||||
|
|
||||||
ArdourCanvas::Color c = frame->fill_color ();
|
|
||||||
double h, s, v;
|
|
||||||
ArdourCanvas::color_to_hsv (c, h, s, v);
|
|
||||||
|
|
||||||
/* full saturate */
|
|
||||||
s = 1.0;
|
|
||||||
/* head towards white */
|
|
||||||
v = min (1.0, v * 3.0);
|
|
||||||
|
|
||||||
c = ArdourCanvas::hsv_to_color (h, s, v, _region->muted() ? MUTED_ALPHA : 1.0);
|
|
||||||
|
|
||||||
wave->set_fill_color (c);
|
|
||||||
}
|
|
||||||
|
|
||||||
wave->set_clip_color (ARDOUR_UI::config()->get_canvasvar_WaveFormClip());
|
|
||||||
wave->set_zero_color (ARDOUR_UI::config()->get_canvasvar_ZeroLine());
|
|
||||||
wave->set_show_zero_line (true);
|
wave->set_show_zero_line (true);
|
||||||
|
|
||||||
switch (Config->get_waveform_shape()) {
|
switch (Config->get_waveform_shape()) {
|
||||||
|
@ -1453,7 +1423,35 @@ AudioRegionView::color_handler ()
|
||||||
void
|
void
|
||||||
AudioRegionView::set_waveform_colors ()
|
AudioRegionView::set_waveform_colors ()
|
||||||
{
|
{
|
||||||
ArdourCanvas::Color fill, outline, clip, zero;
|
for (vector<ArdourCanvas::WaveView*>::iterator w = waves.begin(); w != waves.end(); ++w) {
|
||||||
|
set_one_waveform_color (*w);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
AudioRegionView::set_one_waveform_color (ArdourCanvas::WaveView* wave)
|
||||||
|
{
|
||||||
|
ArdourCanvas::Color fill;
|
||||||
|
ArdourCanvas::Color outline;
|
||||||
|
|
||||||
|
if (ARDOUR_UI::config()->get_color_regions_using_track_color()) {
|
||||||
|
|
||||||
|
/* wave color is a saturated, whiter version of the frame's
|
||||||
|
* fill color
|
||||||
|
*/
|
||||||
|
|
||||||
|
ArdourCanvas::Color c = frame->fill_color ();
|
||||||
|
double h, s, v;
|
||||||
|
ArdourCanvas::color_to_hsv (c, h, s, v);
|
||||||
|
|
||||||
|
/* full saturate */
|
||||||
|
s = 0.45;
|
||||||
|
/* head towards white */
|
||||||
|
v = 0.97;
|
||||||
|
|
||||||
|
fill = ArdourCanvas::hsv_to_color (h, s, v, _region->muted() ? MUTED_ALPHA : 1.0);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
if (_selected) {
|
if (_selected) {
|
||||||
if (_region->muted()) {
|
if (_region->muted()) {
|
||||||
|
@ -1464,11 +1462,7 @@ AudioRegionView::set_waveform_colors ()
|
||||||
fill = ARDOUR_UI::config()->get_canvasvar_SelectedWaveFormFill();
|
fill = ARDOUR_UI::config()->get_canvasvar_SelectedWaveFormFill();
|
||||||
} else {
|
} else {
|
||||||
if (_recregion) {
|
if (_recregion) {
|
||||||
if (_region->muted()) {
|
|
||||||
outline = UINT_RGBA_CHANGE_A(ARDOUR_UI::config()->get_canvasvar_RecWaveForm(), MUTED_ALPHA);
|
|
||||||
} else {
|
|
||||||
outline = ARDOUR_UI::config()->get_canvasvar_RecWaveForm();
|
outline = ARDOUR_UI::config()->get_canvasvar_RecWaveForm();
|
||||||
}
|
|
||||||
fill = ARDOUR_UI::config()->get_canvasvar_RecWaveFormFill();
|
fill = ARDOUR_UI::config()->get_canvasvar_RecWaveFormFill();
|
||||||
} else {
|
} else {
|
||||||
if (_region->muted()) {
|
if (_region->muted()) {
|
||||||
|
@ -1479,16 +1473,12 @@ AudioRegionView::set_waveform_colors ()
|
||||||
fill = ARDOUR_UI::config()->get_canvasvar_WaveFormFill();
|
fill = ARDOUR_UI::config()->get_canvasvar_WaveFormFill();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
clip = ARDOUR_UI::config()->get_canvasvar_WaveFormClip();
|
|
||||||
zero = ARDOUR_UI::config()->get_canvasvar_ZeroLine();
|
|
||||||
|
|
||||||
for (vector<ArdourCanvas::WaveView*>::iterator w = waves.begin(); w != waves.end(); ++w) {
|
|
||||||
(*w)->set_outline_color (outline);
|
|
||||||
(*w)->set_fill_color (fill);
|
|
||||||
(*w)->set_clip_color (clip);
|
|
||||||
(*w)->set_zero_color (zero);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wave->set_fill_color (fill);
|
||||||
|
wave->set_outline_color (outline);
|
||||||
|
wave->set_clip_color (ARDOUR_UI::config()->get_canvasvar_WaveFormClip());
|
||||||
|
wave->set_zero_color (ARDOUR_UI::config()->get_canvasvar_ZeroLine());
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -190,6 +190,7 @@ class AudioRegionView : public RegionView
|
||||||
|
|
||||||
void set_colors ();
|
void set_colors ();
|
||||||
void set_waveform_colors ();
|
void set_waveform_colors ();
|
||||||
|
void set_one_waveform_color (ArdourCanvas::WaveView*);
|
||||||
void compute_colors (Gdk::Color const &);
|
void compute_colors (Gdk::Color const &);
|
||||||
void reset_width_dependent_items (double pixel_width);
|
void reset_width_dependent_items (double pixel_width);
|
||||||
void set_frame_color ();
|
void set_frame_color ();
|
||||||
|
|
|
@ -1392,14 +1392,6 @@ RCOptionEditor::RCOptionEditor ()
|
||||||
sigc::mem_fun (*_rc_config, &RCConfiguration::set_show_zoom_tools)
|
sigc::mem_fun (*_rc_config, &RCConfiguration::set_show_zoom_tools)
|
||||||
));
|
));
|
||||||
|
|
||||||
add_option (_("Editor"),
|
|
||||||
new BoolOption (
|
|
||||||
"color-regions-using-track-color",
|
|
||||||
_("Color regions using their track's color"),
|
|
||||||
sigc::mem_fun (*_rc_config, &RCConfiguration::get_color_regions_using_track_color),
|
|
||||||
sigc::mem_fun (*_rc_config, &RCConfiguration::set_color_regions_using_track_color)
|
|
||||||
));
|
|
||||||
|
|
||||||
add_option (_("Editor"),
|
add_option (_("Editor"),
|
||||||
new BoolOption (
|
new BoolOption (
|
||||||
"update-editor-during-summary-drag",
|
"update-editor-during-summary-drag",
|
||||||
|
|
|
@ -59,6 +59,7 @@ ThemeManager::ThemeManager()
|
||||||
, light_button (_("Light Theme"))
|
, light_button (_("Light Theme"))
|
||||||
, reset_button (_("Restore Defaults"))
|
, reset_button (_("Restore Defaults"))
|
||||||
, flat_buttons (_("Draw \"flat\" buttons"))
|
, flat_buttons (_("Draw \"flat\" buttons"))
|
||||||
|
, region_color_button (_("Color regions using their track's color"))
|
||||||
, waveform_gradient_depth (0, 1.0, 0.05)
|
, waveform_gradient_depth (0, 1.0, 0.05)
|
||||||
, waveform_gradient_depth_label (_("Waveforms color gradient depth"))
|
, waveform_gradient_depth_label (_("Waveforms color gradient depth"))
|
||||||
, timeline_item_gradient_depth (0, 1.0, 0.05)
|
, timeline_item_gradient_depth (0, 1.0, 0.05)
|
||||||
|
@ -102,6 +103,7 @@ ThemeManager::ThemeManager()
|
||||||
vbox->pack_start (all_dialogs, PACK_SHRINK);
|
vbox->pack_start (all_dialogs, PACK_SHRINK);
|
||||||
#endif
|
#endif
|
||||||
vbox->pack_start (flat_buttons, PACK_SHRINK);
|
vbox->pack_start (flat_buttons, PACK_SHRINK);
|
||||||
|
vbox->pack_start (region_color_button, PACK_SHRINK);
|
||||||
|
|
||||||
Gtk::HBox* hbox = Gtk::manage (new Gtk::HBox());
|
Gtk::HBox* hbox = Gtk::manage (new Gtk::HBox());
|
||||||
hbox->set_spacing (6);
|
hbox->set_spacing (6);
|
||||||
|
@ -129,12 +131,16 @@ ThemeManager::ThemeManager()
|
||||||
color_dialog.get_colorsel()->set_has_opacity_control (true);
|
color_dialog.get_colorsel()->set_has_opacity_control (true);
|
||||||
color_dialog.get_colorsel()->set_has_palette (true);
|
color_dialog.get_colorsel()->set_has_palette (true);
|
||||||
|
|
||||||
|
flat_buttons.set_active (ARDOUR_UI::config()->get_flat_buttons());
|
||||||
|
region_color_button.set_active (ARDOUR_UI::config()->get_color_regions_using_track_color());
|
||||||
|
|
||||||
color_dialog.get_ok_button()->signal_clicked().connect (sigc::bind (sigc::mem_fun (color_dialog, &Gtk::Dialog::response), RESPONSE_ACCEPT));
|
color_dialog.get_ok_button()->signal_clicked().connect (sigc::bind (sigc::mem_fun (color_dialog, &Gtk::Dialog::response), RESPONSE_ACCEPT));
|
||||||
color_dialog.get_cancel_button()->signal_clicked().connect (sigc::bind (sigc::mem_fun (color_dialog, &Gtk::Dialog::response), RESPONSE_CANCEL));
|
color_dialog.get_cancel_button()->signal_clicked().connect (sigc::bind (sigc::mem_fun (color_dialog, &Gtk::Dialog::response), RESPONSE_CANCEL));
|
||||||
dark_button.signal_toggled().connect (sigc::mem_fun (*this, &ThemeManager::on_dark_theme_button_toggled));
|
dark_button.signal_toggled().connect (sigc::mem_fun (*this, &ThemeManager::on_dark_theme_button_toggled));
|
||||||
light_button.signal_toggled().connect (sigc::mem_fun (*this, &ThemeManager::on_light_theme_button_toggled));
|
light_button.signal_toggled().connect (sigc::mem_fun (*this, &ThemeManager::on_light_theme_button_toggled));
|
||||||
reset_button.signal_clicked().connect (sigc::mem_fun (*this, &ThemeManager::reset_canvas_colors));
|
reset_button.signal_clicked().connect (sigc::mem_fun (*this, &ThemeManager::reset_canvas_colors));
|
||||||
flat_buttons.signal_toggled().connect (sigc::mem_fun (*this, &ThemeManager::on_flat_buttons_toggled));
|
flat_buttons.signal_toggled().connect (sigc::mem_fun (*this, &ThemeManager::on_flat_buttons_toggled));
|
||||||
|
region_color_button.signal_toggled().connect (sigc::mem_fun (*this, &ThemeManager::on_region_color_toggled));
|
||||||
waveform_gradient_depth.signal_value_changed().connect (sigc::mem_fun (*this, &ThemeManager::on_waveform_gradient_depth_change));
|
waveform_gradient_depth.signal_value_changed().connect (sigc::mem_fun (*this, &ThemeManager::on_waveform_gradient_depth_change));
|
||||||
timeline_item_gradient_depth.signal_value_changed().connect (sigc::mem_fun (*this, &ThemeManager::on_timeline_item_gradient_depth_change));
|
timeline_item_gradient_depth.signal_value_changed().connect (sigc::mem_fun (*this, &ThemeManager::on_timeline_item_gradient_depth_change));
|
||||||
all_dialogs.signal_toggled().connect (sigc::mem_fun (*this, &ThemeManager::on_all_dialogs_toggled));
|
all_dialogs.signal_toggled().connect (sigc::mem_fun (*this, &ThemeManager::on_all_dialogs_toggled));
|
||||||
|
@ -279,6 +285,13 @@ ThemeManager::on_flat_buttons_toggled ()
|
||||||
gtk_rc_reset_styles (gtk_settings_get_default());
|
gtk_rc_reset_styles (gtk_settings_get_default());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ThemeManager::on_region_color_toggled ()
|
||||||
|
{
|
||||||
|
ARDOUR_UI::config()->set_color_regions_using_track_color (region_color_button.get_active());
|
||||||
|
ARDOUR_UI::config()->set_dirty ();
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ThemeManager::on_all_dialogs_toggled ()
|
ThemeManager::on_all_dialogs_toggled ()
|
||||||
{
|
{
|
||||||
|
|
|
@ -44,6 +44,7 @@ class ThemeManager : public ArdourWindow
|
||||||
void on_dark_theme_button_toggled ();
|
void on_dark_theme_button_toggled ();
|
||||||
void on_light_theme_button_toggled ();
|
void on_light_theme_button_toggled ();
|
||||||
void on_flat_buttons_toggled ();
|
void on_flat_buttons_toggled ();
|
||||||
|
void on_region_color_toggled ();
|
||||||
void on_waveform_gradient_depth_change ();
|
void on_waveform_gradient_depth_change ();
|
||||||
void on_timeline_item_gradient_depth_change ();
|
void on_timeline_item_gradient_depth_change ();
|
||||||
void on_all_dialogs_toggled ();
|
void on_all_dialogs_toggled ();
|
||||||
|
@ -73,6 +74,7 @@ class ThemeManager : public ArdourWindow
|
||||||
Gtk::RadioButton light_button;
|
Gtk::RadioButton light_button;
|
||||||
Gtk::Button reset_button;
|
Gtk::Button reset_button;
|
||||||
Gtk::CheckButton flat_buttons;
|
Gtk::CheckButton flat_buttons;
|
||||||
|
Gtk::CheckButton region_color_button;
|
||||||
Gtk::HScale waveform_gradient_depth;
|
Gtk::HScale waveform_gradient_depth;
|
||||||
Gtk::Label waveform_gradient_depth_label;
|
Gtk::Label waveform_gradient_depth_label;
|
||||||
Gtk::HScale timeline_item_gradient_depth;
|
Gtk::HScale timeline_item_gradient_depth;
|
||||||
|
|
|
@ -801,7 +801,7 @@ TimeAxisViewItem::get_fill_color () const
|
||||||
f = ARDOUR_UI::config()->get_canvasvar_RecordingRect();
|
f = ARDOUR_UI::config()->get_canvasvar_RecordingRect();
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
if (high_enough_for_name && !Config->get_color_regions_using_track_color()) {
|
if (high_enough_for_name && !ARDOUR_UI::config()->get_color_regions_using_track_color()) {
|
||||||
f = ARDOUR_UI::config()->get_canvasvar_FrameBase();
|
f = ARDOUR_UI::config()->get_canvasvar_FrameBase();
|
||||||
} else {
|
} else {
|
||||||
f = fill_color;
|
f = fill_color;
|
||||||
|
@ -1094,7 +1094,7 @@ void
|
||||||
TimeAxisViewItem::parameter_changed (string p)
|
TimeAxisViewItem::parameter_changed (string p)
|
||||||
{
|
{
|
||||||
if (p == "color-regions-using-track-color") {
|
if (p == "color-regions-using-track-color") {
|
||||||
set_frame_color ();
|
set_colors ();
|
||||||
} else if (p == "timeline-item-gradient-depth") {
|
} else if (p == "timeline-item-gradient-depth") {
|
||||||
set_frame_gradient ();
|
set_frame_gradient ();
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,4 +22,5 @@ UI_CONFIG_VARIABLE(bool, flat_buttons, "flat-buttons", false)
|
||||||
UI_CONFIG_VARIABLE(float, waveform_gradient_depth, "waveform-gradient-depth", 0.6)
|
UI_CONFIG_VARIABLE(float, waveform_gradient_depth, "waveform-gradient-depth", 0.6)
|
||||||
UI_CONFIG_VARIABLE(float, timeline_item_gradient_depth, "timeline-item-gradient-depth", 1.3)
|
UI_CONFIG_VARIABLE(float, timeline_item_gradient_depth, "timeline-item-gradient-depth", 1.3)
|
||||||
UI_CONFIG_VARIABLE(bool, all_floating_windows_are_dialogs, "all-floating-windows-are-dialogs", false)
|
UI_CONFIG_VARIABLE(bool, all_floating_windows_are_dialogs, "all-floating-windows-are-dialogs", false)
|
||||||
|
UI_CONFIG_VARIABLE (bool, color_regions_using_track_color, "color-regions-using-track-color", false)
|
||||||
|
|
||||||
|
|
|
@ -184,7 +184,6 @@ CONFIG_VARIABLE (WaveformScale, waveform_scale, "waveform-scale", Linear)
|
||||||
CONFIG_VARIABLE (WaveformShape, waveform_shape, "waveform-shape", Traditional)
|
CONFIG_VARIABLE (WaveformShape, waveform_shape, "waveform-shape", Traditional)
|
||||||
CONFIG_VARIABLE (bool, allow_special_bus_removal, "allow-special-bus-removal", false)
|
CONFIG_VARIABLE (bool, allow_special_bus_removal, "allow-special-bus-removal", false)
|
||||||
CONFIG_VARIABLE (int32_t, processor_usage, "processor-usage", -1)
|
CONFIG_VARIABLE (int32_t, processor_usage, "processor-usage", -1)
|
||||||
CONFIG_VARIABLE (bool, color_regions_using_track_color, "color-regions-using-track-color", false)
|
|
||||||
CONFIG_VARIABLE (gain_t, max_gain, "max-gain", 2.0) /* +6.0dB */
|
CONFIG_VARIABLE (gain_t, max_gain, "max-gain", 2.0) /* +6.0dB */
|
||||||
CONFIG_VARIABLE (bool, update_editor_during_summary_drag, "update-editor-during-summary-drag", true)
|
CONFIG_VARIABLE (bool, update_editor_during_summary_drag, "update-editor-during-summary-drag", true)
|
||||||
CONFIG_VARIABLE (bool, never_display_periodic_midi, "never-display-periodic-midi", true)
|
CONFIG_VARIABLE (bool, never_display_periodic_midi, "never-display-periodic-midi", true)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user