mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-09 08:14:58 +01:00
new color management design starts to take shape (canvas color only for now)
git-svn-id: svn://localhost/trunk/ardour2@326 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
898fba7b54
commit
517d411bb0
29 changed files with 620 additions and 167 deletions
|
|
@ -82,6 +82,7 @@ simpleline.cc
|
||||||
canvas-simplerect.c
|
canvas-simplerect.c
|
||||||
simplerect.cc
|
simplerect.cc
|
||||||
canvas-waveview.c
|
canvas-waveview.c
|
||||||
|
color_manager.cc
|
||||||
crossfade_edit.cc
|
crossfade_edit.cc
|
||||||
crossfade_view.cc
|
crossfade_view.cc
|
||||||
curvetest.cc
|
curvetest.cc
|
||||||
|
|
|
||||||
100
gtk2_ardour/ardour.colors
Normal file
100
gtk2_ardour/ardour.colors
Normal file
|
|
@ -0,0 +1,100 @@
|
||||||
|
cWaveForm 0.0 0.0 0.0 0.80
|
||||||
|
cMutedWaveForm 0.35 0.35 0.35 1.0
|
||||||
|
cSelectedFrameBase 0.71 0.57 0.66 1.0
|
||||||
|
cFrameBase 0.75 0.75 0.76 1.0
|
||||||
|
cAudioTrackBase 0.79 0.80 0.85 0.41
|
||||||
|
cAudioTrackOutline 0.00 0.00 0.00 1.00
|
||||||
|
cAudioBusBase 0.90 0.82 0.90 0.41
|
||||||
|
cTempoBar 0.64 0.64 0.66 1.0
|
||||||
|
cMeterBar 0.75 0.75 0.80 1.0
|
||||||
|
cMarkerBar 0.54 0.54 0.56 1.0
|
||||||
|
cRangeMarkerBar 0.48 0.48 0.50 1.0
|
||||||
|
cTransportMarkerBar 0.40 0.40 0.42 1.0
|
||||||
|
cTimeStretchFill 0.89 0.71 0.71 0.59
|
||||||
|
cTimeStretchOutline 0.39 0.39 0.39 0.59
|
||||||
|
cAutomationLine 0.27 0.74 0.35 1.0
|
||||||
|
cLeftPanAutomationLine 0.77 0.24 0.01 1.0
|
||||||
|
cRightPanAutomationLine 0.03 0.26 0.73 1.0
|
||||||
|
cRedirectAutomationLine 0.28 0.34 0.74 1.0
|
||||||
|
cControlPointFill 0 0 0 1.0
|
||||||
|
cControlPointOutline 0 0 0 1.0
|
||||||
|
cEnteredControlPointOutline 1.0 0.21 0.21 1.0
|
||||||
|
cEnteredControlPointSelected 0.00 1.00 0.00 1.00
|
||||||
|
cEnteredControlPoint 1.00 0.00 0.00 1.00
|
||||||
|
cControlPointSelected 0.91 0.04 0.04 1.00
|
||||||
|
cControlPoint 0.00 0.00 0.00 1.00
|
||||||
|
cAutomationTrackFill 0.63 0.63 0.81 0.41
|
||||||
|
cAutomationTrackOutline 0.16 0.16 0.16 1.0
|
||||||
|
cCrossfadeEditorBase 0.16 0.18 0.29 1.0
|
||||||
|
cCrossfadeEditorLine 0 0 0 1.0
|
||||||
|
cSelectedCrossfadeEditorLine 0 0.86 0.86 1.0
|
||||||
|
cCrossfadeEditorLineShading 0 0.63 0.82 0.33
|
||||||
|
cCrossfadeEditorPointFill 0 1.0 0 1.0
|
||||||
|
cCrossfadeEditorPointOutline 0 0 1.0 1.0
|
||||||
|
cCrossfadeEditorWave 1.0 1.0 1.0 0.16
|
||||||
|
cSelectedCrossfadeEditorWave 0.98 0.92 0.08 0.63
|
||||||
|
cCrossfadeLine 0 0 0 1.0
|
||||||
|
cActiveCrossfade 0.91 0.93 0.24 0.47
|
||||||
|
cInactiveCrossfade 0 0 0 0
|
||||||
|
cLocationMarker 0.77 0.96 0.07 1.0
|
||||||
|
cLocationRange 0.29 0.48 0.35 1.0
|
||||||
|
cLocationCDMarker 0.12 0.91 0.77 1.0
|
||||||
|
cLocationLoop 0.21 0.59 0.31 1.0
|
||||||
|
cLocationPunch 0.49 0.23 0.23 1.0
|
||||||
|
cVerboseCanvasCursor 0 0 0 0.74
|
||||||
|
cRangeDragBarRect 0.59 0.59 0.59 0.78
|
||||||
|
cRangeDragBarRectFill 0.78 0.82 0.70 0.43
|
||||||
|
cRangeDragRect 0.59 0.59 0.59 0.78
|
||||||
|
cRangeDragRectFill 0.51 0.78 0.59 0.78
|
||||||
|
cTransportDragRect 0.59 0.59 0.59 0.78
|
||||||
|
cTransportDragRectFill 0.78 0.78 0.78 1.43
|
||||||
|
cMarkerDragLine 0 0.31 0 0.98
|
||||||
|
cTransportLoopRect 0.12 0.47 0.16 0.98
|
||||||
|
cTransportLoopRectFill 0.12 0.47 0.16 0.98
|
||||||
|
cTransportPunchRect 0.43 0.16 0.16 0.90
|
||||||
|
cTransportPunchRectFill 0.43 0.16 0.16 0.90
|
||||||
|
cPunchInLine 0.66 0.00 0.00 1.00
|
||||||
|
cPunchOutLine 0.66 0.00 0.00 1.00
|
||||||
|
cZoomRect 0.59 0.59 0.59 0.78
|
||||||
|
cZoomRectFill 0.78 0.82 0.70 0.43
|
||||||
|
cRubberBandRect 0.08 1.00 0.52 0.59
|
||||||
|
cRubberBandRectFill 0.78 0.78 0.78 0.35
|
||||||
|
cFirstActionMessage 0.00 0.00 0.00 1.00
|
||||||
|
cEnteredGainLine 0.87 0.39 0.39 1.00
|
||||||
|
cEnteredAutomationLine 0.87 0.39 0.39 1.00
|
||||||
|
cEnteredMarker 0.87 0.39 0.39 1.00
|
||||||
|
cMeterMarker 0.95 0.26 0.36 1.00
|
||||||
|
cTempoMarker 0.95 0.26 0.36 1.00
|
||||||
|
cMeasureLineBeat 0.51 0.59 0.87 0.98
|
||||||
|
cMeasureLineBar 0.68 0.68 0.59 0.94
|
||||||
|
cGhostTrackBaseOutline 0.00 0.00 0.00 1.00
|
||||||
|
cGhostTrackBaseFill 0.27 0.00 0.49 0.50
|
||||||
|
cImageTrackBase 0.87 0.87 0.85 1.00
|
||||||
|
cImageTrackOutline 0.00 0.00 0.00 1.00
|
||||||
|
cMarkerTrackBase 0.87 0.87 0.85 1.00
|
||||||
|
cMarkerTrackOutline 0.00 0.00 0.00 1.00
|
||||||
|
cZeroLine 0.71 0.71 0.71 1.00
|
||||||
|
cGainLine 0.00 1.00 0.00 1.00
|
||||||
|
cGainLineInactive 0.06 0.06 0.06 1.00
|
||||||
|
cRecordingRectFill 0.90 0.78 0.78 1.00
|
||||||
|
cRecordingRectOutline 0.31 0.16 0.16 1.00
|
||||||
|
cSelectionRectFill 0.91 0.96 0.83 0.47
|
||||||
|
cSelectionRectOutline 0.39 0.39 0.39 0.59
|
||||||
|
cSelectionEndFill 0.39 0.39 0.39 0.70
|
||||||
|
cSelectionEndOutline 0.39 0.39 0.39 1.0
|
||||||
|
cSelectionStartFill 0.39 0.39 0.39 0.70
|
||||||
|
cSelectionStartOutline 0.39 0.39 0.39 1.0
|
||||||
|
cVestigialFrameFill 0.27 0.00 0.49 0.06
|
||||||
|
cVestigialFrameOutline 0.00 0.00 0.00 1.00
|
||||||
|
cTimeAxisFrameFill 0.27 0.00 0.49 0.06
|
||||||
|
cTimeAxisFrameOutline 0.00 0.00 0.00 1.00
|
||||||
|
cNameHighlightFill 0.00 0.00 1.00 1.00
|
||||||
|
cNameHighlightOutline 0.49 0.00 1.00 0.59
|
||||||
|
cFrameHandleStartFill 0.49 0.00 1.00 0.59
|
||||||
|
cFrameHandleStartOutline 0.00 0.00 0.00 1.00
|
||||||
|
cFrameHandleEndFill 0.49 0.00 1.00 0.59
|
||||||
|
cFrameHandleEndOutline 0.00 0.00 0.00 1.00
|
||||||
|
cTrimHandleLockedStart 0.92 0.06 0.06 0.16
|
||||||
|
cTrimHandleLockedEnd 0.92 0.06 0.06 0.16
|
||||||
|
cTrimHandleStart 0.10 0.00 1.00 0.27
|
||||||
|
cTrimHandleEnd 0.10 0.00 1.00 0.27
|
||||||
|
|
@ -178,6 +178,7 @@
|
||||||
<menuitem action='ToggleSoundFileBrowser'/>
|
<menuitem action='ToggleSoundFileBrowser'/>
|
||||||
<menuitem action='ToggleConnections'/>
|
<menuitem action='ToggleConnections'/>
|
||||||
<menuitem action='ToggleLocations'/>
|
<menuitem action='ToggleLocations'/>
|
||||||
|
<menuitem action='ToggleColorManager'/>
|
||||||
<menuitem action='ToggleBigClock'/>
|
<menuitem action='ToggleBigClock'/>
|
||||||
<separator/>
|
<separator/>
|
||||||
<menuitem action='About'/>
|
<menuitem action='About'/>
|
||||||
|
|
|
||||||
|
|
@ -72,6 +72,7 @@
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
#include "gui_thread.h"
|
#include "gui_thread.h"
|
||||||
#include "meter_xpms.h"
|
#include "meter_xpms.h"
|
||||||
|
#include "color_manager.h"
|
||||||
|
|
||||||
#include "i18n.h"
|
#include "i18n.h"
|
||||||
|
|
||||||
|
|
@ -142,6 +143,16 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], string rcfile)
|
||||||
|
|
||||||
ActionManager::init ();
|
ActionManager::init ();
|
||||||
|
|
||||||
|
/* load colors */
|
||||||
|
|
||||||
|
color_manager = new ColorManager();
|
||||||
|
|
||||||
|
std::string color_file = Glib::getenv(X_("ARDOUR_COLORS"));
|
||||||
|
if(!Glib::file_test(color_file, Glib::FILE_TEST_EXISTS)) {
|
||||||
|
color_file = ARDOUR::find_config_file("ardour.colors");
|
||||||
|
}
|
||||||
|
color_manager->load (color_file);
|
||||||
|
|
||||||
m_new_session_dialog = 0;
|
m_new_session_dialog = 0;
|
||||||
m_new_session_dialog_ref = NewSessionDialogFactory::create();
|
m_new_session_dialog_ref = NewSessionDialogFactory::create();
|
||||||
m_new_session_dialog_ref->get_widget_derived (NewSessionDialogFactory::top_level_widget_name(), m_new_session_dialog);
|
m_new_session_dialog_ref->get_widget_derived (NewSessionDialogFactory::top_level_widget_name(), m_new_session_dialog);
|
||||||
|
|
|
||||||
|
|
@ -76,6 +76,7 @@ class About;
|
||||||
class AddRouteDialog;
|
class AddRouteDialog;
|
||||||
class NewSessionDialog;
|
class NewSessionDialog;
|
||||||
class LocationUI;
|
class LocationUI;
|
||||||
|
class ColorManager;
|
||||||
|
|
||||||
namespace Gtkmm2ext {
|
namespace Gtkmm2ext {
|
||||||
class TearOff;
|
class TearOff;
|
||||||
|
|
@ -146,6 +147,7 @@ class ARDOUR_UI : public Gtkmm2ext::UI
|
||||||
Mixer_UI* the_mixer() { return mixer; }
|
Mixer_UI* the_mixer() { return mixer; }
|
||||||
|
|
||||||
void toggle_location_window ();
|
void toggle_location_window ();
|
||||||
|
void toggle_color_manager ();
|
||||||
void toggle_big_clock_window ();
|
void toggle_big_clock_window ();
|
||||||
void toggle_connection_editor ();
|
void toggle_connection_editor ();
|
||||||
void toggle_route_params_window ();
|
void toggle_route_params_window ();
|
||||||
|
|
@ -586,6 +588,8 @@ class ARDOUR_UI : public Gtkmm2ext::UI
|
||||||
LocationUI *location_ui;
|
LocationUI *location_ui;
|
||||||
int create_location_ui ();
|
int create_location_ui ();
|
||||||
|
|
||||||
|
ColorManager* color_manager;
|
||||||
|
|
||||||
/* Options window */
|
/* Options window */
|
||||||
|
|
||||||
OptionEditor *option_editor;
|
OptionEditor *option_editor;
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,7 @@
|
||||||
#include "public_editor.h"
|
#include "public_editor.h"
|
||||||
#include "route_params_ui.h"
|
#include "route_params_ui.h"
|
||||||
#include "sfdb_ui.h"
|
#include "sfdb_ui.h"
|
||||||
|
#include "color_manager.h"
|
||||||
|
|
||||||
#include "i18n.h"
|
#include "i18n.h"
|
||||||
|
|
||||||
|
|
@ -287,6 +288,22 @@ ARDOUR_UI::toggle_location_window ()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ARDOUR_UI::toggle_color_manager ()
|
||||||
|
{
|
||||||
|
RefPtr<Action> act = ActionManager::get_action (X_("Common"), X_("ToggleColorManager"));
|
||||||
|
if (act) {
|
||||||
|
RefPtr<ToggleAction> tact = RefPtr<ToggleAction>::cast_dynamic(act);
|
||||||
|
|
||||||
|
if (tact->get_active()) {
|
||||||
|
color_manager->show_all ();
|
||||||
|
color_manager->present ();
|
||||||
|
} else {
|
||||||
|
color_manager->hide ();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
ARDOUR_UI::create_route_params ()
|
ARDOUR_UI::create_route_params ()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -178,6 +178,7 @@ ARDOUR_UI::install_actions ()
|
||||||
act = ActionManager::register_toggle_action (common_actions, X_("ToggleBigClock"), _("Big Clock"), mem_fun(*this, &ARDOUR_UI::toggle_big_clock_window));
|
act = ActionManager::register_toggle_action (common_actions, X_("ToggleBigClock"), _("Big Clock"), mem_fun(*this, &ARDOUR_UI::toggle_big_clock_window));
|
||||||
ActionManager::session_sensitive_actions.push_back (act);
|
ActionManager::session_sensitive_actions.push_back (act);
|
||||||
ActionManager::register_action (common_actions, X_("About"), _("About"), mem_fun(*this, &ARDOUR_UI::show_splash));
|
ActionManager::register_action (common_actions, X_("About"), _("About"), mem_fun(*this, &ARDOUR_UI::show_splash));
|
||||||
|
act = ActionManager::register_toggle_action (common_actions, X_("ToggleColorManager"), _("Colors"), mem_fun(*this, &ARDOUR_UI::toggle_color_manager));
|
||||||
|
|
||||||
act = ActionManager::register_action (common_actions, X_("AddAudioTrack"), _("add audio track"), bind (mem_fun(*this, &ARDOUR_UI::session_add_audio_track), 1, 1, ARDOUR::Normal));
|
act = ActionManager::register_action (common_actions, X_("AddAudioTrack"), _("add audio track"), bind (mem_fun(*this, &ARDOUR_UI::session_add_audio_track), 1, 1, ARDOUR::Normal));
|
||||||
ActionManager::session_sensitive_actions.push_back (act);
|
ActionManager::session_sensitive_actions.push_back (act);
|
||||||
|
|
|
||||||
|
|
@ -261,6 +261,7 @@ AudioTimeAxisView::AudioTimeAxisView (PublicEditor& ed, Session& sess, Route& rt
|
||||||
}
|
}
|
||||||
|
|
||||||
editor.ZoomChanged.connect (mem_fun(*this, &AudioTimeAxisView::reset_samples_per_unit));
|
editor.ZoomChanged.connect (mem_fun(*this, &AudioTimeAxisView::reset_samples_per_unit));
|
||||||
|
ColorChanged.connect (mem_fun (*this, &AudioTimeAxisView::color_handler));
|
||||||
}
|
}
|
||||||
|
|
||||||
AudioTimeAxisView::~AudioTimeAxisView ()
|
AudioTimeAxisView::~AudioTimeAxisView ()
|
||||||
|
|
@ -1952,3 +1953,18 @@ AudioTimeAxisView::get_child_xml_node (const string & childname)
|
||||||
{
|
{
|
||||||
return RouteUI::get_child_xml_node (childname);
|
return RouteUI::get_child_xml_node (childname);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
AudioTimeAxisView::color_handler (ColorID id, uint32_t val)
|
||||||
|
{
|
||||||
|
switch (id) {
|
||||||
|
case cTimeStretchOutline:
|
||||||
|
timestretch_rect->property_outline_color_rgba() = val;
|
||||||
|
break;
|
||||||
|
case cTimeStretchFill:
|
||||||
|
timestretch_rect->property_fill_color_rgba() = val;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,7 @@
|
||||||
#include "enums.h"
|
#include "enums.h"
|
||||||
#include "time_axis_view.h"
|
#include "time_axis_view.h"
|
||||||
#include "canvas.h"
|
#include "canvas.h"
|
||||||
|
#include "color.h"
|
||||||
|
|
||||||
namespace ALSA {
|
namespace ALSA {
|
||||||
class MultiChannelDevice;
|
class MultiChannelDevice;
|
||||||
|
|
@ -311,6 +312,8 @@ class AudioTimeAxisView : public RouteUI, public TimeAxisView
|
||||||
void add_ghost_to_redirect (AudioRegionView*, AutomationTimeAxisView*);
|
void add_ghost_to_redirect (AudioRegionView*, AutomationTimeAxisView*);
|
||||||
|
|
||||||
void map_frozen ();
|
void map_frozen ();
|
||||||
|
|
||||||
|
void color_handler (ColorID, uint32_t);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* __ardour_trackview_h__ */
|
#endif /* __ardour_trackview_h__ */
|
||||||
|
|
|
||||||
19
gtk2_ardour/color.h
Normal file
19
gtk2_ardour/color.h
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
#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__ */
|
||||||
203
gtk2_ardour/color_manager.cc
Normal file
203
gtk2_ardour/color_manager.cc
Normal file
|
|
@ -0,0 +1,203 @@
|
||||||
|
#include <cmath>
|
||||||
|
#include <iostream>
|
||||||
|
#include <fstream>
|
||||||
|
#include <errno.h>
|
||||||
|
|
||||||
|
#include <gtkmm/stock.h>
|
||||||
|
|
||||||
|
#include "color_manager.h"
|
||||||
|
#include "rgb_macros.h"
|
||||||
|
|
||||||
|
#include "i18n.h"
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
using namespace Gtk;
|
||||||
|
|
||||||
|
/* 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,ColorID,uint32_t> ColorChanged;
|
||||||
|
|
||||||
|
ColorManager::ColorManager()
|
||||||
|
: ArdourDialog ("ColorManager")
|
||||||
|
{
|
||||||
|
color_list = ListStore::create (columns);
|
||||||
|
color_display.set_model (color_list);
|
||||||
|
color_display.append_column (_("Object"), columns.name);
|
||||||
|
color_display.append_column (_("Color"), columns.color);
|
||||||
|
color_display.get_column (0)->set_data (X_("colnum"), GUINT_TO_POINTER(0));
|
||||||
|
color_display.get_column (1)->set_data (X_("colnum"), GUINT_TO_POINTER(1));
|
||||||
|
color_display.set_reorderable (false);
|
||||||
|
color_display.get_selection()->set_mode (SELECTION_NONE);
|
||||||
|
color_display.set_headers_visible (true);
|
||||||
|
|
||||||
|
CellRenderer* color_cell = color_display.get_column_cell_renderer (1);
|
||||||
|
TreeViewColumn* color_column = color_display.get_column (1);
|
||||||
|
color_column->add_attribute (color_cell->property_cell_background_gdk(), columns.gdkcolor);
|
||||||
|
|
||||||
|
scroller.add (color_display);
|
||||||
|
scroller.set_policy (POLICY_NEVER, POLICY_AUTOMATIC);
|
||||||
|
|
||||||
|
get_vbox()->pack_start (scroller);
|
||||||
|
|
||||||
|
color_display.signal_button_press_event().connect (mem_fun (*this, &ColorManager::button_press_event), false);
|
||||||
|
|
||||||
|
color_dialog.get_colorsel()->set_has_opacity_control (true);
|
||||||
|
color_dialog.get_colorsel()->set_has_palette (true);
|
||||||
|
|
||||||
|
color_dialog.get_ok_button()->signal_clicked().connect (bind (mem_fun (color_dialog, &Gtk::Dialog::response), RESPONSE_ACCEPT));
|
||||||
|
color_dialog.get_cancel_button()->signal_clicked().connect (bind (mem_fun (color_dialog, &Gtk::Dialog::response), RESPONSE_CANCEL));
|
||||||
|
|
||||||
|
set_size_request (-1, 400);
|
||||||
|
}
|
||||||
|
|
||||||
|
ColorManager::~ColorManager()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
ColorManager::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;
|
||||||
|
}
|
||||||
|
|
||||||
|
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
|
||||||
|
ColorManager::save (string path)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
ColorManager::button_press_event (GdkEventButton* ev)
|
||||||
|
{
|
||||||
|
TreeIter iter;
|
||||||
|
TreeModel::Path path;
|
||||||
|
TreeViewColumn* column;
|
||||||
|
int cellx;
|
||||||
|
int celly;
|
||||||
|
|
||||||
|
if (!color_display.get_path_at_pos ((int)ev->x, (int)ev->y, path, column, cellx, celly)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (GPOINTER_TO_UINT (column->get_data (X_("colnum")))) {
|
||||||
|
case 0:
|
||||||
|
/* allow normal processing to occur */
|
||||||
|
return false;
|
||||||
|
|
||||||
|
case 1: /* color */
|
||||||
|
if ((iter = color_list->get_iter (path))) {
|
||||||
|
|
||||||
|
ColorID edit_color_id = (*iter)[columns.id];
|
||||||
|
int r,g, b, a;
|
||||||
|
uint32_t rgba;
|
||||||
|
Gdk::Color color;
|
||||||
|
|
||||||
|
ResponseType result = (ResponseType) color_dialog.run();
|
||||||
|
|
||||||
|
switch (result) {
|
||||||
|
case RESPONSE_CANCEL:
|
||||||
|
break;
|
||||||
|
case RESPONSE_ACCEPT:
|
||||||
|
color = color_dialog.get_colorsel()->get_current_color();
|
||||||
|
a = color_dialog.get_colorsel()->get_current_alpha();
|
||||||
|
r = (int) floor (color.get_red_p() * 255.0);
|
||||||
|
g = (int) floor (color.get_green_p() * 255.0);
|
||||||
|
b = (int) floor (color.get_blue_p() * 255.0);
|
||||||
|
|
||||||
|
rgba = RGBA_TO_UINT(r,g,b,a);
|
||||||
|
|
||||||
|
(*iter)[columns.rgba] = rgba;
|
||||||
|
(*iter)[columns.gdkcolor] = color;
|
||||||
|
|
||||||
|
color_map[edit_color_id] = rgba;
|
||||||
|
|
||||||
|
ColorChanged (edit_color_id, rgba);
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
color_dialog.hide ();
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
48
gtk2_ardour/color_manager.h
Normal file
48
gtk2_ardour/color_manager.h
Normal file
|
|
@ -0,0 +1,48 @@
|
||||||
|
#ifndef __ardour_gtk_color_manager_h__
|
||||||
|
#define __ardour_gtk_color_manager_h__
|
||||||
|
|
||||||
|
#include <gtkmm/treeview.h>
|
||||||
|
#include <gtkmm/liststore.h>
|
||||||
|
#include <gtkmm/scrolledwindow.h>
|
||||||
|
#include <gtkmm/colorselection.h>
|
||||||
|
#include "ardour_dialog.h"
|
||||||
|
#include "color.h"
|
||||||
|
|
||||||
|
class ColorManager : public ArdourDialog
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
ColorManager();
|
||||||
|
~ColorManager();
|
||||||
|
|
||||||
|
int load (std::string path);
|
||||||
|
int save (std::string path);
|
||||||
|
|
||||||
|
private:
|
||||||
|
struct ColorDisplayModelColumns : public Gtk::TreeModel::ColumnRecord {
|
||||||
|
ColorDisplayModelColumns() {
|
||||||
|
add (name);
|
||||||
|
add (color);
|
||||||
|
add (gdkcolor);
|
||||||
|
add (id);
|
||||||
|
add (rgba);
|
||||||
|
}
|
||||||
|
|
||||||
|
Gtk::TreeModelColumn<Glib::ustring> name;
|
||||||
|
Gtk::TreeModelColumn<Glib::ustring> color;
|
||||||
|
Gtk::TreeModelColumn<Gdk::Color> gdkcolor;
|
||||||
|
Gtk::TreeModelColumn<ColorID> id;
|
||||||
|
Gtk::TreeModelColumn<uint32_t> rgba;
|
||||||
|
};
|
||||||
|
|
||||||
|
ColorDisplayModelColumns columns;
|
||||||
|
Gtk::TreeView color_display;
|
||||||
|
Glib::RefPtr<Gtk::ListStore> color_list;
|
||||||
|
Gtk::ColorSelectionDialog color_dialog;
|
||||||
|
Gtk::ScrolledWindow scroller;
|
||||||
|
|
||||||
|
bool button_press_event (GdkEventButton*);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* __ardour_gtk_color_manager_h__ */
|
||||||
|
|
||||||
103
gtk2_ardour/colors.h
Normal file
103
gtk2_ardour/colors.h
Normal file
|
|
@ -0,0 +1,103 @@
|
||||||
|
/* no guard clauses here */
|
||||||
|
|
||||||
|
COLORID(cWaveForm)
|
||||||
|
COLORID(cMutedWaveForm)
|
||||||
|
COLORID(cSelectedFrameBase)
|
||||||
|
COLORID(cFrameBase)
|
||||||
|
COLORID(cAudioTrackBase)
|
||||||
|
COLORID(cAudioTrackOutline)
|
||||||
|
COLORID(cAudioBusBase)
|
||||||
|
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(cTempoBar)
|
||||||
|
COLORID(cMeterBar)
|
||||||
|
COLORID(cMarkerBar)
|
||||||
|
COLORID(cRangeMarkerBar)
|
||||||
|
COLORID(cTransportMarkerBar)
|
||||||
|
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(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)
|
||||||
|
|
@ -47,6 +47,7 @@
|
||||||
#include "canvas_impl.h"
|
#include "canvas_impl.h"
|
||||||
#include "simplerect.h"
|
#include "simplerect.h"
|
||||||
#include "waveview.h"
|
#include "waveview.h"
|
||||||
|
#include "color.h"
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
using namespace ARDOUR;
|
using namespace ARDOUR;
|
||||||
|
|
@ -128,7 +129,7 @@ CrossfadeEditor::CrossfadeEditor (Session& s, Crossfade& xf, double my, double m
|
||||||
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() = (guint32) color_map[cCrossfadeEditorBase];
|
toplevel->property_fill_color_rgba() = color_map[cCrossfadeEditorBase];
|
||||||
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));
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -87,18 +87,4 @@ str2displaycontrol (const string & str) {
|
||||||
#undef DISPLAYCONTROL
|
#undef DISPLAYCONTROL
|
||||||
#define DISPLAYCONTROL(a) /*empty*/
|
#define DISPLAYCONTROL(a) /*empty*/
|
||||||
|
|
||||||
// COLORID
|
|
||||||
#undef COLORID
|
|
||||||
#define COLORID(s) if (!strcmp(type, #s)) {return s;}
|
|
||||||
ColorID
|
|
||||||
str2color_id (const string & str) {
|
|
||||||
const char* type = str.c_str();
|
|
||||||
#include "editing_syms.h"
|
|
||||||
return cFrameHandleEndOutline;
|
|
||||||
}
|
|
||||||
#undef COLORID
|
|
||||||
#define COLORID(a) /*empty*/
|
|
||||||
|
|
||||||
ColorMap color_map;
|
|
||||||
|
|
||||||
} // namespace Editing
|
} // namespace Editing
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,6 @@
|
||||||
#define MOUSEMODE(a) /*empty*/
|
#define MOUSEMODE(a) /*empty*/
|
||||||
#define ZOOMFOCUS(a) /*empty*/
|
#define ZOOMFOCUS(a) /*empty*/
|
||||||
#define DISPLAYCONTROL(a) /*empty*/
|
#define DISPLAYCONTROL(a) /*empty*/
|
||||||
#define COLORID(a) /*empty*/
|
|
||||||
|
|
||||||
namespace Editing {
|
namespace Editing {
|
||||||
|
|
||||||
|
|
@ -125,23 +124,6 @@ DisplayControl str2displaycontrol (const std::string &);
|
||||||
#undef DISPLAYCONTROL
|
#undef DISPLAYCONTROL
|
||||||
#define DISPLAYCONTROL(a) /*empty*/
|
#define DISPLAYCONTROL(a) /*empty*/
|
||||||
|
|
||||||
#undef COLORID
|
|
||||||
#define COLORID(a) a,
|
|
||||||
enum ColorID {
|
|
||||||
#include "editing_syms.h"
|
|
||||||
};
|
|
||||||
|
|
||||||
#undef COLORID
|
|
||||||
#define COLORID(s) #s,
|
|
||||||
static const char *color_id_strs[] = {
|
|
||||||
#include "editing_syms.h"
|
|
||||||
};
|
|
||||||
inline const char* enum2str(ColorID m) {return color_id_strs[m];}
|
|
||||||
ColorID str2color_id (const std::string &);
|
|
||||||
|
|
||||||
#undef COLORID
|
|
||||||
#define COLORID(a) /*empty*/
|
|
||||||
|
|
||||||
/////////////////////
|
/////////////////////
|
||||||
// These don't need their state saved. yet...
|
// These don't need their state saved. yet...
|
||||||
enum CutCopyOp {
|
enum CutCopyOp {
|
||||||
|
|
@ -156,16 +138,6 @@ enum XFadeType {
|
||||||
At
|
At
|
||||||
};
|
};
|
||||||
|
|
||||||
struct Color {
|
|
||||||
char r;
|
|
||||||
char g;
|
|
||||||
char b;
|
|
||||||
char a;
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef std::map<Editing::ColorID,int> ColorMap;
|
|
||||||
extern ColorMap color_map;
|
|
||||||
|
|
||||||
} // namespace Editing
|
} // namespace Editing
|
||||||
|
|
||||||
#endif // __gtk_ardour_editing_h__
|
#endif // __gtk_ardour_editing_h__
|
||||||
|
|
|
||||||
|
|
@ -53,105 +53,3 @@ DISPLAYCONTROL(FollowPlayhead)
|
||||||
DISPLAYCONTROL(ShowMeasures)
|
DISPLAYCONTROL(ShowMeasures)
|
||||||
DISPLAYCONTROL(ShowWaveforms)
|
DISPLAYCONTROL(ShowWaveforms)
|
||||||
DISPLAYCONTROL(ShowWaveformsRecording)
|
DISPLAYCONTROL(ShowWaveformsRecording)
|
||||||
|
|
||||||
COLORID(cWaveForm)
|
|
||||||
COLORID(cMutedWaveForm)
|
|
||||||
COLORID(cSelectedFrameBase)
|
|
||||||
COLORID(cFrameBase)
|
|
||||||
COLORID(cAudioTrackBase)
|
|
||||||
COLORID(cAudioTrackOutline)
|
|
||||||
COLORID(cAudioBusBase)
|
|
||||||
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(cTempoBar)
|
|
||||||
COLORID(cMeterBar)
|
|
||||||
COLORID(cMarkerBar)
|
|
||||||
COLORID(cRangeMarkerBar)
|
|
||||||
COLORID(cTransportMarkerBar)
|
|
||||||
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(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)
|
|
||||||
|
|
|
||||||
|
|
@ -274,8 +274,6 @@ Editor::Editor (AudioEngine& eng)
|
||||||
|
|
||||||
PublicEditor::_instance = this;
|
PublicEditor::_instance = this;
|
||||||
|
|
||||||
init_colormap ();
|
|
||||||
|
|
||||||
session = 0;
|
session = 0;
|
||||||
|
|
||||||
selection = new Selection;
|
selection = new Selection;
|
||||||
|
|
@ -3900,18 +3898,6 @@ Editor::prepare_for_cleanup ()
|
||||||
selection->clear_playlists ();
|
selection->clear_playlists ();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
Editor::init_colormap ()
|
|
||||||
{
|
|
||||||
for (size_t x = 0; x < sizeof (color_id_strs) / sizeof (color_id_strs[0]); ++x) {
|
|
||||||
pair<ColorID,int> newpair;
|
|
||||||
|
|
||||||
newpair.first = (ColorID) x;
|
|
||||||
newpair.second = rgba_from_style (enum2str (newpair.first), 0, 0, 0, 255);
|
|
||||||
color_map.insert (newpair);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Location*
|
Location*
|
||||||
Editor::transport_loop_location()
|
Editor::transport_loop_location()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1836,9 +1836,6 @@ class Editor : public PublicEditor
|
||||||
void toggle_gain_envelope_visibility ();
|
void toggle_gain_envelope_visibility ();
|
||||||
void toggle_gain_envelope_active ();
|
void toggle_gain_envelope_active ();
|
||||||
|
|
||||||
typedef std::map<Editing::ColorID,std::string> ColorStyleMap;
|
|
||||||
void init_colormap ();
|
|
||||||
|
|
||||||
bool on_key_press_event (GdkEventKey*);
|
bool on_key_press_event (GdkEventKey*);
|
||||||
|
|
||||||
void session_state_saved (string);
|
void session_state_saved (string);
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,7 @@
|
||||||
#include "tempo_dialog.h"
|
#include "tempo_dialog.h"
|
||||||
#include "rgb_macros.h"
|
#include "rgb_macros.h"
|
||||||
#include "gui_thread.h"
|
#include "gui_thread.h"
|
||||||
|
#include "color.h"
|
||||||
|
|
||||||
#include "i18n.h"
|
#include "i18n.h"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -250,8 +250,6 @@ ExportDialog::ExportDialog(PublicEditor& e, AudioRegion* r)
|
||||||
|
|
||||||
/* determine longest strings at runtime */
|
/* determine longest strings at runtime */
|
||||||
|
|
||||||
const guint32 FUDGE = 10; // Combo's are stupid - they steal space from the entry for the button
|
|
||||||
|
|
||||||
maxlen = 0;
|
maxlen = 0;
|
||||||
const char *longest = "gl";
|
const char *longest = "gl";
|
||||||
string longest_str;
|
string longest_str;
|
||||||
|
|
|
||||||
|
|
@ -280,8 +280,8 @@ MixerStrip::MixerStrip (Mixer_UI& mx, Session& sess, Route& rt, bool in_mixer)
|
||||||
_route.comment());
|
_route.comment());
|
||||||
comment_button.signal_clicked().connect (mem_fun(*this, &MixerStrip::comment_button_clicked));
|
comment_button.signal_clicked().connect (mem_fun(*this, &MixerStrip::comment_button_clicked));
|
||||||
|
|
||||||
global_vpacker.set_border_width (4);
|
global_vpacker.set_border_width (0);
|
||||||
global_vpacker.set_spacing (4);
|
global_vpacker.set_spacing (0);
|
||||||
|
|
||||||
Gtk::VBox *whvbox = manage (new Gtk::VBox);
|
Gtk::VBox *whvbox = manage (new Gtk::VBox);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -190,6 +190,8 @@ AudioRegionView::init (double amplitude_above_axis, Gdk::Color& basic_color, boo
|
||||||
|
|
||||||
set_colors ();
|
set_colors ();
|
||||||
|
|
||||||
|
ColorChanged.connect (mem_fun (*this, &AudioRegionView::color_handler));
|
||||||
|
|
||||||
/* XXX sync mark drag? */
|
/* XXX sync mark drag? */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1374,4 +1376,30 @@ AudioRegionView::set_waveview_data_src()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
AudioRegionView::color_handler (ColorID id, uint32_t val)
|
||||||
|
{
|
||||||
|
switch (id) {
|
||||||
|
case cMutedWaveForm:
|
||||||
|
case cWaveForm:
|
||||||
|
set_colors ();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case cGainLineInactive:
|
||||||
|
case cGainLine:
|
||||||
|
envelope_active_changed();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case cZeroLine:
|
||||||
|
if (zero_line) {
|
||||||
|
zero_line->property_color_rgba() = (guint) color_map[cZeroLine];
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case cGhostTrackWave:
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,7 @@
|
||||||
#include "enums.h"
|
#include "enums.h"
|
||||||
#include "waveview.h"
|
#include "waveview.h"
|
||||||
#include "canvas.h"
|
#include "canvas.h"
|
||||||
|
#include "color.h"
|
||||||
|
|
||||||
namespace ARDOUR {
|
namespace ARDOUR {
|
||||||
class AudioRegion;
|
class AudioRegion;
|
||||||
|
|
@ -198,6 +199,8 @@ class AudioRegionView : public TimeAxisViewItem
|
||||||
|
|
||||||
vector<GnomeCanvasWaveViewCache*> wave_caches;
|
vector<GnomeCanvasWaveViewCache*> wave_caches;
|
||||||
vector<GhostRegion*> ghosts;
|
vector<GhostRegion*> ghosts;
|
||||||
|
|
||||||
|
void color_handler (ColorID, uint32_t);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* __gtk_ardour_region_view_h__ */
|
#endif /* __gtk_ardour_region_view_h__ */
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@
|
||||||
#include "rgb_macros.h"
|
#include "rgb_macros.h"
|
||||||
#include "gui_thread.h"
|
#include "gui_thread.h"
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
|
#include "color.h"
|
||||||
|
|
||||||
using namespace ARDOUR;
|
using namespace ARDOUR;
|
||||||
using namespace Editing;
|
using namespace Editing;
|
||||||
|
|
@ -74,6 +75,8 @@ StreamView::StreamView (AudioTimeAxisView& tv)
|
||||||
rec_active = false;
|
rec_active = false;
|
||||||
use_rec_regions = tv.editor.show_waveforms_recording ();
|
use_rec_regions = tv.editor.show_waveforms_recording ();
|
||||||
last_rec_peak_frame = 0;
|
last_rec_peak_frame = 0;
|
||||||
|
|
||||||
|
ColorChanged.connect (mem_fun (*this, &StreamView::color_handler));
|
||||||
}
|
}
|
||||||
|
|
||||||
StreamView::~StreamView ()
|
StreamView::~StreamView ()
|
||||||
|
|
@ -918,3 +921,26 @@ StreamView::reveal_xfades_involving (AudioRegionView& rv)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
StreamView::color_handler (ColorID id, uint32_t val)
|
||||||
|
{
|
||||||
|
switch (id) {
|
||||||
|
case cAudioTrackBase:
|
||||||
|
if (_trackview.is_audio_track()) {
|
||||||
|
canvas_rect->property_fill_color_rgba() = val;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case cAudioBusBase:
|
||||||
|
if (!_trackview.is_audio_track()) {
|
||||||
|
canvas_rect->property_fill_color_rgba() = val;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case cAudioTrackOutline:
|
||||||
|
canvas_rect->property_outline_color_rgba() = val;
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,7 @@
|
||||||
#include "enums.h"
|
#include "enums.h"
|
||||||
#include "simplerect.h"
|
#include "simplerect.h"
|
||||||
#include "canvas.h"
|
#include "canvas.h"
|
||||||
|
#include "color.h"
|
||||||
|
|
||||||
namespace Gdk {
|
namespace Gdk {
|
||||||
class Color;
|
class Color;
|
||||||
|
|
@ -167,6 +168,8 @@ class StreamView : public sigc::trackable
|
||||||
Gdk::Color region_color;
|
Gdk::Color region_color;
|
||||||
uint32_t stream_base_color;
|
uint32_t stream_base_color;
|
||||||
|
|
||||||
|
void color_handler (ColorID, uint32_t);
|
||||||
|
|
||||||
vector<sigc::connection> playlist_connections;
|
vector<sigc::connection> playlist_connections;
|
||||||
sigc::connection playlist_change_connection;
|
sigc::connection playlist_change_connection;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -98,6 +98,8 @@ TapeAudioRegionView::init (double amplitude_above_axis, Gdk::Color& basic_color,
|
||||||
/* no events, no state changes */
|
/* no events, no state changes */
|
||||||
|
|
||||||
set_colors ();
|
set_colors ();
|
||||||
|
|
||||||
|
// ColorChanged.connect (mem_fun (*this, &AudioRegionView::color_handler));
|
||||||
}
|
}
|
||||||
|
|
||||||
TapeAudioRegionView::~TapeAudioRegionView()
|
TapeAudioRegionView::~TapeAudioRegionView()
|
||||||
|
|
|
||||||
|
|
@ -147,6 +147,8 @@ TimeAxisView::TimeAxisView (ARDOUR::Session& sess, PublicEditor& ed, TimeAxisVie
|
||||||
controls_frame.add (controls_hbox);
|
controls_frame.add (controls_hbox);
|
||||||
controls_frame.set_name ("TimeAxisViewControlsBaseUnselected");
|
controls_frame.set_name ("TimeAxisViewControlsBaseUnselected");
|
||||||
controls_frame.set_shadow_type (Gtk::SHADOW_OUT);
|
controls_frame.set_shadow_type (Gtk::SHADOW_OUT);
|
||||||
|
|
||||||
|
ColorChanged.connect (mem_fun (*this, &TimeAxisView::color_handler));
|
||||||
}
|
}
|
||||||
|
|
||||||
TimeAxisView::~TimeAxisView()
|
TimeAxisView::~TimeAxisView()
|
||||||
|
|
@ -1003,3 +1005,24 @@ TimeAxisView::hide_name_entry ()
|
||||||
name_packing = NamePackingBits (name_packing & ~NameEntryPacked);
|
name_packing = NamePackingBits (name_packing & ~NameEntryPacked);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
TimeAxisView::color_handler (ColorID id, uint32_t val)
|
||||||
|
{
|
||||||
|
switch (id) {
|
||||||
|
case cSelectionRectFill:
|
||||||
|
break;
|
||||||
|
case cSelectionRectOutline:
|
||||||
|
break;
|
||||||
|
case cSelectionStartFill:
|
||||||
|
break;
|
||||||
|
case cSelectionStartOutline:
|
||||||
|
break;
|
||||||
|
case cSelectionEndFill:
|
||||||
|
break;
|
||||||
|
case cSelectionEndOutline:
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,7 @@
|
||||||
#include "enums.h"
|
#include "enums.h"
|
||||||
#include "editing.h"
|
#include "editing.h"
|
||||||
#include "canvas.h"
|
#include "canvas.h"
|
||||||
|
#include "color.h"
|
||||||
|
|
||||||
namespace ARDOUR {
|
namespace ARDOUR {
|
||||||
class Session;
|
class Session;
|
||||||
|
|
@ -311,6 +312,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);
|
||||||
|
|
||||||
}; /* class TimeAxisView */
|
}; /* class TimeAxisView */
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue