diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2014-07-16 14:11:02 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2014-07-16 14:11:02 -0600 |
commit | c5116b28c46d674541d14e1504e866c68e63bc7e (patch) | |
tree | 30a422ccab7f24ab7e05fe050fc270d5258c3c39 /NxWidgets/nxwm/include/cmediaplayer.hxx | |
parent | 4bfc8992891da3a70f7b39924d6db7dec0ca32a0 (diff) | |
download | px4-nuttx-c5116b28c46d674541d14e1504e866c68e63bc7e.tar.gz px4-nuttx-c5116b28c46d674541d14e1504e866c68e63bc7e.tar.bz2 px4-nuttx-c5116b28c46d674541d14e1504e866c68e63bc7e.zip |
NxWM::CMediaPlayer: Convert CLabel to a CListBox
Diffstat (limited to 'NxWidgets/nxwm/include/cmediaplayer.hxx')
-rw-r--r-- | NxWidgets/nxwm/include/cmediaplayer.hxx | 44 |
1 files changed, 32 insertions, 12 deletions
diff --git a/NxWidgets/nxwm/include/cmediaplayer.hxx b/NxWidgets/nxwm/include/cmediaplayer.hxx index bf4ff61f4..455792db5 100644 --- a/NxWidgets/nxwm/include/cmediaplayer.hxx +++ b/NxWidgets/nxwm/include/cmediaplayer.hxx @@ -46,10 +46,11 @@ #include <nuttx/nx/nxtk.h> #include <nuttx/nx/nxconsole.h> +#include "cnxfont.hxx" #include "cimage.hxx" #include "cstickyimage.hxx" -#include "clabel.hxx" -#include "cnxfont.hxx" +#include "clistbox.hxx" +#include "clistboxdataitem.hxx" #include "cglyphsliderhorizontal.hxx" #include "iapplication.hxx" @@ -117,7 +118,14 @@ 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 */ + int m_level; /**< Current volume level */ + int m_fileIndex; /**< Index to selected file in the list box */ + + /** + * Media player geometry. + */ + + struct nxgl_size_s m_windowSize; /**< The size of the media player window */ /** * Cached constructor parameters. @@ -130,7 +138,7 @@ namespace NxWM * Widgets */ - NXWidgets::CLabel *m_text; /**< Some text in the app for now */ + NXWidgets::CListBox *m_listbox; /**< List box containing media files selections */ NXWidgets::CNxFont *m_font; /**< The font used in the media player */ NXWidgets::CImage *m_play; /**< Play control */ NXWidgets::CImage *m_pause; /**< Pause control */ @@ -152,19 +160,31 @@ namespace NxWM NXWidgets::CRlePaletteBitmap *m_volumeBitmap; /**< Volume control grip bitmap */ /** - * Calculator geometry. This stuff does not really have to be retained - * in memory. If you are pinched for memory, get rid of these. + * Open a media file for playing. Called after a file has been selected + * from the list box. */ - 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 */ + inline bool openMediaFile(const NXWidgets::CListBoxDataItem *item); /** - * Select the geometry of the media player given the current window size. - * Only called as part of construction. - */ + * Close media file. Called when a new media file is selected, when a + * media file is de-selected, or when destroying the media player instance. + */ + + inline void closeMediaFile(void); + + /** + * Select the geometry of the media player given the current window size. + * Only called as part of construction. + */ + + inline void setGeometry(void); + + /** + * Load media files into the list box. + */ - inline void setGeometry(void); + inline bool showMediaFiles(const char *mediaPath); /** * Create the Media Player controls. Only start as part of the application |