summaryrefslogtreecommitdiffstats
path: root/Graphic_Equalizer/src/eventhandler.hcc
diff options
context:
space:
mode:
authorOliver Schinagl <oliver@schinagl.nl>2004-11-11 16:13:58 (GMT)
committerOliver Schinagl <oliver@schinagl.nl>2004-11-11 16:13:58 (GMT)
commit27405f4f8c65baabb28ce427912851be10207781 (patch)
tree3a090403142563d916a8cbb5ef8a3c4113a5b6ae /Graphic_Equalizer/src/eventhandler.hcc
parent9877678730e53e9ee99241a8ab5babe35eacf28d (diff)
downloadTASS-27405f4f8c65baabb28ce427912851be10207781.zip
TASS-27405f4f8c65baabb28ce427912851be10207781.tar.gz
TASS-27405f4f8c65baabb28ce427912851be10207781.tar.bz2
Added fft files
fixed some issues, included equalizer.
Diffstat (limited to 'Graphic_Equalizer/src/eventhandler.hcc')
-rw-r--r--Graphic_Equalizer/src/eventhandler.hcc27
1 files changed, 24 insertions, 3 deletions
diff --git a/Graphic_Equalizer/src/eventhandler.hcc b/Graphic_Equalizer/src/eventhandler.hcc
index b614d28..f0583aa 100644
--- a/Graphic_Equalizer/src/eventhandler.hcc
+++ b/Graphic_Equalizer/src/eventhandler.hcc
@@ -36,7 +36,7 @@
extern chan unsigned 1 maskupdate_notification;
-/*! \fn void eventhandler_main(events_t *events, mousedata_t *mousedata);
+/*! \fn void eventhandler_main(equalizer_levels_t *equalizer_levels, events_t *events, mousedata_t *mousedata);
* \brief
*
* \param events_t *events pointer to struct with all events.
@@ -45,12 +45,15 @@ extern chan unsigned 1 maskupdate_notification;
* \return Never Returns.
* \retval void
*/
-macro proc eventhandler_main(events, mousedata) {
+macro proc eventhandler_main(equalizer_levels, events, mousedata) {
unsigned 5 volume_left;
unsigned 1 newmaskupdate;
for (;;) {
maskupdate_notification ? newmaskupdate;
+ print_string("Mask: ");print_hex_value(0 @ events.mask);print_eol();
+ print_string("state: ");print_hex_value(0 @ mousedata.state);print_eol();
+
/*
* First we determine what mousestate we currently have. Then
* we check where we are to decide what to do.
@@ -96,7 +99,25 @@ macro proc eventhandler_main(events, mousedata) {
delay;
}
if ((AREA_EQUALIZER_MIN <= events.mask) && (events.mask <= AREA_EQUALIZER_MAX)) {
- delay;
+ print_string("Ypos for eq: ");print_hex_value(0 @ mousedata.y);print_eol();
+ /*
+ * Copy the current Y position into a
+ * store for the current equalizer bar.
+ */
+ events.equalizer_position[(events.mask -0x80) <- 7] = mousedata.y;
+ /*
+ * We look our current possition up in
+ * the lookup table. We determin our
+ * position via the current Y position
+ * (minus an offset of course). We
+ * store the result in the array of
+ * equalizer levels. The index we get
+ * from the current mask.
+ *
+ * TODO: lock equalizer store with a
+ * semaphore!
+ */
+ equalizer_levels.write[0 @ (events.mask -0x80) <- 7] = equalizer_table[((mousedata.y) -382) <- 7];
} else {
delay;
}