Player compatible code, interface still needs some changes for player

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@874 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Felix Arends 2002-06-01 20:56:38 +00:00
parent 61648002b4
commit 647661c3bb
6 changed files with 61 additions and 41 deletions

View file

@ -18,6 +18,7 @@
****************************************************************************/ ****************************************************************************/
#include <windows.h> #include <windows.h>
#include "uisw32.h"
#include "config.h" #include "config.h"
#include "sh7034.h" #include "sh7034.h"
#include "button.h" #include "button.h"
@ -34,6 +35,8 @@ void button_init(void)
int button_get(bool block) int button_get(bool block)
{ {
int btn = 0; int btn = 0;
if (bActive)
{
if (KEY (VK_NUMPAD4) || if (KEY (VK_NUMPAD4) ||
KEY (VK_LEFT)) // left button KEY (VK_LEFT)) // left button
btn |= BUTTON_LEFT; btn |= BUTTON_LEFT;
@ -50,16 +53,13 @@ int button_get(bool block)
KEY (VK_DOWN)) KEY (VK_DOWN))
btn |= BUTTON_DOWN; // down button btn |= BUTTON_DOWN; // down button
if (KEY (VK_NUMPAD5) ||
KEY (VK_SPACE))
btn |= BUTTON_PLAY; // play button
if (KEY (VK_RETURN))
btn |= BUTTON_OFF; // off button
if (KEY (VK_ADD)) if (KEY (VK_ADD))
btn |= BUTTON_ON; // on button btn |= BUTTON_ON; // on button
#ifdef HAVE_RECORDER_KEYPAD
if (KEY (VK_RETURN))
btn |= BUTTON_OFF; // off button
if (KEY (VK_DIVIDE)) if (KEY (VK_DIVIDE))
btn |= BUTTON_F1; // F1 button btn |= BUTTON_F1; // F1 button
@ -69,8 +69,17 @@ int button_get(bool block)
if (KEY (VK_SUBTRACT)) if (KEY (VK_SUBTRACT))
btn |= BUTTON_F3; // F3 button btn |= BUTTON_F3; // F3 button
if (KEY (VK_NUMPAD5) ||
KEY (VK_SPACE))
btn |= BUTTON_PLAY; // play button
#else
if (KEY (VK_RETURN))
btn |= BUTTON_MENU; // menu button
#endif
if (btn != 0) { if (btn != 0) {
last_key = 0 ; last_key = 0 ;
} }
}
return btn; return btn;
} }

View file

@ -27,8 +27,15 @@ APPDIR = ../../apps/
RECDIR = $(APPDIR)recorder/ RECDIR = $(APPDIR)recorder/
RM = del RM = del
#DISPLAY = -DHAVE_LCD_CHARCELLS
DISPLAY = -DHAVE_LCD_BITMAP
#KEYPAD = -DHAVE_PLAYER_KEYPAD
KEYPAD = -DHAVE_RECORDER_KEYPAD
CC = cl CC = cl
DEFINES = -DHAVE_CONFIG_H -DGETTIMEOFDAY_TWO_ARGS -DSIMULATOR -DARCHOS_RECORDER -D_WIN32 -DWIN32 DEFINES = -DWIN32 -DHAVE_CONFIG_H -DGETTIMEOFDAY_TWO_ARGS -DSIMULATOR \
$(KEYPAD) $(DISPLAY)
LDFLAGS = /ouisw32.exe /link -subsystem:windows LDFLAGS = /ouisw32.exe /link -subsystem:windows
INCLUDES = -I$(FIRMWAREDIR) -I$(DRIVERS) -I$(COMMON) -I$(SIMDIR) -I$(APPDIR) -I$(RECDIR) INCLUDES = -I$(FIRMWAREDIR) -I$(DRIVERS) -I$(COMMON) -I$(SIMDIR) -I$(APPDIR) -I$(RECDIR)
LIBS = gdi32.lib user32.lib LIBS = gdi32.lib user32.lib
@ -36,12 +43,14 @@ LIBS = gdi32.lib user32.lib
CFLAGS = $(DEBUG) $(DEFINES) $(INCLUDES) /MD /Fd"Release/vc70.pdb" CFLAGS = $(DEBUG) $(DEFINES) $(INCLUDES) /MD /Fd"Release/vc70.pdb"
#SRCS = $(wildcard *.c) SRCS = lcd-win32.c uisw32.c lcd.c button.c tree.c main.c \
SRCS = lcd-win32.c tetris.c uisw32.c lcd.c button.c tree.c main.c \
chartables.c kernel.c uisw32.res dir-win32.c main_menu.c \ chartables.c kernel.c uisw32.res dir-win32.c main_menu.c \
play.c bmp.c debug-win32.c screensaver.c menu.c credits.c \ play.c debug-win32.c menu.c credits.c sound_menu.c mpeg.c \
icons.c sound_menu.c mpeg.c id3.c settings.c sprintf.c id3.c settings.c sprintf.c
!IF ("$(DISPLAY)" == "-DHAVE_LCD_BITMAP")
SRCS = $(SRCS) tetris.c screensaver.c icons.c bmp.c
!ENDIF
OBJS = $(SRCS:.c=.obj) OBJS = $(SRCS:.c=.obj)

View file

@ -31,6 +31,7 @@ extern void new_key(int key);
HWND hGUIWnd; // the GUI window handle HWND hGUIWnd; // the GUI window handle
unsigned int uThreadID; // id of mod thread unsigned int uThreadID; // id of mod thread
PBYTE lpKeys; PBYTE lpKeys;
bool bActive; // window active?
// GUIWndProc // GUIWndProc
// window proc for GUI simulator // window proc for GUI simulator
@ -47,6 +48,12 @@ LRESULT GUIWndProc (
switch (uMsg) switch (uMsg)
{ {
case WM_ACTIVATE:
if (LOWORD(wParam) == WA_ACTIVE || LOWORD(wParam) == WA_CLICKACTIVE)
bActive = true;
else
bActive = false;
return TRUE;
case WM_CREATE: case WM_CREATE:
// load background image // load background image
hBkgnd = (HBITMAP)LoadImage (GetModuleHandle (NULL), MAKEINTRESOURCE(IDB_UI), hBkgnd = (HBITMAP)LoadImage (GetModuleHandle (NULL), MAKEINTRESOURCE(IDB_UI),

View file

@ -34,6 +34,7 @@
extern HWND hGUIWnd; // the GUI window handle extern HWND hGUIWnd; // the GUI window handle
extern unsigned int uThreadID; // id of mod thread extern unsigned int uThreadID; // id of mod thread
extern bool bActive;
// typedefs // typedefs
typedef unsigned char uchar; typedef unsigned char uchar;

Binary file not shown.

View file

@ -20,7 +20,7 @@
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="0" Optimization="0"
AdditionalIncludeDirectories="&quot;C:\Programming\CVS Checkout\RockBox\apps\recorder&quot;;&quot;C:\Programming\CVS Checkout\RockBox\apps&quot;;&quot;C:\Programming\CVS Checkout\RockBox\firmware&quot;;&quot;C:\Programming\CVS Checkout\RockBox\uisimulator\win32&quot;;&quot;C:\Programming\CVS Checkout\RockBox\firmware\drivers&quot;;&quot;C:\Programming\CVS Checkout\RockBox\firmware\common&quot;" AdditionalIncludeDirectories="&quot;C:\Programming\CVS Checkout\RockBox\apps\recorder&quot;;&quot;C:\Programming\CVS Checkout\RockBox\apps&quot;;&quot;C:\Programming\CVS Checkout\RockBox\firmware&quot;;&quot;C:\Programming\CVS Checkout\RockBox\uisimulator\win32&quot;;&quot;C:\Programming\CVS Checkout\RockBox\firmware\drivers&quot;;&quot;C:\Programming\CVS Checkout\RockBox\firmware\common&quot;"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;ARCHOS_RECORDER;SIMULATOR;HAVE_LCD_BITMAP;SIMULATOR;" PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;HAVE_PLAYER_KEYPAD;HAVE_LCD_CHARCELLS;SIMULATOR;SIMULATOR;"
MinimalRebuild="TRUE" MinimalRebuild="TRUE"
BasicRuntimeChecks="3" BasicRuntimeChecks="3"
RuntimeLibrary="1" RuntimeLibrary="1"
@ -184,9 +184,6 @@
<File <File
RelativePath="..\..\firmware\playlist.c"> RelativePath="..\..\firmware\playlist.c">
</File> </File>
<File
RelativePath="..\..\apps\recorder\screensaver.c">
</File>
<File <File
RelativePath="..\..\firmware\settings.c"> RelativePath="..\..\firmware\settings.c">
</File> </File>
@ -196,9 +193,6 @@
<File <File
RelativePath="..\..\firmware\common\sprintf.c"> RelativePath="..\..\firmware\common\sprintf.c">
</File> </File>
<File
RelativePath="..\..\apps\recorder\tetris.c">
</File>
<File <File
RelativePath="..\..\apps\tree.c"> RelativePath="..\..\apps\tree.c">
</File> </File>