Major Theme Manager changes, see ardour-dev

git-svn-id: svn://localhost/ardour2/trunk@1987 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Doug McLain 2007-06-15 22:08:27 +00:00
parent cd9fdb935f
commit 789cbb2181
45 changed files with 469 additions and 548 deletions

View file

@ -1,6 +1,6 @@
cWaveForm 0.0 0.0 0.0 0.80 cWaveForm 0.0 0.0 0.0 0.80
cWaveFormClip 1.0 0.0 0.0 0.90 cWaveFormClip 1.0 0.0 0.0 0.90
cMutedWaveForm 0.35 0.35 0.35 1.0 cMutedWaveForm 0.0 0.0 0.0 0.30
cSelectedFrameBase 0.71 0.57 0.66 1.0 cSelectedFrameBase 0.71 0.57 0.66 1.0
cFrameBase 0.75 0.75 0.76 1.0 cFrameBase 0.75 0.75 0.76 1.0
cAudioTrackOutline 0.00 0.00 0.00 1.00 cAudioTrackOutline 0.00 0.00 0.00 1.00

View file

@ -80,7 +80,7 @@ style "marker_text"
style "time_axis_view_item_name" style "time_axis_view_item_name"
{ {
font_name = "sans 9" font_name = "sans 6"
} }
style "default_base" = "medium_text" style "default_base" = "medium_text"
@ -122,9 +122,6 @@ style "default_base" = "medium_text"
engine "clearlooks" engine "clearlooks"
{ {
menubarstyle = 0 # 0 = flat, 1 = sunken, 2 = flat gradient menubarstyle = 0 # 0 = flat, 1 = sunken, 2 = flat gradient
menuitemstyle = 0 # 0 = flat, 1 = 3d-ish (gradient), 2 = 3d-ish (button)
listviewitemstyle = 0 # 0 = flat, 1 = 3d-ish (gradient)
progressbarstyle = 1 # 0 = candy bar, 1 = fancy candy bar, 2 = flat
} }
} }

View file

@ -169,9 +169,9 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[])
theme_manager = new ThemeManager(); theme_manager = new ThemeManager();
std::string color_file = ARDOUR::find_config_file("ardour.colors"); //std::string color_file = ARDOUR::find_config_file("ardour.colors");
theme_manager->load (color_file); //theme_manager->load (color_file);
editor = 0; editor = 0;
mixer = 0; mixer = 0;
@ -1527,7 +1527,7 @@ ARDOUR_UI::setup_theme ()
} }
ThemeChanged (rcfile); //EMIT SIGNAL ThemeChanged (rcfile); //EMIT SIGNAL
theme_manager->setup_theme_buttons(); theme_manager->setup_theme();
} }
gint gint

View file

@ -57,6 +57,7 @@
#include <gtkmm2ext/bindable_button.h> #include <gtkmm2ext/bindable_button.h>
#include <ardour/ardour.h> #include <ardour/ardour.h>
#include <ardour/session.h> #include <ardour/session.h>
#include <ardour/configuration.h>
#include "audio_clock.h" #include "audio_clock.h"
#include "ardour_dialog.h" #include "ardour_dialog.h"

View file

@ -48,6 +48,8 @@
#include "i18n.h" #include "i18n.h"
#define MUTED_ALPHA 0x50
using namespace sigc; using namespace sigc;
using namespace ARDOUR; using namespace ARDOUR;
using namespace PBD; using namespace PBD;
@ -390,9 +392,9 @@ AudioRegionView::region_muted ()
for (uint32_t n=0; n < waves.size(); ++n) { for (uint32_t n=0; n < waves.size(); ++n) {
if (_region->muted()) { if (_region->muted()) {
waves[n]->property_wave_color() = color_map[cMutedWaveForm]; waves[n]->property_wave_color() = UINT_RGBA_CHANGE_A(Config->canvasvar_WaveForm.get(), MUTED_ALPHA);
} else { } else {
waves[n]->property_wave_color() = color_map[cWaveForm]; waves[n]->property_wave_color() = Config->canvasvar_WaveForm.get();
} }
} }
} }
@ -699,18 +701,18 @@ AudioRegionView::set_colors ()
RegionView::set_colors(); RegionView::set_colors();
if (gain_line) { if (gain_line) {
gain_line->set_line_color (audio_region()->envelope_active() ? color_map[cGainLine] : color_map[cGainLineInactive]); gain_line->set_line_color (audio_region()->envelope_active() ? Config->canvasvar_GainLine.get() : Config->canvasvar_GainLineInactive.get());
} }
for (uint32_t n=0; n < waves.size(); ++n) { for (uint32_t n=0; n < waves.size(); ++n) {
if (_region->muted()) { if (_region->muted()) {
waves[n]->property_wave_color() = color_map[cMutedWaveForm]; waves[n]->property_wave_color() = UINT_RGBA_CHANGE_A(Config->canvasvar_WaveForm.get(), MUTED_ALPHA);
} else { } else {
waves[n]->property_wave_color() = color_map[cWaveForm]; waves[n]->property_wave_color() = Config->canvasvar_WaveForm.get();
} }
waves[n]->property_clip_color() = color_map[cWaveFormClip]; waves[n]->property_clip_color() = Config->canvasvar_WaveFormClip.get();
waves[n]->property_zero_color() = color_map[cZeroLine]; waves[n]->property_zero_color() = Config->canvasvar_ZeroLine.get();
} }
} }
@ -848,9 +850,9 @@ AudioRegionView::create_one_wave (uint32_t which, bool direct)
wave->property_height() = (double) ht; wave->property_height() = (double) ht;
wave->property_samples_per_unit() = samples_per_unit; wave->property_samples_per_unit() = samples_per_unit;
wave->property_amplitude_above_axis() = _amplitude_above_axis; wave->property_amplitude_above_axis() = _amplitude_above_axis;
wave->property_wave_color() = _region->muted() ? color_map[cMutedWaveForm] : color_map[cWaveForm]; wave->property_wave_color() = _region->muted() ? UINT_RGBA_CHANGE_A(Config->canvasvar_WaveForm.get(), MUTED_ALPHA) : Config->canvasvar_WaveForm.get();
wave->property_clip_color() = color_map[cWaveFormClip]; wave->property_clip_color() = Config->canvasvar_WaveFormClip.get();
wave->property_zero_color() = color_map[cZeroLine]; wave->property_zero_color() = Config->canvasvar_ZeroLine.get();
wave->property_region_start() = _region->start(); wave->property_region_start() = _region->start();
wave->property_rectified() = (bool) (_flags & WaveformRectified); wave->property_rectified() = (bool) (_flags & WaveformRectified);
wave->property_logscaled() = (bool) (_flags & WaveformLogScaled); wave->property_logscaled() = (bool) (_flags & WaveformLogScaled);
@ -894,7 +896,7 @@ AudioRegionView::create_one_wave (uint32_t which, bool direct)
zero_line = new ArdourCanvas::SimpleLine (*group); zero_line = new ArdourCanvas::SimpleLine (*group);
zero_line->property_x1() = (gdouble) 1.0; zero_line->property_x1() = (gdouble) 1.0;
zero_line->property_x2() = (gdouble) (_region->length() / samples_per_unit) - 1.0; zero_line->property_x2() = (gdouble) (_region->length() / samples_per_unit) - 1.0;
zero_line->property_color_rgba() = (guint) color_map[cZeroLine]; zero_line->property_color_rgba() = (guint) Config->canvasvar_ZeroLine.get();
manage_zero_line (); manage_zero_line ();
} }
} }
@ -1096,9 +1098,9 @@ AudioRegionView::add_ghost (AutomationTimeAxisView& atv)
wave->property_x() = 0.0; wave->property_x() = 0.0;
wave->property_samples_per_unit() = samples_per_unit; wave->property_samples_per_unit() = samples_per_unit;
wave->property_amplitude_above_axis() = _amplitude_above_axis; wave->property_amplitude_above_axis() = _amplitude_above_axis;
wave->property_wave_color() = color_map[cGhostTrackWave]; wave->property_wave_color() = Config->canvasvar_GhostTrackWave.get();
wave->property_clip_color() = color_map[cGhostTrackWaveClip]; wave->property_clip_color() = Config->canvasvar_GhostTrackWaveClip.get();
wave->property_zero_color() = color_map[cGhostTrackZeroLine]; wave->property_zero_color() = Config->canvasvar_GhostTrackZeroLine.get();
wave->property_region_start() = _region->start(); wave->property_region_start() = _region->start();
ghost->waves.push_back(wave); ghost->waves.push_back(wave);
@ -1151,7 +1153,7 @@ void
AudioRegionView::envelope_active_changed () AudioRegionView::envelope_active_changed ()
{ {
if (gain_line) { if (gain_line) {
gain_line->set_line_color (audio_region()->envelope_active() ? color_map[cGainLine] : color_map[cGainLineInactive]); gain_line->set_line_color (audio_region()->envelope_active() ? Config->canvasvar_GainLine.get() : Config->canvasvar_GainLineInactive.get());
} }
} }
@ -1178,22 +1180,16 @@ AudioRegionView::set_waveview_data_src()
} }
void void
AudioRegionView::color_handler (ColorID id, uint32_t val) AudioRegionView::color_handler ()
{ {
switch (id) { //case cMutedWaveForm:
case cMutedWaveForm: //case cWaveForm:
case cWaveForm: //case cWaveFormClip:
case cWaveFormClip: //case cZeroLine:
case cZeroLine: set_colors ();
set_colors ();
break;
case cGainLineInactive: //case cGainLineInactive:
case cGainLine: //case cGainLine:
envelope_active_changed(); envelope_active_changed();
break;
default:
break;
}
} }

View file

@ -163,7 +163,7 @@ class AudioRegionView : public RegionView
void reset_width_dependent_items (double pixel_width); void reset_width_dependent_items (double pixel_width);
void set_waveview_data_src(); void set_waveview_data_src();
void color_handler (ColorID, uint32_t); void color_handler ();
vector<GnomeCanvasWaveViewCache*> wave_caches; vector<GnomeCanvasWaveViewCache*> wave_caches;

View file

@ -64,12 +64,12 @@ AudioStreamView::AudioStreamView (AudioTimeAxisView& tv)
_waveform_shape = Traditional; _waveform_shape = Traditional;
if (tv.is_track()) if (tv.is_track())
stream_base_color = color_map[cAudioTrackBase]; stream_base_color = Config->canvasvar_AudioTrackBase.get();
else else
stream_base_color = color_map[cAudioBusBase]; stream_base_color = Config->canvasvar_AudioBusBase.get();
canvas_rect->property_fill_color_rgba() = stream_base_color; canvas_rect->property_fill_color_rgba() = stream_base_color;
canvas_rect->property_outline_color_rgba() = color_map[cAudioTrackOutline]; canvas_rect->property_outline_color_rgba() = RGBA_BLACK;
_amplitude_above_axis = 1.0; _amplitude_above_axis = 1.0;
@ -520,12 +520,12 @@ AudioStreamView::setup_rec_box ()
switch (_trackview.audio_track()->mode()) { switch (_trackview.audio_track()->mode()) {
case Normal: case Normal:
xend = xstart; xend = xstart;
fill_color = color_map[cRecordingRectFill]; fill_color = Config->canvasvar_RecordingRect.get();
break; break;
case Destructive: case Destructive:
xend = xstart + 2; xend = xstart + 2;
fill_color = color_map[cRecordingRectFill]; fill_color = Config->canvasvar_RecordingRect.get();
/* make the recording rect translucent to allow /* make the recording rect translucent to allow
the user to see the peak data coming in, etc. the user to see the peak data coming in, etc.
*/ */
@ -538,7 +538,7 @@ AudioStreamView::setup_rec_box ()
rec_rect->property_y1() = 1.0; rec_rect->property_y1() = 1.0;
rec_rect->property_x2() = xend; rec_rect->property_x2() = xend;
rec_rect->property_y2() = (double) _trackview.height - 1; rec_rect->property_y2() = (double) _trackview.height - 1;
rec_rect->property_outline_color_rgba() = color_map[cRecordingRectOutline]; rec_rect->property_outline_color_rgba() = Config->canvasvar_RecordingRect.get();
rec_rect->property_fill_color_rgba() = fill_color; rec_rect->property_fill_color_rgba() = fill_color;
rec_rect->lower_to_bottom(); rec_rect->lower_to_bottom();
@ -761,26 +761,18 @@ AudioStreamView::reveal_xfades_involving (AudioRegionView& rv)
} }
void void
AudioStreamView::color_handler (ColorID id, uint32_t val) AudioStreamView::color_handler ()
{ {
switch (id) { //case cAudioTrackBase:
case cAudioTrackBase: if (_trackview.is_track()) {
if (_trackview.is_track()) { canvas_rect->property_fill_color_rgba() = Config->canvasvar_AudioTrackBase.get();
canvas_rect->property_fill_color_rgba() = val;
}
break;
case cAudioBusBase:
if (!_trackview.is_track()) {
canvas_rect->property_fill_color_rgba() = val;
}
break;
case cAudioTrackOutline:
canvas_rect->property_outline_color_rgba() = val;
break;
default:
break;
} }
//case cAudioBusBase:
if (!_trackview.is_track()) {
canvas_rect->property_fill_color_rgba() = Config->canvasvar_AudioBusBase.get();
}
} }
void void

View file

@ -97,7 +97,7 @@ class AudioStreamView : public StreamView
void add_crossfade_weak (boost::weak_ptr<ARDOUR::Crossfade>); void add_crossfade_weak (boost::weak_ptr<ARDOUR::Crossfade>);
void remove_crossfade (boost::shared_ptr<ARDOUR::Region>); void remove_crossfade (boost::shared_ptr<ARDOUR::Region>);
void color_handler (ColorID id, uint32_t val); void color_handler ();
void update_contents_y_position_and_height (); void update_contents_y_position_and_height ();

View file

@ -379,7 +379,7 @@ AudioTimeAxisView::add_gain_automation_child ()
*gain_track->canvas_display, *gain_track->canvas_display,
_route->gain_automation_curve()); _route->gain_automation_curve());
line->set_line_color (color_map[cAutomationLine]); line->set_line_color (Config->canvasvar_AutomationLine.get());
gain_track->add_line (*line); gain_track->add_line (*line);
@ -460,10 +460,10 @@ AudioTimeAxisView::update_pans ()
if (p == _route->panner().begin()) { if (p == _route->panner().begin()) {
/* first line is a nice orange */ /* first line is a nice orange */
line->set_line_color (color_map[cLeftPanAutomationLine]); line->set_line_color (Config->canvasvar_AutomationLine.get());
} else { } else {
/* second line is a nice blue */ /* second line is a nice blue */
line->set_line_color (color_map[cRightPanAutomationLine]); line->set_line_color (Config->canvasvar_AutomationLine.get());
} }
pan_track->add_line (*line); pan_track->add_line (*line);

View file

@ -69,8 +69,8 @@ ControlPoint::ControlPoint (AutomationLine& al)
item = new Canvas::SimpleRect (line.canvas_group()); item = new Canvas::SimpleRect (line.canvas_group());
item->property_draw() = true; item->property_draw() = true;
item->property_fill() = false; item->property_fill() = false;
item->property_fill_color_rgba() = color_map[cControlPointFill]; item->property_fill_color_rgba() = Config->canvasvar_ControlPointFill.get();
item->property_outline_color_rgba() = color_map[cControlPointOutline]; item->property_outline_color_rgba() = Config->canvasvar_ControlPointOutline.get();
item->property_outline_pixels() = 1; item->property_outline_pixels() = 1;
item->set_data ("control_point", this); item->set_data ("control_point", this);
item->signal_event().connect (mem_fun (this, &ControlPoint::event_handler)); item->signal_event().connect (mem_fun (this, &ControlPoint::event_handler));
@ -97,7 +97,7 @@ ControlPoint::ControlPoint (const ControlPoint& other, bool dummy_arg_to_force_s
item = new Canvas::SimpleRect (line.canvas_group()); item = new Canvas::SimpleRect (line.canvas_group());
item->property_fill() = false; item->property_fill() = false;
item->property_outline_color_rgba() = color_map[cEnteredControlPointOutline]; item->property_outline_color_rgba() = Config->canvasvar_EnteredControlPointOutline.get();
item->property_outline_pixels() = 1; item->property_outline_pixels() = 1;
/* NOTE: no event handling in copied ControlPoints */ /* NOTE: no event handling in copied ControlPoints */
@ -148,10 +148,10 @@ ControlPoint::show_color (bool entered, bool hide_too)
{ {
if (entered) { if (entered) {
if (selected) { if (selected) {
item->property_outline_color_rgba() = color_map[cEnteredControlPointSelected]; item->property_outline_color_rgba() = Config->canvasvar_EnteredControlPointSelected.get();
set_visible(true); set_visible(true);
} else { } else {
item->property_outline_color_rgba() = color_map[cEnteredControlPoint]; item->property_outline_color_rgba() = Config->canvasvar_EnteredControlPoint.get();
if (hide_too) { if (hide_too) {
set_visible(false); set_visible(false);
} }
@ -159,10 +159,10 @@ ControlPoint::show_color (bool entered, bool hide_too)
} else { } else {
if (selected) { if (selected) {
item->property_outline_color_rgba() = color_map[cControlPointSelected]; item->property_outline_color_rgba() = Config->canvasvar_ControlPointSelected.get();
set_visible(true); set_visible(true);
} else { } else {
item->property_outline_color_rgba() = color_map[cControlPoint]; item->property_outline_color_rgba() = Config->canvasvar_ControlPoint.get();
if (hide_too) { if (hide_too) {
set_visible(false); set_visible(false);
} }
@ -1148,7 +1148,7 @@ AutomationLine::set_selected_points (PointSelection& points)
} }
void AutomationLine::set_colors() { void AutomationLine::set_colors() {
set_line_color( color_map[cAutomationLine] ); set_line_color( Config->canvasvar_AutomationLine.get() );
for (vector<ControlPoint*>::iterator i = control_points.begin(); i != control_points.end(); ++i) { for (vector<ControlPoint*>::iterator i = control_points.begin(); i != control_points.end(); ++i) {
(*i)->show_color (false, !points_visible); (*i)->show_color (false, !points_visible);
} }

View file

@ -74,11 +74,11 @@ AutomationTimeAxisView::AutomationTimeAxisView (Session& s, boost::shared_ptr<Ro
base_rect->property_x1() = 0.0; base_rect->property_x1() = 0.0;
base_rect->property_y1() = 0.0; base_rect->property_y1() = 0.0;
base_rect->property_x2() = editor.frame_to_pixel (max_frames); base_rect->property_x2() = editor.frame_to_pixel (max_frames);
base_rect->property_outline_color_rgba() = color_map[cAutomationTrackOutline]; base_rect->property_outline_color_rgba() = Config->canvasvar_AutomationTrackOutline.get();
/* outline ends and bottom */ /* outline ends and bottom */
base_rect->property_outline_what() = (guint32) (0x1|0x2|0x8); base_rect->property_outline_what() = (guint32) (0x1|0x2|0x8);
base_rect->property_fill_color_rgba() = color_map[cAutomationTrackFill]; base_rect->property_fill_color_rgba() = Config->canvasvar_AutomationTrackFill.get();
//base_rect->property_fill_color_rgba() = color_map[cEnteredControlPoint]; //base_rect->property_fill_color_rgba() = Config->canvasvar_EnteredControlPoint.get();
base_rect->set_data ("trackview", this); base_rect->set_data ("trackview", this);
@ -182,7 +182,7 @@ AutomationTimeAxisView::AutomationTimeAxisView (Session& s, boost::shared_ptr<Ro
/* make sure labels etc. are correct */ /* make sure labels etc. are correct */
automation_state_changed (); automation_state_changed ();
ColorChanged.connect (mem_fun (*this, &AutomationTimeAxisView::color_handler)); ColorsChanged.connect (mem_fun (*this, &AutomationTimeAxisView::color_handler));
} }
AutomationTimeAxisView::~AutomationTimeAxisView () AutomationTimeAxisView::~AutomationTimeAxisView ()
@ -821,24 +821,19 @@ AutomationTimeAxisView::set_colors () {
} }
void void
AutomationTimeAxisView::color_handler (ColorID id, uint32_t val) { AutomationTimeAxisView::color_handler ()
{
switch (id) { //case cGhostTrackWave:
case cGhostTrackWave: //case cGhostTrackWaveClip:
case cGhostTrackWaveClip: //case cGhostTrackZeroLine:
case cGhostTrackZeroLine:
case cControlPoint: //case cControlPoint:
case cControlPointFill: //case cControlPointFill:
case cControlPointOutline: //case cControlPointOutline:
case cAutomationLine: //case cAutomationLine:
set_colors (); set_colors ();
break;
default:
break;
}
} }

View file

@ -142,7 +142,7 @@ class AutomationTimeAxisView : public TimeAxisView {
void exited (); void exited ();
void set_colors (); void set_colors ();
void color_handler (ColorID, uint32_t); void color_handler ();
static Pango::FontDescription name_font; static Pango::FontDescription name_font;
static bool have_name_font; static bool have_name_font;

View file

@ -1,38 +0,0 @@
/*
Copyright (C) 2000-2007 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_color_h__
#define __gtk_ardour_color_h__
#include <sigc++/signal.h>
#undef COLORID
#define COLORID(a) a,
enum ColorID {
#include "colors.h"
};
#undef COLORID
typedef std::map<ColorID,int> ColorMap;
extern ColorMap color_map;
extern sigc::signal<void> ColorsChanged;
extern sigc::signal<void,ColorID,uint32_t> ColorChanged;
#endif /* __gtk_ardour_color_h__ */

View file

@ -1,137 +0,0 @@
/*
Copyright (C) 2000-2007 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.
*/
/* no guard clauses here */
COLORID(cWaveForm)
COLORID(cWaveFormClip)
COLORID(cMutedWaveForm)
COLORID(cSelectedFrameBase)
COLORID(cFrameBase)
COLORID(cAudioTrackBase)
COLORID(cAudioTrackOutline)
COLORID(cAudioBusBase)
COLORID(cMidiTrackBase)
COLORID(cMidiTrackOutline)
COLORID(cMidiBusBase)
COLORID(cTimeStretchFill)
COLORID(cTimeStretchOutline)
COLORID(cAutomationLine)
COLORID(cLeftPanAutomationLine)
COLORID(cRightPanAutomationLine)
COLORID(cRedirectAutomationLine)
COLORID(cControlPointFill)
COLORID(cControlPointOutline)
COLORID(cEnteredControlPointOutline)
COLORID(cEnteredControlPointSelected)
COLORID(cEnteredControlPoint)
COLORID(cControlPointSelected)
COLORID(cControlPoint)
COLORID(cAutomationTrackFill)
COLORID(cAutomationTrackOutline)
COLORID(cCrossfadeEditorBase)
COLORID(cCrossfadeEditorLine)
COLORID(cSelectedCrossfadeEditorLine)
COLORID(cCrossfadeEditorLineShading)
COLORID(cCrossfadeEditorPointFill)
COLORID(cCrossfadeEditorPointOutline)
COLORID(cCrossfadeEditorWave)
COLORID(cSelectedCrossfadeEditorWave)
COLORID(cCrossfadeLine)
COLORID(cActiveCrossfade)
COLORID(cInactiveCrossfade)
COLORID(cLocationMarker)
COLORID(cLocationRange)
COLORID(cLocationCDMarker)
COLORID(cLocationLoop)
COLORID(cLocationPunch)
COLORID(cVerboseCanvasCursor)
COLORID(cMarkerLabel)
COLORID(cTempoBar)
COLORID(cTempoSeparator)
COLORID(cMeterBar)
COLORID(cMeterSeparator)
COLORID(cMarkerBar)
COLORID(cMarkerSeparator)
COLORID(cRangeMarkerBar)
COLORID(cRangeMarkerSeparator)
COLORID(cTransportMarkerBar)
COLORID(cTransportMarkerSeparator)
COLORID(cRangeDragBarRect)
COLORID(cRangeDragBarRectFill)
COLORID(cRangeDragRect)
COLORID(cRangeDragRectFill)
COLORID(cTransportDragRect)
COLORID(cTransportDragRectFill)
COLORID(cMarkerDragLine)
COLORID(cTransportLoopRect)
COLORID(cTransportLoopRectFill)
COLORID(cTransportPunchRect)
COLORID(cTransportPunchRectFill)
COLORID(cPunchInLine)
COLORID(cPunchOutLine)
COLORID(cZoomRect)
COLORID(cZoomRectFill)
COLORID(cRubberBandRect)
COLORID(cRubberBandRectFill)
COLORID(cFirstActionMessage)
COLORID(cEnteredGainLine)
COLORID(cEnteredAutomationLine)
COLORID(cEnteredMarker)
COLORID(cMeterMarker)
COLORID(cTempoMarker)
COLORID(cMeasureLineBeat)
COLORID(cMeasureLineBar)
COLORID(cGhostTrackBaseOutline)
COLORID(cGhostTrackBaseFill)
COLORID(cGhostTrackWave)
COLORID(cGhostTrackWaveClip)
COLORID(cGhostTrackZeroLine)
COLORID(cImageTrackBase)
COLORID(cImageTrackOutline)
COLORID(cMarkerTrackBase)
COLORID(cMarkerTrackOutline)
COLORID(cZeroLine)
COLORID(cGainLine)
COLORID(cGainLineInactive)
COLORID(cRecordingRectFill)
COLORID(cRecordingRectOutline)
COLORID(cSelectionRectFill)
COLORID(cSelectionRectOutline)
COLORID(cSelectionEndFill)
COLORID(cSelectionEndOutline)
COLORID(cSelectionStartFill)
COLORID(cSelectionStartOutline)
COLORID(cVestigialFrameFill)
COLORID(cVestigialFrameOutline)
COLORID(cTimeAxisFrameFill)
COLORID(cTimeAxisFrameOutline)
COLORID(cNameHighlightFill)
COLORID(cNameHighlightOutline)
COLORID(cFrameHandleStartFill)
COLORID(cFrameHandleStartOutline)
COLORID(cFrameHandleEndFill)
COLORID(cFrameHandleEndOutline)
COLORID(cTrimHandleLockedStart)
COLORID(cTrimHandleLockedEnd)
COLORID(cTrimHandleStart)
COLORID(cTrimHandleEnd)
COLORID(cEditCursor)
COLORID(cPlayHead)

View file

@ -129,23 +129,23 @@ CrossfadeEditor::CrossfadeEditor (Session& s, boost::shared_ptr<Crossfade> xf, d
toplevel->property_x2() = 10.0; toplevel->property_x2() = 10.0;
toplevel->property_y2() = 10.0; toplevel->property_y2() = 10.0;
toplevel->property_fill() = true; toplevel->property_fill() = true;
toplevel->property_fill_color_rgba() = color_map[cCrossfadeEditorBase]; toplevel->property_fill_color_rgba() = Config->canvasvar_CrossfadeEditorBase.get();
toplevel->property_outline_pixels() = 0; toplevel->property_outline_pixels() = 0;
toplevel->signal_event().connect (mem_fun (*this, &CrossfadeEditor::canvas_event)); toplevel->signal_event().connect (mem_fun (*this, &CrossfadeEditor::canvas_event));
fade[Out].line = new ArdourCanvas::Line (*(canvas->root())); fade[Out].line = new ArdourCanvas::Line (*(canvas->root()));
fade[Out].line->property_width_pixels() = 1; fade[Out].line->property_width_pixels() = 1;
fade[Out].line->property_fill_color_rgba() = color_map[cCrossfadeEditorLine]; fade[Out].line->property_fill_color_rgba() = Config->canvasvar_CrossfadeEditorLine.get();
fade[Out].shading = new ArdourCanvas::Polygon (*(canvas->root())); fade[Out].shading = new ArdourCanvas::Polygon (*(canvas->root()));
fade[Out].shading->property_fill_color_rgba() = color_map[cCrossfadeEditorLineShading]; fade[Out].shading->property_fill_color_rgba() = Config->canvasvar_CrossfadeEditorLineShading.get();
fade[In].line = new ArdourCanvas::Line (*(canvas->root())); fade[In].line = new ArdourCanvas::Line (*(canvas->root()));
fade[In].line->property_width_pixels() = 1; fade[In].line->property_width_pixels() = 1;
fade[In].line->property_fill_color_rgba() = color_map[cCrossfadeEditorLine]; fade[In].line->property_fill_color_rgba() = Config->canvasvar_CrossfadeEditorLine.get();
fade[In].shading = new ArdourCanvas::Polygon (*(canvas->root())); fade[In].shading = new ArdourCanvas::Polygon (*(canvas->root()));
fade[In].shading->property_fill_color_rgba() = color_map[cCrossfadeEditorLineShading]; fade[In].shading->property_fill_color_rgba() = Config->canvasvar_CrossfadeEditorLineShading.get();
fade[In].shading->signal_event().connect (mem_fun (*this, &CrossfadeEditor::canvas_event)); fade[In].shading->signal_event().connect (mem_fun (*this, &CrossfadeEditor::canvas_event));
fade[In].line->signal_event().connect (mem_fun (*this, &CrossfadeEditor::curve_event)); fade[In].line->signal_event().connect (mem_fun (*this, &CrossfadeEditor::curve_event));
@ -454,8 +454,8 @@ CrossfadeEditor::make_point ()
p->box = new ArdourCanvas::SimpleRect (*(canvas->root())); p->box = new ArdourCanvas::SimpleRect (*(canvas->root()));
p->box->property_fill() = true; p->box->property_fill() = true;
p->box->property_fill_color_rgba() = color_map[cCrossfadeEditorPointFill]; p->box->property_fill_color_rgba() = Config->canvasvar_CrossfadeEditorPointFill.get();
p->box->property_outline_color_rgba() = color_map[cCrossfadeEditorPointOutline]; p->box->property_outline_color_rgba() = Config->canvasvar_CrossfadeEditorPointOutline.get();
p->box->property_outline_pixels() = 1; p->box->property_outline_pixels() = 1;
p->curve = fade[current].line; p->curve = fade[current].line;
@ -976,15 +976,15 @@ CrossfadeEditor::curve_select_clicked (WhichFade wf)
if (wf == In) { if (wf == In) {
for (vector<ArdourCanvas::WaveView*>::iterator i = fade[In].waves.begin(); i != fade[In].waves.end(); ++i) { for (vector<ArdourCanvas::WaveView*>::iterator i = fade[In].waves.begin(); i != fade[In].waves.end(); ++i) {
(*i)->property_wave_color() = color_map[cSelectedCrossfadeEditorWave]; (*i)->property_wave_color() = Config->canvasvar_SelectedCrossfadeEditorWave.get();
} }
for (vector<ArdourCanvas::WaveView*>::iterator i = fade[Out].waves.begin(); i != fade[Out].waves.end(); ++i) { for (vector<ArdourCanvas::WaveView*>::iterator i = fade[Out].waves.begin(); i != fade[Out].waves.end(); ++i) {
(*i)->property_wave_color() = color_map[cCrossfadeEditorWave]; (*i)->property_wave_color() = Config->canvasvar_CrossfadeEditorWave.get();
} }
fade[In].line->property_fill_color_rgba() = color_map[cSelectedCrossfadeEditorLine]; fade[In].line->property_fill_color_rgba() = Config->canvasvar_SelectedCrossfadeEditorLine.get();
fade[Out].line->property_fill_color_rgba() = color_map[cCrossfadeEditorLine]; fade[Out].line->property_fill_color_rgba() = Config->canvasvar_CrossfadeEditorLine.get();
fade[Out].shading->hide(); fade[Out].shading->hide();
fade[In].shading->show(); fade[In].shading->show();
@ -999,15 +999,15 @@ CrossfadeEditor::curve_select_clicked (WhichFade wf)
} else { } else {
for (vector<ArdourCanvas::WaveView*>::iterator i = fade[In].waves.begin(); i != fade[In].waves.end(); ++i) { for (vector<ArdourCanvas::WaveView*>::iterator i = fade[In].waves.begin(); i != fade[In].waves.end(); ++i) {
(*i)->property_wave_color() = color_map[cCrossfadeEditorWave]; (*i)->property_wave_color() = Config->canvasvar_CrossfadeEditorWave.get();
} }
for (vector<ArdourCanvas::WaveView*>::iterator i = fade[Out].waves.begin(); i != fade[Out].waves.end(); ++i) { for (vector<ArdourCanvas::WaveView*>::iterator i = fade[Out].waves.begin(); i != fade[Out].waves.end(); ++i) {
(*i)->property_wave_color() = color_map[cSelectedCrossfadeEditorWave]; (*i)->property_wave_color() = Config->canvasvar_SelectedCrossfadeEditorWave.get();
} }
fade[Out].line->property_fill_color_rgba() = color_map[cSelectedCrossfadeEditorLine]; fade[Out].line->property_fill_color_rgba() = Config->canvasvar_SelectedCrossfadeEditorLine.get();
fade[In].line->property_fill_color_rgba() = color_map[cCrossfadeEditorLine]; fade[In].line->property_fill_color_rgba() = Config->canvasvar_CrossfadeEditorLine.get();
fade[In].shading->hide(); fade[In].shading->hide();
fade[Out].shading->show(); fade[Out].shading->show();
@ -1049,9 +1049,9 @@ CrossfadeEditor::make_waves (boost::shared_ptr<AudioRegion> region, WhichFade wh
double spu; double spu;
if (which == In) { if (which == In) {
color = color_map[cSelectedCrossfadeEditorWave]; color = Config->canvasvar_SelectedCrossfadeEditorWave.get();
} else { } else {
color = color_map[cCrossfadeEditorWave]; color = Config->canvasvar_CrossfadeEditorWave.get();
} }
ht = canvas->get_allocation().get_height() / (double) nchans; ht = canvas->get_allocation().get_height() / (double) nchans;

View file

@ -61,11 +61,11 @@ CrossfadeView::CrossfadeView (ArdourCanvas::Group *parent,
_visible = true; _visible = true;
fade_in = new Line (*group); fade_in = new Line (*group);
fade_in->property_fill_color_rgba() = color_map[cCrossfadeLine]; fade_in->property_fill_color_rgba() = Config->canvasvar_CrossfadeLine.get();
fade_in->property_width_pixels() = 1; fade_in->property_width_pixels() = 1;
fade_out = new Line (*group); fade_out = new Line (*group);
fade_out->property_fill_color_rgba() = color_map[cCrossfadeLine]; fade_out->property_fill_color_rgba() = Config->canvasvar_CrossfadeLine.get();
fade_out->property_width_pixels() = 1; fade_out->property_width_pixels() = 1;
set_y_position_and_height (0, get_time_axis_view().height); set_y_position_and_height (0, get_time_axis_view().height);
@ -84,6 +84,7 @@ CrossfadeView::CrossfadeView (ArdourCanvas::Group *parent,
crossfade_changed (Change (~0)); crossfade_changed (Change (~0));
crossfade->StateChanged.connect (mem_fun(*this, &CrossfadeView::crossfade_changed)); crossfade->StateChanged.connect (mem_fun(*this, &CrossfadeView::crossfade_changed));
ColorsChanged.connect (mem_fun (*this, &CrossfadeView::color_handler));
} }
CrossfadeView::~CrossfadeView () CrossfadeView::~CrossfadeView ()
@ -219,14 +220,20 @@ void
CrossfadeView::active_changed () CrossfadeView::active_changed ()
{ {
if (crossfade->active()) { if (crossfade->active()) {
frame->property_fill_color_rgba() = color_map[cActiveCrossfade]; frame->property_fill_color_rgba() = Config->canvasvar_ActiveCrossfade.get();
} else { } else {
frame->property_fill_color_rgba() = color_map[cInactiveCrossfade]; frame->property_fill_color_rgba() = Config->canvasvar_InactiveCrossfade.get();
} }
redraw_curves (); redraw_curves ();
} }
void
CrossfadeView::color_handler ()
{
active_changed ();
}
void void
CrossfadeView::set_valid (bool yn) CrossfadeView::set_valid (bool yn)
{ {
@ -262,3 +269,4 @@ CrossfadeView::fake_hide ()
{ {
group->hide(); group->hide();
} }

View file

@ -79,6 +79,7 @@ struct CrossfadeView : public TimeAxisViewItem
void crossfade_changed (ARDOUR::Change); void crossfade_changed (ARDOUR::Change);
void active_changed (); void active_changed ();
void redraw_curves (); void redraw_curves ();
void color_handler ();
}; };
#endif /* __gtk_ardour_crossfade_view_h__ */ #endif /* __gtk_ardour_crossfade_view_h__ */

View file

@ -312,11 +312,11 @@ Editor::Editor ()
_dragging_playhead = false; _dragging_playhead = false;
_dragging_hscrollbar = false; _dragging_hscrollbar = false;
location_marker_color = color_map[cLocationMarker]; location_marker_color = Config->canvasvar_LocationMarker.get();
location_range_color = color_map[cLocationRange]; location_range_color = Config->canvasvar_LocationRange.get();
location_cd_marker_color = color_map[cLocationCDMarker]; location_cd_marker_color = Config->canvasvar_LocationCDMarker.get();
location_loop_color = color_map[cLocationLoop]; location_loop_color = Config->canvasvar_LocationLoop.get();
location_punch_color = color_map[cLocationPunch]; location_punch_color = Config->canvasvar_LocationPunch.get();
range_marker_drag_rect = 0; range_marker_drag_rect = 0;
marker_drag_line = 0; marker_drag_line = 0;
@ -3649,3 +3649,4 @@ Editor::edit_cursor_position(bool sync)
return edit_cursor->current_frame; return edit_cursor->current_frame;
} }

View file

@ -351,6 +351,7 @@ class Editor : public PublicEditor
private: private:
/// The session that we are editing, or 0 /// The session that we are editing, or 0
void color_handler ();
ARDOUR::Session *session; ARDOUR::Session *session;
bool constructed; bool constructed;

View file

@ -138,7 +138,6 @@ Editor::initialize_canvas ()
verbose_canvas_cursor = new ArdourCanvas::Text (*track_canvas.root()); verbose_canvas_cursor = new ArdourCanvas::Text (*track_canvas.root());
verbose_canvas_cursor->property_font_desc() = font; verbose_canvas_cursor->property_font_desc() = font;
verbose_canvas_cursor->property_anchor() = ANCHOR_NW; verbose_canvas_cursor->property_anchor() = ANCHOR_NW;
verbose_canvas_cursor->property_fill_color_rgba() = color_map[cVerboseCanvasCursor];
verbose_cursor_visible = false; verbose_cursor_visible = false;
@ -160,44 +159,30 @@ Editor::initialize_canvas ()
transport_marker_group = new ArdourCanvas::Group (*time_canvas.root(), 0.0, timebar_height * 4.0); transport_marker_group = new ArdourCanvas::Group (*time_canvas.root(), 0.0, timebar_height * 4.0);
tempo_bar = new ArdourCanvas::SimpleRect (*tempo_group, 0.0, 0.0, max_canvas_coordinate, timebar_height-1.0); tempo_bar = new ArdourCanvas::SimpleRect (*tempo_group, 0.0, 0.0, max_canvas_coordinate, timebar_height-1.0);
tempo_bar->property_fill_color_rgba() = color_map[cTempoBar];
tempo_bar->property_outline_what() = (0x1 | 0x8); tempo_bar->property_outline_what() = (0x1 | 0x8);
tempo_bar->property_outline_pixels() = 1; tempo_bar->property_outline_pixels() = 1;
tempo_bar->property_outline_color_rgba() = color_map[cTempoSeparator];
meter_bar = new ArdourCanvas::SimpleRect (*meter_group, 0.0, 0.0, max_canvas_coordinate, timebar_height-1.0); meter_bar = new ArdourCanvas::SimpleRect (*meter_group, 0.0, 0.0, max_canvas_coordinate, timebar_height-1.0);
meter_bar->property_fill_color_rgba() = color_map[cMeterBar];
meter_bar->property_outline_what() = (0x1 | 0x8); meter_bar->property_outline_what() = (0x1 | 0x8);
meter_bar->property_outline_pixels() = 1; meter_bar->property_outline_pixels() = 1;
meter_bar->property_outline_color_rgba() = color_map[cMeterSeparator];
marker_bar = new ArdourCanvas::SimpleRect (*marker_group, 0.0, 0.0, max_canvas_coordinate, timebar_height-1.0); marker_bar = new ArdourCanvas::SimpleRect (*marker_group, 0.0, 0.0, max_canvas_coordinate, timebar_height-1.0);
marker_bar->property_fill_color_rgba() = color_map[cMarkerBar];
marker_bar->property_outline_what() = (0x1 | 0x8); marker_bar->property_outline_what() = (0x1 | 0x8);
marker_bar->property_outline_pixels() = 1; marker_bar->property_outline_pixels() = 1;
marker_bar->property_outline_color_rgba() = color_map[cMarkerSeparator];
range_marker_bar = new ArdourCanvas::SimpleRect (*range_marker_group, 0.0, 0.0, max_canvas_coordinate, timebar_height-1.0); range_marker_bar = new ArdourCanvas::SimpleRect (*range_marker_group, 0.0, 0.0, max_canvas_coordinate, timebar_height-1.0);
range_marker_bar->property_fill_color_rgba() = color_map[cRangeMarkerBar];
range_marker_bar->property_outline_what() = (0x1 | 0x8); range_marker_bar->property_outline_what() = (0x1 | 0x8);
range_marker_bar->property_outline_pixels() = 1; range_marker_bar->property_outline_pixels() = 1;
range_marker_bar->property_outline_color_rgba() = color_map[cRangeMarkerSeparator];
transport_marker_bar = new ArdourCanvas::SimpleRect (*transport_marker_group, 0.0, 0.0, max_canvas_coordinate, timebar_height-1.0); transport_marker_bar = new ArdourCanvas::SimpleRect (*transport_marker_group, 0.0, 0.0, max_canvas_coordinate, timebar_height-1.0);
transport_marker_bar->property_fill_color_rgba() = color_map[cTransportMarkerBar];
transport_marker_bar->property_outline_what() = (0x1 | 0x8); transport_marker_bar->property_outline_what() = (0x1 | 0x8);
transport_marker_bar->property_outline_pixels() = 1; transport_marker_bar->property_outline_pixels() = 1;
transport_marker_bar->property_outline_color_rgba() = color_map[cTransportMarkerSeparator];
range_bar_drag_rect = new ArdourCanvas::SimpleRect (*range_marker_group, 0.0, 0.0, max_canvas_coordinate, timebar_height-1.0); range_bar_drag_rect = new ArdourCanvas::SimpleRect (*range_marker_group, 0.0, 0.0, max_canvas_coordinate, timebar_height-1.0);
range_bar_drag_rect->property_fill_color_rgba() = color_map[cRangeDragBarRectFill];
range_bar_drag_rect->property_outline_color_rgba() = color_map[cRangeDragBarRect];
range_bar_drag_rect->property_outline_pixels() = 0; range_bar_drag_rect->property_outline_pixels() = 0;
range_bar_drag_rect->hide (); range_bar_drag_rect->hide ();
transport_bar_drag_rect = new ArdourCanvas::SimpleRect (*transport_marker_group, 0.0, 0.0, max_canvas_coordinate, timebar_height-1.0); transport_bar_drag_rect = new ArdourCanvas::SimpleRect (*transport_marker_group, 0.0, 0.0, max_canvas_coordinate, timebar_height-1.0);
transport_bar_drag_rect ->property_fill_color_rgba() = color_map[cTransportDragRectFill];
transport_bar_drag_rect->property_outline_color_rgba() = color_map[cTransportDragRect];
transport_bar_drag_rect->property_outline_pixels() = 0; transport_bar_drag_rect->property_outline_pixels() = 0;
transport_bar_drag_rect->hide (); transport_bar_drag_rect->hide ();
@ -206,24 +191,17 @@ Editor::initialize_canvas ()
marker_drag_line = new ArdourCanvas::Line (*track_canvas.root()); marker_drag_line = new ArdourCanvas::Line (*track_canvas.root());
marker_drag_line->property_width_pixels() = 1; marker_drag_line->property_width_pixels() = 1;
marker_drag_line->property_fill_color_rgba() = color_map[cMarkerDragLine];
marker_drag_line->property_points() = marker_drag_line_points; marker_drag_line->property_points() = marker_drag_line_points;
marker_drag_line->hide(); marker_drag_line->hide();
range_marker_drag_rect = new ArdourCanvas::SimpleRect (*track_canvas.root(), 0.0, 0.0, 0.0, 0.0); range_marker_drag_rect = new ArdourCanvas::SimpleRect (*track_canvas.root(), 0.0, 0.0, 0.0, 0.0);
range_marker_drag_rect->property_fill_color_rgba() = color_map[cRangeDragRectFill];
range_marker_drag_rect->property_outline_color_rgba() = color_map[cRangeDragRect];
range_marker_drag_rect->hide (); range_marker_drag_rect->hide ();
transport_loop_range_rect = new ArdourCanvas::SimpleRect (*time_line_group, 0.0, 0.0, 0.0, 0.0); transport_loop_range_rect = new ArdourCanvas::SimpleRect (*time_line_group, 0.0, 0.0, 0.0, 0.0);
transport_loop_range_rect->property_fill_color_rgba() = color_map[cTransportLoopRectFill];
transport_loop_range_rect->property_outline_color_rgba() = color_map[cTransportLoopRect];
transport_loop_range_rect->property_outline_pixels() = 1; transport_loop_range_rect->property_outline_pixels() = 1;
transport_loop_range_rect->hide(); transport_loop_range_rect->hide();
transport_punch_range_rect = new ArdourCanvas::SimpleRect (*time_line_group, 0.0, 0.0, 0.0, 0.0); transport_punch_range_rect = new ArdourCanvas::SimpleRect (*time_line_group, 0.0, 0.0, 0.0, 0.0);
transport_punch_range_rect->property_fill_color_rgba() = color_map[cTransportPunchRectFill];
transport_punch_range_rect->property_outline_color_rgba() = color_map[cTransportPunchRect];
transport_punch_range_rect->property_outline_pixels() = 0; transport_punch_range_rect->property_outline_pixels() = 0;
transport_punch_range_rect->hide(); transport_punch_range_rect->hide();
@ -234,7 +212,6 @@ Editor::initialize_canvas ()
transport_punchin_line->property_y1() = 0.0; transport_punchin_line->property_y1() = 0.0;
transport_punchin_line->property_x2() = 0.0; transport_punchin_line->property_x2() = 0.0;
transport_punchin_line->property_y2() = 0.0; transport_punchin_line->property_y2() = 0.0;
transport_punchin_line->property_color_rgba() = color_map[cPunchInLine];
transport_punchin_line->hide (); transport_punchin_line->hide ();
transport_punchout_line = new ArdourCanvas::SimpleLine (*time_line_group); transport_punchout_line = new ArdourCanvas::SimpleLine (*time_line_group);
@ -242,13 +219,10 @@ Editor::initialize_canvas ()
transport_punchout_line->property_y1() = 0.0; transport_punchout_line->property_y1() = 0.0;
transport_punchout_line->property_x2() = 0.0; transport_punchout_line->property_x2() = 0.0;
transport_punchout_line->property_y2() = 0.0; transport_punchout_line->property_y2() = 0.0;
transport_punchout_line->property_color_rgba() = color_map[cPunchOutLine];
transport_punchout_line->hide(); transport_punchout_line->hide();
// used to show zoom mode active zooming // used to show zoom mode active zooming
zoom_rect = new ArdourCanvas::SimpleRect (*track_canvas.root(), 0.0, 0.0, 0.0, 0.0); zoom_rect = new ArdourCanvas::SimpleRect (*track_canvas.root(), 0.0, 0.0, 0.0, 0.0);
zoom_rect->property_fill_color_rgba() = color_map[cZoomRectFill];
zoom_rect->property_outline_color_rgba() = color_map[cZoomRect];
zoom_rect->property_outline_pixels() = 1; zoom_rect->property_outline_pixels() = 1;
zoom_rect->hide(); zoom_rect->hide();
@ -256,8 +230,6 @@ Editor::initialize_canvas ()
// used as rubberband rect // used as rubberband rect
rubberband_rect = new ArdourCanvas::SimpleRect (*track_canvas.root(), 0.0, 0.0, 0.0, 0.0); rubberband_rect = new ArdourCanvas::SimpleRect (*track_canvas.root(), 0.0, 0.0, 0.0, 0.0);
rubberband_rect->property_outline_color_rgba() = color_map[cRubberBandRect];
rubberband_rect->property_fill_color_rgba() = (guint32) color_map[cRubberBandRectFill];
rubberband_rect->property_outline_pixels() = 1; rubberband_rect->property_outline_pixels() = 1;
rubberband_rect->hide(); rubberband_rect->hide();
@ -274,24 +246,15 @@ Editor::initialize_canvas ()
double time_width = FLT_MAX/frames_per_unit; double time_width = FLT_MAX/frames_per_unit;
time_canvas.set_scroll_region(0.0, 0.0, time_width, time_height); time_canvas.set_scroll_region(0.0, 0.0, time_width, time_height);
if (!color_map[cEditCursor]) {
warning << _("edit cursor color not defined, check your ardour.colors file!") << endmsg;
color_map[cEditCursor] = RGBA_TO_UINT (30,30,30,255);
}
if (!color_map[cPlayHead]) {
warning << _("playhead color not defined, check your ardour.colors file!") << endmsg;
color_map[cPlayHead] = RGBA_TO_UINT (0,0,0,255);
}
edit_cursor = new Cursor (*this, &Editor::canvas_edit_cursor_event); edit_cursor = new Cursor (*this, &Editor::canvas_edit_cursor_event);
edit_cursor->canvas_item.property_fill_color_rgba() = color_map[cEditCursor];
playhead_cursor = new Cursor (*this, &Editor::canvas_playhead_cursor_event); playhead_cursor = new Cursor (*this, &Editor::canvas_playhead_cursor_event);
playhead_cursor->canvas_item.property_fill_color_rgba() = color_map[cPlayHead];
initial_ruler_update_required = true; initial_ruler_update_required = true;
track_canvas.signal_size_allocate().connect (mem_fun(*this, &Editor::track_canvas_allocate)); track_canvas.signal_size_allocate().connect (mem_fun(*this, &Editor::track_canvas_allocate));
ColorsChanged.connect (mem_fun (*this, &Editor::color_handler));
color_handler();
} }
void void
@ -734,3 +697,64 @@ Editor::canvas_horizontally_scrolled ()
redisplay_tempo (!_dragging_hscrollbar); redisplay_tempo (!_dragging_hscrollbar);
} }
void
Editor::color_handler()
{
edit_cursor->canvas_item.property_fill_color_rgba() = Config->canvasvar_EditCursor.get();
playhead_cursor->canvas_item.property_fill_color_rgba() = Config->canvasvar_PlayHead.get();
verbose_canvas_cursor->property_fill_color_rgba() = Config->canvasvar_VerboseCanvasCursor.get();
meter_bar->property_fill_color_rgba() = Config->canvasvar_MeterBar.get();
meter_bar->property_outline_color_rgba() = Config->canvasvar_MeterBar.get();
tempo_bar->property_fill_color_rgba() = Config->canvasvar_TempoBar.get();
tempo_bar->property_outline_color_rgba() = Config->canvasvar_TempoBar.get();
marker_bar->property_fill_color_rgba() = Config->canvasvar_MarkerBar.get();
marker_bar->property_outline_color_rgba() = Config->canvasvar_MarkerBar.get();
range_marker_bar->property_fill_color_rgba() = Config->canvasvar_RangeMarkerBar.get();
range_marker_bar->property_outline_color_rgba() = Config->canvasvar_RangeMarkerBar.get();
transport_marker_bar->property_fill_color_rgba() = Config->canvasvar_TransportMarkerBar.get();
transport_marker_bar->property_outline_color_rgba() = Config->canvasvar_TransportMarkerBar.get();
range_bar_drag_rect->property_fill_color_rgba() = Config->canvasvar_RangeDragBarRect.get();
range_bar_drag_rect->property_outline_color_rgba() = Config->canvasvar_RangeDragBarRect.get();
transport_bar_drag_rect->property_fill_color_rgba() = Config->canvasvar_TransportDragRect.get();
transport_bar_drag_rect->property_outline_color_rgba() = Config->canvasvar_TransportDragRect.get();
marker_drag_line->property_fill_color_rgba() = Config->canvasvar_MarkerDragLine.get();
range_marker_drag_rect->property_fill_color_rgba() = Config->canvasvar_RangeDragRect.get();
range_marker_drag_rect->property_outline_color_rgba() = Config->canvasvar_RangeDragRect.get();
transport_loop_range_rect->property_fill_color_rgba() = Config->canvasvar_TransportLoopRect.get();
transport_loop_range_rect->property_outline_color_rgba() = Config->canvasvar_TransportLoopRect.get();
transport_punch_range_rect->property_fill_color_rgba() = Config->canvasvar_TransportPunchRect.get();
transport_punch_range_rect->property_outline_color_rgba() = Config->canvasvar_TransportPunchRect.get();
transport_punchin_line->property_color_rgba() = Config->canvasvar_PunchLine.get();
transport_punchout_line->property_color_rgba() = Config->canvasvar_PunchLine.get();
zoom_rect->property_fill_color_rgba() = Config->canvasvar_ZoomRect.get();
zoom_rect->property_outline_color_rgba() = Config->canvasvar_ZoomRect.get();
rubberband_rect->property_outline_color_rgba() = Config->canvasvar_RubberBandRect.get();
rubberband_rect->property_fill_color_rgba() = (guint32) Config->canvasvar_RubberBandRect.get();
location_marker_color = Config->canvasvar_LocationMarker.get();
location_range_color = Config->canvasvar_LocationRange.get();
location_cd_marker_color = Config->canvasvar_LocationCDMarker.get();
location_loop_color = Config->canvasvar_LocationLoop.get();
location_punch_color = Config->canvasvar_LocationPunch.get();
refresh_location_display ();
redisplay_tempo (true);
if (session)
session->tempo_map().apply_with_metrics (*this, &Editor::draw_metric_marks); // redraw metric markers
}

View file

@ -1087,7 +1087,7 @@ Editor::enter_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_
if (mouse_mode == MouseGain) { if (mouse_mode == MouseGain) {
ArdourCanvas::Line *line = dynamic_cast<ArdourCanvas::Line *> (item); ArdourCanvas::Line *line = dynamic_cast<ArdourCanvas::Line *> (item);
if (line) if (line)
line->property_fill_color_rgba() = color_map[cEnteredGainLine]; line->property_fill_color_rgba() = Config->canvasvar_EnteredGainLine.get();
if (is_drawable()) { if (is_drawable()) {
track_canvas.get_window()->set_cursor (*fader_cursor); track_canvas.get_window()->set_cursor (*fader_cursor);
} }
@ -1101,7 +1101,7 @@ Editor::enter_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_
{ {
ArdourCanvas::Line *line = dynamic_cast<ArdourCanvas::Line *> (item); ArdourCanvas::Line *line = dynamic_cast<ArdourCanvas::Line *> (item);
if (line) if (line)
line->property_fill_color_rgba() = color_map[cEnteredAutomationLine]; line->property_fill_color_rgba() = Config->canvasvar_EnteredAutomationLine.get();
} }
if (is_drawable()) { if (is_drawable()) {
track_canvas.get_window()->set_cursor (*fader_cursor); track_canvas.get_window()->set_cursor (*fader_cursor);
@ -1188,7 +1188,7 @@ Editor::enter_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_
if ((marker = static_cast<Marker *> (item->get_data ("marker"))) == 0) { if ((marker = static_cast<Marker *> (item->get_data ("marker"))) == 0) {
break; break;
} }
marker->set_color_rgba (color_map[cEnteredMarker]); marker->set_color_rgba (Config->canvasvar_EnteredMarker.get());
// fall through // fall through
case MeterMarkerItem: case MeterMarkerItem:
case TempoMarkerItem: case TempoMarkerItem:
@ -2179,7 +2179,7 @@ Editor::start_meter_marker_copy_grab (ArdourCanvas::Item* item, GdkEvent* event)
// The actual copying is not done before we reach the finish callback. // The actual copying is not done before we reach the finish callback.
char name[64]; char name[64];
snprintf (name, sizeof(name), "%g/%g", meter_marker->meter().beats_per_bar(), meter_marker->meter().note_divisor ()); snprintf (name, sizeof(name), "%g/%g", meter_marker->meter().beats_per_bar(), meter_marker->meter().note_divisor ());
MeterMarker* new_marker = new MeterMarker(*this, *meter_group, color_map[cMeterMarker], name, MeterMarker* new_marker = new MeterMarker(*this, *meter_group, Config->canvasvar_MeterMarker.get(), name,
*new MeterSection(meter_marker->meter())); *new MeterSection(meter_marker->meter()));
drag_info.item = &new_marker->the_item(); drag_info.item = &new_marker->the_item();
@ -2310,7 +2310,7 @@ Editor::start_tempo_marker_copy_grab (ArdourCanvas::Item* item, GdkEvent* event)
// The actual copying is not done before we reach the finish callback. // The actual copying is not done before we reach the finish callback.
char name[64]; char name[64];
snprintf (name, sizeof (name), "%.2f", tempo_marker->tempo().beats_per_minute()); snprintf (name, sizeof (name), "%.2f", tempo_marker->tempo().beats_per_minute());
TempoMarker* new_marker = new TempoMarker(*this, *tempo_group, color_map[cTempoMarker], name, TempoMarker* new_marker = new TempoMarker(*this, *tempo_group, Config->canvasvar_TempoMarker.get(), name,
*new TempoSection(tempo_marker->tempo())); *new TempoSection(tempo_marker->tempo()));
drag_info.item = &new_marker->the_item(); drag_info.item = &new_marker->the_item();

View file

@ -70,7 +70,7 @@ void
Editor::draw_metric_marks (const Metrics& metrics) Editor::draw_metric_marks (const Metrics& metrics)
{ {
const MeterSection *ms; const MeterSection *ms;
const TempoSection *ts; const TempoSection *ts;
char buf[64]; char buf[64];
@ -80,11 +80,11 @@ Editor::draw_metric_marks (const Metrics& metrics)
if ((ms = dynamic_cast<const MeterSection*>(*i)) != 0) { if ((ms = dynamic_cast<const MeterSection*>(*i)) != 0) {
snprintf (buf, sizeof(buf), "%g/%g", ms->beats_per_bar(), ms->note_divisor ()); snprintf (buf, sizeof(buf), "%g/%g", ms->beats_per_bar(), ms->note_divisor ());
metric_marks.push_back (new MeterMarker (*this, *meter_group, color_map[cMeterMarker], buf, metric_marks.push_back (new MeterMarker (*this, *meter_group, Config->canvasvar_MeterMarker.get(), buf,
*(const_cast<MeterSection*>(ms)))); *(const_cast<MeterSection*>(ms))));
} else if ((ts = dynamic_cast<const TempoSection*>(*i)) != 0) { } else if ((ts = dynamic_cast<const TempoSection*>(*i)) != 0) {
snprintf (buf, sizeof (buf), "%.2f", ts->beats_per_minute()); snprintf (buf, sizeof (buf), "%.2f", ts->beats_per_minute());
metric_marks.push_back (new TempoMarker (*this, *tempo_group, color_map[cTempoMarker], buf, metric_marks.push_back (new TempoMarker (*this, *tempo_group, Config->canvasvar_TempoMarker.get(), buf,
*(const_cast<TempoSection*>(ts)))); *(const_cast<TempoSection*>(ts))));
} }
@ -249,9 +249,9 @@ Editor::draw_measures ()
case TempoMap::Beat: case TempoMap::Beat:
if ((*i).beat == 1) { if ((*i).beat == 1) {
color = color_map[cMeasureLineBar]; color = Config->canvasvar_MeasureLineBar.get();
} else { } else {
color = color_map[cMeasureLineBeat]; color = Config->canvasvar_MeasureLineBeat.get();
if (beat_density > 2.0) { if (beat_density > 2.0) {
/* only draw beat lines if the gaps between beats are large. /* only draw beat lines if the gaps between beats are large.

View file

@ -25,6 +25,7 @@
using namespace Editing; using namespace Editing;
using namespace ArdourCanvas; using namespace ArdourCanvas;
using namespace ARDOUR;
GhostRegion::GhostRegion (AutomationTimeAxisView& atv, double initial_pos) GhostRegion::GhostRegion (AutomationTimeAxisView& atv, double initial_pos)
: trackview (atv) : trackview (atv)
@ -43,8 +44,8 @@ GhostRegion::GhostRegion (AutomationTimeAxisView& atv, double initial_pos)
base_rect->property_y1() = (double) 0.0; base_rect->property_y1() = (double) 0.0;
base_rect->property_y2() = (double) trackview.height; base_rect->property_y2() = (double) trackview.height;
base_rect->property_outline_what() = (guint32) 0; base_rect->property_outline_what() = (guint32) 0;
base_rect->property_outline_color_rgba() = color_map[cGhostTrackBaseOutline]; base_rect->property_outline_color_rgba() = Config->canvasvar_GhostTrackBase.get();
base_rect->property_fill_color_rgba() = color_map[cGhostTrackBaseFill]; base_rect->property_fill_color_rgba() = Config->canvasvar_GhostTrackBase.get();
group->lower_to_bottom (); group->lower_to_bottom ();
atv.add_ghost (this); atv.add_ghost (this);
@ -91,10 +92,13 @@ GhostRegion::set_height ()
void void
GhostRegion::set_colors () GhostRegion::set_colors ()
{ {
for (uint32_t n=0; n < waves.size(); ++n) { base_rect->property_outline_color_rgba() = Config->canvasvar_GhostTrackBase.get();
waves[n]->property_wave_color() = color_map[cGhostTrackWave]; base_rect->property_fill_color_rgba() = Config->canvasvar_GhostTrackBase.get();
waves[n]->property_clip_color() = color_map[cGhostTrackWaveClip]; for (uint32_t n=0; n < waves.size(); ++n) {
waves[n]->property_zero_color() = color_map[cGhostTrackZeroLine]; waves[n]->property_wave_color() = Config->canvasvar_GhostTrackWave.get();
waves[n]->property_clip_color() = Config->canvasvar_GhostTrackWaveClip.get();
waves[n]->property_zero_color() = Config->canvasvar_GhostTrackZeroLine.get();
} }
} }

View file

@ -23,6 +23,7 @@
#include <vector> #include <vector>
#include <sigc++/signal.h> #include <sigc++/signal.h>
#include <libgnomecanvasmm.h> #include <libgnomecanvasmm.h>
#include <ardour/configuration.h>
#include "canvas.h" #include "canvas.h"
#include "simplerect.h" #include "simplerect.h"

View file

@ -52,9 +52,9 @@ ImageFrameTimeAxisView::ImageFrameTimeAxisView (ImageFrameTimeAxis& tv)
canvas_rect (canvas_group, 0.0, 0.0, 1000000.0, tv.height) canvas_rect (canvas_group, 0.0, 0.0, 1000000.0, tv.height)
{ {
region_color = _trackview.color() ; region_color = _trackview.color() ;
stream_base_color = color_map[cImageTrackBase] ; stream_base_color = Config->canvasvar_ImageTrack.get() ;
canvas_rect.property_outline_color_rgba() = color_map[cImageTrackOutline]; canvas_rect.property_outline_color_rgba() = Config->canvasvar_ImageTrack.get();
canvas_rect.property_fill_color_rgba() = stream_base_color; canvas_rect.property_fill_color_rgba() = stream_base_color;
canvas_rect.signal_event().connect (bind (mem_fun (_trackview.editor, &PublicEditor::canvas_imageframe_view_event), (ArdourCanvas::Item*) &canvas_rect, &tv)); canvas_rect.signal_event().connect (bind (mem_fun (_trackview.editor, &PublicEditor::canvas_imageframe_view_event), (ArdourCanvas::Item*) &canvas_rect, &tv));

View file

@ -28,6 +28,8 @@
#include "i18n.h" #include "i18n.h"
using namespace ARDOUR;
Marker::Marker (PublicEditor& ed, ArdourCanvas::Group& parent, guint32 rgba, const string& annotation, Marker::Marker (PublicEditor& ed, ArdourCanvas::Group& parent, guint32 rgba, const string& annotation,
Type type, nframes_t frame, bool handle_events) Type type, nframes_t frame, bool handle_events)
@ -253,7 +255,7 @@ Marker::Marker (PublicEditor& ed, ArdourCanvas::Group& parent, guint32 rgba, con
} }
text->property_y() = 0.0; text->property_y() = 0.0;
text->property_anchor() = Gtk::ANCHOR_NW; text->property_anchor() = Gtk::ANCHOR_NW;
text->property_fill_color_rgba() = color_map[cMarkerLabel]; text->property_fill_color_rgba() = Config->canvasvar_MarkerLabel.get();
editor.ZoomChanged.connect (mem_fun (*this, &Marker::reposition)); editor.ZoomChanged.connect (mem_fun (*this, &Marker::reposition));

View file

@ -49,7 +49,7 @@ MarkerTimeAxisView::MarkerTimeAxisView(MarkerTimeAxis& tv)
: _trackview (tv) : _trackview (tv)
{ {
region_color = _trackview.color(); region_color = _trackview.color();
stream_base_color = color_map[cMarkerTrackBase]; stream_base_color = Config->canvasvar_MarkerTrack.get();
canvas_group = new ArdourCanvas::Group (*_trackview.canvas_display); canvas_group = new ArdourCanvas::Group (*_trackview.canvas_display);
@ -58,7 +58,7 @@ MarkerTimeAxisView::MarkerTimeAxisView(MarkerTimeAxis& tv)
canvas_rect->property_y1() = 0.0; canvas_rect->property_y1() = 0.0;
canvas_rect->property_x2() = max_frames; canvas_rect->property_x2() = max_frames;
canvas_rect->property_y2() = (double)20; canvas_rect->property_y2() = (double)20;
canvas_rect->property_outline_color_rgba() = color_map[cMarkerTrackOutline]; canvas_rect->property_outline_color_rgba() = Config->canvasvar_MarkerTrack.get();
canvas_rect->property_fill_color_rgba() = stream_base_color; canvas_rect->property_fill_color_rgba() = stream_base_color;
canvas_rect->signal_event().connect (bind (mem_fun (_trackview.editor, &PublicEditor::canvas_marker_time_axis_view_event), canvas_rect, &_trackview)); canvas_rect->signal_event().connect (bind (mem_fun (_trackview.editor, &PublicEditor::canvas_marker_time_axis_view_event), canvas_rect, &_trackview));

View file

@ -56,12 +56,12 @@ MidiStreamView::MidiStreamView (MidiTimeAxisView& tv)
: StreamView (tv) : StreamView (tv)
{ {
if (tv.is_track()) if (tv.is_track())
stream_base_color = color_map[cMidiTrackBase]; stream_base_color = Config->canvasvar_MidiTrackBase.get();
else else
stream_base_color = color_map[cMidiBusBase]; stream_base_color = Config->canvasvar_MidiBusBase.get();
canvas_rect->property_fill_color_rgba() = stream_base_color; canvas_rect->property_fill_color_rgba() = stream_base_color;
canvas_rect->property_outline_color_rgba() = color_map[cAudioTrackOutline]; canvas_rect->property_outline_color_rgba() = RGBA_BLACK;
//use_rec_regions = tv.editor.show_waveforms_recording (); //use_rec_regions = tv.editor.show_waveforms_recording ();
use_rec_regions = true; use_rec_regions = true;
@ -216,14 +216,14 @@ MidiStreamView::setup_rec_box ()
assert(_trackview.midi_track()->mode() == Normal); assert(_trackview.midi_track()->mode() == Normal);
xend = xstart; xend = xstart;
fill_color = color_map[cRecordingRectFill]; fill_color = Config->canvasvar_RecordingRect.get();
ArdourCanvas::SimpleRect * rec_rect = new Gnome::Canvas::SimpleRect (*canvas_group); ArdourCanvas::SimpleRect * rec_rect = new Gnome::Canvas::SimpleRect (*canvas_group);
rec_rect->property_x1() = xstart; rec_rect->property_x1() = xstart;
rec_rect->property_y1() = 1.0; rec_rect->property_y1() = 1.0;
rec_rect->property_x2() = xend; rec_rect->property_x2() = xend;
rec_rect->property_y2() = (double) _trackview.height - 1; rec_rect->property_y2() = (double) _trackview.height - 1;
rec_rect->property_outline_color_rgba() = color_map[cRecordingRectOutline]; rec_rect->property_outline_color_rgba() = Config->canvasvar_RecordingRect.get();
rec_rect->property_fill_color_rgba() = fill_color; rec_rect->property_fill_color_rgba() = fill_color;
rec_rect->lower_to_bottom(); rec_rect->lower_to_bottom();
@ -409,24 +409,17 @@ MidiStreamView::rec_data_range_ready (boost::shared_ptr<MidiBuffer> data, jack_n
} }
void void
MidiStreamView::color_handler (ColorID id, uint32_t val) MidiStreamView::color_handler ()
{ {
switch (id) {
case cMidiTrackBase:
if (_trackview.is_midi_track()) {
canvas_rect->property_fill_color_rgba() = val;
}
break;
case cMidiBusBase:
if (!_trackview.is_midi_track()) {
canvas_rect->property_fill_color_rgba() = val;
}
break;
case cMidiTrackOutline:
canvas_rect->property_outline_color_rgba() = val;
break;
default: //case cMidiTrackBase:
break; if (_trackview.is_midi_track()) {
canvas_rect->property_fill_color_rgba() = Config->canvasvar_MidiTrackBase.get();
}
//case cMidiBusBase:
if (!_trackview.is_midi_track()) {
canvas_rect->property_fill_color_rgba() = Config->canvasvar_MidiBusBase.get();;
} }
} }

View file

@ -68,7 +68,7 @@ class MidiStreamView : public StreamView
void redisplay_diskstream (); void redisplay_diskstream ();
void color_handler (ColorID id, uint32_t val); void color_handler ();
}; };
#endif /* __ardour_midi_streamview_h__ */ #endif /* __ardour_midi_streamview_h__ */

View file

@ -146,7 +146,7 @@ RegionView::init (Gdk::Color& basic_color, bool wfd)
set_colors (); set_colors ();
ColorChanged.connect (mem_fun (*this, &RegionView::color_handler)); ColorsChanged.connect (mem_fun (*this, &RegionView::color_handler));
/* XXX sync mark drag? */ /* XXX sync mark drag? */
} }

View file

@ -117,7 +117,7 @@ class RegionView : public TimeAxisViewItem
virtual void set_frame_color (); virtual void set_frame_color ();
virtual void reset_width_dependent_items (double pixel_width); virtual void reset_width_dependent_items (double pixel_width);
virtual void color_handler (ColorID, uint32_t) {} virtual void color_handler () {}
boost::shared_ptr<ARDOUR::Region> _region; boost::shared_ptr<ARDOUR::Region> _region;

View file

@ -197,7 +197,7 @@ RouteTimeAxisView::RouteTimeAxisView (PublicEditor& ed, Session& sess, boost::sh
} }
editor.ZoomChanged.connect (mem_fun(*this, &RouteTimeAxisView::reset_samples_per_unit)); editor.ZoomChanged.connect (mem_fun(*this, &RouteTimeAxisView::reset_samples_per_unit));
ColorChanged.connect (mem_fun (*this, &RouteTimeAxisView::color_handler)); ColorsChanged.connect (mem_fun (*this, &RouteTimeAxisView::color_handler));
} }
RouteTimeAxisView::~RouteTimeAxisView () RouteTimeAxisView::~RouteTimeAxisView ()
@ -599,8 +599,8 @@ RouteTimeAxisView::show_timestretch (nframes_t start, nframes_t end)
timestretch_rect->property_y1() = 0.0; timestretch_rect->property_y1() = 0.0;
timestretch_rect->property_x2() = 0.0; timestretch_rect->property_x2() = 0.0;
timestretch_rect->property_y2() = 0.0; timestretch_rect->property_y2() = 0.0;
timestretch_rect->property_fill_color_rgba() = color_map[cTimeStretchFill]; timestretch_rect->property_fill_color_rgba() = Config->canvasvar_TimeStretchFill.get();
timestretch_rect->property_outline_color_rgba() = color_map[cTimeStretchOutline]; timestretch_rect->property_outline_color_rgba() = Config->canvasvar_TimeStretchOutline.get();
} }
timestretch_rect->show (); timestretch_rect->show ();
@ -1367,18 +1367,17 @@ RouteTimeAxisView::map_frozen ()
} }
void void
RouteTimeAxisView::color_handler (ColorID id, uint32_t val) RouteTimeAxisView::color_handler ()
{ {
switch (id) { //case cTimeStretchOutline:
case cTimeStretchOutline: if (timestretch_rect) {
timestretch_rect->property_outline_color_rgba() = val; timestretch_rect->property_outline_color_rgba() = Config->canvasvar_TimeStretchOutline.get();
break;
case cTimeStretchFill:
timestretch_rect->property_fill_color_rgba() = val;
break;
default:
break;
} }
//case cTimeStretchFill:
if (timestretch_rect) {
timestretch_rect->property_fill_color_rgba() = Config->canvasvar_TimeStretchFill.get();
}
} }
void void
@ -1549,7 +1548,7 @@ RouteTimeAxisView::add_redirect_automation_curve (boost::shared_ptr<Redirect> re
*redirect, what, _session, *ran->view, *redirect, what, _session, *ran->view,
*ran->view->canvas_display, redirect->automation_list (what)); *ran->view->canvas_display, redirect->automation_list (what));
ral->set_line_color (color_map[cRedirectAutomationLine]); ral->set_line_color (Config->canvasvar_RedirectAutomationLine.get());
ral->queue_reset (); ral->queue_reset ();
ran->view->add_line (*ral); ran->view->add_line (*ral);

View file

@ -199,7 +199,7 @@ protected:
void map_frozen (); void map_frozen ();
void color_handler (ColorID, uint32_t); void color_handler ();
void region_view_added (RegionView*); void region_view_added (RegionView*);
void add_ghost_to_redirect (RegionView*, AutomationTimeAxisView*); void add_ghost_to_redirect (RegionView*, AutomationTimeAxisView*);

View file

@ -80,7 +80,7 @@ StreamView::StreamView (RouteTimeAxisView& tv)
_trackview.session().RecordStateChanged.connect (mem_fun (*this, &StreamView::sess_rec_enable_changed)); _trackview.session().RecordStateChanged.connect (mem_fun (*this, &StreamView::sess_rec_enable_changed));
} }
ColorChanged.connect (mem_fun (*this, &StreamView::color_handler)); ColorsChanged.connect (mem_fun (*this, &StreamView::color_handler));
} }
StreamView::~StreamView () StreamView::~StreamView ()

View file

@ -121,7 +121,7 @@ protected:
virtual void playlist_modified_weak (boost::weak_ptr<ARDOUR::Diskstream>); virtual void playlist_modified_weak (boost::weak_ptr<ARDOUR::Diskstream>);
virtual void playlist_modified (boost::shared_ptr<ARDOUR::Diskstream>); virtual void playlist_modified (boost::shared_ptr<ARDOUR::Diskstream>);
virtual void color_handler (ColorID, uint32_t) = 0; virtual void color_handler () = 0;
virtual void update_contents_y_position_and_height (); virtual void update_contents_y_position_and_height ();

View file

@ -39,23 +39,9 @@ using namespace Gtk;
using namespace PBD; using namespace PBD;
using namespace ARDOUR; using namespace ARDOUR;
/* the global color map */
ColorMap color_map;
/* lookup table of color IDs as strings */
#undef COLORID
#define COLORID(s) #s,
static const char *color_id_strs[] = {
#include "colors.h"
};
#undef COLORID
/* global color change signals */
sigc::signal<void> ColorsChanged; sigc::signal<void> ColorsChanged;
sigc::signal<void,ColorID,uint32_t> ColorChanged; sigc::signal<void,uint32_t> ColorChanged;
ThemeManager::ThemeManager() ThemeManager::ThemeManager()
: ArdourDialog ("ThemeManager"), : ArdourDialog ("ThemeManager"),
@ -106,73 +92,6 @@ ThemeManager::~ThemeManager()
{ {
} }
int
ThemeManager::load (string path)
{
ifstream in (path.c_str());
if (!in) {
error << string_compose (_("cannot open color definition file %1: %2"), path, strerror(errno)) << endmsg;
return -1;
}
cerr << "Loading color definition file " << path << endl;
while (in) {
string name;
double r, g, b, a;
in >> name; if (!in) break;
in >> r; if (!in) break;
in >> g; if (!in) break;
in >> b; if (!in) break;
in >> a; if (!in) break;
for (uint32_t i = 0; i < sizeof (color_id_strs)/sizeof(color_id_strs[0]); ++i) {
if (name == color_id_strs[i]) {
/* set color map */
int ir,ig,ib,ia;
int rgba;
ir = (int) floor (r * 255.0);
ig = (int) floor (g * 255.0);
ib = (int) floor (b * 255.0);
ia = (int) floor (a * 255.0);
rgba = RGBA_TO_UINT (ir, ig, ib, ia);
color_map[(ColorID)i] = rgba;
/* set up list entry */
Gdk::Color col;
col.set_rgb_p (r,g,b);
TreeModel::Row row = *(color_list->append());
/* all the color names are prefixed by 'c' to avoid
naming collisions when used as enums. trim
this leading character from the displayed
value.
*/
row[columns.name] = name.substr (1);
row[columns.color] = "";
row[columns.id] = (ColorID) i;
row[columns.gdkcolor] = col;
row[columns.rgba] = rgba;
break;
}
}
}
ColorsChanged(); /* emit signal */
return 0;
}
int int
ThemeManager::save (string path) ThemeManager::save (string path)
{ {
@ -188,6 +107,8 @@ ThemeManager::button_press_event (GdkEventButton* ev)
int cellx; int cellx;
int celly; int celly;
ARDOUR::ConfigVariable<uint32_t> *ccvar;
if (!color_display.get_path_at_pos ((int)ev->x, (int)ev->y, path, column, cellx, celly)) { if (!color_display.get_path_at_pos ((int)ev->x, (int)ev->y, path, column, cellx, celly)) {
return false; return false;
} }
@ -200,11 +121,16 @@ ThemeManager::button_press_event (GdkEventButton* ev)
case 1: /* color */ case 1: /* color */
if ((iter = color_list->get_iter (path))) { if ((iter = color_list->get_iter (path))) {
ColorID edit_color_id = (*iter)[columns.id];
int r,g, b, a; int r,g, b, a;
uint32_t rgba; uint32_t rgba = (*iter)[columns.rgba];
Gdk::Color color; Gdk::Color color;
UINT_TO_RGBA (rgba, &r, &g, &b, &a);
color.set_rgb_p (r / 255.0, g / 255.0, b / 255.0);
color_dialog.get_colorsel()->set_current_color (color);
color_dialog.get_colorsel()->set_previous_color (color);
color_dialog.get_colorsel()->set_current_alpha (a * 256);
color_dialog.get_colorsel()->set_previous_alpha (a * 256);
ResponseType result = (ResponseType) color_dialog.run(); ResponseType result = (ResponseType) color_dialog.run();
switch (result) { switch (result) {
@ -218,13 +144,15 @@ ThemeManager::button_press_event (GdkEventButton* ev)
b = (int) floor (color.get_blue_p() * 255.0); b = (int) floor (color.get_blue_p() * 255.0);
rgba = RGBA_TO_UINT(r,g,b,a); rgba = RGBA_TO_UINT(r,g,b,a);
cerr << (*iter)[columns.name] << " == " << hex << rgba << endl;
(*iter)[columns.rgba] = rgba; (*iter)[columns.rgba] = rgba;
(*iter)[columns.gdkcolor] = color; (*iter)[columns.gdkcolor] = color;
color_map[edit_color_id] = rgba; ccvar = (*iter)[columns.pVar];
ccvar->set(rgba);
ColorChanged (edit_color_id, rgba); //ColorChanged (rgba);
ColorsChanged();//EMIT SIGNAL
break; break;
default: default:
@ -260,11 +188,33 @@ ThemeManager::load_rc(int which)
ThemeChanged(find_config_file(Config->get_ui_rc_file())); //EMIT SIGNAL ThemeChanged(find_config_file(Config->get_ui_rc_file())); //EMIT SIGNAL
cerr << "load_rc() called " << find_config_file(Config->get_ui_rc_file()) << endl; cerr << "load_rc() called " << find_config_file(Config->get_ui_rc_file()) << endl;
} }
void void
ThemeManager::setup_theme_buttons () ThemeManager::setup_theme ()
{ {
int r, g, b, a;
for (std::vector<ConfigVariable<uint32_t> *>::iterator i = Config->canvas_colors.begin(); i != Config->canvas_colors.end(); i++) {
TreeModel::Row row = *(color_list->append());
Gdk::Color col;
uint32_t rgba = (*i)->get();
UINT_TO_RGBA (rgba, &r, &g, &b, &a);
cerr << (*i)->name() << " == " << hex << rgba << ": " << hex << r << " " << hex << g << " " << hex << b << endl;
col.set_rgb_p (r / 255.0, g / 255.0, b / 255.0);
row[columns.name] = (*i)->name();
row[columns.color] = "";
row[columns.pVar] = *i;
row[columns.rgba] = rgba;
row[columns.gdkcolor] = col;
//cerr << (*i)->name() << " == " << rgba << endl;
}
cerr << "ThemeManager::setup_theme () called" << endl;
ColorsChanged(); //EMIT SIGNAL
if (getenv ("ARDOUR2_UI_RC")) { if (getenv ("ARDOUR2_UI_RC")) {
return; return;
@ -275,5 +225,6 @@ ThemeManager::setup_theme_buttons ()
} else if (Config->get_ui_rc_file() == "ardour2_ui_light.rc") { } else if (Config->get_ui_rc_file() == "ardour2_ui_light.rc") {
light_button.set_active(); light_button.set_active();
} }
} }

View file

@ -26,8 +26,8 @@
#include <gtkmm/colorselection.h> #include <gtkmm/colorselection.h>
#include <gtkmm/radiobutton.h> #include <gtkmm/radiobutton.h>
#include <gtkmm/rc.h> #include <gtkmm/rc.h>
#include <ardour/configuration.h>
#include "ardour_dialog.h" #include "ardour_dialog.h"
#include "color.h"
class ThemeManager : public ArdourDialog class ThemeManager : public ArdourDialog
@ -36,10 +36,9 @@ class ThemeManager : public ArdourDialog
ThemeManager(); ThemeManager();
~ThemeManager(); ~ThemeManager();
int load (std::string path);
int save (std::string path); int save (std::string path);
void load_rc (int which); void load_rc (int which);
void setup_theme_buttons (); void setup_theme ();
private: private:
struct ColorDisplayModelColumns : public Gtk::TreeModel::ColumnRecord { struct ColorDisplayModelColumns : public Gtk::TreeModel::ColumnRecord {
@ -47,14 +46,14 @@ class ThemeManager : public ArdourDialog
add (name); add (name);
add (color); add (color);
add (gdkcolor); add (gdkcolor);
add (id); add (pVar);
add (rgba); add (rgba);
} }
Gtk::TreeModelColumn<Glib::ustring> name; Gtk::TreeModelColumn<Glib::ustring> name;
Gtk::TreeModelColumn<Glib::ustring> color; Gtk::TreeModelColumn<Glib::ustring> color;
Gtk::TreeModelColumn<Gdk::Color> gdkcolor; Gtk::TreeModelColumn<Gdk::Color> gdkcolor;
Gtk::TreeModelColumn<ColorID> id; Gtk::TreeModelColumn<ARDOUR::ConfigVariable<uint32_t> *> pVar;
Gtk::TreeModelColumn<uint32_t> rgba; Gtk::TreeModelColumn<uint32_t> rgba;
}; };

View file

@ -152,7 +152,7 @@ TimeAxisView::TimeAxisView (ARDOUR::Session& sess, PublicEditor& ed, TimeAxisVie
controls_frame.set_name ("TimeAxisViewControlsBaseUnselected"); controls_frame.set_name ("TimeAxisViewControlsBaseUnselected");
controls_frame.set_shadow_type (Gtk::SHADOW_ETCHED_OUT); controls_frame.set_shadow_type (Gtk::SHADOW_ETCHED_OUT);
ColorChanged.connect (mem_fun (*this, &TimeAxisView::color_handler)); ColorsChanged.connect (mem_fun (*this, &TimeAxisView::color_handler));
} }
TimeAxisView::~TimeAxisView() TimeAxisView::~TimeAxisView()
@ -787,20 +787,20 @@ TimeAxisView::get_selection_rect (uint32_t id)
rect->rect->property_y1() = 0.0; rect->rect->property_y1() = 0.0;
rect->rect->property_x2() = 0.0; rect->rect->property_x2() = 0.0;
rect->rect->property_y2() = 0.0; rect->rect->property_y2() = 0.0;
rect->rect->property_fill_color_rgba() = color_map[cSelectionRectFill]; rect->rect->property_fill_color_rgba() = Config->canvasvar_SelectionRect.get();
rect->rect->property_outline_color_rgba() = color_map[cSelectionRectOutline]; rect->rect->property_outline_color_rgba() = Config->canvasvar_Selection.get();
rect->start_trim = new SimpleRect (*selection_group); rect->start_trim = new SimpleRect (*selection_group);
rect->start_trim->property_x1() = 0.0; rect->start_trim->property_x1() = 0.0;
rect->start_trim->property_x2() = 0.0; rect->start_trim->property_x2() = 0.0;
rect->start_trim->property_fill_color_rgba() = color_map[cSelectionStartFill]; rect->start_trim->property_fill_color_rgba() = Config->canvasvar_Selection.get();
rect->start_trim->property_outline_color_rgba() = color_map[cSelectionStartOutline]; rect->start_trim->property_outline_color_rgba() = Config->canvasvar_Selection.get();
rect->end_trim = new SimpleRect (*selection_group); rect->end_trim = new SimpleRect (*selection_group);
rect->end_trim->property_x1() = 0.0; rect->end_trim->property_x1() = 0.0;
rect->end_trim->property_x2() = 0.0; rect->end_trim->property_x2() = 0.0;
rect->end_trim->property_fill_color_rgba() = color_map[cSelectionEndFill]; rect->end_trim->property_fill_color_rgba() = Config->canvasvar_Selection.get();
rect->end_trim->property_outline_color_rgba() = color_map[cSelectionEndOutline]; rect->end_trim->property_outline_color_rgba() = Config->canvasvar_Selection.get();
free_selection_rects.push_front (rect); free_selection_rects.push_front (rect);
@ -1056,23 +1056,31 @@ TimeAxisView::hide_name_entry ()
} }
void void
TimeAxisView::color_handler (ColorID id, uint32_t val) TimeAxisView::color_handler ()
{ {
switch (id) {
case cSelectionRectFill: for (list<SelectionRect*>::iterator i = used_selection_rects.begin(); i != used_selection_rects.end(); ++i) {
break;
case cSelectionRectOutline: (*i)->rect->property_fill_color_rgba() = Config->canvasvar_SelectionRect.get();
break; (*i)->rect->property_outline_color_rgba() = Config->canvasvar_Selection.get();
case cSelectionStartFill:
break; (*i)->start_trim->property_fill_color_rgba() = Config->canvasvar_Selection.get();
case cSelectionStartOutline: (*i)->start_trim->property_outline_color_rgba() = Config->canvasvar_Selection.get();
break;
case cSelectionEndFill: (*i)->end_trim->property_fill_color_rgba() = Config->canvasvar_Selection.get();
break; (*i)->end_trim->property_outline_color_rgba() = Config->canvasvar_Selection.get();
case cSelectionEndOutline: }
break;
default: for (list<SelectionRect*>::iterator i = free_selection_rects.begin(); i != free_selection_rects.end(); ++i) {
break;
(*i)->rect->property_fill_color_rgba() = Config->canvasvar_SelectionRect.get();
(*i)->rect->property_outline_color_rgba() = Config->canvasvar_Selection.get();
(*i)->start_trim->property_fill_color_rgba() = Config->canvasvar_Selection.get();
(*i)->start_trim->property_outline_color_rgba() = Config->canvasvar_Selection.get();
(*i)->end_trim->property_fill_color_rgba() = Config->canvasvar_Selection.get();
(*i)->end_trim->property_outline_color_rgba() = Config->canvasvar_Selection.get();
} }
} }

View file

@ -305,7 +305,7 @@ class TimeAxisView : public virtual AxisView
static bool need_size_info; static bool need_size_info;
void set_height_pixels (uint32_t h); void set_height_pixels (uint32_t h);
void color_handler (ColorID, uint32_t); void color_handler ();
}; /* class TimeAxisView */ }; /* class TimeAxisView */

View file

@ -39,6 +39,7 @@ using namespace std;
using namespace Editing; using namespace Editing;
using namespace Glib; using namespace Glib;
using namespace PBD; using namespace PBD;
using namespace ARDOUR;
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
/** Initialize const static memeber data */ /** Initialize const static memeber data */
@ -133,7 +134,7 @@ TimeAxisViewItem::init (const string& it_name, double spu, Gdk::Color& base_colo
frame_position = start ; frame_position = start ;
item_duration = duration ; item_duration = duration ;
name_connected = false; name_connected = false;
fill_opacity = 60; // why? fill_opacity = 60;
position_locked = false ; position_locked = false ;
max_item_duration = ARDOUR::max_frames; max_item_duration = ARDOUR::max_frames;
min_item_duration = 0 ; min_item_duration = 0 ;
@ -150,8 +151,8 @@ TimeAxisViewItem::init (const string& it_name, double spu, Gdk::Color& base_colo
vestigial_frame->property_y1() = (double) 1.0; vestigial_frame->property_y1() = (double) 1.0;
vestigial_frame->property_x2() = 2.0; vestigial_frame->property_x2() = 2.0;
vestigial_frame->property_y2() = (double) trackview.height; vestigial_frame->property_y2() = (double) trackview.height;
vestigial_frame->property_outline_color_rgba() = color_map[cVestigialFrameOutline]; vestigial_frame->property_outline_color_rgba() = Config->canvasvar_VestigialFrame.get();
vestigial_frame->property_fill_color_rgba() = color_map[cVestigialFrameFill]; vestigial_frame->property_fill_color_rgba() = Config->canvasvar_VestigialFrame.get();
vestigial_frame->hide (); vestigial_frame->hide ();
if (visibility & ShowFrame) { if (visibility & ShowFrame) {
@ -160,8 +161,8 @@ TimeAxisViewItem::init (const string& it_name, double spu, Gdk::Color& base_colo
frame->property_y1() = (double) 1.0; frame->property_y1() = (double) 1.0;
frame->property_x2() = (double) trackview.editor.frame_to_pixel(duration); frame->property_x2() = (double) trackview.editor.frame_to_pixel(duration);
frame->property_y2() = (double) trackview.height; frame->property_y2() = (double) trackview.height;
frame->property_outline_color_rgba() = color_map[cTimeAxisFrameOutline]; frame->property_outline_color_rgba() = Config->canvasvar_TimeAxisFrame.get();
frame->property_fill_color_rgba() = color_map[cTimeAxisFrameFill]; frame->property_fill_color_rgba() = Config->canvasvar_TimeAxisFrame.get();
/* by default draw all 4 edges */ /* by default draw all 4 edges */
@ -196,8 +197,8 @@ TimeAxisViewItem::init (const string& it_name, double spu, Gdk::Color& base_colo
} }
name_highlight->property_y1() = (double) (trackview.height - TimeAxisViewItem::NAME_HIGHLIGHT_SIZE); name_highlight->property_y1() = (double) (trackview.height - TimeAxisViewItem::NAME_HIGHLIGHT_SIZE);
name_highlight->property_y2() = (double) (trackview.height - 1); name_highlight->property_y2() = (double) (trackview.height - 1);
name_highlight->property_outline_color_rgba() = color_map[cNameHighlightFill]; name_highlight->property_outline_color_rgba() = Config->canvasvar_NameHighlightFill.get();
name_highlight->property_fill_color_rgba() = color_map[cNameHighlightOutline]; name_highlight->property_fill_color_rgba() = Config->canvasvar_NameHighlightOutline.get();
name_highlight->set_data ("timeaxisviewitem", this); name_highlight->set_data ("timeaxisviewitem", this);
@ -229,16 +230,16 @@ TimeAxisViewItem::init (const string& it_name, double spu, Gdk::Color& base_colo
frame_handle_start->property_x2() = (double) TimeAxisViewItem::GRAB_HANDLE_LENGTH; frame_handle_start->property_x2() = (double) TimeAxisViewItem::GRAB_HANDLE_LENGTH;
frame_handle_start->property_y1() = (double) 1.0; frame_handle_start->property_y1() = (double) 1.0;
frame_handle_start->property_y2() = (double) TimeAxisViewItem::GRAB_HANDLE_LENGTH+1; frame_handle_start->property_y2() = (double) TimeAxisViewItem::GRAB_HANDLE_LENGTH+1;
frame_handle_start->property_outline_color_rgba() = color_map[cFrameHandleStartOutline]; frame_handle_start->property_outline_color_rgba() = Config->canvasvar_FrameHandle.get();
frame_handle_start->property_fill_color_rgba() = color_map[cFrameHandleStartFill]; frame_handle_start->property_fill_color_rgba() = Config->canvasvar_FrameHandle.get();
frame_handle_end = new ArdourCanvas::SimpleRect (*group); frame_handle_end = new ArdourCanvas::SimpleRect (*group);
frame_handle_end->property_x1() = (double) (trackview.editor.frame_to_pixel(get_duration())) - (TimeAxisViewItem::GRAB_HANDLE_LENGTH); frame_handle_end->property_x1() = (double) (trackview.editor.frame_to_pixel(get_duration())) - (TimeAxisViewItem::GRAB_HANDLE_LENGTH);
frame_handle_end->property_x2() = (double) trackview.editor.frame_to_pixel(get_duration()); frame_handle_end->property_x2() = (double) trackview.editor.frame_to_pixel(get_duration());
frame_handle_end->property_y1() = (double) 1; frame_handle_end->property_y1() = (double) 1;
frame_handle_end->property_y2() = (double) TimeAxisViewItem::GRAB_HANDLE_LENGTH + 1; frame_handle_end->property_y2() = (double) TimeAxisViewItem::GRAB_HANDLE_LENGTH + 1;
frame_handle_end->property_outline_color_rgba() = color_map[cFrameHandleEndOutline]; frame_handle_end->property_outline_color_rgba() = Config->canvasvar_FrameHandle.get();
frame_handle_end->property_fill_color_rgba() = color_map[cFrameHandleEndFill]; frame_handle_end->property_fill_color_rgba() = Config->canvasvar_FrameHandle.get();
} else { } else {
frame_handle_start = 0; frame_handle_start = 0;
@ -797,11 +798,11 @@ TimeAxisViewItem::set_frame_color()
uint32_t r,g,b,a; uint32_t r,g,b,a;
if (_selected && should_show_selection) { if (_selected && should_show_selection) {
UINT_TO_RGBA(color_map[cSelectedFrameBase], &r, &g, &b, &a); UINT_TO_RGBA(Config->canvasvar_SelectedFrameBase.get(), &r, &g, &b, &a);
frame->property_fill_color_rgba() = RGBA_TO_UINT(r, g, b, fill_opacity); frame->property_fill_color_rgba() = RGBA_TO_UINT(r, g, b, a);
} else { } else {
UINT_TO_RGBA(color_map[cFrameBase], &r, &g, &b, &a); UINT_TO_RGBA(Config->canvasvar_FrameBase.get(), &r, &g, &b, &a);
frame->property_fill_color_rgba() = RGBA_TO_UINT(r, g, b, fill_opacity); frame->property_fill_color_rgba() = RGBA_TO_UINT(r, g, b, a);
} }
} }
} }
@ -815,11 +816,11 @@ TimeAxisViewItem::set_trim_handle_colors()
{ {
if (frame_handle_start) { if (frame_handle_start) {
if (position_locked) { if (position_locked) {
frame_handle_start->property_fill_color_rgba() = color_map[cTrimHandleLockedStart]; frame_handle_start->property_fill_color_rgba() = Config->canvasvar_TrimHandleLocked.get();
frame_handle_end->property_fill_color_rgba() = color_map[cTrimHandleLockedEnd]; frame_handle_end->property_fill_color_rgba() = Config->canvasvar_TrimHandleLocked.get();
} else { } else {
frame_handle_start->property_fill_color_rgba() = color_map[cTrimHandleStart]; frame_handle_start->property_fill_color_rgba() = Config->canvasvar_TrimHandle.get();
frame_handle_end->property_fill_color_rgba() = color_map[cTrimHandleEnd]; frame_handle_end->property_fill_color_rgba() = Config->canvasvar_TrimHandle.get();
} }
} }
} }

View file

@ -0,0 +1,81 @@
CANVAS_VARIABLE(canvasvar_WaveForm, "waveform", 0x000000cc)
CANVAS_VARIABLE(canvasvar_WaveFormClip, "clipped aveform", 0xff0000e5)
CANVAS_VARIABLE(canvasvar_FrameBase, "region base", 0xbfbfc1ff)
CANVAS_VARIABLE(canvasvar_SelectedFrameBase, "selected region base", 0xb591a8ff)
CANVAS_VARIABLE(canvasvar_AudioTrackBase, "audio track base", 0xc6d3d868)
CANVAS_VARIABLE(canvasvar_AudioBusBase, "audio bus base", 0xdbd1ea68)
CANVAS_VARIABLE(canvasvar_MidiTrackBase, "midi track base", 0x00000033)
CANVAS_VARIABLE(canvasvar_MidiBusBase, "midi bus base", 0xff0000ee)
CANVAS_VARIABLE(canvasvar_TimeStretchFill, "time-stretch-fill", 0xe2b5b596)
CANVAS_VARIABLE(canvasvar_TimeStretchOutline, "time-stretch-outline", 0x63636396)
CANVAS_VARIABLE(canvasvar_AutomationLine, "automation line", 0x44bc59ff)
CANVAS_VARIABLE(canvasvar_RedirectAutomationLine, "redirect automation line", 0x7aa3f9ff)
CANVAS_VARIABLE(canvasvar_ControlPointFill, "control point fill", 0x000000ff)
CANVAS_VARIABLE(canvasvar_ControlPointOutline, "control point outline", 0x000000ff)
CANVAS_VARIABLE(canvasvar_EnteredControlPointOutline, "entered control point outline", 0xff0000ee)
CANVAS_VARIABLE(canvasvar_EnteredControlPointSelected, "entered control point selected", 0xff3535ff)
CANVAS_VARIABLE(canvasvar_EnteredControlPoint, "entered control point", 0x000000cc)
CANVAS_VARIABLE(canvasvar_ControlPointSelected, "control point selected", 0x00ff00ff)
CANVAS_VARIABLE(canvasvar_ControlPoint, "control point", 0xff0000ff)
CANVAS_VARIABLE(canvasvar_AutomationTrackFill, "automation track fill", 0xa0a0ce68)
CANVAS_VARIABLE(canvasvar_AutomationTrackOutline, "automation track outline", 0x282828ff)
CANVAS_VARIABLE(canvasvar_CrossfadeEditorBase, "crossfade editor base", 0x282d49ff)
CANVAS_VARIABLE(canvasvar_CrossfadeEditorLine, "crossfade editor line", 0x000000ff)
CANVAS_VARIABLE(canvasvar_SelectedCrossfadeEditorLine, "selected crossfade editor line", 0x00dbdbff)
CANVAS_VARIABLE(canvasvar_CrossfadeEditorLineShading, "crossfade editor line shading", 0x00a0d154)
CANVAS_VARIABLE(canvasvar_CrossfadeEditorPointFill, "crossfade editor point fill", 0x00ff00ff)
CANVAS_VARIABLE(canvasvar_CrossfadeEditorPointOutline, "crossfade editor point outline", 0x0000ffff)
CANVAS_VARIABLE(canvasvar_CrossfadeEditorWave, "crossfade editor wave", 0xffffff28)
CANVAS_VARIABLE(canvasvar_SelectedCrossfadeEditorWave, "selected crossfade editor wave", 0xf9ea14a0)
CANVAS_VARIABLE(canvasvar_CrossfadeLine, "crossfade line", 0x000000ff)
CANVAS_VARIABLE(canvasvar_ActiveCrossfade, "active crossfade", 0xe8ed3d77)
CANVAS_VARIABLE(canvasvar_InactiveCrossfade, "inactive crossfade", 0xe8ed3d77)
CANVAS_VARIABLE(canvasvar_LocationMarker, "location marker", 0xc4f411ff)
CANVAS_VARIABLE(canvasvar_LocationRange, "location range", 0x497a59ff)
CANVAS_VARIABLE(canvasvar_LocationCDMarker, "location cd marker", 0x1ee8c4ff)
CANVAS_VARIABLE(canvasvar_LocationLoop, "location loop", 0x35964fff)
CANVAS_VARIABLE(canvasvar_LocationPunch, "location punch", 0x7c3a3aff)
CANVAS_VARIABLE(canvasvar_VerboseCanvasCursor, "verbose canvas cursor", 0xf4f214bc)
CANVAS_VARIABLE(canvasvar_MarkerLabel, "marker label", 0xc4f411ff)
CANVAS_VARIABLE(canvasvar_TempoBar, "tempo bar", 0x72727fff)
CANVAS_VARIABLE(canvasvar_MeterBar, "meterbar", 0x666672ff)
CANVAS_VARIABLE(canvasvar_MarkerBar, "markerbar", 0x7f7f8cff)
CANVAS_VARIABLE(canvasvar_RangeMarkerBar, "rangemarker bar", 0x8c8c96ff)
CANVAS_VARIABLE(canvasvar_TransportMarkerBar, "TransportMarkerBar", 0x9898a3ff)
CANVAS_VARIABLE(canvasvar_RangeDragBarRect, "RangeDragBarRect", 0x969696c6)
CANVAS_VARIABLE(canvasvar_RangeDragRect, "RangeDragRect", 0x82c696c6)
CANVAS_VARIABLE(canvasvar_TransportDragRect, "TransportDragRect", 0x969696c6)
CANVAS_VARIABLE(canvasvar_MarkerDragLine, "MarkerDragLine", 0x004f00f9)
CANVAS_VARIABLE(canvasvar_TransportLoopRect, "TransportLoopRect", 0x1e7728f9)
CANVAS_VARIABLE(canvasvar_TransportPunchRect, "TransportPunchRect", 0x6d2828e5)
CANVAS_VARIABLE(canvasvar_PunchLine, "PunchLine", 0xa80000ff)
CANVAS_VARIABLE(canvasvar_ZoomRect, "ZoomRect", 0xc6d1b26d)
CANVAS_VARIABLE(canvasvar_RubberBandRect, "RubberBandRect", 0xc6c6c659)
CANVAS_VARIABLE(canvasvar_EnteredGainLine, "EnteredGainLine", 0xdd6363ff)
CANVAS_VARIABLE(canvasvar_EnteredAutomationLine, "EnteredAutomationLine", 0xdd6363ff)
CANVAS_VARIABLE(canvasvar_EnteredMarker, "EnteredMarker", 0xdd6363ff)
CANVAS_VARIABLE(canvasvar_MeterMarker, "MeterMarker", 0xf2425bff)
CANVAS_VARIABLE(canvasvar_TempoMarker, "TempoMarker", 0xf2425bff)
CANVAS_VARIABLE(canvasvar_MeasureLineBeat, "MeasureLineBeat", 0x72727266)
CANVAS_VARIABLE(canvasvar_MeasureLineBar, "MeasureLineBar", 0x8c8c988c)
CANVAS_VARIABLE(canvasvar_GhostTrackBase, "GhostTrackBase", 0x44007c7f)
CANVAS_VARIABLE(canvasvar_GhostTrackWave, "GhostTrackWave", 0x02fd004c)
CANVAS_VARIABLE(canvasvar_GhostTrackWaveClip, "GhostTrackWaveClip", 0xff000000)
CANVAS_VARIABLE(canvasvar_GhostTrackZeroLine, "GhostTrackZeroLine", 0xe500e566)
CANVAS_VARIABLE(canvasvar_ImageTrack, "ImageTrack", 0xddddd8ff)
CANVAS_VARIABLE(canvasvar_MarkerTrack, "MarkerTrack", 0xddddd8ff)
CANVAS_VARIABLE(canvasvar_ZeroLine, "ZeroLine", 0xb5b5b5ff)
CANVAS_VARIABLE(canvasvar_GainLine, "GainLine", 0xff00ff00)
CANVAS_VARIABLE(canvasvar_GainLineInactive, "GainLineInactive", 0xf0f0fff)
CANVAS_VARIABLE(canvasvar_RecordingRect, "RecordingRect", 0xe5c6c6ff)
CANVAS_VARIABLE(canvasvar_SelectionRect, "SelectionRect", 0xe8f4d377)
CANVAS_VARIABLE(canvasvar_Selection, "Selection", 0x636363b2)
CANVAS_VARIABLE(canvasvar_VestigialFrame, "VestigialFrame", 0x44007c0f)
CANVAS_VARIABLE(canvasvar_TimeAxisFrame, "TimeAxisFrame", 0x44007c0f)
CANVAS_VARIABLE(canvasvar_NameHighlightFill, "NameHighlightFill", 0x0000ffff)
CANVAS_VARIABLE(canvasvar_NameHighlightOutline, "NameHighlightOutline", 0x7c00ff96)
CANVAS_VARIABLE(canvasvar_FrameHandle, "FrameHandle", 0x7c00ff96)
CANVAS_VARIABLE(canvasvar_TrimHandleLocked, "TrimHandleLocked", 0xea0f0f28)
CANVAS_VARIABLE(canvasvar_TrimHandle, "TrimHandle", 0x1900ff44)
CANVAS_VARIABLE(canvasvar_EditCursor, "EditCursor", 0x0000ffff)
CANVAS_VARIABLE(canvasvar_PlayHead, "PlayHead", 0xff0000ff)

View file

@ -54,6 +54,8 @@ class Configuration : public Stateful
std::map<std::string,MidiPortDescriptor *> midi_ports; std::map<std::string,MidiPortDescriptor *> midi_ports;
std::vector<ConfigVariable<uint32_t> *> canvas_colors;
void map_parameters (sigc::slot<void,const char*> theSlot); void map_parameters (sigc::slot<void,const char*> theSlot);
int load_state (); int load_state ();
@ -61,8 +63,9 @@ class Configuration : public Stateful
int set_state (const XMLNode&); int set_state (const XMLNode&);
XMLNode& get_state (void); XMLNode& get_state (void);
XMLNode& get_variables (sigc::slot<bool,ConfigVariableBase::Owner>); XMLNode& get_variables (sigc::slot<bool,ConfigVariableBase::Owner>, std::string which_node = "Config");
void set_variables (const XMLNode&, ConfigVariableBase::Owner owner); void set_variables (const XMLNode&, ConfigVariableBase::Owner owner);
void pack_canvasvars ();
void set_current_owner (ConfigVariableBase::Owner); void set_current_owner (ConfigVariableBase::Owner);
@ -84,6 +87,11 @@ class Configuration : public Stateful
#undef CONFIG_VARIABLE #undef CONFIG_VARIABLE
#undef CONFIG_VARIABLE_SPECIAL #undef CONFIG_VARIABLE_SPECIAL
#undef CANVAS_VARIABLE
#define CANVAS_VARIABLE(var,name,value) ConfigVariable<uint32_t> var; // <-- is this really so bad?
#include "ardour/canvas_vars.h"
#undef CANVAS_VARIABLE
private: private:
/* declare variables */ /* declare variables */

View file

@ -65,7 +65,7 @@ class ConfigVariable : public ConfigVariableBase
ConfigVariable (std::string str) : ConfigVariableBase (str) {} ConfigVariable (std::string str) : ConfigVariableBase (str) {}
ConfigVariable (std::string str, T val) : ConfigVariableBase (str), value (val) {} ConfigVariable (std::string str, T val) : ConfigVariableBase (str), value (val) {}
virtual bool set (T val, Owner owner) { virtual bool set (T val, Owner owner = ARDOUR::ConfigVariableBase::Config) {
if (val == value) { if (val == value) {
miss (); miss ();
return false; return false;
@ -92,7 +92,7 @@ class ConfigVariable : public ConfigVariableBase
bool set_from_node (const XMLNode& node, Owner owner) { bool set_from_node (const XMLNode& node, Owner owner) {
if (node.name() == "Config") { if (node.name() == "Config" || node.name() == "Canvas") {
/* ardour.rc */ /* ardour.rc */

View file

@ -160,3 +160,4 @@ CONFIG_VARIABLE (string, bwf_organization_code, "bwf-organization-code", "US")
/* these variables have custom set() methods (e.g. path globbing) */ /* these variables have custom set() methods (e.g. path globbing) */
CONFIG_VARIABLE_SPECIAL(Glib::ustring, raid_path, "raid-path", "", path_expand) CONFIG_VARIABLE_SPECIAL(Glib::ustring, raid_path, "raid-path", "", path_expand)

View file

@ -53,6 +53,11 @@ Configuration::Configuration ()
#undef CONFIG_VARIABLE #undef CONFIG_VARIABLE
#undef CONFIG_VARIABLE_SPECIAL #undef CONFIG_VARIABLE_SPECIAL
#undef CANVAS_VARIABLE
#define CANVAS_VARIABLE(var,name,value) var (name,value), // <-- is this really so bad?
#include "ardour/canvas_vars.h"
#undef CANVAS_VARIABLE
current_owner (ConfigVariableBase::Default) current_owner (ConfigVariableBase::Default)
{ {
_control_protocol_state = 0; _control_protocol_state = 0;
@ -120,6 +125,7 @@ Configuration::load_state ()
} }
} }
pack_canvasvars();
return 0; return 0;
} }
@ -162,7 +168,8 @@ Configuration::get_state ()
root->add_child_nocopy(m->second->get_state()); root->add_child_nocopy(m->second->get_state());
} }
root->add_child_nocopy (get_variables (sigc::mem_fun (*this, &Configuration::save_config_options_predicate))); root->add_child_nocopy (get_variables (sigc::mem_fun (*this, &Configuration::save_config_options_predicate), "Config"));
root->add_child_nocopy (get_variables (sigc::mem_fun (*this, &Configuration::save_config_options_predicate), "Canvas"));
if (_extra_xml) { if (_extra_xml) {
root->add_child_copy (*_extra_xml); root->add_child_copy (*_extra_xml);
@ -174,23 +181,28 @@ Configuration::get_state ()
} }
XMLNode& XMLNode&
Configuration::get_variables (sigc::slot<bool,ConfigVariableBase::Owner> predicate) Configuration::get_variables (sigc::slot<bool,ConfigVariableBase::Owner> predicate, std::string which_node)
{ {
XMLNode* node; XMLNode* node;
LocaleGuard lg (X_("POSIX")); LocaleGuard lg (X_("POSIX"));
node = new XMLNode("Config"); node = new XMLNode(which_node);
#undef CONFIG_VARIABLE #undef CONFIG_VARIABLE
#undef CONFIG_VARIABLE_SPECIAL #undef CONFIG_VARIABLE_SPECIAL
#define CONFIG_VARIABLE(type,var,name,value) \ #define CONFIG_VARIABLE(type,var,Name,value) \
if (predicate (var.owner())) { var.add_to_node (*node); } if (node->name() == "Config") { if (predicate (var.owner())) { var.add_to_node (*node); }}
#define CONFIG_VARIABLE_SPECIAL(type,var,name,value,mutator) \ #define CONFIG_VARIABLE_SPECIAL(type,var,Name,value,mutator) \
if (predicate (var.owner())) { var.add_to_node (*node); } if (node->name() == "Config") { if (predicate (var.owner())) { var.add_to_node (*node); }}
#include "ardour/configuration_vars.h" #include "ardour/configuration_vars.h"
#undef CONFIG_VARIABLE #undef CONFIG_VARIABLE
#undef CONFIG_VARIABLE_SPECIAL #undef CONFIG_VARIABLE_SPECIAL
#undef CANVAS_VARIABLE
#define CANVAS_VARIABLE(var,Name,value) if (node->name() == "Canvas") { if (predicate (ConfigVariableBase::Config)) { var.add_to_node (*node); }}
#include "ardour/canvas_vars.h"
#undef CANVAS_VARIABLE
return *node; return *node;
} }
@ -222,7 +234,7 @@ Configuration::set_state (const XMLNode& root)
warning << _("ill-formed MIDI port specification in ardour rcfile (ignored)") << endmsg; warning << _("ill-formed MIDI port specification in ardour rcfile (ignored)") << endmsg;
} }
} else if (node->name() == "Config") { } else if (node->name() == "Config" || node->name() == "Canvas" ) {
set_variables (*node, ConfigVariableBase::Config); set_variables (*node, ConfigVariableBase::Config);
@ -252,10 +264,30 @@ Configuration::set_variables (const XMLNode& node, ConfigVariableBase::Owner own
if (var.set_from_node (node, owner)) { \ if (var.set_from_node (node, owner)) { \
ParameterChanged (name); \ ParameterChanged (name); \
} }
#include "ardour/configuration_vars.h" #include "ardour/configuration_vars.h"
#undef CONFIG_VARIABLE #undef CONFIG_VARIABLE
#undef CONFIG_VARIABLE_SPECIAL #undef CONFIG_VARIABLE_SPECIAL
#undef CANVAS_VARIABLE
#define CANVAS_VARIABLE(var,name,value) \
if (var.set_from_node (node, owner)) { \
ParameterChanged (name); \
}
#include "ardour/canvas_vars.h"
#undef CANVAS_VARIABLE
}
void
Configuration::pack_canvasvars ()
{
#undef CANVAS_VARIABLE
#define CANVAS_VARIABLE(var,name,value) canvas_colors.push_back(&var);
#include "ardour/canvas_vars.h"
#undef CANVAS_VARIABLE
cerr << "Configuration::pack_canvasvars () called, canvas_colors.size() = " << canvas_colors.size() << endl;
} }
Configuration::MidiPortDescriptor::MidiPortDescriptor (const XMLNode& node) Configuration::MidiPortDescriptor::MidiPortDescriptor (const XMLNode& node)