/*! \file eventhandler.hcc * * \section generic This modules coordinates all events. Thus for example * when the mousehandler registers a 'click' we coordinate * the actions that follow that click. * * \section project Project information. * Project Graphic Equalizer\n * \author O.M. Schinagl * \date 20041110 * \version 0.1 * * \section copyright Copyright * Copyright ©2004 Koninklijke Philips Electronics N.V. All rights reserved * * \section history Change history * 20041110: O.M. Schinagl\n Initial version * ********************************************************************/ /******** System Includes *************/ #include #include "pal_master.hch" /******** Application Includes ********/ #include "eventhandler.hch" #include "eventhandler_shared.hch" #include "mouse_shared.hch" #include "display_shared.hch" /*! \fn void eventhandler_main(events_t *events, mousedata_t *mousedata); * \brief * * \param events_t *events pointer to struct with all events. * \param mousedata_t *mousedata pointer to struct with mouse data. * * \return Never Returns. * \retval void */ void eventhandler_main(events_t *events, mousedata_t *mousedata) { extern chan unsigned 1 mousedata_notification; unsigned 5 volume_left; unsigned 1 newmousedata; for (;;) { /* * 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: if (BUTTON_HELP == events->mask) { events->help = !events->help; } break; case MOUSE_STATE_ON_PRESS: if (AREA_VOLUME_YAXIS) { events->volume_position = mousedata->y; volume_left = volume_table[(mousedata->y) -65]; RC200SetVolume(!volume_left, volume_left, volume_left); } if ((AREA_EQUALIZER_MIN <= events->mask) && (events->mask <= AREA_EQUALIZER_MAX)) { } break; } } } /* --- eventhandler_main() --- */