From 1f22a1e6dce27a9ce1b4ccd434be371994ae14e6 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 31 Mar 2014 02:28:26 +0000 Subject: Make port colours configurable. git-svn-id: http://svn.drobilla.net/lad/trunk/patchage@5350 a436a847-0d15-0410-975c-d299462d15a1 --- src/Configuration.hpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'src/Configuration.hpp') diff --git a/src/Configuration.hpp b/src/Configuration.hpp index b169c34..34b1595 100644 --- a/src/Configuration.hpp +++ b/src/Configuration.hpp @@ -17,6 +17,8 @@ #ifndef PATCHAGE_CONFIGURATION_HPP #define PATCHAGE_CONFIGURATION_HPP +#include + #include #include #include @@ -27,6 +29,8 @@ enum ModuleType { Input, Output, InputOutput }; enum PortType { JACK_AUDIO, JACK_MIDI, ALSA_MIDI }; +#define N_PORT_TYPES 3 + struct Coord { Coord(double x_=0, double y_=0) : x(x_), y(y_) {} double x; @@ -47,10 +51,13 @@ public: void set_module_split(const std::string& name, bool split); bool get_module_split(const std::string& name, bool default_val) const; - float get_zoom(); - void set_zoom(float zoom); + float get_zoom() { return _zoom; } + void set_zoom(float zoom) { _zoom = zoom; } - int get_port_color(PortType type); + uint32_t get_port_color(PortType type) const { return _port_colors[type]; } + void set_port_color(PortType type, uint32_t rgba) { + _port_colors[type] = rgba; + } Coord get_window_location() { return _window_location; } void set_window_location(Coord loc) { _window_location = loc; } @@ -68,6 +75,9 @@ private: std::map _module_settings; + uint32_t _default_port_colors[N_PORT_TYPES]; + uint32_t _port_colors[N_PORT_TYPES]; + Coord _window_location; Coord _window_size; float _zoom; -- cgit v1.2.1