From 9170f5ac5117c9239e9fb9265a9d74725b089d16 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sat, 11 May 2013 16:15:51 -0600 Subject: Add beginning a a media player window to NxWM from Ken Pettit. Still a work in progress --- NxWidgets/UnitTests/nxwm/nxwm_main.cxx | 45 ++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) (limited to 'NxWidgets/UnitTests/nxwm') 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" @@ -560,6 +564,37 @@ static bool createHexCalculator(void) return true; } +///////////////////////////////////////////////////////////////////////////// +// 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()) -- cgit v1.2.3