summaryrefslogtreecommitdiff
path: root/libs/surfaces/tranzport/bling.cc
blob: c60b699f3dc75dc91bbde6d6112bf9a51d18b9b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
/*
 *   Copyright (C) 2006 Paul Davis 
 *   Copyright (C) 2007 Michael Taht
 *
 *   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.
 *  
 *   */

/* The Bling class theoretically knows nothing about the device it's blinging 
   and depends on the overlying implementation to tell it about the format of the
   device. Maybe this will become a template or people will inherit from it */

/* Bling is where all the bad, bad, marketing driven ideas go */

class bling {
public:
	enum BlingMode {
	        BlingOff = 0,
	        BlingOn = 1,
		BlingEnter = 2,
		BlingExit = 4,
		// Light Specific Stuff
	        BlingKit = 8,
	        BlingRotating = 16,
	        BlingPairs = 32,
	        BlingRows = 64,
		BlingColumns = 128,
	        BlingFlashAllLights = 256,
		// Screen Specific Stuff
		// Slider Specific Stuff
		BlingSliderMax,
		BlingSliderMid,
		BlingSliderMin,
		// Random stuff
		BlingRandomLight,
		BlingRandomSlider,
		BlingRandomScreen,
		BlingAllSliders
	};
	bling();
	~bling();
	set(BlingMode);
	unset(BlingMode);
	run();
	next();
	prev();
	msg(string&);
	scrollmsg(string&);

protected:
// The as yet undefined "advanced_ui" class provides methods to find out at run time
// what the heck is what
	BlingMode blingmode;
	advancedUI *intf;
	int last_light;
// I don't think these actually need to be part of the public definition of the class
	enter();
	exit();
	rotate();
// etc
};

// make absolutely sure we have the pointer to the interface
// something like this

#define BLING_INTFA(a) (intf)? 0:intf->a  
#define BLING_INTF(a) { if (intf) { intf->a; } else { return 0; } }  

// Should any of these bother to return a status code?

bling::rotate() {
	BLING_INTF(light(last_light,off));
	last_light = BLING_INTFA(next_light(last_light));
	BLING_INTF(light(last_light,on));
}

bling::enter() {
}

bling::exit() {
}

bling::flashall() {
}

bling::rows() {
}

bling::columns() {
}

bling::msg() {
}

bling::scrollmsg() {
}

// Based on the current bling mode, do whatever it is you are going to do
bling::run() {
	
}

// etc