summaryrefslogtreecommitdiffstats
path: root/Graphic_Equalizer/src/eventhandler.hcc
diff options
context:
space:
mode:
authorOliver Schinagl <oliver@schinagl.nl>2004-11-10 16:11:03 (GMT)
committerOliver Schinagl <oliver@schinagl.nl>2004-11-10 16:11:03 (GMT)
commit51085a870cc074c3eeef5a6ba1b45503ce0e0f4d (patch)
tree2232a881b7a90f475da5640161f32cf900102369 /Graphic_Equalizer/src/eventhandler.hcc
parentedf01e33d5680018a8c48224b8f7134587f3fcdf (diff)
downloadTASS-51085a870cc074c3eeef5a6ba1b45503ce0e0f4d.zip
TASS-51085a870cc074c3eeef5a6ba1b45503ce0e0f4d.tar.gz
TASS-51085a870cc074c3eeef5a6ba1b45503ce0e0f4d.tar.bz2
Diffstat (limited to 'Graphic_Equalizer/src/eventhandler.hcc')
-rw-r--r--Graphic_Equalizer/src/eventhandler.hcc62
1 files changed, 55 insertions, 7 deletions
diff --git a/Graphic_Equalizer/src/eventhandler.hcc b/Graphic_Equalizer/src/eventhandler.hcc
index 9c67aef..b9b6b1f 100644
--- a/Graphic_Equalizer/src/eventhandler.hcc
+++ b/Graphic_Equalizer/src/eventhandler.hcc
@@ -24,10 +24,10 @@
#include "pal_master.hch"
/******** Application Includes ********/
-#include "eventhandler.hch"
-#include "eventhandler_shared.hch"
#include "mouse_shared.hch"
#include "display_shared.hch"
+#include "eventhandler_shared.hch"
+#include "eventhandler.hch"
@@ -47,25 +47,73 @@ void eventhandler_main(events_t *events, mousedata_t *mousedata) {
unsigned 1 newmousedata;
for (;;) {
+ mousedata_notification ? newmousedata;
/*
* First we determine what mousestate we currently have. Then
* we check where we are to decide what to do.
*/
switch (mousedata->state) {
- case MOUSE_STATE_DOWN:
+ case MOUSE_STATE_ON_PRESS:
+ /*
+ * If the current mask equals the help button
+ * we flip the help bit.
+ */
if (BUTTON_HELP == events->mask) {
events->help = !events->help;
+ } else {
+ delay;
}
break;
- case MOUSE_STATE_ON_PRESS:
+ case MOUSE_STATE_DOWN:
+ /*
+ * If we are in the volume area we update the
+ * volume level for both channels.
+ */
if (AREA_VOLUME_YAXIS) {
- events->volume_position = mousedata->y;
- volume_left = volume_table[(mousedata->y) -65];
- RC200SetVolume(!volume_left, volume_left, volume_left);
+ /*
+ * Copy the current Y cursor position
+ * to the events struct. This we then
+ * later use for drawing purposes.
+ */
+ events->volume_position = 0 @ mousedata->y;
+ /*
+ * Look the relative y-coordinate up in
+ * the volumecontrol lookup table.
+ */
+ volume_left = volumecontrol_table[((mousedata->y) -65) <- 6];
+ /*
+ * We feel that volume gets softer the
+ * closer it gets to the 0, and louder
+ * as it approaches 0x1f. The SetVolume
+ * RC200 call does this in an unnatural
+ * reverse way. Therefor we reverse it.
+ */
+ RC200AudioOutSetVolume(!volume_left, 0x1f -volume_left, 0x1f -volume_left);
+ } else {
+ delay;
}
if ((AREA_EQUALIZER_MIN <= events->mask) && (events->mask <= AREA_EQUALIZER_MAX)) {
+ delay;
+ } else {
+ delay;
}
break;
}
}
} /* --- eventhandler_main() --- */
+
+
+
+/*
+ * Volume Control lookuptable.
+ * TODO: This table is now hardcoded. To ensure full skinability this table
+ * should be dynamically loaded.
+ */
+rom unsigned 5 volumecontrol_table[46] = {31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 12, 11, 11, 10, 10, 9, 9, 8, 8, 7, 7, 6, 6, 5, 5, 4, 4, 3, 3, 2, 2, 1, 1, 0, 0, 0};
+
+/*
+ * Equalizer lookuptabe.
+ * TODO: This table is now hardcoded. To ensure full skinability this table
+ * should be dynamically loaded.
+ */
+rom unsigned 4 equalizer_table[66] = {15, 15, 15, 15, 15, 14, 14, 14, 14, 13, 13, 13, 13, 12, 12, 12, 12, 11, 11, 11, 11, 10, 10, 10, 10, 9, 9, 9, 9, 8, 8, 8, 8, 7, 7, 7, 7, 6, 6, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 3, 3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0}; \ No newline at end of file