diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2013-05-11 16:15:51 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2013-05-11 16:15:51 -0600 |
commit | 9170f5ac5117c9239e9fb9265a9d74725b089d16 (patch) | |
tree | 7f32fd395083732ea58ec3697d0e6c0121773847 /NxWidgets/UnitTests/nxwm/nxwm_main.cxx | |
parent | 5b0a06cafebd0a0dc8060f7e7a4208cac06dcaaa (diff) | |
download | nuttx-9170f5ac5117c9239e9fb9265a9d74725b089d16.tar.gz nuttx-9170f5ac5117c9239e9fb9265a9d74725b089d16.tar.bz2 nuttx-9170f5ac5117c9239e9fb9265a9d74725b089d16.zip |
Add beginning a a media player window to NxWM from Ken Pettit. Still a work in progress
Diffstat (limited to 'NxWidgets/UnitTests/nxwm/nxwm_main.cxx')
-rw-r--r-- | NxWidgets/UnitTests/nxwm/nxwm_main.cxx | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/NxWidgets/UnitTests/nxwm/nxwm_main.cxx b/NxWidgets/UnitTests/nxwm/nxwm_main.cxx index fa05d52e4..04ffb64ba 100644 --- a/NxWidgets/UnitTests/nxwm/nxwm_main.cxx +++ b/NxWidgets/UnitTests/nxwm/nxwm_main.cxx @@ -49,6 +49,10 @@ #include "cnxconsole.hxx" #include "chexcalculator.hxx" +#ifdef CONFIG_NXWM_MEDIAPLAYER +#include "cmediaplayer.hxx" +#endif + #ifdef CONFIG_NXWM_TOUCHSCREEN # include "ctouchscreen.hxx" # include "ccalibration.hxx" @@ -561,6 +565,37 @@ static bool createHexCalculator(void) } ///////////////////////////////////////////////////////////////////////////// +// Name: createMediaPlayer +///////////////////////////////////////////////////////////////////////////// + +#ifdef CONFIG_NXWM_MEDIAPLAYER +static bool createMediaPlayer(void) +{ + // Add the hex calculator application to the start window + + printf("createHexCalculator: Creating the hex calculator application\n"); + NxWM::CMediaPlayerFactory *calculator = new NxWM::CMediaPlayerFactory(g_nxwmtest.taskbar); + if (!calculator) + { + printf("createMediaPlayer: ERROR: Failed to instantiate CMediaPlayerFactory\n"); + return false; + } + showTestCaseMemory("createMediaPlayer: After creating the media player application"); + + printf("createMediaPlayer: Adding the hex calculator application to the start window\n"); + if (!g_nxwmtest.startwindow->addApplication(calculator)) + { + printf("createMediaPlayer: ERROR: Failed to add CNxConsoleFactory to the start window\n"); + delete calculator; + return false; + } + + showTestCaseMemory("createMediaPlayer: After adding the media player application"); + return true; +} +#endif + +///////////////////////////////////////////////////////////////////////////// // Public Functions ///////////////////////////////////////////////////////////////////////////// @@ -673,6 +708,16 @@ int nxwm_main(int argc, char *argv[]) testCleanUpAndExit(EXIT_FAILURE); } + // Create the media player application and add it to the start window + +#ifdef CONFIG_NXWM_MEDIAPLAYER + if (!createMediaPlayer()) + { + printf("nxwm_main: ERROR: Failed to create the media player application\n"); + testCleanUpAndExit(EXIT_FAILURE); + } +#endif + // Call CTaskBar::startWindowManager to start the display with applications in place. if (!startWindowManager()) |