summaryrefslogtreecommitdiff
path: root/libs/ardour
diff options
context:
space:
mode:
Diffstat (limited to 'libs/ardour')
-rw-r--r--libs/ardour/ardour/canvas_vars.h81
-rw-r--r--libs/ardour/ardour/configuration.h12
-rw-r--r--libs/ardour/ardour/configuration_variable.h4
-rw-r--r--libs/ardour/ardour/configuration_vars.h1
-rw-r--r--libs/ardour/configuration.cc52
5 files changed, 136 insertions, 14 deletions
diff --git a/libs/ardour/ardour/canvas_vars.h b/libs/ardour/ardour/canvas_vars.h
new file mode 100644
index 0000000000..4a3c510682
--- /dev/null
+++ b/libs/ardour/ardour/canvas_vars.h
@@ -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)
diff --git a/libs/ardour/ardour/configuration.h b/libs/ardour/ardour/configuration.h
index 31cb74ab33..ecc5494690 100644
--- a/libs/ardour/ardour/configuration.h
+++ b/libs/ardour/ardour/configuration.h
@@ -54,6 +54,8 @@ class Configuration : public Stateful
std::map<std::string,MidiPortDescriptor *> midi_ports;
+ std::vector<ConfigVariable<uint32_t> *> canvas_colors;
+
void map_parameters (sigc::slot<void,const char*> theSlot);
int load_state ();
@@ -61,8 +63,9 @@ class Configuration : public Stateful
int set_state (const XMLNode&);
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 pack_canvasvars ();
void set_current_owner (ConfigVariableBase::Owner);
@@ -83,7 +86,12 @@ class Configuration : public Stateful
#include "ardour/configuration_vars.h"
#undef CONFIG_VARIABLE
#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:
/* declare variables */
diff --git a/libs/ardour/ardour/configuration_variable.h b/libs/ardour/ardour/configuration_variable.h
index fa149672be..fa6701250a 100644
--- a/libs/ardour/ardour/configuration_variable.h
+++ b/libs/ardour/ardour/configuration_variable.h
@@ -65,7 +65,7 @@ class ConfigVariable : public ConfigVariableBase
ConfigVariable (std::string str) : ConfigVariableBase (str) {}
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) {
miss ();
return false;
@@ -92,7 +92,7 @@ class ConfigVariable : public ConfigVariableBase
bool set_from_node (const XMLNode& node, Owner owner) {
- if (node.name() == "Config") {
+ if (node.name() == "Config" || node.name() == "Canvas") {
/* ardour.rc */
diff --git a/libs/ardour/ardour/configuration_vars.h b/libs/ardour/ardour/configuration_vars.h
index 8ba9830841..b78421b48f 100644
--- a/libs/ardour/ardour/configuration_vars.h
+++ b/libs/ardour/ardour/configuration_vars.h
@@ -160,3 +160,4 @@ CONFIG_VARIABLE (string, bwf_organization_code, "bwf-organization-code", "US")
/* these variables have custom set() methods (e.g. path globbing) */
CONFIG_VARIABLE_SPECIAL(Glib::ustring, raid_path, "raid-path", "", path_expand)
+
diff --git a/libs/ardour/configuration.cc b/libs/ardour/configuration.cc
index c8d71c5155..58d702e3d9 100644
--- a/libs/ardour/configuration.cc
+++ b/libs/ardour/configuration.cc
@@ -51,7 +51,12 @@ Configuration::Configuration ()
#define CONFIG_VARIABLE_SPECIAL(Type,var,name,value,mutator) var (name,value,mutator),
#include "ardour/configuration_vars.h"
#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)
{
@@ -120,6 +125,7 @@ Configuration::load_state ()
}
}
+ pack_canvasvars();
return 0;
}
@@ -162,7 +168,8 @@ Configuration::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) {
root->add_child_copy (*_extra_xml);
@@ -174,23 +181,28 @@ Configuration::get_state ()
}
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;
LocaleGuard lg (X_("POSIX"));
- node = new XMLNode("Config");
+ node = new XMLNode(which_node);
#undef CONFIG_VARIABLE
#undef CONFIG_VARIABLE_SPECIAL
-#define CONFIG_VARIABLE(type,var,name,value) \
- if (predicate (var.owner())) { var.add_to_node (*node); }
-#define CONFIG_VARIABLE_SPECIAL(type,var,name,value,mutator) \
- if (predicate (var.owner())) { var.add_to_node (*node); }
+#define CONFIG_VARIABLE(type,var,Name,value) \
+ if (node->name() == "Config") { if (predicate (var.owner())) { var.add_to_node (*node); }}
+#define CONFIG_VARIABLE_SPECIAL(type,var,Name,value,mutator) \
+ if (node->name() == "Config") { if (predicate (var.owner())) { var.add_to_node (*node); }}
#include "ardour/configuration_vars.h"
#undef CONFIG_VARIABLE
#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;
}
@@ -222,7 +234,7 @@ Configuration::set_state (const XMLNode& root)
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);
@@ -252,10 +264,30 @@ Configuration::set_variables (const XMLNode& node, ConfigVariableBase::Owner own
if (var.set_from_node (node, owner)) { \
ParameterChanged (name); \
}
+
#include "ardour/configuration_vars.h"
#undef CONFIG_VARIABLE
#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)