/*! \file events.hcc * * \section generic This module contains the various actions and events * that need to be performed. * * \section project Project information. * Project Graphic Equalizer\n * \author O.M. Schinagl * \date 20041710 * \version 0.1 * * \section copyright Copyright * Copyright ©2004 Koninklijke Philips Electronics N.V. All rights reserved * * \section history Change history * 20041710: O.M. Schinagl\n Initial version * *****************************************************************************/ /******** System Includes *************/ #include #include "pal_master.hch" /******** Application Includes ********/ #include "configuration.hch" #include "eventhandler_shared.hch" #include "events.hch" #if HAVE_DEBUG #include "debug.hch" #endif ram unsigned 8 presets_default_values[768] = { #include "presets_hardcoded.txt" }; /*! \fn void load_preset(unsigned 10 preset, unsigned 4 *equalizer_levels_ptr); * \brief This function loads 768 4bits presets into the equalizer_levels * array pointed to by equalizer_levels. * * \param *equalizer_levels Location where to store presets loaded * from blockram. * * \return void * \retval void */ void load_preset(unsigned 10 preset, unsigned 4 *equalizer_levels_ptr) { unsigned 10 equalizer_index; unsigned 4 temp; equalizer_index = 0; while (equalizer_index != 768) { temp = presets_default_values[preset +(0 @ (equalizer_index \\ 1))][7:4]; equalizer_levels_ptr[equalizer_index] = temp; temp = presets_default_values[preset +(0 @ (equalizer_index \\ 1))][3:0]; equalizer_levels_ptr[equalizer_index +1] = temp; equalizer_index += 2; } } /* --- load_preset() --- */ /* * Equalizer lookuptabes. * TODO: This table is now hardcoded. To ensure full skinability this table * should be dynamically loaded. */ ram unsigned 4 equalizer_table[640] = {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}; ram unsigned 10 equalizer_table_inv[16] = {446, 444, 440, 436, 432, 428, 424, 420, 416, 412, 408, 404, 400, 396, 392, 384};