|
NXWidgets
1.19
|
#include <cmediaplayer.hxx>

Classes | |
| struct | SPendingOperation |
Public Member Functions | |
| CMediaPlayer (CTaskbar *taskbar, CApplicationWindow *window) | |
| ~CMediaPlayer (void) | |
| IApplicationWindow * | getWindow (void) const |
| NXWidgets::IBitmap * | getIcon (void) |
| NXWidgets::CNxString | getName (void) |
| bool | run (void) |
| void | stop (void) |
| void | destroy (void) |
| void | hide (void) |
| void | redraw (void) |
| bool | isFullScreen (void) const |
Public Member Functions inherited from NxWM::IApplication | |
| virtual | ~IApplication (void) |
| void | setMinimized (bool minimized) |
| void | setTopApplication (bool topapp) |
| bool | isMinimized (void) const |
| bool | isTopApplication (void) const |
Private Types | |
| enum | EMediaPlayerState { MPLAYER_STOPPED = 0, MPLAYER_STAGED, MPLAYER_PLAYING, MPLAYER_PAUSED, MPLAYER_FFORWARD, MPLAYER_FREWIND } |
| enum | EPendingRelease { PENDING_NONE = 0, PENDING_PLAY_RELEASE, PENDING_PAUSE_RELEASE } |
Private Attributes | |
| FAR struct nxplayer_s * | m_player |
| enum EMediaPlayerState | m_state |
| enum EMediaPlayerState | m_prevState |
| enum EPendingRelease | m_pending |
| NXWidgets::CNxString | m_filePath |
| int | m_fileIndex |
| bool | m_fileReady |
| uint8_t | m_level |
| uint8_t | m_subSample |
| struct nxgl_size_s | m_windowSize |
| CTaskbar * | m_taskbar |
| CApplicationWindow * | m_window |
| NXWidgets::CListBox * | m_listbox |
| NXWidgets::CNxFont * | m_font |
| NXWidgets::CImage * | m_play |
| NXWidgets::CImage * | m_pause |
| NXWidgets::CStickyImage * | m_rewind |
| NXWidgets::CStickyImage * | m_fforward |
| NXWidgets::CGlyphSliderHorizontal * | m_volume |
| NXWidgets::CLabel * | m_speed |
| NXWidgets::CRlePaletteBitmap * | m_playBitmap |
| NXWidgets::CRlePaletteBitmap * | m_pauseBitmap |
| NXWidgets::CRlePaletteBitmap * | m_rewindBitmap |
| NXWidgets::CRlePaletteBitmap * | m_fforwardBitmap |
| NXWidgets::CRlePaletteBitmap * | m_volumeBitmap |
Additional Inherited Members | |
Protected Attributes inherited from NxWM::IApplication | |
| bool | m_minimized |
| bool | m_topapp |
This class implements the CMediaPlayer application.
Definition at line 82 of file cmediaplayer.hxx.
|
private |
This enumeration identifies the state of the media player
State Transition Table
------—+-------—+-------—+-------—+-------—+-------—+-------—+ | FILE | FILE | | | FAST | | STATE | SELECTED |DESELECTED| PLAY | PAUSE | FORWARD | REWIND | ------—+-------—+-------—+-------—+-------—+-------—+-------—+ STOPPED | STAGED | X | X | X | X | X | STAGED | STAGED | STOPPED | PLAYING | X | X | X | PLAYING | X | X | X | PAUSED |FFORWARD2 | REWIND2 | PAUSED | STAGED | STOPPED | PLAYING | X |FFORWARD1 | REWIND1 | FFORWARD1| X | X | PAUSED | X |FFORWARD1 | REWIND1 | REWIND1 | X | X | PAUSED | X |FFORWARD1 | REWIND1 | FFORWARD2| X | X | X | PLAYING | PLAYING | REWIND1 | REWIND2 | X | X | X | PLAYING |FFORWARD1 | PLAYING | ------—+-------—+-------—+-------—+-------—+-------—+-------—+
Configuration Dependencies. States in the above state transition table may not be supported if any of the following features are excluded from the configuration:
CONFIG_AUDIO_EXCLUDE_STOP CONFIG_AUDIO_EXCLUDE_PAUSE_RESUME CONFIG_AUDIO_EXCLUDE_VOLUME CONFIG_AUDIO_EXCLUDE_FFORWARD CONFIG_AUDIO_EXCLUDE_REWIND
Definition at line 116 of file cmediaplayer.hxx.
|
private |
Describes the state of an image touch. Some image touch cannot be processed until the image contact is lost. This enumeration arms and manages those cases.
| Enumerator | |
|---|---|
| PENDING_NONE | Nothing is pending |
| PENDING_PLAY_RELEASE | Expect play image to be released |
| PENDING_PAUSE_RELEASE | Expect pause image to be released |
Definition at line 132 of file cmediaplayer.hxx.
| CMediaPlayer::CMediaPlayer | ( | CTaskbar * | taskbar, |
| CApplicationWindow * | window | ||
| ) |
CMediaPlayer constructor
| window. | The application window |
| taskbar. | A pointer to the parent task bar instance |
| window. | The window to be used by this application. |
CMediaPlayer constructor
| window. | The application window |
Definition at line 113 of file cmediaplayer.cxx.
| CMediaPlayer::~CMediaPlayer | ( | void | ) |
CMediaPlayer destructor
CMediaPlayer destructor
| window. | The application window |
Definition at line 176 of file cmediaplayer.cxx.
|
inlineprivate |
Check if a new file has been selected (or de-selected) in the list box
Definition at line 1454 of file cmediaplayer.cxx.
|
privatevirtual |
Called when the window minimize close is pressed.
Called when the window close image is pressed.
Implements NxWM::IApplicationCallback.
Definition at line 1092 of file cmediaplayer.cxx.
|
inlineprivate |
Configure the NxPlayer.
Definition at line 691 of file cmediaplayer.cxx.
|
inlineprivate |
Create the Media Player controls. Only start as part of the application start method.
Create the media player widgets. Only start as part of the application start method.
Definition at line 720 of file cmediaplayer.cxx.
|
virtual |
Destroy the application and free all of its resources. This method will initiate blocking of messages from the NX server. The server will flush the window message queue and reply with the blocked message. When the block message is received by CWindowMessenger, it will send the destroy message to the start window task which will, finally, safely delete the application.
Implements NxWM::IApplication.
Definition at line 360 of file cmediaplayer.cxx.
|
virtual |
Get the icon associated with the application
Implements NxWM::IApplication.
Definition at line 280 of file cmediaplayer.cxx.
|
private |
Get the full media file path and make ready for playing. Called after a file has been selected from the list box.
Definition at line 427 of file cmediaplayer.cxx.
|
virtual |
Get the name string associated with the application
Implements NxWM::IApplication.
Definition at line 294 of file cmediaplayer.cxx.
|
virtual |
Each implementation of IApplication must provide a method to recover the contained CApplicationWindow instance.
Implements NxWM::IApplication.
Definition at line 267 of file cmediaplayer.cxx.
|
privatevirtual |
Handle a widget action event. For this application, that means image pre-release events.
| e | The event data. |
Reimplemented from NXWidgets::CWidgetEventHandler.
Definition at line 1583 of file cmediaplayer.cxx.
|
privatevirtual |
Handle a widget release event. Only the play and pause image release are of interest.
Reimplemented from NXWidgets::CWidgetEventHandler.
Definition at line 1718 of file cmediaplayer.cxx.
|
privatevirtual |
Handle a widget release event when the widget WAS dragged outside of its original bounding box. Only the play and pause image release are of interest.
Reimplemented from NXWidgets::CWidgetEventHandler.
Definition at line 1875 of file cmediaplayer.cxx.
|
privatevirtual |
Handle value changes. This will get events when there is a change in the volume level or a file is selected or deselected.
Reimplemented from NXWidgets::CWidgetEventHandler.
Definition at line 1885 of file cmediaplayer.cxx.
|
virtual |
The application window is hidden (either it is minimized or it is maximized, but not at the top of the hierarchy
Implements NxWM::IApplication.
Definition at line 376 of file cmediaplayer.cxx.
|
virtual |
Report of this is a "normal" window or a full screen window. The primary purpose of this method is so that window manager will know whether or not it show draw the task bar.
Implements NxWM::IApplication.
Definition at line 417 of file cmediaplayer.cxx.
|
privatevirtual |
Called when the window minimize image is pressed.
Implements NxWM::IApplicationCallback.
Definition at line 1083 of file cmediaplayer.cxx.
|
private |
Get the full media file path and make ready for playing. Called after a file has been selected from the list box.
|
virtual |
Redraw the entire window. The application has been maximized or otherwise moved to the top of the hierarchy. This method is call from CTaskbar when the application window must be displayed
Redraw the entire window. The application has been maximized or otherwise moved to the top of the hierarchy. This method is call from CTaskbar when the application window must be displayed.
Implements NxWM::IApplication.
Definition at line 389 of file cmediaplayer.cxx.
|
private |
Redraw all widgets. Called from redraw() and also on any state change.
| state | The new state to enter. |
Definition at line 1104 of file cmediaplayer.cxx.
|
virtual |
Start the application (perhaps in the minimized state).
Implements NxWM::IApplication.
Definition at line 305 of file cmediaplayer.cxx.
|
inlineprivate |
Set the preferred audio device for playback
Definition at line 634 of file cmediaplayer.cxx.
|
inlineprivate |
Select the geometry of the media player given the current window size. Only called as part of construction.
Select the geometry of the media player given the current window size.
Definition at line 521 of file cmediaplayer.cxx.
|
private |
Transition to a new media player state.
| state | The new state to enter. |
Definition at line 1157 of file cmediaplayer.cxx.
|
private |
Set the new volume level based on the position of the volume slider.
Definition at line 1418 of file cmediaplayer.cxx.
|
inlineprivate |
Load media files into the list box.
Definition at line 536 of file cmediaplayer.cxx.
|
virtual |
Stop the application.
Implements NxWM::IApplication.
Definition at line 336 of file cmediaplayer.cxx.
|
private |
Stop playing the current file. Called when a new media file is selected, when a media file is de-selected, or when destroying the media player instance.
Definition at line 499 of file cmediaplayer.cxx.
|
private |
Update fast forward/rewind speed indicator. Called on each state change and after each change in the speed of motion.
Definition at line 1531 of file cmediaplayer.cxx.
|
private |
Fast forward control
Definition at line 189 of file cmediaplayer.hxx.
|
private |
Bitmap for the fast forward control
Definition at line 205 of file cmediaplayer.hxx.
|
private |
Last selected text box selection
Definition at line 158 of file cmediaplayer.hxx.
|
private |
The full path to the selected file
Definition at line 157 of file cmediaplayer.hxx.
|
private |
True: Ready to play
Definition at line 159 of file cmediaplayer.hxx.
|
private |
The font used in the media player
Definition at line 185 of file cmediaplayer.hxx.
|
private |
Current volume level, range 0-100
Definition at line 161 of file cmediaplayer.hxx.
|
private |
WidgetsList box containing media files selections
Definition at line 184 of file cmediaplayer.hxx.
|
private |
Pause control
Definition at line 187 of file cmediaplayer.hxx.
|
private |
Bitmap for the pause control
Definition at line 203 of file cmediaplayer.hxx.
|
private |
Pending image release event
Definition at line 156 of file cmediaplayer.hxx.
|
private |
Play control
Definition at line 186 of file cmediaplayer.hxx.
|
private |
Bitmaps
These are retained only so that they can be released when the media is closed playerBitmap for the play control
Definition at line 202 of file cmediaplayer.hxx.
|
private |
Media player state data.NxPlayer handle
Definition at line 153 of file cmediaplayer.hxx.
|
private |
Media player previous state
Definition at line 155 of file cmediaplayer.hxx.
|
private |
Rewind control
Definition at line 188 of file cmediaplayer.hxx.
|
private |
Bitmap for the rewind control
Definition at line 204 of file cmediaplayer.hxx.
|
private |
FForward/rewind speed
Definition at line 192 of file cmediaplayer.hxx.
|
private |
Media player current state
Definition at line 154 of file cmediaplayer.hxx.
|
private |
Current FFFORWARD subsampling index
Definition at line 164 of file cmediaplayer.hxx.
|
private |
Cached constructor parameters.Reference to the "parent" taskbar
Definition at line 177 of file cmediaplayer.hxx.
|
private |
Volume control
Definition at line 190 of file cmediaplayer.hxx.
|
private |
Volume control grip bitmap
Definition at line 206 of file cmediaplayer.hxx.
|
private |
Reference to the application window
Definition at line 178 of file cmediaplayer.hxx.
|
private |
Media player geometry.The size of the media player window
Definition at line 171 of file cmediaplayer.hxx.
1.8.13