summaryrefslogtreecommitdiff
path: root/NT
diff options
context:
space:
mode:
authorTim Redfern <tim@eclectronics.org>2014-05-22 10:14:01 +0100
committerTim Redfern <tim@eclectronics.org>2014-05-22 10:14:01 +0100
commit8f1667713a961de1f20688470ab84db097151692 (patch)
tree43f3b068dac7b30df538344ef16d7c6003036203 /NT
parentbb6498e5ff6a8a8af8c06300dac051659a37e89b (diff)
colour palette as string inlet
Diffstat (limited to 'NT')
-rw-r--r--NT/src/nodes_source.h11
-rw-r--r--NT/src/rotor.h2
2 files changed, 11 insertions, 2 deletions
diff --git a/NT/src/nodes_source.h b/NT/src/nodes_source.h
index 08da163..ede0dcb 100644
--- a/NT/src/nodes_source.h
+++ b/NT/src/nodes_source.h
@@ -6,9 +6,15 @@
namespace Rotor {
class Signal_colour: public Image_node {
public:
+ //has a palette of colours which can be initialised from json or from an inlet
+ //1 - a data type which is a variable length array of data [as opposed to a array of inlets]
+ //2 - a way to initialise this from json
+ //enum - this is a hack to achieve this? designed for option selectors, can it work here?
+ //or just parse a string into a list of colours?
Signal_colour(){
selector=create_inlet<double>("selector");
- create_attribute("palette","palette list of web colours","Colour palette","000000");
+ palette=create_inlet<string>("palette","colour to choose from palette","Palette","000000")
+ //create_attribute("palette","palette list of web colours","Colour palette","000000");
title="Signal colour";
description="Cycles through a palette of background colours according to selector signal";
NODEID="a2183fe0-2d09-11e3-9a64-538ee2cf40bc";
@@ -42,7 +48,9 @@ namespace Rotor {
vector<Colour> palette;
int prevcol;
Number_inlet *selector;
+ Enum_inlet *palette;
};
+ /*
class Signal_greyscale: public Image_node {
//Draws signal bars in greyscale
public:
@@ -73,5 +81,6 @@ namespace Rotor {
private:
uint8_t prevcol;
};
+ */
}
#endif
diff --git a/NT/src/rotor.h b/NT/src/rotor.h
index 2ddf3ee..59533f5 100644
--- a/NT/src/rotor.h
+++ b/NT/src/rotor.h
@@ -91,7 +91,7 @@ namespace Rotor {
template <class NT> class Node_type;
class Enum{
- //enumerated string type for menus
+ //enumerated string type for node options that can appear in a menu
public:
Enum(std::initializer_list<std::string> init={},int def=0) : labels(init), value(def){};
int get_value(){return value;};