diff options
Diffstat (limited to 'NxWidgets/nxwm/include')
-rw-r--r-- | NxWidgets/nxwm/include/cmediaplayer.hxx | 28 | ||||
-rw-r--r-- | NxWidgets/nxwm/include/nxwmconfig.hxx | 12 |
2 files changed, 35 insertions, 5 deletions
diff --git a/NxWidgets/nxwm/include/cmediaplayer.hxx b/NxWidgets/nxwm/include/cmediaplayer.hxx index 6d803b537..bf4ff61f4 100644 --- a/NxWidgets/nxwm/include/cmediaplayer.hxx +++ b/NxWidgets/nxwm/include/cmediaplayer.hxx @@ -117,6 +117,7 @@ namespace NxWM enum EMediaPlayerState m_state; /**< Media player current state */ enum EMediaPlayerState m_prevState; /**< Media player previous state */ enum EPendingRelease m_pending; /**< Pending image release event */ + unsigned int m_level; /**< Current volume level */ /** * Cached constructor parameters. @@ -148,6 +149,7 @@ namespace NxWM NXWidgets::CRlePaletteBitmap *m_pauseBitmap; /**< Bitmap for the pause control */ NXWidgets::CRlePaletteBitmap *m_rewindBitmap; /**< Bitmap for the rewind control */ NXWidgets::CRlePaletteBitmap *m_fforwardBitmap; /**< Bitmap for the fast forward control */ + NXWidgets::CRlePaletteBitmap *m_volumeBitmap; /**< Volume control grip bitmap */ /** * Calculator geometry. This stuff does not really have to be retained @@ -156,7 +158,6 @@ namespace NxWM struct nxgl_size_s m_windowSize; /**< The size of the media player window */ struct nxgl_size_s m_textSize; /**< The size of the media player textbox */ - struct nxgl_point_s m_textPos; /**< The position of the media player textbox */ /** * Select the geometry of the media player given the current window size. @@ -185,6 +186,15 @@ namespace NxWM void close(void); /** + * Redraw all widgets. Called from redraw() and also on any state + * change. + * + * @param state The new state to enter. + */ + + void redrawWidgets(void); + + /** * Transition to a new media player state. * * @param state The new state to enter. @@ -193,8 +203,14 @@ namespace NxWM void setMediaPlayerState(enum EMediaPlayerState state); /** - * Handle a widget action event. This includes a image pre/release - * release events and volume slider change events. + * Set the new volume level based on the position of the volume slider. + */ + + void setVolumeLevel(void); + + /** + * Handle a widget action event. For this application, that means image + * pre-release events. * * @param e The event data. */ @@ -216,6 +232,12 @@ namespace NxWM void handleReleaseOutsideEvent(const NXWidgets::CWidgetEventArgs &e); + /** + * Handle changes in the volume level. + */ + + void handleValueChangeEvent(const NXWidgets::CWidgetEventArgs &e); + public: /** * CMediaPlayer constructor diff --git a/NxWidgets/nxwm/include/nxwmconfig.hxx b/NxWidgets/nxwm/include/nxwmconfig.hxx index c6781bcd5..40689c0f5 100644 --- a/NxWidgets/nxwm/include/nxwmconfig.hxx +++ b/NxWidgets/nxwm/include/nxwmconfig.hxx @@ -1,7 +1,7 @@ /**************************************************************************** * NxWidgets/nxwm/include/nxwmconfig.hxx * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2012, 2014 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without @@ -628,12 +628,20 @@ * Default: CONFIG_NXWM_DEFAULT_FONTID */ +#ifndef CONFIG_NXWM_MEDIAPLAYER_MEDIAPATH +# define CONFIG_NXWM_MEDIAPLAYER_MEDIAPATH "/mnt/sdcard" +#endif + #ifndef CONFIG_NXWM_MEDIAPLAYER_BACKGROUNDCOLOR # define CONFIG_NXWM_MEDIAPLAYER_BACKGROUNDCOLOR CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR #endif #ifndef CONFIG_NXWM_MEDIAPLAYER_XSPACING -# define CONFIG_NXWM_MEDIAPLAYER_XSPACING 16 +# define CONFIG_NXWM_MEDIAPLAYER_XSPACING 12 +#endif + +#ifndef CONFIG_NXWM_MEDIAPLAYER_YSPACING +# define CONFIG_NXWM_MEDIAPLAYER_YSPACING 8 #endif #ifndef CONFIG_NXWM_MEDIAPLAYER_ICON |