From 09944d18820099d2014db45226ba30667f769f30 Mon Sep 17 00:00:00 2001 From: emartinez Date: Tue, 23 Apr 2024 21:02:53 +0200 Subject: [PATCH 01/66] add support for rg35xx-plus boards, tested on RG35XX-H --- projects/Makefile | 30 ++++++++++++++++++++++ projects/Makefile.RG35XXH | 33 +++++++++++++++++++++++++ projects/resources/RG35XXH/config.json | 6 +++++ projects/resources/RG35XXH/config.xml | 29 ++++++++++++++++++++++ projects/resources/RG35XXH/launch.sh | 6 +++++ projects/resources/RG35XXH/lgpt.png | Bin 0 -> 1499 bytes projects/resources/RG35XXH/mapping.xml | 12 +++++++++ 7 files changed, 116 insertions(+) create mode 100644 projects/Makefile.RG35XXH create mode 100644 projects/resources/RG35XXH/config.json create mode 100644 projects/resources/RG35XXH/config.xml create mode 100755 projects/resources/RG35XXH/launch.sh create mode 100644 projects/resources/RG35XXH/lgpt.png create mode 100644 projects/resources/RG35XXH/mapping.xml diff --git a/projects/Makefile b/projects/Makefile index 0f0a1024..a4b5960e 100644 --- a/projects/Makefile +++ b/projects/Makefile @@ -169,6 +169,18 @@ MIYOODIRS := . \ ../sources/Adapters/SDL/GUI \ ../sources/Adapters/SDL/Timer +RG35XXHDIRS := . \ + ../sources/Adapters/DINGOO/Main \ + ../sources/Adapters/Unix/FileSystem \ + ../sources/System/Process \ + ../sources/Adapters/Unix/Process \ + ../sources/Adapters/DINGOO/System \ + ../sources/Adapters/Dummy/Midi \ + ../sources/Adapters/SDL/Audio \ + ../sources/Adapters/SDL/Process \ + ../sources/Adapters/SDL/GUI \ + ../sources/Adapters/SDL/Timer + PSPDIRS := . \ ../sources/Adapters/PSP/Main \ ../sources/Adapters/PSP/FileSystem \ @@ -302,6 +314,23 @@ MIYOOFILES := GPSDLMain.o \ DummyMidi.o \ SDLGUIWindowImp.o +RG35XXHFILES := GPSDLMain.o \ + UnixFileSystem.o \ + SDLAudio.o \ + Process.o \ + UnixProcess.o \ + SDLAudioDriver.o \ + MIYOOSystem.o \ + DINGOOEventQueue.o \ + SDLProcess.o \ + SDLTimer.o \ + GUIFactory.o \ + SDLEventManager.o \ + DummyMidi.o \ + SDLGUIWindowImp.o + + + PSPFILES := PSPmain.o \ PSPFileSystem.o \ Process.o \ @@ -602,6 +631,7 @@ deploy: # make PLATFORM=RS97 # make PLATFORM=BITTBOY make PLATFORM=MIYOO + make PLATFORM=RG35XXH # ./resources/packaging/docker_steam.sh ./resources/packaging/build_and_copy_from_pi.sh ./resources/packaging/build_and_copy_from_chip.sh diff --git a/projects/Makefile.RG35XXH b/projects/Makefile.RG35XXH new file mode 100644 index 00000000..3016b391 --- /dev/null +++ b/projects/Makefile.RG35XXH @@ -0,0 +1,33 @@ +-include $(PWD)/rules_base +STRIP = $(CROSS_COMPILE)strip + +%.elf: $(OFILES) + $(CXX) $(LDFLAGS) -o $@ $(OFILES) $(LIBS) + @$(STRIP) $@ + +DEVKIT = /opt/rg35xx-toolchain/usr/ +CROSS_COMPILE=$(DEVKIT)bin/arm-buildroot-linux-gnueabihf- + +CC = $(CROSS_COMPILE)gcc +CXX = $(CROSS_COMPILE)g++ +SYSROOT := $(shell $(CROSS_COMPILE)gcc --print-sysroot) +SDL_CFLAGS := $(shell $(SYSROOT)/usr/bin/sdl-config --cflags) +SDL_LIBS := $(shell $(SYSROOT)/usr/bin/sdl-config --libs) + +DEFINES = -DHAVE_STDINT_H -D_NDEBUG -D_NO_JACK_ -I$(PWD)/../sources -DCPP_MEMORY $(SDL_CFLAGS) $(SDL_LIBS) -DBUFFERED +INCLUDES = -Iinclude $(SDL_CFLAGS) +OPT_FLAGS = -O3 -Ofast -fdata-sections -fdata-sections -fno-common -fno-PIC -flto -marm -mtune=cortex-a53 -mfpu=neon-vfpv4 -mfloat-abi=hard -march=armv8-a + +OUTPUT = ../lgpt-rg35xxh + +TOOLPATH=$(DEVKIT)/usr/bin +PREFIX := arm-linux-gnueabihf- + +CFLAGS := $(DEFINES) $(INCLUDES) $(OPT_FLAGS) -Wall +CXXFLAGS:= $(CFLAGS) -std=gnu++03 + +EXTENSION:= elf + +LIBS := -lSDL -lpthread +LIBDIRS := $(DEKVIT)/usr/lib +LIBDIRS += $(DEKVIT)/usr/include diff --git a/projects/resources/RG35XXH/config.json b/projects/resources/RG35XXH/config.json new file mode 100644 index 00000000..b0a167b6 --- /dev/null +++ b/projects/resources/RG35XXH/config.json @@ -0,0 +1,6 @@ +{ + "label": "LittleGPTracker", + "icon": "lgpt.png", + "launch": "launch.sh", + "description": "16bit sample-based tracker" +} diff --git a/projects/resources/RG35XXH/config.xml b/projects/resources/RG35XXH/config.xml new file mode 100644 index 00000000..e3905c70 --- /dev/null +++ b/projects/resources/RG35XXH/config.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/projects/resources/RG35XXH/launch.sh b/projects/resources/RG35XXH/launch.sh new file mode 100755 index 00000000..230851f5 --- /dev/null +++ b/projects/resources/RG35XXH/launch.sh @@ -0,0 +1,6 @@ +#!/bin/sh +progdir=$(dirname "$0")/lgpt +cd $progdir +HOME=$progdir +LD_LIBRARY_PATH=$PROGDIR:$LD_LIBRARY_PATH ./lgpt-rg35xxh.elf > ./lgpt.log +#sync diff --git a/projects/resources/RG35XXH/lgpt.png b/projects/resources/RG35XXH/lgpt.png new file mode 100644 index 0000000000000000000000000000000000000000..3ee4d69ae65098a018b4cd486aa93280cdc5e49c GIT binary patch literal 1499 zcmV<11tj{3P)Ob~`^R^JK82rW6W2)!pDUa}r}P5>tuX+lDz zIe|IBSlb!IoM0Uy5+uUOxWasatGcUyY+(2qkg5~FHrTSCdh4xn8vq$HWXO>5@Z;&4 zKdzMeYFnqZetM)6^-EYeZv1!d4~&tT{f^O6H?$BnIU}olQvd+41NZ^}s2_wZA?nr| z#r0^n(*OXFgCfSvc4hg|yxBG{zu#ZXy1IrZA?m@0oTyucUalHZPE42qyeWL2;xf5J^g`6Ni6Zg#>2Ya^4J2q=Az_XUrC$dCfH@QT`40=d5Opo0 z3`uAl^JBiWwQuXRow^#g%TxMnZN=pMXLU=6x)xF6yvcIq>xZjNj2f<2r;K{*fw-|m zLDmqgQMdGsHA{$+6Lo{`0SWdF(=|7fL*EWixTMxNPA5%NOsTGmh1n5SB4ztEQJLVf zS_@GRLsSoIh`$jce8IKCU71CnjD$ew!L0=*LN9T} z_?Wt^CBL^PgDhM($4KkI>MWvmhp7pc zb<}!}rNGp`{lt%ZmISaP0eKNnW9$dLFrkOOOX+5XDd7*ZH_6Kv0D#utBTI<7ME8Jh zT$W0mwG-Y2*dR$G)SukR^IrFJ6P77NqBDr7HNFnqeQ{U1##?EpYL*ZsC+a57oC@^D z+0JmD002ObXh*>x{ZXyyo zx(`CsCB*!gkz;E(XC}4p;Wy>RaT`hR-YCrWMQ9JA2jP9LLYv}uJ!b4y*fGK`MBR$0 z*id+z{Y`xY_JDM!7^)DO+ATq%r4#*DM8Evj)`q>$5c3qZZKmxp9W(n+h!Qcs)6g5U ziDct}LKofOoer&-QyJ%nnG>R)epY}WbfF)%iGy%tb)@k%5PpBPY=pgQeuEHo3B!5P z*jaJh_Pndc#Jrx6@alk?f=uMJqkFK8rGA%S`c2-MAU{mYvc8UjCq(_UMkzF$y!W%g zD@#|g7{}W=l2^j7ZwLZbk@EVh`>v^c03( zq|!%mUhujOtM)8cfpzFA;p(n~zz|z3@pBR;m=R4=!foeko`^8?Y6-nN74x;*85prv zvVXTJzrdt3JCzYdd__jrZbP@i=$W0j(jL=na(Hr@5Or&f8Zbc_nJcNTs>0u%cE%T2dPhG>w=U18O zSm-#_t6it{;r_W0C5H3P#GD47DmZ>sXQlo?@LB9kG0%^N>S$SLLe9OdwqoH%a~__4 zzlfOsxR{gS+$SAro-gyCh3S|DGv%ev%3U{qXVVs6>Fdhv8t|K>nM)aeSiFlQA?j8d zMK?bGl_X77w7fVi%_B+JqZ$puzW97eI>_mAwJ|DpXbVH;P$v*y=3(qCY$Ju1QPb7Jp_fQYY}Ds zi-oRKWE;EAeG;Kb%lJ$S&VCsWA}O3E#B#_oH}$71^&6pHV(L#0i?e9dy_YcGHmnNR ze@x*&0qu+hu_Pj + + + + + + + + + + + From 8cf5d934eee80c30510f7e7c03b89f7909b1cff3 Mon Sep 17 00:00:00 2001 From: emartinez Date: Tue, 23 Apr 2024 21:05:12 +0200 Subject: [PATCH 02/66] add RG35XXH toolchain info --- projects/Makefile.RG35XXH | 3 +++ 1 file changed, 3 insertions(+) diff --git a/projects/Makefile.RG35XXH b/projects/Makefile.RG35XXH index 3016b391..3e953bd7 100644 --- a/projects/Makefile.RG35XXH +++ b/projects/Makefile.RG35XXH @@ -5,6 +5,9 @@ STRIP = $(CROSS_COMPILE)strip $(CXX) $(LDFLAGS) -o $@ $(OFILES) $(LIBS) @$(STRIP) $@ +# compiled using the https://github.com/shauninman/union-rg35xx-toolchain +# Docker image + DEVKIT = /opt/rg35xx-toolchain/usr/ CROSS_COMPILE=$(DEVKIT)bin/arm-buildroot-linux-gnueabihf- From 7bf306673083fee63b5dce95952d473f3894f937 Mon Sep 17 00:00:00 2001 From: Nine-H Date: Mon, 27 May 2024 18:32:50 +1000 Subject: [PATCH 03/66] build: fix whitespace in make file --- projects/Makefile | 1069 +++++++++++++++++++++++---------------------- 1 file changed, 549 insertions(+), 520 deletions(-) diff --git a/projects/Makefile b/projects/Makefile index f7ebfa4c..ad169956 100644 --- a/projects/Makefile +++ b/projects/Makefile @@ -4,7 +4,7 @@ .SUFFIXES: #--------------------------------------------------------------------------------- -PLATFORM:= RASPI +PLATFORM := RASPI FONT := original.bmp include $(PWD)/Makefile.$(PLATFORM) @@ -12,513 +12,546 @@ include $(PWD)/Makefile.$(PLATFORM) # options for FXE #--------------------------------------------------------------------------------- -AUTHOR := n0s -TITLE := lgpt -NAME := LittleGPTracker -ICON := lgpt_icon.bmp - +AUTHOR := n0s +TITLE := lgpt +NAME := LittleGPTracker +ICON := lgpt_icon.bmp #--------------------------------------------------------------------------------- # Directory definitions #--------------------------------------------------------------------------------- -NDSDIRS := . \ - ../sources/Adapters/NDS/FileSystem \ - ../sources/Adapters/NDS/System \ - ../sources/Adapters/NDS/Main \ - ../sources/Adapters/Dummy/Midi \ - ../sources/Adapters/NDS/Sound \ - ../sources/Adapters/NDS/UI - - - -DEBDIRS := ../sources/Adapters/Unix/FileSystem \ - ../sources/Adapters/DEB/Main \ - ../sources/Adapters/Unix/Process \ - ../sources/System/Process \ - ../sources/Externals/RTAudio \ - ../sources/Externals/RtMidi \ - ../sources/Adapters/DEB/System \ - ../sources/Adapters/Jack/Audio\ - ../sources/Adapters/Jack/Midi\ - ../sources/Adapters/Jack/Client\ - ../sources/Adapters/Jack/Midi\ - ../sources/Adapters/RTAudio\ - ../sources/Adapters/RTMidi\ - ../sources/Adapters/SDL/Timer\ - ../sources/Adapters/SDL/GUI - -BEAGLEBOARDDIRS := ../sources/Adapters/Unix/FileSystem \ - ../sources/Adapters/DEB/Main \ - ../sources/Adapters/Unix/Process \ - ../sources/System/Process \ - ../sources/Externals/RTAudio \ - ../sources/Adapters/DEB/System \ - ../sources/Adapters/Dummy/Midi \ - ../sources/Adapters/Jack/Audio\ - ../sources/Adapters/Jack/Midi\ - ../sources/Adapters/Jack/Client\ - ../sources/Adapters/Jack/Midi\ - ../sources/Adapters/RTAudio\ - ../sources/Adapters/SDL/Timer\ - ../sources/Adapters/SDL/GUI - -RASPIDIRS := ../sources/Adapters/Unix/FileSystem \ - ../sources/Adapters/DEB/Main\ - ../sources/Adapters/Unix/Process\ - ../sources/System/Process\ - ../sources/Externals/RTAudio\ - ../sources/Externals/RtMidi\ - ../sources/Adapters/DEB/System\ - ../sources/Adapters/Jack/Audio\ - ../sources/Adapters/Jack/Midi\ - ../sources/Adapters/Jack/Client\ - ../sources/Adapters/RTAudio\ - ../sources/Adapters/RTMidi\ - ../sources/Adapters/SDL/Timer\ - ../sources/Adapters/SDL/GUI - -STEAMDIRS := ../sources/Adapters/Unix/FileSystem \ - ../sources/Adapters/DEB/Main\ - ../sources/Adapters/Unix/Process\ - ../sources/System/Process\ - ../sources/Externals/RTAudio\ - ../sources/Externals/RtMidi\ - ../sources/Adapters/DEB/System\ - ../sources/Adapters/Jack/Audio\ - ../sources/Adapters/Jack/Midi\ - ../sources/Adapters/Jack/Client\ - ../sources/Adapters/Jack/Midi\ - ../sources/Adapters/RTAudio\ - ../sources/Adapters/RTMidi\ - ../sources/Adapters/SDL/Timer\ - ../sources/Adapters/SDL/GUI - -GP2XDIRS := . \ - ../sources/Adapters/GP2X/Main \ - ../sources/Adapters/GP2X/FileSystem \ - ../sources/System/Process \ - ../sources/Adapters/Unix/Process \ - ../sources/Adapters/GP2X/System \ - ../sources/Adapters/GP2X/Midi \ - ../sources/Adapters/GP2X/Audio \ - ../sources/Adapters/SDL/GUI\ - ../sources/Adapters/SDL/Timer - -CAANOODIRS := . \ - ../sources/Adapters/CAANOO/Main \ - ../sources/Adapters/Unix/FileSystem \ - ../sources/System/Process \ - ../sources/Adapters/Unix/Process \ - ../sources/Adapters/CAANOO/System \ - ../sources/Adapters/CAANOO/Midi \ - ../sources/Adapters/CAANOO/Audio \ - ../sources/Adapters/SDL/GUI\ - ../sources/Adapters/SDL/Timer - -DINGOODIRS := . \ - ../sources/Adapters/DINGOO/Main \ - ../sources/Adapters/Unix/FileSystem \ - ../sources/System/Process \ - ../sources/Adapters/Unix/Process \ - ../sources/Adapters/DINGOO/System \ - ../sources/Adapters/DINGOO/Midi \ - ../sources/Adapters/Dummy/Midi \ - ../sources/Adapters/DINGOO/Audio \ - ../sources/Adapters/SDL/Audio \ - ../sources/Adapters/SDL/Process \ - ../sources/Adapters/SDL/GUI \ - ../sources/Adapters/SDL/Timer - -RS97DIRS := . \ - ../sources/Adapters/DINGOO/Main \ - ../sources/Adapters/Unix/FileSystem \ - ../sources/System/Process \ - ../sources/Adapters/Unix/Process \ - ../sources/Adapters/DINGOO/System \ - ../sources/Adapters/DINGOO/Midi \ - ../sources/Adapters/DINGOO/Audio \ - ../sources/Adapters/SDL/Audio \ - ../sources/Adapters/SDL/Process \ - ../sources/Adapters/SDL/GUI \ - ../sources/Adapters/SDL/Timer - -BITTBOYDIRS := . \ - ../sources/Adapters/DINGOO/Main \ - ../sources/Adapters/Unix/FileSystem \ - ../sources/System/Process \ - ../sources/Adapters/Unix/Process \ - ../sources/Adapters/DINGOO/System \ - ../sources/Adapters/DINGOO/Midi \ - ../sources/Adapters/DINGOO/Audio \ - ../sources/Adapters/SDL/Audio \ - ../sources/Adapters/SDL/Process \ - ../sources/Adapters/SDL/GUI \ - ../sources/Adapters/SDL/Timer - -MIYOODIRS := . \ - ../sources/Adapters/DINGOO/Main \ - ../sources/Adapters/Unix/FileSystem \ - ../sources/System/Process \ - ../sources/Adapters/Unix/Process \ - ../sources/Adapters/DINGOO/System \ - ../sources/Adapters/Dummy/Midi \ - ../sources/Adapters/SDL/Audio \ - ../sources/Adapters/SDL/Process \ - ../sources/Adapters/SDL/GUI \ - ../sources/Adapters/SDL/Timer - -RG35XXDIRS := . \ - ../sources/Adapters/DINGOO/Main \ - ../sources/Adapters/Unix/FileSystem \ - ../sources/System/Process \ - ../sources/Adapters/Unix/Process \ - ../sources/Adapters/DINGOO/System \ - ../sources/Adapters/SDL/Audio \ - ../sources/Adapters/SDL/Process \ - ../sources/Adapters/SDL/GUI \ - ../sources/Adapters/SDL/Timer\ - ../sources/Adapters/Dummy/Midi +NDSDIRS := \ + . \ + ../sources/Adapters/NDS/FileSystem \ + ../sources/Adapters/NDS/System \ + ../sources/Adapters/NDS/Main \ + ../sources/Adapters/Dummy/Midi \ + ../sources/Adapters/NDS/Sound \ + ../sources/Adapters/NDS/UI + +DEBDIRS := \ + ../sources/Adapters/Unix/FileSystem \ + ../sources/Adapters/DEB/Main \ + ../sources/Adapters/Unix/Process \ + ../sources/System/Process \ + ../sources/Externals/RTAudio \ + ../sources/Externals/RtMidi \ + ../sources/Adapters/DEB/System \ + ../sources/Adapters/Jack/Audio \ + ../sources/Adapters/Jack/Midi \ + ../sources/Adapters/Jack/Client \ + ../sources/Adapters/Jack/Midi \ + ../sources/Adapters/RTAudio \ + ../sources/Adapters/RTMidi \ + ../sources/Adapters/SDL/Timer \ + ../sources/Adapters/SDL/GUI + +BEAGLEBOARDDIRS := \ + ../sources/Adapters/Unix/FileSystem \ + ../sources/Adapters/DEB/Main \ + ../sources/Adapters/Unix/Process \ + ../sources/System/Process \ + ../sources/Externals/RTAudio \ + ../sources/Adapters/DEB/System \ + ../sources/Adapters/Dummy/Midi \ + ../sources/Adapters/Jack/Audio \ + ../sources/Adapters/Jack/Midi \ + ../sources/Adapters/Jack/Client \ + ../sources/Adapters/Jack/Midi \ + ../sources/Adapters/RTAudio \ + ../sources/Adapters/SDL/Timer \ + ../sources/Adapters/SDL/GUI + +RASPIDIRS := \ + ../sources/Adapters/Unix/FileSystem \ + ../sources/Adapters/DEB/Main \ + ../sources/Adapters/Unix/Process \ + ../sources/System/Process \ + ../sources/Externals/RTAudio \ + ../sources/Externals/RtMidi \ + ../sources/Adapters/DEB/System \ + ../sources/Adapters/Jack/Audio \ + ../sources/Adapters/Jack/Midi \ + ../sources/Adapters/Jack/Client \ + ../sources/Adapters/RTAudio \ + ../sources/Adapters/RTMidi \ + ../sources/Adapters/SDL/Timer \ + ../sources/Adapters/SDL/GUI + +STEAMDIRS := \ + ../sources/Adapters/Unix/FileSystem \ + ../sources/Adapters/DEB/Main\ + ../sources/Adapters/Unix/Process\ + ../sources/System/Process\ + ../sources/Externals/RTAudio\ + ../sources/Externals/RtMidi\ + ../sources/Adapters/DEB/System\ + ../sources/Adapters/Jack/Audio\ + ../sources/Adapters/Jack/Midi\ + ../sources/Adapters/Jack/Client\ + ../sources/Adapters/Jack/Midi\ + ../sources/Adapters/RTAudio\ + ../sources/Adapters/RTMidi\ + ../sources/Adapters/SDL/Timer\ + ../sources/Adapters/SDL/GUI + +GP2XDIRS := \ + . \ + ../sources/Adapters/GP2X/Main \ + ../sources/Adapters/GP2X/FileSystem \ + ../sources/System/Process \ + ../sources/Adapters/Unix/Process \ + ../sources/Adapters/GP2X/System \ + ../sources/Adapters/GP2X/Midi \ + ../sources/Adapters/GP2X/Audio \ + ../sources/Adapters/SDL/GUI \ + ../sources/Adapters/SDL/Timer + +CAANOODIRS := \ + . \ + ../sources/Adapters/CAANOO/Main \ + ../sources/Adapters/Unix/FileSystem \ + ../sources/System/Process \ + ../sources/Adapters/Unix/Process \ + ../sources/Adapters/CAANOO/System \ + ../sources/Adapters/CAANOO/Midi \ + ../sources/Adapters/CAANOO/Audio \ + ../sources/Adapters/SDL/GUI \ + ../sources/Adapters/SDL/Timer + +DINGOODIRS := \ + . \ + ../sources/Adapters/DINGOO/Main \ + ../sources/Adapters/Unix/FileSystem \ + ../sources/System/Process \ + ../sources/Adapters/Unix/Process \ + ../sources/Adapters/DINGOO/System \ + ../sources/Adapters/DINGOO/Midi \ + ../sources/Adapters/Dummy/Midi \ + ../sources/Adapters/DINGOO/Audio \ + ../sources/Adapters/SDL/Audio \ + ../sources/Adapters/SDL/Process \ + ../sources/Adapters/SDL/GUI \ + ../sources/Adapters/SDL/Timer + +RS97DIRS := \ + . \ + ../sources/Adapters/DINGOO/Main \ + ../sources/Adapters/Unix/FileSystem \ + ../sources/System/Process \ + ../sources/Adapters/Unix/Process \ + ../sources/Adapters/DINGOO/System \ + ../sources/Adapters/DINGOO/Midi \ + ../sources/Adapters/DINGOO/Audio \ + ../sources/Adapters/SDL/Audio \ + ../sources/Adapters/SDL/Process \ + ../sources/Adapters/SDL/GUI \ + ../sources/Adapters/SDL/Timer + +BITTBOYDIRS := \ + . \ + ../sources/Adapters/DINGOO/Main \ + ../sources/Adapters/Unix/FileSystem \ + ../sources/System/Process \ + ../sources/Adapters/Unix/Process \ + ../sources/Adapters/DINGOO/System \ + ../sources/Adapters/DINGOO/Midi \ + ../sources/Adapters/DINGOO/Audio \ + ../sources/Adapters/SDL/Audio \ + ../sources/Adapters/SDL/Process \ + ../sources/Adapters/SDL/GUI \ + ../sources/Adapters/SDL/Timer + +MIYOODIRS := \ + . \ + ../sources/Adapters/DINGOO/Main \ + ../sources/Adapters/Unix/FileSystem \ + ../sources/System/Process \ + ../sources/Adapters/Unix/Process \ + ../sources/Adapters/DINGOO/System \ + ../sources/Adapters/Dummy/Midi \ + ../sources/Adapters/SDL/Audio \ + ../sources/Adapters/SDL/Process \ + ../sources/Adapters/SDL/GUI \ + ../sources/Adapters/SDL/Timer + +RG35XXDIRS := \ + . \ + ../sources/Adapters/DINGOO/Main \ + ../sources/Adapters/Unix/FileSystem \ + ../sources/System/Process \ + ../sources/Adapters/Unix/Process \ + ../sources/Adapters/DINGOO/System \ + ../sources/Adapters/SDL/Audio \ + ../sources/Adapters/SDL/Process \ + ../sources/Adapters/SDL/GUI \ + ../sources/Adapters/SDL/Timer\ + ../sources/Adapters/Dummy/Midi # ../sources/Adapters/RTMidi \ # Disabled for now # ../sources/Externals/RtMidi PSPDIRS := . \ - ../sources/Adapters/PSP/Main \ - ../sources/Adapters/PSP/FileSystem \ - ../sources/System/Process \ - ../sources/Adapters/PSP/System \ - ../sources/Adapters/Dummy/Midi \ - ../sources/Adapters/SDL/Process \ - ../sources/Adapters/SDL/Audio\ - ../sources/Adapters/SDL/GUI\ - ../sources/Adapters/SDL/Timer - -GP32DIRS := .\ - ../sources/Adapters/GP32FileSystem \ - ../sources/Adapters/GP32Midi \ - ../sources/Adapters/GP32/Main \ - ../sources/Adapters/GP32System \ - ../sources/Adapters/GP32Timer \ - ../sources/Adapters/GP32UI - -W32DIRS := .\ - ../sources/Adapters/W32FileSystem \ - ../sources/Adapters/W32Midi \ - ../sources/Adapters/W32Sound \ - ../sources/Adapters/WSDLSystem \ - ../sources/Adapters/WSDLUI \ - ../sources/Adapters/SDL/Input \ - ../sources/Adapters/W32/Main \ - ../sources/Adapters/W32/Process \ - ../sources/Adapters/W32/Audio \ - ../sources/System/Process - -COMMONDIRS := ../sources/System/Console \ - ../sources/System/io \ - ../sources/Services/Midi \ - ../sources/Services/Time \ - ../sources/Services/Controllers \ - ../sources/System/FileSystem \ - ../sources/System/Timer \ - ../sources/System/Errors \ - ../sources/UIFramework/Framework \ - ../sources/UIFramework/BasicDatas \ - ../sources/UIFramework/SimpleBaseClasses \ - ../sources/UIFramework/Interfaces \ - ../sources/Application \ - ../sources/Application/Controllers \ - ../sources/Application/Commands \ - ../sources/Application/Audio \ - ../sources/Application/Views \ - ../sources/Application/Views/ModalDialogs \ - ../sources/Application/Views/BaseClasses \ - ../sources/Application/Model \ - ../sources/Application/Utils \ - ../sources/Application/Player \ - ../sources/Application/Mixer \ - ../sources/Application/Instruments \ - ../sources/Application/Persistency \ - ../sources/Foundation \ - ../sources/Services/Audio \ - ../sources/Foundation/Services \ - ../sources/Foundation/Variables \ - ../sources/Externals/Compression \ - ../sources/Externals/Soundfont \ - ../sources/Externals/TinyXML + ../sources/Adapters/PSP/Main \ + ../sources/Adapters/PSP/FileSystem \ + ../sources/System/Process \ + ../sources/Adapters/PSP/System \ + ../sources/Adapters/Dummy/Midi \ + ../sources/Adapters/SDL/Process \ + ../sources/Adapters/SDL/Audio \ + ../sources/Adapters/SDL/GUI \ + ../sources/Adapters/SDL/Timer + +GP32DIRS := \ + .\ + ../sources/Adapters/GP32FileSystem \ + ../sources/Adapters/GP32Midi \ + ../sources/Adapters/GP32/Main \ + ../sources/Adapters/GP32System \ + ../sources/Adapters/GP32Timer \ + ../sources/Adapters/GP32UI + +W32DIRS := \ + .\ + ../sources/Adapters/W32FileSystem \ + ../sources/Adapters/W32Midi \ + ../sources/Adapters/W32Sound \ + ../sources/Adapters/WSDLSystem \ + ../sources/Adapters/WSDLUI \ + ../sources/Adapters/SDL/Input \ + ../sources/Adapters/W32/Main \ + ../sources/Adapters/W32/Process \ + ../sources/Adapters/W32/Audio \ + ../sources/System/Process + +COMMONDIRS := \ + ../sources/System/Console \ + ../sources/System/io \ + ../sources/Services/Midi \ + ../sources/Services/Time \ + ../sources/Services/Controllers \ + ../sources/System/FileSystem \ + ../sources/System/Timer \ + ../sources/System/Errors \ + ../sources/UIFramework/Framework \ + ../sources/UIFramework/BasicDatas \ + ../sources/UIFramework/SimpleBaseClasses \ + ../sources/UIFramework/Interfaces \ + ../sources/Application \ + ../sources/Application/Controllers \ + ../sources/Application/Commands \ + ../sources/Application/Audio \ + ../sources/Application/Views \ + ../sources/Application/Views/ModalDialogs \ + ../sources/Application/Views/BaseClasses \ + ../sources/Application/Model \ + ../sources/Application/Utils \ + ../sources/Application/Player \ + ../sources/Application/Mixer \ + ../sources/Application/Instruments \ + ../sources/Application/Persistency \ + ../sources/Foundation \ + ../sources/Services/Audio \ + ../sources/Foundation/Services \ + ../sources/Foundation/Variables \ + ../sources/Externals/Compression \ + ../sources/Externals/Soundfont \ + ../sources/Externals/TinyXML #--------------------------------------------------------------------------------- # files definition #--------------------------------------------------------------------------------- -DINGOOFILES := GPSDLMain.o \ - UnixFileSystem.o \ - DummyMidi.o \ - DINGOOAudio.o \ - Process.o \ - UnixProcess.o \ - SDLAudioDriver.o \ - DINGOOAudioDriver.o \ - DINGOOSystem.o \ - DINGOOEventQueue.o \ - SDLProcess.o \ - SDLTimer.o \ - GUIFactory.o \ - SDLEventManager.o \ - SDLGUIWindowImp.o - -RS97FILES := GPSDLMain.o \ - UnixFileSystem.o \ - DINGOOAudio.o \ - Process.o \ - UnixProcess.o \ - SDLAudioDriver.o \ - DINGOOAudioDriver.o \ - BITTBOYSystem.o \ - DINGOOEventQueue.o \ - SDLProcess.o \ - SDLTimer.o \ - GUIFactory.o \ - SDLEventManager.o \ - BITTBOYSerialMidiDevice.o \ - BITTBOYMidiService.o \ - SDLGUIWindowImp.o - -BITTBOYFILES := GPSDLMain.o \ - UnixFileSystem.o \ - DINGOOAudio.o \ - Process.o \ - UnixProcess.o \ - SDLAudioDriver.o \ - DINGOOAudioDriver.o \ - BITTBOYSystem.o \ - DINGOOEventQueue.o \ - SDLProcess.o \ - SDLTimer.o \ - GUIFactory.o \ - SDLEventManager.o \ - BITTBOYSerialMidiDevice.o \ - BITTBOYMidiService.o \ - SDLGUIWindowImp.o - -MIYOOFILES := GPSDLMain.o \ - UnixFileSystem.o \ - SDLAudio.o \ - Process.o \ - UnixProcess.o \ - SDLAudioDriver.o \ - MIYOOSystem.o \ - DINGOOEventQueue.o \ - SDLProcess.o \ - SDLTimer.o \ - GUIFactory.o \ - SDLEventManager.o \ - DummyMidi.o \ - SDLGUIWindowImp.o - -RG35XXFILES := GPSDLMain.o \ - UnixFileSystem.o \ - SDLAudio.o \ - Process.o \ - UnixProcess.o \ - SDLAudioDriver.o \ - MIYOOSystem.o \ - DINGOOEventQueue.o \ - SDLProcess.o \ - SDLTimer.o \ - GUIFactory.o \ - SDLEventManager.o \ - DummyMidi.o \ - SDLGUIWindowImp.o +DINGOOFILES := \ + GPSDLMain.o \ + UnixFileSystem.o \ + DummyMidi.o \ + DINGOOAudio.o \ + Process.o \ + UnixProcess.o \ + SDLAudioDriver.o \ + DINGOOAudioDriver.o \ + DINGOOSystem.o \ + DINGOOEventQueue.o \ + SDLProcess.o \ + SDLTimer.o \ + GUIFactory.o \ + SDLEventManager.o \ + SDLGUIWindowImp.o + +RS97FILES := \ + GPSDLMain.o \ + UnixFileSystem.o \ + DINGOOAudio.o \ + Process.o \ + UnixProcess.o \ + SDLAudioDriver.o \ + DINGOOAudioDriver.o \ + BITTBOYSystem.o \ + DINGOOEventQueue.o \ + SDLProcess.o \ + SDLTimer.o \ + GUIFactory.o \ + SDLEventManager.o \ + BITTBOYSerialMidiDevice.o \ + BITTBOYMidiService.o \ + SDLGUIWindowImp.o + +BITTBOYFILES := \ + GPSDLMain.o \ + UnixFileSystem.o \ + DINGOOAudio.o \ + Process.o \ + UnixProcess.o \ + SDLAudioDriver.o \ + DINGOOAudioDriver.o \ + BITTBOYSystem.o \ + DINGOOEventQueue.o \ + SDLProcess.o \ + SDLTimer.o \ + GUIFactory.o \ + SDLEventManager.o \ + BITTBOYSerialMidiDevice.o \ + BITTBOYMidiService.o \ + SDLGUIWindowImp.o + +MIYOOFILES := \ + GPSDLMain.o \ + UnixFileSystem.o \ + SDLAudio.o \ + Process.o \ + UnixProcess.o \ + SDLAudioDriver.o \ + MIYOOSystem.o \ + DINGOOEventQueue.o \ + SDLProcess.o \ + SDLTimer.o \ + GUIFactory.o \ + SDLEventManager.o \ + DummyMidi.o \ + SDLGUIWindowImp.o + +RG35XXFILES := \ + GPSDLMain.o \ + UnixFileSystem.o \ + SDLAudio.o \ + Process.o \ + UnixProcess.o \ + SDLAudioDriver.o \ + MIYOOSystem.o \ + DINGOOEventQueue.o \ + SDLProcess.o \ + SDLTimer.o \ + GUIFactory.o \ + SDLEventManager.o \ + DummyMidi.o \ + SDLGUIWindowImp.o # RtMidi.o \ #Disabled for now # RTMidiService.o \ # RTMidiOutDevice.o \ # RTMidiInDevice.o \ -PSPFILES := PSPmain.o \ - PSPFileSystem.o \ - Process.o \ - DummyMidi.o \ - GUIFactory.o \ - SDLGUIWindowImp.o \ - SDLEventManager.o \ - SDLAudioDriver.o \ - SDLAudio.o \ - SDLProcess.o \ - SDLTimer.o \ - PSPSystem.o - -DEBFILES := UnixFileSystem.o \ - DEBmain.o \ - DEBSystem.o \ - GUIFactory.o \ - SDLGUIWindowImp.o \ - SDLEventManager.o \ - Process.o \ - UnixProcess.o \ - RTAudioDriver.o \ - RTAudioStub.o \ - RtAudio.o\ - RtMidi.o\ - RTMidiService.o\ - RTMidiOutDevice.o\ - RTMidiInDevice.o\ - SDLTimer.o \ - JackAudioDriver.o \ - JackClient.o \ - JackAudio.o - -BEAGLEBOARDFILES := UnixFileSystem.o \ - DEBmain.o \ - DEBSystem.o \ - GUIFactory.o \ - SDLGUIWindowImp.o \ - SDLEventManager.o \ - Process.o \ - UnixProcess.o \ - DummyMidi.o \ - RTAudioDriver.o \ - RTAudioStub.o \ - RtAudio.o\ - SDLTimer.o - -RASPIFILES := UnixFileSystem.o \ - DEBmain.o \ - DEBSystem.o \ - GUIFactory.o \ - SDLGUIWindowImp.o \ - SDLEventManager.o \ - Process.o \ - UnixProcess.o \ - RTAudioDriver.o \ - RTAudioStub.o \ - RtAudio.o\ - RtMidi.o\ - RTMidiService.o\ - RTMidiOutDevice.o\ - RTMidiInDevice.o\ - SDLTimer.o \ - JackAudioDriver.o \ - JackClient.o \ - JackAudio.o - -STEAMFILES := UnixFileSystem.o \ - DEBmain.o \ - DEBSystem.o \ - GUIFactory.o \ - SDLGUIWindowImp.o \ - SDLEventManager.o \ - Process.o \ - UnixProcess.o \ - RTAudioDriver.o \ - RTAudioStub.o \ - RtAudio.o\ - RtMidi.o\ - RTMidiService.o\ - RTMidiOutDevice.o\ - RTMidiInDevice.o\ - SDLTimer.o \ - JackAudioDriver.o \ - JackClient.o \ - JackAudio.o - -NDSFILES := NDSmain.o \ - NDSFileSystem.o \ - DummyMidi.o \ - NDSSound.o \ - NDSSystem.o \ - GUIFactory.o NDSGUIWindowImp.o - -W32FILES := WSDLmain.o \ - W32FileSystem.o \ - W32Midi.o \ - W32AudioDriver.o \ - WSDLSystem.o \ - SDLInput.o \ - Process.o \ - W32Process.o \ - W32Audio.o \ - GUIFactory.o WSDLGUIWindowImp.o - -GP2XFILES := GPSDLMain.o \ - GP2XFileSystem.o \ - GP2XMidiService.o \ - GP2XSerialMidiDevice.o \ - GP2XAudio.o \ - Process.o \ - UnixProcess.o \ - GP2XAudioDriver.o \ - GP2XSystem.o \ - GP2XEventQueue.o \ - gpmemcpy.o \ - gpmemset.o \ - SDLTimer.o \ - GUIFactory.o SDLEventManager.o SDLGUIWindowImp.o - -CAANOOFILES := CAANOOSDLMain.o \ - UnixFileSystem.o \ - CAANOOMidiService.o \ - CAANOOSerialMidiDevice.o \ - CAANOOAudio.o \ - Process.o \ - UnixProcess.o \ - CAANOOAudioDriver.o \ - CAANOOSystem.o \ - CAANOOEventQueue.o \ - gpmemcpy.o \ - gpmemset.o \ - SDLTimer.o \ - GUIFactory.o SDLEventManager.o SDLGUIWindowImp.o - -COMMONFILES := Logger.o Trace.o Result.o Status.o Config.o \ - Timer.o FileSystem.o \ - SysMutex.o TimeService.o \ - MidiOutDevice.o MidiInDevice.o MidiService.o Groove.o \ - MidiChannel.o MidiInMerger.o \ - GUIEvent.o GUIRect.o \ - EventManager.o GUIWindow.o \ - Channel.o Mixer.o \ - ControlRoom.o \ - MultiChannelAdapter.o \ - CommandDispatcher.o \ - ApplicationCommandDispatcher.o \ - EventDispatcher.o \ - ControllerService.o \ - ButtonControllerSource.o \ - KeyboardControllerSource.o \ - JoystickControllerSource.o \ - HatControllerSource.o \ - ControllerSource.o \ - ControlNode.o \ - I_GUIWindowImp.o \ - Application.o AppWindow.o SelectProjectDialog.o \ - NewProjectDialog.o \ - ImportSampleDialog.o \ - MixerView.o NullView.o \ - SongView.o ChainView.o PhraseView.o ViewData.o ConsoleView.o ProjectView.o InstrumentView.o UIController.o \ - View.o ModalView.o FieldView.o UIField.o UIIntField.o \ - UIIntVarOffField.o UIIntVarField.o ViewEvent.o I_Action.o\ - UITempoField.o UIActionField.o \ - MessageBox.o \ - GrooveView.o UINoteVarField.o UIBigHexVarField.o \ - SRPUpdaters.o UIStaticField.o \ - Song.o Chain.o Phrase.o Project.o \ - char.o n_assert.o fixed.o wildcard.o \ - SyncMaster.o TablePlayback.o Player.o \ - Table.o TableView.o\ - InstrumentBank.o WavFileWriter.o WavFile.o MidiInstrument.o Filters.o SampleVariable.o SampleInstrument.o SamplePool.o CommandList.o \ - PersistencyService.o Persistent.o \ - Observable.o SingletonRegistry.o \ - Audio.o AudioMixer.o AudioOutDriver.o AudioDriver.o \ - AudioOut.o \ - DummyAudioOut.o PlayerChannel.o AudioFileStreamer.o \ - MixBus.o \ - MixerService.o PlayerMixer.o \ - Service.o ServiceRegistry.o SubService.o \ - Variable.o VariableContainer.o WatchedVariable.o \ - SoundFontPreset.o SoundFontManager.o SoundFontSample.o \ - ENAB.o HYDRA.o OMEGA.o RIFF.o SFDETECT.o SFLOOKUP.o SFNAV.o SFREADER.o WIN_MEM.o \ - HexBuffers.o lz.o \ - tinyxmlparser.o tinyxml.o tinyxmlerror.o tinystr.o Tiny2NosStub.o \ +PSPFILES := \ + PSPmain.o \ + PSPFileSystem.o \ + Process.o \ + DummyMidi.o \ + GUIFactory.o \ + SDLGUIWindowImp.o \ + SDLEventManager.o \ + SDLAudioDriver.o \ + SDLAudio.o \ + SDLProcess.o \ + SDLTimer.o \ + PSPSystem.o + +DEBFILES := \ + UnixFileSystem.o \ + DEBmain.o \ + DEBSystem.o \ + GUIFactory.o \ + SDLGUIWindowImp.o \ + SDLEventManager.o \ + Process.o \ + UnixProcess.o \ + RTAudioDriver.o \ + RTAudioStub.o \ + RtAudio.o\ + RtMidi.o\ + RTMidiService.o\ + RTMidiOutDevice.o\ + RTMidiInDevice.o\ + SDLTimer.o \ + JackAudioDriver.o \ + JackClient.o \ + JackAudio.o + +BEAGLEBOARDFILES := \ + UnixFileSystem.o \ + DEBmain.o \ + DEBSystem.o \ + GUIFactory.o \ + SDLGUIWindowImp.o \ + SDLEventManager.o \ + Process.o \ + UnixProcess.o \ + DummyMidi.o \ + RTAudioDriver.o \ + RTAudioStub.o \ + RtAudio.o\ + SDLTimer.o + +RASPIFILES := \ + UnixFileSystem.o \ + DEBmain.o \ + DEBSystem.o \ + GUIFactory.o \ + SDLGUIWindowImp.o \ + SDLEventManager.o \ + Process.o \ + UnixProcess.o \ + RTAudioDriver.o \ + RTAudioStub.o \ + RtAudio.o \ + RtMidi.o \ + RTMidiService.o \ + RTMidiOutDevice.o \ + RTMidiInDevice.o \ + SDLTimer.o \ + JackAudioDriver.o \ + JackClient.o \ + JackAudio.o + +STEAMFILES := \ + UnixFileSystem.o \ + DEBmain.o \ + DEBSystem.o \ + GUIFactory.o \ + SDLGUIWindowImp.o \ + SDLEventManager.o \ + Process.o \ + UnixProcess.o \ + RTAudioDriver.o \ + RTAudioStub.o \ + RtAudio.o\ + RtMidi.o\ + RTMidiService.o\ + RTMidiOutDevice.o\ + RTMidiInDevice.o\ + SDLTimer.o \ + JackAudioDriver.o \ + JackClient.o \ + JackAudio.o + +NDSFILES := \ + NDSmain.o \ + NDSFileSystem.o \ + DummyMidi.o \ + NDSSound.o \ + NDSSystem.o \ + GUIFactory.o \ + NDSGUIWindowImp.o + +W32FILES := \ + WSDLmain.o \ + W32FileSystem.o \ + W32Midi.o \ + W32AudioDriver.o \ + WSDLSystem.o \ + SDLInput.o \ + Process.o \ + W32Process.o \ + W32Audio.o \ + GUIFactory.o \ + WSDLGUIWindowImp.o + +GP2XFILES := \ + GPSDLMain.o \ + GP2XFileSystem.o \ + GP2XMidiService.o \ + GP2XSerialMidiDevice.o \ + GP2XAudio.o \ + Process.o \ + UnixProcess.o \ + GP2XAudioDriver.o \ + GP2XSystem.o \ + GP2XEventQueue.o \ + gpmemcpy.o \ + gpmemset.o \ + SDLTimer.o \ + GUIFactory.o \ + SDLEventManager.o \ + SDLGUIWindowImp.o + +CAANOOFILES := \ + CAANOOSDLMain.o \ + UnixFileSystem.o \ + CAANOOMidiService.o \ + CAANOOSerialMidiDevice.o \ + CAANOOAudio.o \ + Process.o \ + UnixProcess.o \ + CAANOOAudioDriver.o \ + CAANOOSystem.o \ + CAANOOEventQueue.o \ + gpmemcpy.o \ + gpmemset.o \ + SDLTimer.o \ + GUIFactory.o \ + SDLEventManager.o \ + SDLGUIWindowImp.o + +COMMONFILES := \ + Logger.o Trace.o Result.o Status.o Config.o \ + Timer.o FileSystem.o \ + SysMutex.o TimeService.o \ + MidiOutDevice.o MidiInDevice.o MidiService.o Groove.o \ + MidiChannel.o MidiInMerger.o \ + GUIEvent.o GUIRect.o \ + EventManager.o GUIWindow.o \ + Channel.o Mixer.o \ + ControlRoom.o \ + MultiChannelAdapter.o \ + CommandDispatcher.o \ + ApplicationCommandDispatcher.o \ + EventDispatcher.o \ + ControllerService.o \ + ButtonControllerSource.o \ + KeyboardControllerSource.o \ + JoystickControllerSource.o \ + HatControllerSource.o \ + ControllerSource.o \ + ControlNode.o \ + I_GUIWindowImp.o \ + Application.o AppWindow.o SelectProjectDialog.o \ + NewProjectDialog.o \ + ImportSampleDialog.o \ + MixerView.o NullView.o \ + SongView.o ChainView.o PhraseView.o ViewData.o ConsoleView.o ProjectView.o InstrumentView.o UIController.o \ + View.o ModalView.o FieldView.o UIField.o UIIntField.o \ + UIIntVarOffField.o UIIntVarField.o ViewEvent.o I_Action.o\ + UITempoField.o UIActionField.o \ + MessageBox.o \ + GrooveView.o UINoteVarField.o UIBigHexVarField.o \ + SRPUpdaters.o UIStaticField.o \ + Song.o Chain.o Phrase.o Project.o \ + char.o n_assert.o fixed.o wildcard.o \ + SyncMaster.o TablePlayback.o Player.o \ + Table.o TableView.o\ + InstrumentBank.o WavFileWriter.o WavFile.o MidiInstrument.o Filters.o SampleVariable.o SampleInstrument.o SamplePool.o CommandList.o \ + PersistencyService.o Persistent.o \ + Observable.o SingletonRegistry.o \ + Audio.o AudioMixer.o AudioOutDriver.o AudioDriver.o \ + AudioOut.o \ + DummyAudioOut.o PlayerChannel.o AudioFileStreamer.o \ + MixBus.o \ + MixerService.o PlayerMixer.o \ + Service.o ServiceRegistry.o SubService.o \ + Variable.o VariableContainer.o WatchedVariable.o \ + SoundFontPreset.o SoundFontManager.o SoundFontSample.o \ + ENAB.o HYDRA.o OMEGA.o RIFF.o SFDETECT.o SFLOOKUP.o SFNAV.o SFREADER.o WIN_MEM.o \ + HexBuffers.o lz.o \ + tinyxmlparser.o tinyxml.o tinyxmlerror.o tinystr.o Tiny2NosStub.o #--------------------------------------------------------------------------------- # TARGET is the name of the output @@ -527,17 +560,17 @@ COMMONFILES := Logger.o Trace.o Result.o Status.o Config.o \ # INCLUDES is a list of directories containing extra header files #--------------------------------------------------------------------------------- -TARGET := $(TITLE) -BUILD := build$(PLATFORM) -SOURCES := $($(PLATFORM)DIRS) $(COMMONDIRS) - -INCLUDES := - +TARGET := $(TITLE) +BUILD := build$(PLATFORM) +SOURCES := $($(PLATFORM)DIRS) $(COMMONDIRS) +INCLUDES := #--------------------------------------------------------------------------------- # path to tools - this can be deleted if you set the path in windows #--------------------------------------------------------------------------------- -export PATH := $(DEVKITARM)/bin:$(PATH) + +export PATH := $(DEVKITARM)/bin:$(PATH) + #--------------------------------------------------------------------------------- # any extra libraries we wish to link with the project #--------------------------------------------------------------------------------- @@ -547,8 +580,6 @@ export PATH := $(DEVKITARM)/bin:$(PATH) # include and lib #--------------------------------------------------------------------------------- - - #--------------------------------------------------------------------------------- # no real need to edit anything past this point unless you need to add additional # rules for different file extensions @@ -556,42 +587,42 @@ export PATH := $(DEVKITARM)/bin:$(PATH) ifneq ($(BUILD),$(notdir $(CURDIR))) #--------------------------------------------------------------------------------- -export OUTPUT := $(CURDIR)/$(TARGET) - -export VPATH := $(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) -export DEPSDIR := $(CURDIR)/$(BUILD) +export OUTPUT := $(CURDIR)/$(TARGET) +export VPATH := $(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) +export DEPSDIR := $(CURDIR)/$(BUILD) #--------------------------------------------------------------------------------- # use CXX for linking C++ projects, CC for standard C #--------------------------------------------------------------------------------- -export LD := $(CXX) -export OFILES := $(COMMONFILES) $($(PLATFORM)FILES) +export LD := $(CXX) +export OFILES := $(COMMONFILES) $($(PLATFORM)FILES) export OBJS := $(OFILES) -export INCLUDE := $(foreach dir,$(INCLUDES),-I$(CURDIR)/$(dir)) \ - $(foreach dir,$(LIBDIRS),-I$(dir)/include) \ - -I$(CURDIR)/$(BUILD) - -export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) +export INCLUDE := $(foreach dir,$(INCLUDES),-I$(CURDIR)/$(dir)) \ + $(foreach dir,$(LIBDIRS),-I$(dir)/include) \ + -I$(CURDIR)/$(BUILD) +export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) .PHONY: $(BUILD) clean #--------------------------------------------------------------------------------- + $(BUILD): python3 ../sources/Resources/mkfont.py ../sources/Resources/$(FONT) ../sources/Resources/font.h @[ -d $@ ] || mkdir -p $@ @make --no-print-directory -C $(BUILD) -f $(PWD)/Makefile #--------------------------------------------------------------------------------- + clean: @echo clean ... @rm -fr $(OUTPUT).$(EXTENSION) $(BUILD) *.elf *.gxb *.fxe *.gdb - #--------------------------------------------------------------------------------- + else -DEPENDS := $(OFILES:.o=.d) +DEPENDS := $(OFILES:.o=.d) ifeq ($(PLATFORM),PSP) include $(PSPSDK)/lib/build.mak @@ -603,26 +634,24 @@ endif all: $(OUTPUT).$(EXTENSION) -$(OUTPUT).exe : $(OFILES) +$(OUTPUT).exe : $(OFILES) @echo "linking result.." @$(LD) $(LDFLAGS) -o $@ $(OFILES) $(LIBS) - -$(OUTPUT).fxe : $(OUTPUT).gxb -$(OUTPUT).gxb : $(OUTPUT).elf +$(OUTPUT).fxe : $(OUTPUT).gxb -$(OUTPUT).elf : $(OFILES) +$(OUTPUT).gxb : $(OUTPUT).elf -$(OUTPUT).deb-exe : $(OFILES) - $(LD) $(LDFLAGS) -o $@ $(OFILES) $(LIBS) +$(OUTPUT).elf : $(OFILES) -$(OUTPUT).beagle-exe : $(OFILES) +$(OUTPUT).deb-exe : $(OFILES) $(LD) $(LDFLAGS) -o $@ $(OFILES) $(LIBS) +$(OUTPUT).beagle-exe : $(OFILES) + $(LD) $(LDFLAGS) -o $@ $(OFILES) $(LIBS) -include $(DEPENDS) - #--------------------------------------------------------------------------------------- endif #--------------------------------------------------------------------------------------- From f45058bf14d5da2ebd733fa05d8e5e9ede0f4895 Mon Sep 17 00:00:00 2001 From: Nine-H Date: Mon, 27 May 2024 19:05:10 +1000 Subject: [PATCH 04/66] build: fix repetitive folder definitions in make file --- projects/Makefile | 368 ++++++++++++++++++---------------------------- 1 file changed, 142 insertions(+), 226 deletions(-) diff --git a/projects/Makefile b/projects/Makefile index ad169956..ab0f5612 100644 --- a/projects/Makefile +++ b/projects/Makefile @@ -21,242 +21,158 @@ ICON := lgpt_icon.bmp # Directory definitions #--------------------------------------------------------------------------------- +COMMONDIRS := \ + ../sources/System/Console \ + ../sources/System/io \ + ../sources/Services/Midi \ + ../sources/Services/Time \ + ../sources/Services/Controllers \ + ../sources/System/FileSystem \ + ../sources/System/Timer \ + ../sources/System/Errors \ + ../sources/UIFramework/Framework \ + ../sources/UIFramework/BasicDatas \ + ../sources/UIFramework/SimpleBaseClasses \ + ../sources/UIFramework/Interfaces \ + ../sources/Application \ + ../sources/Application/Controllers \ + ../sources/Application/Commands \ + ../sources/Application/Audio \ + ../sources/Application/Views \ + ../sources/Application/Views/ModalDialogs \ + ../sources/Application/Views/BaseClasses \ + ../sources/Application/Model \ + ../sources/Application/Utils \ + ../sources/Application/Player \ + ../sources/Application/Mixer \ + ../sources/Application/Instruments \ + ../sources/Application/Persistency \ + ../sources/Foundation \ + ../sources/Services/Audio \ + ../sources/Foundation/Services \ + ../sources/Foundation/Variables \ + ../sources/Externals/Compression \ + ../sources/Externals/Soundfont \ + ../sources/Externals/TinyXML + +#--------------------------------------------------------------------------------- +# Linux +#--------------------------------------------------------------------------------- + +LINUXDIRS := \ + ../sources/Adapters/Unix/FileSystem \ + ../sources/Adapters/DEB/Main \ + ../sources/Adapters/Unix/Process \ + ../sources/System/Process \ + ../sources/Externals/RTAudio \ + ../sources/Externals/RtMidi \ + ../sources/Adapters/DEB/System \ + ../sources/Adapters/Jack/Audio \ + ../sources/Adapters/Jack/Midi \ + ../sources/Adapters/Jack/Client \ + ../sources/Adapters/RTAudio \ + ../sources/Adapters/RTMidi \ + ../sources/Adapters/SDL/Timer \ + ../sources/Adapters/SDL/GUI + +BEAGLEBOARDDIRS := $(LINUXDIRS) +DEBDIRS := $(LINUXDIRS) +RASPIDIRS := $(LINUXDIRS) +STEAMDIRS := $(LINUXDIRS) + +#--------------------------------------------------------------------------------- +# Consoles/Embedded +#--------------------------------------------------------------------------------- + NDSDIRS := \ - . \ - ../sources/Adapters/NDS/FileSystem \ - ../sources/Adapters/NDS/System \ - ../sources/Adapters/NDS/Main \ - ../sources/Adapters/Dummy/Midi \ - ../sources/Adapters/NDS/Sound \ - ../sources/Adapters/NDS/UI - -DEBDIRS := \ - ../sources/Adapters/Unix/FileSystem \ - ../sources/Adapters/DEB/Main \ - ../sources/Adapters/Unix/Process \ - ../sources/System/Process \ - ../sources/Externals/RTAudio \ - ../sources/Externals/RtMidi \ - ../sources/Adapters/DEB/System \ - ../sources/Adapters/Jack/Audio \ - ../sources/Adapters/Jack/Midi \ - ../sources/Adapters/Jack/Client \ - ../sources/Adapters/Jack/Midi \ - ../sources/Adapters/RTAudio \ - ../sources/Adapters/RTMidi \ - ../sources/Adapters/SDL/Timer \ - ../sources/Adapters/SDL/GUI - -BEAGLEBOARDDIRS := \ - ../sources/Adapters/Unix/FileSystem \ - ../sources/Adapters/DEB/Main \ - ../sources/Adapters/Unix/Process \ - ../sources/System/Process \ - ../sources/Externals/RTAudio \ - ../sources/Adapters/DEB/System \ - ../sources/Adapters/Dummy/Midi \ - ../sources/Adapters/Jack/Audio \ - ../sources/Adapters/Jack/Midi \ - ../sources/Adapters/Jack/Client \ - ../sources/Adapters/Jack/Midi \ - ../sources/Adapters/RTAudio \ - ../sources/Adapters/SDL/Timer \ - ../sources/Adapters/SDL/GUI - -RASPIDIRS := \ - ../sources/Adapters/Unix/FileSystem \ - ../sources/Adapters/DEB/Main \ - ../sources/Adapters/Unix/Process \ - ../sources/System/Process \ - ../sources/Externals/RTAudio \ - ../sources/Externals/RtMidi \ - ../sources/Adapters/DEB/System \ - ../sources/Adapters/Jack/Audio \ - ../sources/Adapters/Jack/Midi \ - ../sources/Adapters/Jack/Client \ - ../sources/Adapters/RTAudio \ - ../sources/Adapters/RTMidi \ - ../sources/Adapters/SDL/Timer \ - ../sources/Adapters/SDL/GUI - -STEAMDIRS := \ - ../sources/Adapters/Unix/FileSystem \ - ../sources/Adapters/DEB/Main\ - ../sources/Adapters/Unix/Process\ - ../sources/System/Process\ - ../sources/Externals/RTAudio\ - ../sources/Externals/RtMidi\ - ../sources/Adapters/DEB/System\ - ../sources/Adapters/Jack/Audio\ - ../sources/Adapters/Jack/Midi\ - ../sources/Adapters/Jack/Client\ - ../sources/Adapters/Jack/Midi\ - ../sources/Adapters/RTAudio\ - ../sources/Adapters/RTMidi\ - ../sources/Adapters/SDL/Timer\ - ../sources/Adapters/SDL/GUI + . \ + ../sources/Adapters/NDS/FileSystem \ + ../sources/Adapters/NDS/System \ + ../sources/Adapters/NDS/Main \ + ../sources/Adapters/Dummy/Midi \ + ../sources/Adapters/NDS/Sound \ + ../sources/Adapters/NDS/UI + +PSPDIRS := \ + . \ + ../sources/Adapters/PSP/Main \ + ../sources/Adapters/PSP/FileSystem \ + ../sources/System/Process \ + ../sources/Adapters/PSP/System \ + ../sources/Adapters/Dummy/Midi \ + ../sources/Adapters/SDL/Process \ + ../sources/Adapters/SDL/Audio \ + ../sources/Adapters/SDL/GUI \ + ../sources/Adapters/SDL/Timer GP2XDIRS := \ - . \ - ../sources/Adapters/GP2X/Main \ - ../sources/Adapters/GP2X/FileSystem \ - ../sources/System/Process \ - ../sources/Adapters/Unix/Process \ - ../sources/Adapters/GP2X/System \ - ../sources/Adapters/GP2X/Midi \ - ../sources/Adapters/GP2X/Audio \ - ../sources/Adapters/SDL/GUI \ - ../sources/Adapters/SDL/Timer + . \ + ../sources/Adapters/GP2X/Main \ + ../sources/Adapters/GP2X/FileSystem \ + ../sources/System/Process \ + ../sources/Adapters/Unix/Process \ + ../sources/Adapters/GP2X/System \ + ../sources/Adapters/GP2X/Midi \ + ../sources/Adapters/GP2X/Audio \ + ../sources/Adapters/SDL/GUI \ + ../sources/Adapters/SDL/Timer + +GP32DIRS := \ + .\ + ../sources/Adapters/GP32FileSystem \ + ../sources/Adapters/GP32Midi \ + ../sources/Adapters/GP32/Main \ + ../sources/Adapters/GP32System \ + ../sources/Adapters/GP32Timer \ + ../sources/Adapters/GP32UI CAANOODIRS := \ - . \ - ../sources/Adapters/CAANOO/Main \ - ../sources/Adapters/Unix/FileSystem \ - ../sources/System/Process \ - ../sources/Adapters/Unix/Process \ - ../sources/Adapters/CAANOO/System \ - ../sources/Adapters/CAANOO/Midi \ - ../sources/Adapters/CAANOO/Audio \ - ../sources/Adapters/SDL/GUI \ - ../sources/Adapters/SDL/Timer + . \ + ../sources/Adapters/CAANOO/Main \ + ../sources/Adapters/Unix/FileSystem \ + ../sources/System/Process \ + ../sources/Adapters/Unix/Process \ + ../sources/Adapters/CAANOO/System \ + ../sources/Adapters/CAANOO/Midi \ + ../sources/Adapters/CAANOO/Audio \ + ../sources/Adapters/SDL/GUI \ + ../sources/Adapters/SDL/Timer DINGOODIRS := \ - . \ - ../sources/Adapters/DINGOO/Main \ - ../sources/Adapters/Unix/FileSystem \ - ../sources/System/Process \ - ../sources/Adapters/Unix/Process \ - ../sources/Adapters/DINGOO/System \ - ../sources/Adapters/DINGOO/Midi \ - ../sources/Adapters/Dummy/Midi \ - ../sources/Adapters/DINGOO/Audio \ - ../sources/Adapters/SDL/Audio \ - ../sources/Adapters/SDL/Process \ - ../sources/Adapters/SDL/GUI \ - ../sources/Adapters/SDL/Timer - -RS97DIRS := \ - . \ - ../sources/Adapters/DINGOO/Main \ - ../sources/Adapters/Unix/FileSystem \ - ../sources/System/Process \ - ../sources/Adapters/Unix/Process \ - ../sources/Adapters/DINGOO/System \ - ../sources/Adapters/DINGOO/Midi \ - ../sources/Adapters/DINGOO/Audio \ - ../sources/Adapters/SDL/Audio \ - ../sources/Adapters/SDL/Process \ - ../sources/Adapters/SDL/GUI \ - ../sources/Adapters/SDL/Timer - -BITTBOYDIRS := \ - . \ - ../sources/Adapters/DINGOO/Main \ - ../sources/Adapters/Unix/FileSystem \ - ../sources/System/Process \ - ../sources/Adapters/Unix/Process \ - ../sources/Adapters/DINGOO/System \ - ../sources/Adapters/DINGOO/Midi \ - ../sources/Adapters/DINGOO/Audio \ - ../sources/Adapters/SDL/Audio \ - ../sources/Adapters/SDL/Process \ - ../sources/Adapters/SDL/GUI \ - ../sources/Adapters/SDL/Timer - -MIYOODIRS := \ - . \ - ../sources/Adapters/DINGOO/Main \ - ../sources/Adapters/Unix/FileSystem \ - ../sources/System/Process \ - ../sources/Adapters/Unix/Process \ - ../sources/Adapters/DINGOO/System \ - ../sources/Adapters/Dummy/Midi \ - ../sources/Adapters/SDL/Audio \ - ../sources/Adapters/SDL/Process \ - ../sources/Adapters/SDL/GUI \ - ../sources/Adapters/SDL/Timer - -RG35XXDIRS := \ - . \ - ../sources/Adapters/DINGOO/Main \ - ../sources/Adapters/Unix/FileSystem \ - ../sources/System/Process \ - ../sources/Adapters/Unix/Process \ - ../sources/Adapters/DINGOO/System \ - ../sources/Adapters/SDL/Audio \ - ../sources/Adapters/SDL/Process \ - ../sources/Adapters/SDL/GUI \ - ../sources/Adapters/SDL/Timer\ - ../sources/Adapters/Dummy/Midi -# ../sources/Adapters/RTMidi \ # Disabled for now -# ../sources/Externals/RtMidi - -PSPDIRS := . \ - ../sources/Adapters/PSP/Main \ - ../sources/Adapters/PSP/FileSystem \ - ../sources/System/Process \ - ../sources/Adapters/PSP/System \ - ../sources/Adapters/Dummy/Midi \ - ../sources/Adapters/SDL/Process \ - ../sources/Adapters/SDL/Audio \ - ../sources/Adapters/SDL/GUI \ - ../sources/Adapters/SDL/Timer + . \ + ../sources/Adapters/DINGOO/Main \ + ../sources/Adapters/Unix/FileSystem \ + ../sources/System/Process \ + ../sources/Adapters/Unix/Process \ + ../sources/Adapters/DINGOO/System \ + ../sources/Adapters/DINGOO/Midi \ + ../sources/Adapters/Dummy/Midi \ + ../sources/Adapters/DINGOO/Audio \ + ../sources/Adapters/SDL/Audio \ + ../sources/Adapters/SDL/Process \ + ../sources/Adapters/SDL/GUI \ + ../sources/Adapters/SDL/Timer + +RS97DIRS := $(DINGOODIRS) +BITTBOYDIRS := $(DINGOODIRS) +MIYOODIRS := $(DINGOODIRS) -GP32DIRS := \ - .\ - ../sources/Adapters/GP32FileSystem \ - ../sources/Adapters/GP32Midi \ - ../sources/Adapters/GP32/Main \ - ../sources/Adapters/GP32System \ - ../sources/Adapters/GP32Timer \ - ../sources/Adapters/GP32UI +#--------------------------------------------------------------------------------- +# Windows +#--------------------------------------------------------------------------------- W32DIRS := \ - .\ - ../sources/Adapters/W32FileSystem \ - ../sources/Adapters/W32Midi \ - ../sources/Adapters/W32Sound \ - ../sources/Adapters/WSDLSystem \ - ../sources/Adapters/WSDLUI \ - ../sources/Adapters/SDL/Input \ - ../sources/Adapters/W32/Main \ - ../sources/Adapters/W32/Process \ - ../sources/Adapters/W32/Audio \ - ../sources/System/Process - -COMMONDIRS := \ - ../sources/System/Console \ - ../sources/System/io \ - ../sources/Services/Midi \ - ../sources/Services/Time \ - ../sources/Services/Controllers \ - ../sources/System/FileSystem \ - ../sources/System/Timer \ - ../sources/System/Errors \ - ../sources/UIFramework/Framework \ - ../sources/UIFramework/BasicDatas \ - ../sources/UIFramework/SimpleBaseClasses \ - ../sources/UIFramework/Interfaces \ - ../sources/Application \ - ../sources/Application/Controllers \ - ../sources/Application/Commands \ - ../sources/Application/Audio \ - ../sources/Application/Views \ - ../sources/Application/Views/ModalDialogs \ - ../sources/Application/Views/BaseClasses \ - ../sources/Application/Model \ - ../sources/Application/Utils \ - ../sources/Application/Player \ - ../sources/Application/Mixer \ - ../sources/Application/Instruments \ - ../sources/Application/Persistency \ - ../sources/Foundation \ - ../sources/Services/Audio \ - ../sources/Foundation/Services \ - ../sources/Foundation/Variables \ - ../sources/Externals/Compression \ - ../sources/Externals/Soundfont \ - ../sources/Externals/TinyXML + .\ + ../sources/Adapters/W32FileSystem \ + ../sources/Adapters/W32Midi \ + ../sources/Adapters/W32Sound \ + ../sources/Adapters/WSDLSystem \ + ../sources/Adapters/WSDLUI \ + ../sources/Adapters/SDL/Input \ + ../sources/Adapters/W32/Main \ + ../sources/Adapters/W32/Process \ + ../sources/Adapters/W32/Audio \ + ../sources/System/Process #--------------------------------------------------------------------------------- # files definition From 97fbc9a85071c6f20d424d3643234fec6c1248c7 Mon Sep 17 00:00:00 2001 From: Nine-H Date: Mon, 27 May 2024 20:34:03 +1000 Subject: [PATCH 05/66] build: fix repetitive file definitions --- projects/Makefile | 459 +++++++++++++++++++--------------------------- 1 file changed, 188 insertions(+), 271 deletions(-) diff --git a/projects/Makefile b/projects/Makefile index ab0f5612..c7edc4f8 100644 --- a/projects/Makefile +++ b/projects/Makefile @@ -73,7 +73,7 @@ LINUXDIRS := \ ../sources/Adapters/RTAudio \ ../sources/Adapters/RTMidi \ ../sources/Adapters/SDL/Timer \ - ../sources/Adapters/SDL/GUI + ../sources/Adapters/SDL/GUI BEAGLEBOARDDIRS := $(LINUXDIRS) DEBDIRS := $(LINUXDIRS) @@ -84,27 +84,36 @@ STEAMDIRS := $(LINUXDIRS) # Consoles/Embedded #--------------------------------------------------------------------------------- -NDSDIRS := \ +CAANOODIRS := \ . \ - ../sources/Adapters/NDS/FileSystem \ - ../sources/Adapters/NDS/System \ - ../sources/Adapters/NDS/Main \ - ../sources/Adapters/Dummy/Midi \ - ../sources/Adapters/NDS/Sound \ - ../sources/Adapters/NDS/UI + ../sources/Adapters/CAANOO/Main \ + ../sources/Adapters/Unix/FileSystem \ + ../sources/System/Process \ + ../sources/Adapters/Unix/Process \ + ../sources/Adapters/CAANOO/System \ + ../sources/Adapters/CAANOO/Midi \ + ../sources/Adapters/CAANOO/Audio \ + ../sources/Adapters/SDL/GUI \ + ../sources/Adapters/SDL/Timer -PSPDIRS := \ +DINGOODIRS := \ . \ - ../sources/Adapters/PSP/Main \ - ../sources/Adapters/PSP/FileSystem \ - ../sources/System/Process \ - ../sources/Adapters/PSP/System \ - ../sources/Adapters/Dummy/Midi \ - ../sources/Adapters/SDL/Process \ + ../sources/Adapters/DINGOO/Main \ + ../sources/Adapters/Unix/FileSystem \ + ../sources/System/Process \ + ../sources/Adapters/Unix/Process \ + ../sources/Adapters/DINGOO/System \ + ../sources/Adapters/DINGOO/Midi \ + ../sources/Adapters/DINGOO/Audio \ ../sources/Adapters/SDL/Audio \ + ../sources/Adapters/SDL/Process \ ../sources/Adapters/SDL/GUI \ ../sources/Adapters/SDL/Timer +RS97DIRS := $(DINGOODIRS) +BITTBOYDIRS := $(DINGOODIRS) +MIYOODIRS := $(DINGOODIRS) + GP2XDIRS := \ . \ ../sources/Adapters/GP2X/Main \ @@ -126,37 +135,27 @@ GP32DIRS := \ ../sources/Adapters/GP32Timer \ ../sources/Adapters/GP32UI -CAANOODIRS := \ +NDSDIRS := \ . \ - ../sources/Adapters/CAANOO/Main \ - ../sources/Adapters/Unix/FileSystem \ - ../sources/System/Process \ - ../sources/Adapters/Unix/Process \ - ../sources/Adapters/CAANOO/System \ - ../sources/Adapters/CAANOO/Midi \ - ../sources/Adapters/CAANOO/Audio \ - ../sources/Adapters/SDL/GUI \ - ../sources/Adapters/SDL/Timer + ../sources/Adapters/NDS/FileSystem \ + ../sources/Adapters/NDS/System \ + ../sources/Adapters/NDS/Main \ + ../sources/Adapters/Dummy/Midi \ + ../sources/Adapters/NDS/Sound \ + ../sources/Adapters/NDS/UI -DINGOODIRS := \ +PSPDIRS := \ . \ - ../sources/Adapters/DINGOO/Main \ - ../sources/Adapters/Unix/FileSystem \ + ../sources/Adapters/PSP/Main \ + ../sources/Adapters/PSP/FileSystem \ ../sources/System/Process \ - ../sources/Adapters/Unix/Process \ - ../sources/Adapters/DINGOO/System \ - ../sources/Adapters/DINGOO/Midi \ + ../sources/Adapters/PSP/System \ ../sources/Adapters/Dummy/Midi \ - ../sources/Adapters/DINGOO/Audio \ - ../sources/Adapters/SDL/Audio \ ../sources/Adapters/SDL/Process \ + ../sources/Adapters/SDL/Audio \ ../sources/Adapters/SDL/GUI \ ../sources/Adapters/SDL/Timer -RS97DIRS := $(DINGOODIRS) -BITTBOYDIRS := $(DINGOODIRS) -MIYOODIRS := $(DINGOODIRS) - #--------------------------------------------------------------------------------- # Windows #--------------------------------------------------------------------------------- @@ -178,94 +177,182 @@ W32DIRS := \ # files definition #--------------------------------------------------------------------------------- -DINGOOFILES := \ - GPSDLMain.o \ +COMMONFILES := \ + Logger.o Trace.o Result.o Status.o Config.o \ + Timer.o FileSystem.o \ + SysMutex.o TimeService.o \ + MidiOutDevice.o MidiInDevice.o MidiService.o Groove.o \ + MidiChannel.o MidiInMerger.o \ + GUIEvent.o GUIRect.o \ + EventManager.o GUIWindow.o \ + Channel.o Mixer.o \ + ControlRoom.o \ + MultiChannelAdapter.o \ + CommandDispatcher.o \ + ApplicationCommandDispatcher.o \ + EventDispatcher.o \ + ControllerService.o \ + ButtonControllerSource.o \ + KeyboardControllerSource.o \ + JoystickControllerSource.o \ + HatControllerSource.o \ + ControllerSource.o \ + ControlNode.o \ + I_GUIWindowImp.o \ + Application.o AppWindow.o SelectProjectDialog.o \ + NewProjectDialog.o \ + ImportSampleDialog.o \ + MixerView.o NullView.o \ + SongView.o ChainView.o PhraseView.o ViewData.o ConsoleView.o ProjectView.o InstrumentView.o UIController.o \ + View.o ModalView.o FieldView.o UIField.o UIIntField.o \ + UIIntVarOffField.o UIIntVarField.o ViewEvent.o I_Action.o\ + UITempoField.o UIActionField.o \ + MessageBox.o \ + GrooveView.o UINoteVarField.o UIBigHexVarField.o \ + SRPUpdaters.o UIStaticField.o \ + Song.o Chain.o Phrase.o Project.o \ + char.o n_assert.o fixed.o wildcard.o \ + SyncMaster.o TablePlayback.o Player.o \ + Table.o TableView.o\ + InstrumentBank.o WavFileWriter.o WavFile.o MidiInstrument.o Filters.o SampleVariable.o SampleInstrument.o SamplePool.o CommandList.o \ + PersistencyService.o Persistent.o \ + Observable.o SingletonRegistry.o \ + Audio.o AudioMixer.o AudioOutDriver.o AudioDriver.o \ + AudioOut.o \ + DummyAudioOut.o PlayerChannel.o AudioFileStreamer.o \ + MixBus.o \ + MixerService.o PlayerMixer.o \ + Service.o ServiceRegistry.o SubService.o \ + Variable.o VariableContainer.o WatchedVariable.o \ + SoundFontPreset.o SoundFontManager.o SoundFontSample.o \ + ENAB.o HYDRA.o OMEGA.o RIFF.o SFDETECT.o SFLOOKUP.o SFNAV.o SFREADER.o WIN_MEM.o \ + HexBuffers.o lz.o \ + tinyxmlparser.o tinyxml.o tinyxmlerror.o tinystr.o Tiny2NosStub.o + +#--------------------------------------------------------------------------------- +# Linux +#--------------------------------------------------------------------------------- + +LINUXFILES := \ UnixFileSystem.o \ - DummyMidi.o \ - DINGOOAudio.o \ - Process.o \ - UnixProcess.o \ - SDLAudioDriver.o \ - DINGOOAudioDriver.o \ - DINGOOSystem.o \ - DINGOOEventQueue.o \ - SDLProcess.o \ - SDLTimer.o \ + DEBmain.o \ + DEBSystem.o \ GUIFactory.o \ + SDLGUIWindowImp.o \ SDLEventManager.o \ - SDLGUIWindowImp.o + Process.o \ + UnixProcess.o \ + RTAudioDriver.o \ + RTAudioStub.o \ + RtAudio.o\ + SDLTimer.o -RS97FILES := \ - GPSDLMain.o \ +RTMIDIFILES := \ + RtMidi.o\ + RTMidiService.o\ + RTMidiOutDevice.o\ + RTMidiInDevice.o + +JACKFILES := \ + JackAudioDriver.o \ + JackClient.o \ + JackAudio.o + +DEBFILES := $(LINUXFILES) $(RTMIDIFILES) $(JACKFILES) +BEAGLEBOARDFILES := $(LINUXFILES) DummyMidi.o +RASPIFILES := $(LINUXFILES) $(RTMIDIFILES) $(JACKFILES) +STEAMFILES := $(LINUXFILES) $(RTMIDIFILES) $(JACKFILES) + +#--------------------------------------------------------------------------------- +# Consoles/Embedded +#--------------------------------------------------------------------------------- + +CAANOOFILES := \ + CAANOOSDLMain.o \ UnixFileSystem.o \ - DINGOOAudio.o \ + CAANOOMidiService.o \ + CAANOOSerialMidiDevice.o \ + CAANOOAudio.o \ Process.o \ UnixProcess.o \ - SDLAudioDriver.o \ - DINGOOAudioDriver.o \ - BITTBOYSystem.o \ - DINGOOEventQueue.o \ - SDLProcess.o \ + CAANOOAudioDriver.o \ + CAANOOSystem.o \ + CAANOOEventQueue.o \ + gpmemcpy.o \ + gpmemset.o \ SDLTimer.o \ GUIFactory.o \ SDLEventManager.o \ - BITTBOYSerialMidiDevice.o \ - BITTBOYMidiService.o \ SDLGUIWindowImp.o -BITTBOYFILES := \ +GP2XFILES := \ GPSDLMain.o \ - UnixFileSystem.o \ - DINGOOAudio.o \ + GP2XFileSystem.o \ + GP2XMidiService.o \ + GP2XSerialMidiDevice.o \ + GP2XAudio.o \ Process.o \ UnixProcess.o \ - SDLAudioDriver.o \ - DINGOOAudioDriver.o \ - BITTBOYSystem.o \ - DINGOOEventQueue.o \ - SDLProcess.o \ + GP2XAudioDriver.o \ + GP2XSystem.o \ + GP2XEventQueue.o \ + gpmemcpy.o \ + gpmemset.o \ SDLTimer.o \ GUIFactory.o \ SDLEventManager.o \ - BITTBOYSerialMidiDevice.o \ - BITTBOYMidiService.o \ SDLGUIWindowImp.o -MIYOOFILES := \ +DINGUXFILES := \ + DINGOOEventQueue.o \ GPSDLMain.o \ - UnixFileSystem.o \ - SDLAudio.o \ + GUIFactory.o \ Process.o \ - UnixProcess.o \ SDLAudioDriver.o \ - MIYOOSystem.o \ - DINGOOEventQueue.o \ + SDLEventManager.o \ + SDLGUIWindowImp.o \ SDLProcess.o \ SDLTimer.o \ - GUIFactory.o \ - SDLEventManager.o \ + UnixFileSystem.o \ + UnixProcess.o + +DINGOOFILES := \ + $(DINGUXFILES) \ DummyMidi.o \ - SDLGUIWindowImp.o + DINGOOAudio.o \ + DINGOOAudioDriver.o \ + DINGOOSystem.o -RG35XXFILES := \ - GPSDLMain.o \ - UnixFileSystem.o \ - SDLAudio.o \ - Process.o \ - UnixProcess.o \ - SDLAudioDriver.o \ +RS97FILES := \ + $(DINGUXFILES) \ + DINGOOAudio.o \ + DINGOOAudioDriver.o \ + BITTBOYSystem.o \ + BITTBOYSerialMidiDevice.o \ + BITTBOYMidiService.o + +BITTBOYFILES := \ + $(DINGUXFILES) \ + DINGOOAudio.o \ + DINGOOAudioDriver.o \ + BITTBOYSystem.o \ + BITTBOYSerialMidiDevice.o \ + BITTBOYMidiService.o + +MIYOOFILES := \ + $(DINGUXFILES) \ + DummyMidi.o \ MIYOOSystem.o \ - DINGOOEventQueue.o \ - SDLProcess.o \ - SDLTimer.o \ - GUIFactory.o \ - SDLEventManager.o \ + SDLAudio.o + +NDSFILES := \ + NDSmain.o \ + NDSFileSystem.o \ DummyMidi.o \ - SDLGUIWindowImp.o -# RtMidi.o \ #Disabled for now -# RTMidiService.o \ -# RTMidiOutDevice.o \ -# RTMidiInDevice.o \ + NDSSound.o \ + NDSSystem.o \ + GUIFactory.o \ + NDSGUIWindowImp.o PSPFILES := \ PSPmain.o \ @@ -281,92 +368,9 @@ PSPFILES := \ SDLTimer.o \ PSPSystem.o -DEBFILES := \ - UnixFileSystem.o \ - DEBmain.o \ - DEBSystem.o \ - GUIFactory.o \ - SDLGUIWindowImp.o \ - SDLEventManager.o \ - Process.o \ - UnixProcess.o \ - RTAudioDriver.o \ - RTAudioStub.o \ - RtAudio.o\ - RtMidi.o\ - RTMidiService.o\ - RTMidiOutDevice.o\ - RTMidiInDevice.o\ - SDLTimer.o \ - JackAudioDriver.o \ - JackClient.o \ - JackAudio.o - -BEAGLEBOARDFILES := \ - UnixFileSystem.o \ - DEBmain.o \ - DEBSystem.o \ - GUIFactory.o \ - SDLGUIWindowImp.o \ - SDLEventManager.o \ - Process.o \ - UnixProcess.o \ - DummyMidi.o \ - RTAudioDriver.o \ - RTAudioStub.o \ - RtAudio.o\ - SDLTimer.o - -RASPIFILES := \ - UnixFileSystem.o \ - DEBmain.o \ - DEBSystem.o \ - GUIFactory.o \ - SDLGUIWindowImp.o \ - SDLEventManager.o \ - Process.o \ - UnixProcess.o \ - RTAudioDriver.o \ - RTAudioStub.o \ - RtAudio.o \ - RtMidi.o \ - RTMidiService.o \ - RTMidiOutDevice.o \ - RTMidiInDevice.o \ - SDLTimer.o \ - JackAudioDriver.o \ - JackClient.o \ - JackAudio.o - -STEAMFILES := \ - UnixFileSystem.o \ - DEBmain.o \ - DEBSystem.o \ - GUIFactory.o \ - SDLGUIWindowImp.o \ - SDLEventManager.o \ - Process.o \ - UnixProcess.o \ - RTAudioDriver.o \ - RTAudioStub.o \ - RtAudio.o\ - RtMidi.o\ - RTMidiService.o\ - RTMidiOutDevice.o\ - RTMidiInDevice.o\ - SDLTimer.o \ - JackAudioDriver.o \ - JackClient.o \ - JackAudio.o - -NDSFILES := \ - NDSmain.o \ - NDSFileSystem.o \ - DummyMidi.o \ - NDSSound.o \ - NDSSystem.o \ - GUIFactory.o \ - NDSGUIWindowImp.o +#--------------------------------------------------------------------------------- +# Windows +#--------------------------------------------------------------------------------- W32FILES := \ WSDLmain.o \ @@ -381,94 +385,6 @@ W32FILES := \ GUIFactory.o \ WSDLGUIWindowImp.o -GP2XFILES := \ - GPSDLMain.o \ - GP2XFileSystem.o \ - GP2XMidiService.o \ - GP2XSerialMidiDevice.o \ - GP2XAudio.o \ - Process.o \ - UnixProcess.o \ - GP2XAudioDriver.o \ - GP2XSystem.o \ - GP2XEventQueue.o \ - gpmemcpy.o \ - gpmemset.o \ - SDLTimer.o \ - GUIFactory.o \ - SDLEventManager.o \ - SDLGUIWindowImp.o - -CAANOOFILES := \ - CAANOOSDLMain.o \ - UnixFileSystem.o \ - CAANOOMidiService.o \ - CAANOOSerialMidiDevice.o \ - CAANOOAudio.o \ - Process.o \ - UnixProcess.o \ - CAANOOAudioDriver.o \ - CAANOOSystem.o \ - CAANOOEventQueue.o \ - gpmemcpy.o \ - gpmemset.o \ - SDLTimer.o \ - GUIFactory.o \ - SDLEventManager.o \ - SDLGUIWindowImp.o - -COMMONFILES := \ - Logger.o Trace.o Result.o Status.o Config.o \ - Timer.o FileSystem.o \ - SysMutex.o TimeService.o \ - MidiOutDevice.o MidiInDevice.o MidiService.o Groove.o \ - MidiChannel.o MidiInMerger.o \ - GUIEvent.o GUIRect.o \ - EventManager.o GUIWindow.o \ - Channel.o Mixer.o \ - ControlRoom.o \ - MultiChannelAdapter.o \ - CommandDispatcher.o \ - ApplicationCommandDispatcher.o \ - EventDispatcher.o \ - ControllerService.o \ - ButtonControllerSource.o \ - KeyboardControllerSource.o \ - JoystickControllerSource.o \ - HatControllerSource.o \ - ControllerSource.o \ - ControlNode.o \ - I_GUIWindowImp.o \ - Application.o AppWindow.o SelectProjectDialog.o \ - NewProjectDialog.o \ - ImportSampleDialog.o \ - MixerView.o NullView.o \ - SongView.o ChainView.o PhraseView.o ViewData.o ConsoleView.o ProjectView.o InstrumentView.o UIController.o \ - View.o ModalView.o FieldView.o UIField.o UIIntField.o \ - UIIntVarOffField.o UIIntVarField.o ViewEvent.o I_Action.o\ - UITempoField.o UIActionField.o \ - MessageBox.o \ - GrooveView.o UINoteVarField.o UIBigHexVarField.o \ - SRPUpdaters.o UIStaticField.o \ - Song.o Chain.o Phrase.o Project.o \ - char.o n_assert.o fixed.o wildcard.o \ - SyncMaster.o TablePlayback.o Player.o \ - Table.o TableView.o\ - InstrumentBank.o WavFileWriter.o WavFile.o MidiInstrument.o Filters.o SampleVariable.o SampleInstrument.o SamplePool.o CommandList.o \ - PersistencyService.o Persistent.o \ - Observable.o SingletonRegistry.o \ - Audio.o AudioMixer.o AudioOutDriver.o AudioDriver.o \ - AudioOut.o \ - DummyAudioOut.o PlayerChannel.o AudioFileStreamer.o \ - MixBus.o \ - MixerService.o PlayerMixer.o \ - Service.o ServiceRegistry.o SubService.o \ - Variable.o VariableContainer.o WatchedVariable.o \ - SoundFontPreset.o SoundFontManager.o SoundFontSample.o \ - ENAB.o HYDRA.o OMEGA.o RIFF.o SFDETECT.o SFLOOKUP.o SFNAV.o SFREADER.o WIN_MEM.o \ - HexBuffers.o lz.o \ - tinyxmlparser.o tinyxml.o tinyxmlerror.o tinystr.o Tiny2NosStub.o - #--------------------------------------------------------------------------------- # TARGET is the name of the output # BUILD is the directory where object files & intermediate files will be placed @@ -514,7 +430,8 @@ export DEPSDIR := $(CURDIR)/$(BUILD) export LD := $(CXX) export OFILES := $(COMMONFILES) $($(PLATFORM)FILES) export OBJS := $(OFILES) -export INCLUDE := $(foreach dir,$(INCLUDES),-I$(CURDIR)/$(dir)) \ +export INCLUDE := \ + $(foreach dir,$(INCLUDES),-I$(CURDIR)/$(dir)) \ $(foreach dir,$(LIBDIRS),-I$(dir)/include) \ -I$(CURDIR)/$(BUILD) export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) From 680484d3b77f929340f22fe0e12780389849c38f Mon Sep 17 00:00:00 2001 From: Nine-H Date: Tue, 28 May 2024 11:14:18 +1000 Subject: [PATCH 06/66] build: separate rtmidi and jackaudio from linuxdirs --- projects/Makefile | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/projects/Makefile b/projects/Makefile index c7edc4f8..57f994f6 100644 --- a/projects/Makefile +++ b/projects/Makefile @@ -65,20 +65,22 @@ LINUXDIRS := \ ../sources/Adapters/Unix/Process \ ../sources/System/Process \ ../sources/Externals/RTAudio \ - ../sources/Externals/RtMidi \ ../sources/Adapters/DEB/System \ - ../sources/Adapters/Jack/Audio \ - ../sources/Adapters/Jack/Midi \ - ../sources/Adapters/Jack/Client \ ../sources/Adapters/RTAudio \ - ../sources/Adapters/RTMidi \ ../sources/Adapters/SDL/Timer \ ../sources/Adapters/SDL/GUI +JACKDIRS := \ + ../sources/Adapters/Jack/Audio \ + ../sources/Adapters/Jack/Midi \ + ../sources/Adapters/Jack/Client + +RTMIDIDIRS := ../sources/Adapters/RTMidi + BEAGLEBOARDDIRS := $(LINUXDIRS) -DEBDIRS := $(LINUXDIRS) -RASPIDIRS := $(LINUXDIRS) -STEAMDIRS := $(LINUXDIRS) +DEBDIRS := $(LINUXDIRS) $(JACKDIRS) $(RTMIDIDIRS) +RASPIDIRS := $(LINUXDIRS) $(JACKDIRS) $(RTMIDIDIRS) +STEAMDIRS := $(LINUXDIRS) $(JACKDIRS) $(RTMIDIDIRS) #--------------------------------------------------------------------------------- # Consoles/Embedded From a5b2a7e712b7f595681d5ffe9875cb667c703bbc Mon Sep 17 00:00:00 2001 From: Nine-H Date: Mon, 27 May 2024 22:38:37 +1000 Subject: [PATCH 07/66] feature: duplicate DEB target to generic LINUX target and document --- sources/Adapters/LINUX/Main/LINUXMain.cpp | 21 ++ sources/Adapters/LINUX/System/LINUXSystem.cpp | 223 ++++++++++++++++++ sources/Adapters/LINUX/System/LINUXSystem.h | 36 +++ 3 files changed, 280 insertions(+) create mode 100644 sources/Adapters/LINUX/Main/LINUXMain.cpp create mode 100644 sources/Adapters/LINUX/System/LINUXSystem.cpp create mode 100644 sources/Adapters/LINUX/System/LINUXSystem.h diff --git a/sources/Adapters/LINUX/Main/LINUXMain.cpp b/sources/Adapters/LINUX/Main/LINUXMain.cpp new file mode 100644 index 00000000..20436639 --- /dev/null +++ b/sources/Adapters/LINUX/Main/LINUXMain.cpp @@ -0,0 +1,21 @@ +#include +#include "Adapters/LINUX/System/LINUXSystem.h" +#include "Adapters/SDL/GUI/SDLGUIWindowImp.h" +#include "Application/Application.h" + +/* + * generic entrypoint for linux based targets + */ +int main(int argc,char *argv[]) { + LINUXSystem::Boot(argc,argv); + + SDLCreateWindowParams params; + params.title="littlegptracker"; + params.cacheFonts_=true; + + Application::GetInstance()->Init(params); + + return LINUXSystem::MainLoop(); +} + +void _assert() {}; diff --git a/sources/Adapters/LINUX/System/LINUXSystem.cpp b/sources/Adapters/LINUX/System/LINUXSystem.cpp new file mode 100644 index 00000000..4ee94381 --- /dev/null +++ b/sources/Adapters/LINUX/System/LINUXSystem.cpp @@ -0,0 +1,223 @@ +#include +#include +#include +#include +#include "LINUXSystem.h" +#include "Application/Controllers/ControlRoom.h" +#include "Application/Commands/NodeList.h" +#include "Application/Model/Config.h" +#include "Adapters/SDL/Timer/SDLTimer.h" +#include "Adapters/SDL/GUI/GUIFactory.h" +#include "Adapters/SDL/GUI/SDLGUIWindowImp.h" +#include "Adapters/SDL/GUI/SDLEventManager.h" +#include "Adapters/Unix/FileSystem/UnixFileSystem.h" +#include "Adapters/Unix/Process/UnixProcess.h" +#include "System/Console/Logger.h" + +#ifdef AUDIO_JACK +#include "Adapters/Jack/Audio/JackAudio.h" +#include "Adapters/Jack/Midi/JackMidiService.h" +#include "Adapters/Jack/Client/JackClient.h" +#endif + +#ifdef AUDIO_RT +#include "Adapters/RTAudio/RTAudioStub.h" +#endif + +#ifdef MIDI_RT +#include "Adapters/RTMidi/RTMidiService.h" +#endif + +EventManager *LINUXSystem::eventManager_ = NULL; +static int secbase = 0; + + +/* + * starts the main loop + */ +int LINUXSystem::MainLoop() { + eventManager_->InstallMappings(); + return eventManager_->MainLoop() ; +}; + +/* + * initializes the application + */ +void LINUXSystem::Boot(int argc,char **argv) { + + SDL_putenv((char *)"SDL_VIDEO_X11_WMCLASS=LittleGPTracker") ; + + // Install System + System::Install(new LINUXSystem()); + + // Install FileSystem + FileSystem::Install(new UnixFileSystem()); + + // Install aliases + char buff[1024]; + ssize_t len = ::readlink("/proc/self/exe",buff,sizeof(buff)-1); + if (len != -1) + { + buff[len] = 0; + } + else + { + strcpy(buff,"."); + } + Path::SetAlias("bin",dirname(buff)) ; + + Path::SetAlias("root",".") ; + +#ifdef _DEBUG + Trace::GetInstance()->SetLogger(*(new StdOutLogger())); +#else + Path logPath("bin:lgpt.log"); + FileLogger *fileLogger=new FileLogger(logPath); + if(fileLogger->Init().Succeeded()) + { + Trace::GetInstance()->SetLogger(*fileLogger); + } +#endif + + // Process arguments + Config::GetInstance()->ProcessArguments(argc,argv) ; + + // Install GUI Factory + I_GUIWindowFactory::Install(new GUIFactory()) ; + + // Install Timers + TimerService::GetInstance()->Install(new SDLTimerService()) ; + +#ifdef AUDIO_JACK + // if we're using jack then install jack + if (JackClient::GetInstance()->Init()) { + Trace::Debug("Audio","Found jack.. connecting to it") ; + AudioSettings hints ; // Jack doesn't care of hints for now on + Audio::Install(new JackAudio(hints)) ; + // MidiService::Install(new JackMidiService()) ; + MidiService::Install(new RTMidiService()) ; + } + else +#endif + { + Trace::Debug("Audio","Jack not found.. using default audio driver") ; + AudioSettings hints ; + hints.bufferSize_= 256 ; + hints.preBufferCount_=2 ; + Audio::Install(new RTAudioStub(hints)) ; + MidiService::Install(new RTMidiService()) ; + } + + // Install Threads + + SysProcessFactory::Install(new UnixProcessFactory()) ; + + if ( SDL_Init(SDL_INIT_VIDEO|SDL_INIT_TIMER) < 0 ) { + return; + } + SDL_EnableUNICODE(1); + SDL_ShowCursor(SDL_DISABLE); + + atexit(SDL_Quit); + + eventManager_=I_GUIWindowFactory::GetInstance()->GetEventManager() ; + eventManager_->Init() ; + + eventManager_->MapAppButton("a",APP_BUTTON_A) ; + eventManager_->MapAppButton("s",APP_BUTTON_B) ; + eventManager_->MapAppButton("left",APP_BUTTON_LEFT) ; + eventManager_->MapAppButton("right",APP_BUTTON_RIGHT) ; + eventManager_->MapAppButton("up",APP_BUTTON_UP) ; + eventManager_->MapAppButton("down",APP_BUTTON_DOWN) ; + eventManager_->MapAppButton("right ctrl",APP_BUTTON_L) ; + eventManager_->MapAppButton("left ctrl",APP_BUTTON_R) ; + eventManager_->MapAppButton("space",APP_BUTTON_START) ; +}; + +void LINUXSystem::Shutdown() {}; + +/* + * get current time for status display + */ +unsigned long LINUXSystem::GetClock() { + struct timeval tp; + + gettimeofday(&tp, NULL); + if (!secbase) { + secbase = tp.tv_sec; + return long(tp.tv_usec/1000.0); + } + return long((tp.tv_sec - secbase)*1000 + tp.tv_usec/1000.0); +} + +/* + * wraps sleep, guess we never sleep! + */ +void LINUXSystem::Sleep(int millisec) { + //if (millisec>0) + //::Sleep(millisec) ; +} + +/* + * wraps malloc + */ +void *LINUXSystem::Malloc(unsigned size) { + void *ptr=malloc(size) ; + //Trace::Debug("alloc:%x (%d)",ptr,size) ; + return ptr ; +} + +/* + * wraps free + */ +void LINUXSystem::Free(void *ptr) { + //Trace::Debug("free:%x",ptr) ; + free(ptr) ; +} + +/* + * wraps memset + */ +void LINUXSystem::Memset(void *addr,char val,int size) { + unsigned int ad=(unsigned int)addr ; + if (((ad&0x3)==0)&&((size&0x3)==0)) { // Are we 4-byte aligned ? + unsigned int intVal=0; + for (int i=0;i<4;i++) { + intVal=(intVal<<8)+val; + } + unsigned int *dst=(unsigned int *)addr; + size_t intSize=size>>2 ; + + for (unsigned int i=0;iPostQuitMessage() ; +}; + +/* + * get memory usage, guess it's infinite + */ +unsigned int LINUXSystem::GetMemoryUsage() { return 0; }; diff --git a/sources/Adapters/LINUX/System/LINUXSystem.h b/sources/Adapters/LINUX/System/LINUXSystem.h new file mode 100644 index 00000000..996e951f --- /dev/null +++ b/sources/Adapters/LINUX/System/LINUXSystem.h @@ -0,0 +1,36 @@ +#ifndef _LINUX_SYSTEM_H_ +#define _LINUX_SYSTEM_H_ + +#include +#include "System/System/System.h" +#include "UIFramework/SimpleBaseClasses/EventManager.h" + +class LINUXSystem: public System { +public: + static void Boot(int argc,char **argv); + static void Shutdown(); + static int MainLoop(); + +public: // System implementation + virtual unsigned long GetClock(); + virtual void Sleep(int millisec); + virtual void *Malloc(unsigned size); + virtual void Free(void *); + virtual void Memset(void *addr,char val,int size); + virtual void *Memcpy(void *s1, const void *s2, int n); + virtual void AddUserLog(const char *); + virtual int GetBatteryLevel() { return -1 ; }; + virtual void PostQuitMessage(); + virtual unsigned int GetMemoryUsage(); + +protected: // Additional + static unsigned short getButtonMask(SDL_Event&); + static void readConfig(); + static void checkKey(int ,const char *,const char *[]); +private: + static int keyRepeat_; + static int keyDelay_; + static bool finished_; + static EventManager *eventManager_; +}; +#endif From 80d5726f28328f5797a98700a9c7e4cf2dfd7e34 Mon Sep 17 00:00:00 2001 From: Nine-H Date: Thu, 6 Jun 2024 17:12:45 +1000 Subject: [PATCH 08/66] feature: integrate 64 bit patches, makefile for x64 build, add rtmidi logging --- projects/Makefile | 74 ++++++---- projects/Makefile.PLUSH | 33 +++++ projects/Makefile.X64 | 21 +++ sources/Adapters/LINUX/System/LINUXSystem.cpp | 127 ++++++++++-------- sources/Adapters/RTAudio/RTAudioDriver.cpp | 4 + sources/Adapters/RTMidi/RTMidiOutDevice.cpp | 4 +- sources/Adapters/RTMidi/RTMidiService.cpp | 84 +++++------- sources/Adapters/SDL/Audio/SDLAudioDriver.cpp | 4 + .../Unix/FileSystem/UnixFileSystem.cpp | 6 + .../Instruments/SampleInstrument.cpp | 4 + .../Instruments/SoundFontManager.cpp | 10 +- .../Views/BaseClasses/UIActionField.cpp | 4 + .../Views/BaseClasses/UITempoField.cpp | 4 + sources/Application/Views/ProjectView.cpp | 4 + sources/System/Console/Trace.cpp | 7 +- sources/System/Console/Trace.h | 4 + 16 files changed, 256 insertions(+), 138 deletions(-) create mode 100644 projects/Makefile.PLUSH create mode 100644 projects/Makefile.X64 diff --git a/projects/Makefile b/projects/Makefile index 57f994f6..50e3dd46 100644 --- a/projects/Makefile +++ b/projects/Makefile @@ -13,9 +13,9 @@ include $(PWD)/Makefile.$(PLATFORM) #--------------------------------------------------------------------------------- AUTHOR := n0s -TITLE := lgpt -NAME := LittleGPTracker -ICON := lgpt_icon.bmp +TITLE := lgpt +NAME := LittleGPTracker +ICON := lgpt_icon.bmp #--------------------------------------------------------------------------------- # Directory definitions @@ -61,26 +61,37 @@ COMMONDIRS := \ LINUXDIRS := \ ../sources/Adapters/Unix/FileSystem \ - ../sources/Adapters/DEB/Main \ + ../sources/Adapters/LINUX/Main \ ../sources/Adapters/Unix/Process \ ../sources/System/Process \ - ../sources/Externals/RTAudio \ - ../sources/Adapters/DEB/System \ - ../sources/Adapters/RTAudio \ + ../sources/Adapters/LINUX/System \ ../sources/Adapters/SDL/Timer \ ../sources/Adapters/SDL/GUI +DUMMYMIDIDIRS := \ + ../sources/Adapters/Dummy/Midi + JACKDIRS := \ ../sources/Adapters/Jack/Audio \ ../sources/Adapters/Jack/Midi \ ../sources/Adapters/Jack/Client -RTMIDIDIRS := ../sources/Adapters/RTMidi +RTAUDIODIRS := \ + ../sources/Adapters/RTAudio \ + ../sources/Externals/RTAudio + +RTMIDIDIRS := \ + ../sources/Adapters/RTMidi \ + ../sources/Externals/RtMidi -BEAGLEBOARDDIRS := $(LINUXDIRS) -DEBDIRS := $(LINUXDIRS) $(JACKDIRS) $(RTMIDIDIRS) -RASPIDIRS := $(LINUXDIRS) $(JACKDIRS) $(RTMIDIDIRS) -STEAMDIRS := $(LINUXDIRS) $(JACKDIRS) $(RTMIDIDIRS) +SDLAUDIODIRS := \ + ../sources/Adapters/SDL/Audio + +BEAGLEBOARDDIRS := $(LINUXDIRS) $(RTAUDIODIRS) +DEBDIRS := $(LINUXDIRS) $(JACKDIRS) $(RTAUDIODIRS) $(RTMIDIDIRS) +RASPIDIRS := $(LINUXDIRS) $(JACKDIRS) $(RTAUDIODIRS) $(RTMIDIDIRS) +STEAMDIRS := $(LINUXDIRS) $(JACKDIRS) $(RTAUDIODIRS) $(RTMIDIDIRS) +X64DIRS := $(LINUXDIRS) $(RTMIDIDIRS) $(SDLAUDIODIRS) #--------------------------------------------------------------------------------- # Consoles/Embedded @@ -110,11 +121,12 @@ DINGOODIRS := \ ../sources/Adapters/SDL/Audio \ ../sources/Adapters/SDL/Process \ ../sources/Adapters/SDL/GUI \ - ../sources/Adapters/SDL/Timer + ../sources/Adapters/SDL/Timer RS97DIRS := $(DINGOODIRS) BITTBOYDIRS := $(DINGOODIRS) MIYOODIRS := $(DINGOODIRS) +PLUSHDIRS := $(MIYOODIRS) GP2XDIRS := \ . \ @@ -237,17 +249,22 @@ COMMONFILES := \ LINUXFILES := \ UnixFileSystem.o \ - DEBmain.o \ - DEBSystem.o \ + LINUXMain.o \ + LINUXSystem.o \ GUIFactory.o \ SDLGUIWindowImp.o \ SDLEventManager.o \ Process.o \ UnixProcess.o \ + SDLTimer.o + +DUMMYMIDIFILES := \ + DummyMidi.o + +RTAUDIOFILES := \ RTAudioDriver.o \ RTAudioStub.o \ - RtAudio.o\ - SDLTimer.o + RtAudio.o RTMIDIFILES := \ RtMidi.o\ @@ -260,10 +277,15 @@ JACKFILES := \ JackClient.o \ JackAudio.o +SDLAUDIOFILES := \ + SDLAudioDriver.o \ + SDLAudio.o + DEBFILES := $(LINUXFILES) $(RTMIDIFILES) $(JACKFILES) -BEAGLEBOARDFILES := $(LINUXFILES) DummyMidi.o +BEAGLEBOARDFILES := $(LINUXFILES) $(DUMMYMIDIFILES) RASPIFILES := $(LINUXFILES) $(RTMIDIFILES) $(JACKFILES) STEAMFILES := $(LINUXFILES) $(RTMIDIFILES) $(JACKFILES) +X64FILES := $(LINUXFILES) $(SDLAUDIOFILES) $(RTMIDIFILES) #--------------------------------------------------------------------------------- # Consoles/Embedded @@ -285,7 +307,7 @@ CAANOOFILES := \ SDLTimer.o \ GUIFactory.o \ SDLEventManager.o \ - SDLGUIWindowImp.o + SDLGUIWindowImp.o GP2XFILES := \ GPSDLMain.o \ @@ -303,7 +325,7 @@ GP2XFILES := \ SDLTimer.o \ GUIFactory.o \ SDLEventManager.o \ - SDLGUIWindowImp.o + SDLGUIWindowImp.o DINGUXFILES := \ DINGOOEventQueue.o \ @@ -347,6 +369,8 @@ MIYOOFILES := \ MIYOOSystem.o \ SDLAudio.o +PLUSHFILES = $(MIYOOFILES) + NDSFILES := \ NDSmain.o \ NDSFileSystem.o \ @@ -394,9 +418,9 @@ W32FILES := \ # INCLUDES is a list of directories containing extra header files #--------------------------------------------------------------------------------- -TARGET := $(TITLE) -BUILD := build$(PLATFORM) -SOURCES := $($(PLATFORM)DIRS) $(COMMONDIRS) +TARGET := $(TITLE) +BUILD := build$(PLATFORM) +SOURCES := $($(PLATFORM)DIRS) $(COMMONDIRS) INCLUDES := #--------------------------------------------------------------------------------- @@ -421,8 +445,8 @@ export PATH := $(DEVKITARM)/bin:$(PATH) ifneq ($(BUILD),$(notdir $(CURDIR))) #--------------------------------------------------------------------------------- -export OUTPUT := $(CURDIR)/$(TARGET) -export VPATH := $(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) +export OUTPUT := $(CURDIR)/$(TARGET) +export VPATH := $(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) export DEPSDIR := $(CURDIR)/$(BUILD) #--------------------------------------------------------------------------------- diff --git a/projects/Makefile.PLUSH b/projects/Makefile.PLUSH new file mode 100644 index 00000000..68547f05 --- /dev/null +++ b/projects/Makefile.PLUSH @@ -0,0 +1,33 @@ +-include $(PWD)/rules_base +STRIP = $(CROSS_COMPILE)strip + +%.arm7hf: $(OFILES) + $(CXX) $(LDFLAGS) -o $@ $(OFILES) $(LIBS) + @$(STRIP) $@ + +DEVKIT = /opt/arm-buildroot-linux-gnueabihf_sdk-buildroot/ +CROSS_COMPILE = $(DEVKIT)bin/arm-buildroot-linux-gnueabihf- + +CC = $(CROSS_COMPILE)gcc +CXX = $(CROSS_COMPILE)g++ +SYSROOT := $(shell $(CROSS_COMPILE)gcc --print-sysroot) +SDL_CFLAGS := -I/opt/arm-buildroot-linux-gnueabihf_sdk-buildroot/arm-buildroot-linux-gnueabihf/sysroot/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT +SDL_LIBS := -L/opt/arm-buildroot-linux-gnueabihf_sdk-buildroot/arm-buildroot-linux-gnueabihf/sysroot/usr/lib -lSDL + +DEFINES = -DHAVE_STDINT_H -D_NDEBUG -D_NO_JACK_ -I$(PWD)/../sources -DCPP_MEMORY $(SDL_CFLAGS) $(SDL_LIBS) -DBUFFERED +INCLUDES = -Iinclude $(SDL_CFLAGS) +OPT_FLAGS = -O3 -Ofast -fdata-sections -fdata-sections -fno-common -fno-PIC -flto -marm -mtune=cortex-a53 + +OUTPUT = ../lgpt-rg35xxplush24 + +TOOLPATH = $(DEVKIT)/usr/bin +PREFIX := arm-linux-gnueabihf- + +CFLAGS := $(DEFINES) $(INCLUDES) $(OPT_FLAGS) -Wall +CXXFLAGS := $(CFLAGS) -std=gnu++03 + +EXTENSION := arm7hf + +LIBS := -lSDL -lSDL_mixer -lpthread +LIBDIRS := $(DEKVIT)/usr/lib +LIBDIRS += $(DEKVIT)/usr/include diff --git a/projects/Makefile.X64 b/projects/Makefile.X64 new file mode 100644 index 00000000..54f40eab --- /dev/null +++ b/projects/Makefile.X64 @@ -0,0 +1,21 @@ +-include $(PWD)/rules_base + +# config +DEFINES := \ + -DCPP_MEMORY \ + -D__LINUX_ALSA__ \ + -D__LINUX_ALSASEQ__ \ + -D_64BIT \ + -DSDLAUDIO \ + -DRTMIDI + +# optimization +CFLAGS := $(DEFINES) -g -O3 -Wall -I/usr/local/include -I$(PWD)/../sources +CXXFLAGS := $(CFLAGS) -std=gnu++03 +LIBS := -L/local/lib -Wl,-rpath,/usr/local/lib -lasound -lSDL -ljack -lpthread +OUTPUT := ../lgpt +EXTENSION := x64 + +# build rule +%.x64: $(OFILES) + $(CXX) $(LDFLAGS) -o $@ $(OFILES) $(LIBS) diff --git a/sources/Adapters/LINUX/System/LINUXSystem.cpp b/sources/Adapters/LINUX/System/LINUXSystem.cpp index 4ee94381..ae6bc049 100644 --- a/sources/Adapters/LINUX/System/LINUXSystem.cpp +++ b/sources/Adapters/LINUX/System/LINUXSystem.cpp @@ -14,24 +14,34 @@ #include "Adapters/Unix/Process/UnixProcess.h" #include "System/Console/Logger.h" -#ifdef AUDIO_JACK +#ifdef DUMMYMIDI +#include "Adapters/Dummy/Midi/DummyMidi.h" +#endif + +#ifdef JACKAUDIO #include "Adapters/Jack/Audio/JackAudio.h" -#include "Adapters/Jack/Midi/JackMidiService.h" #include "Adapters/Jack/Client/JackClient.h" #endif -#ifdef AUDIO_RT +#ifdef JACKMIDI +#include "Adapters/Jack/Midi/JackMidiService.h" +#endif + +#ifdef RTAUDIO #include "Adapters/RTAudio/RTAudioStub.h" #endif -#ifdef MIDI_RT +#ifdef RTMIDI #include "Adapters/RTMidi/RTMidiService.h" #endif +#ifdef SDLAUDIO +#include "Adapters/SDL/Audio/SDLAudio.h" +#endif + EventManager *LINUXSystem::eventManager_ = NULL; static int secbase = 0; - /* * starts the main loop */ @@ -65,54 +75,60 @@ void LINUXSystem::Boot(int argc,char **argv) { strcpy(buff,"."); } Path::SetAlias("bin",dirname(buff)) ; - Path::SetAlias("root",".") ; -#ifdef _DEBUG + // always use stdout, user can capture in launch script Trace::GetInstance()->SetLogger(*(new StdOutLogger())); -#else - Path logPath("bin:lgpt.log"); - FileLogger *fileLogger=new FileLogger(logPath); - if(fileLogger->Init().Succeeded()) - { - Trace::GetInstance()->SetLogger(*fileLogger); - } -#endif // Process arguments - Config::GetInstance()->ProcessArguments(argc,argv) ; - - // Install GUI Factory - I_GUIWindowFactory::Install(new GUIFactory()) ; - - // Install Timers - TimerService::GetInstance()->Install(new SDLTimerService()) ; - -#ifdef AUDIO_JACK - // if we're using jack then install jack - if (JackClient::GetInstance()->Init()) { - Trace::Debug("Audio","Found jack.. connecting to it") ; - AudioSettings hints ; // Jack doesn't care of hints for now on - Audio::Install(new JackAudio(hints)) ; - // MidiService::Install(new JackMidiService()) ; - MidiService::Install(new RTMidiService()) ; - } - else + Config::GetInstance()->ProcessArguments(argc,argv) ; + + // Install GUI Factory + I_GUIWindowFactory::Install(new GUIFactory()) ; + + // Install Timers + TimerService::GetInstance()->Install(new SDLTimerService()) ; + +#ifdef JACKAUDIO + Trace::Log("System","Installing JACK audio") ; + Audio::Install(new JackAudio(AudioSettings hints)); #endif - { - Trace::Debug("Audio","Jack not found.. using default audio driver") ; - AudioSettings hints ; - hints.bufferSize_= 256 ; - hints.preBufferCount_=2 ; - Audio::Install(new RTAudioStub(hints)) ; - MidiService::Install(new RTMidiService()) ; - } - // Install Threads +#ifdef RTAUDIO + Trace::Log("System","Installing RT audio") ; + AudioSettings hints ; + hints.bufferSize_= 256 ; + hints.preBufferCount_=2 ; + Audio::Install(new RTAudioStub(hints)) ; +#endif - SysProcessFactory::Install(new UnixProcessFactory()) ; +#ifdef SDLAUDIO + Trace::Log("System","Installing SDL audio") ; + AudioSettings hint; + hint.bufferSize_ = 1024; + hint.preBufferCount_ = 8; + Audio::Install(new SDLAudio(hint)); +#endif + +#ifdef DUMMYMIDI + Trace::Log("System","Installing DUMMY MIDI") ; + MidiService::Install(new DummyMidi()); +#endif - if ( SDL_Init(SDL_INIT_VIDEO|SDL_INIT_TIMER) < 0 ) { +#ifdef JACKMIDI + Trace::Log("System","Installing JACK MIDI") ; + MidiService::Install(new JackMidiService()) ; +#endif + +#ifdef RTMIDI + Trace::Log("System","Installing RT MIDI") ; + MidiService::Install(new RTMidiService()) ; +#endif + + // Install Threads + SysProcessFactory::Install(new UnixProcessFactory()); + + if ( SDL_Init(SDL_INIT_VIDEO|SDL_INIT_TIMER) < 0 ) { return; } SDL_EnableUNICODE(1); @@ -120,18 +136,8 @@ void LINUXSystem::Boot(int argc,char **argv) { atexit(SDL_Quit); - eventManager_=I_GUIWindowFactory::GetInstance()->GetEventManager() ; - eventManager_->Init() ; - - eventManager_->MapAppButton("a",APP_BUTTON_A) ; - eventManager_->MapAppButton("s",APP_BUTTON_B) ; - eventManager_->MapAppButton("left",APP_BUTTON_LEFT) ; - eventManager_->MapAppButton("right",APP_BUTTON_RIGHT) ; - eventManager_->MapAppButton("up",APP_BUTTON_UP) ; - eventManager_->MapAppButton("down",APP_BUTTON_DOWN) ; - eventManager_->MapAppButton("right ctrl",APP_BUTTON_L) ; - eventManager_->MapAppButton("left ctrl",APP_BUTTON_R) ; - eventManager_->MapAppButton("space",APP_BUTTON_START) ; + eventManager_ = I_GUIWindowFactory::GetInstance()->GetEventManager(); + eventManager_ -> Init(); }; void LINUXSystem::Shutdown() {}; @@ -171,15 +177,18 @@ void *LINUXSystem::Malloc(unsigned size) { * wraps free */ void LINUXSystem::Free(void *ptr) { - //Trace::Debug("free:%x",ptr) ; - free(ptr) ; + free(ptr); } /* * wraps memset */ void LINUXSystem::Memset(void *addr,char val,int size) { - unsigned int ad=(unsigned int)addr ; +#ifdef _64BIT + unsigned int ad = (intptr_t)addr; +#else + unsigned int ad=(unsigned int)addr; +#endif if (((ad&0x3)==0)&&((size&0x3)==0)) { // Are we 4-byte aligned ? unsigned int intVal=0; for (int i=0;i<4;i++) { diff --git a/sources/Adapters/RTAudio/RTAudioDriver.cpp b/sources/Adapters/RTAudio/RTAudioDriver.cpp index b82e0f76..92789f9e 100644 --- a/sources/Adapters/RTAudio/RTAudioDriver.cpp +++ b/sources/Adapters/RTAudio/RTAudioDriver.cpp @@ -104,7 +104,11 @@ bool RTAudioDriver::InitDriver() { // Allocates a rotating sound buffer unalignedMain_=(char *)SYS_MALLOC(fragSize_+SOUND_BUFFER_MAX) ; // Make sure the buffer is aligned +#ifdef _64BIT + mainBuffer_ = (char *)unalignedMain_; +#else mainBuffer_=(char *)((((int)unalignedMain_)+1)&(0xFFFFFFFC)) ; +#endif // Create mini blank buffer in case of underruns diff --git a/sources/Adapters/RTMidi/RTMidiOutDevice.cpp b/sources/Adapters/RTMidi/RTMidiOutDevice.cpp index 75ca2af6..328b27ab 100644 --- a/sources/Adapters/RTMidi/RTMidiOutDevice.cpp +++ b/sources/Adapters/RTMidi/RTMidiOutDevice.cpp @@ -6,8 +6,8 @@ RTMidiOutDevice::RTMidiOutDevice(RtMidiOut &out,int index,const char *name): MidiOutDevice(name), rtMidiOut_(out), - running_(false), - index_(index) + index_(index), + running_(false) { } ; diff --git a/sources/Adapters/RTMidi/RTMidiService.cpp b/sources/Adapters/RTMidi/RTMidiService.cpp index 63782fac..722ee591 100644 --- a/sources/Adapters/RTMidi/RTMidiService.cpp +++ b/sources/Adapters/RTMidi/RTMidiService.cpp @@ -1,4 +1,3 @@ - #include "RTMidiService.h" #include "RTMidiOutDevice.h" #include "RTMidiInDevice.h" @@ -8,15 +7,14 @@ //static void CALLBACK MidiFlushProc(UINT uiID, UINT uiMsg, DWORD // dwUser, DWORD dw1, DWORD dw2) { // -// W32MidiService *msvc=(W32MidiService *)dwUser ; -// msvc->Flush() ; -//} ; - +// W32MidiService *msvc=(W32MidiService *)dwUser; +// msvc->Flush(); +//}; RTMidiService::RTMidiService() { - const char *delay=Config::GetInstance()->GetValue("MIDIDELAY") ; + const char *delay = Config::GetInstance()->GetValue("MIDIDELAY"); if (delay) { - midiDelay_=atoi(delay) ; + midiDelay_=atoi(delay); } else { midiDelay_=0; } @@ -24,66 +22,54 @@ RTMidiService::RTMidiService() { // RtMidiIn constructor try { rtMidiIn_ = new RtMidiIn(); - } - catch ( RtError &error ) { - Trace::Error("Couldn't get RtMidiIn object") ; - rtMidiIn_=0 ; - Trace::Error(error.getMessageString()); + } catch ( RtError &error ) { + Trace::Log("RtMidiService", "Couldn't get RtMidiIn object"); + rtMidiIn_=0; + Trace::Log("RtMidiService", error.getMessageString()); } // RtMidiOut constructor try { rtMidiOut_ = new RtMidiOut(); + } catch ( RtError &error ) { + Trace::Log("RtMidiService", "Couldn't get RtMidiOut object"); + rtMidiOut_=0; + Trace::Log("RtMidiService", error.getMessageString()); } - catch ( RtError &error ) { - Trace::Error("Couldn't get RtMidiOut object") ; - rtMidiOut_=0 ; - Trace::Error(error.getMessageString()); - } - -} ; +}; RTMidiService::~RTMidiService() { -} ; - -void RTMidiService::buildDriverList() {// Here we just loop over existing Midi out and create a midi device for each of them. - - // Let's enumerate midi ins - - - // Check inputs. +}; +/* + * here we just loop over existing midi out and create a midi device for each of them + */ +void RTMidiService::buildDriverList() { + // check inputs unsigned int nPorts = (rtMidiIn_)?rtMidiIn_->getPortCount():0; - Trace::Log("MIDI","%d input port(s)",nPorts) ; - - for (uint i=0; igetPortName(i); - RTMidiInDevice *in=new RTMidiInDevice(i,portName.c_str()) ; - Trace::Log("MIDI"," %s",portName.c_str()) ; - inList_.Insert(in) ; + RTMidiInDevice *in = new RTMidiInDevice(i, portName.c_str()); + Trace::Log("RTMidiService", " %s", portName.c_str()); + inList_.Insert(in); } catch (RtError &error) { - Trace::Error(error.getMessageString()); + Trace::Log("RTMidiService", error.getMessageString()); } } - // Now check outputs. - + // check outputs nPorts = (rtMidiOut_)?rtMidiOut_->getPortCount():0; - Trace::Log("MIDI","%d output port(s)",nPorts) ; - for (uint i=0; igetPortName(i); - RTMidiOutDevice *out=new RTMidiOutDevice(*rtMidiOut_,i,portName.c_str()) ; - Trace::Log("MIDI"," %s",portName.c_str()) ; - Insert(out) ; - } - catch (RtError &error) - { - Trace::Error(error.getMessageString()); + RTMidiOutDevice *out = new RTMidiOutDevice(*rtMidiOut_,i,portName.c_str()); + Trace::Log("RTMidiService", " %s", portName.c_str()); + Insert(out); + } catch (RtError &error) { + Trace::Log("RTMidiService", error.getMessageString()); } } } - diff --git a/sources/Adapters/SDL/Audio/SDLAudioDriver.cpp b/sources/Adapters/SDL/Audio/SDLAudioDriver.cpp index e0aae34a..b454bcce 100644 --- a/sources/Adapters/SDL/Audio/SDLAudioDriver.cpp +++ b/sources/Adapters/SDL/Audio/SDLAudioDriver.cpp @@ -77,7 +77,11 @@ bool SDLAudioDriver::InitDriver() { // Allocates a rotating sound buffer unalignedMain_=(char *)SYS_MALLOC(fragSize_+SOUND_BUFFER_MAX) ; // Make sure the buffer is aligned +#ifdef _64BIT + mainBuffer_=(char *)unalignedMain_; +#else mainBuffer_=(char *)((((int)unalignedMain_)+1)&(0xFFFFFFFC)) ; +#endif Trace::Log("AUDIO","%s successfully opened with %d samples",bufferName,fragSize_/4 ) ; diff --git a/sources/Adapters/Unix/FileSystem/UnixFileSystem.cpp b/sources/Adapters/Unix/FileSystem/UnixFileSystem.cpp index e1c678d9..c4a38950 100644 --- a/sources/Adapters/Unix/FileSystem/UnixFileSystem.cpp +++ b/sources/Adapters/Unix/FileSystem/UnixFileSystem.cpp @@ -4,7 +4,11 @@ #include #include #include +#ifdef _64BIT +#include +#else #include +#endif #include #include #include @@ -133,7 +137,9 @@ long UnixFile::Tell() { } ; void UnixFile::Close() { fflush(file_) ; +#ifndef _64BIT fsync(fileno(file_)) ; +#endif fclose(file_) ; } ; diff --git a/sources/Application/Instruments/SampleInstrument.cpp b/sources/Application/Instruments/SampleInstrument.cpp index 74f4816d..7368f8fc 100644 --- a/sources/Application/Instruments/SampleInstrument.cpp +++ b/sources/Application/Instruments/SampleInstrument.cpp @@ -809,7 +809,11 @@ bool SampleInstrument::Render(int channel,fixed *buffer,int size,bool updateTick { if (useDirtyDownsampling_) { +#ifdef _64BIT + i1 =(short *)(((long)input)&dsMask); +#else i1 =(short *)(((unsigned int)input)&dsMask); +#endif } else { diff --git a/sources/Application/Instruments/SoundFontManager.cpp b/sources/Application/Instruments/SoundFontManager.cpp index 8d794f61..0acec549 100644 --- a/sources/Application/Instruments/SoundFontManager.cpp +++ b/sources/Application/Instruments/SoundFontManager.cpp @@ -2,6 +2,10 @@ #include "System/System/System.h" #include "System/FileSystem/FileSystem.h" +#ifdef _64BIT +#include +#endif + SoundFontManager::SoundFontManager() { } ; @@ -62,7 +66,11 @@ sfBankID SoundFontManager::LoadBank(const char *path) { current.dwEnd=(current.dwEnd-current.dwStart) ; current.dwStartloop=(current.dwStartloop-current.dwStart) ; current.dwEndloop=(current.dwEndloop-current.dwStart) ; +#ifdef _64BIT + current.dwStart=(intptr_t)buffer ; +#else current.dwStart=(DWORD)buffer ; +#endif sampleData_.push_back(buffer) ; } @@ -70,4 +78,4 @@ sfBankID SoundFontManager::LoadBank(const char *path) { SAFE_DELETE(fin) ; return id ; -} ; \ No newline at end of file +} ; diff --git a/sources/Application/Views/BaseClasses/UIActionField.cpp b/sources/Application/Views/BaseClasses/UIActionField.cpp index ea1fbee9..7bf3d732 100644 --- a/sources/Application/Views/BaseClasses/UIActionField.cpp +++ b/sources/Application/Views/BaseClasses/UIActionField.cpp @@ -31,7 +31,11 @@ void UIActionField::Draw(GUIWindow &w, int offset) { void UIActionField::OnClick() { SetChanged() ; +#ifdef _64BIT + NotifyObservers((I_ObservableData *) &fourcc_); +#else NotifyObservers((I_ObservableData *)fourcc_) ; +#endif } ; const char *UIActionField::GetString() { diff --git a/sources/Application/Views/BaseClasses/UITempoField.cpp b/sources/Application/Views/BaseClasses/UITempoField.cpp index ead33b3a..8ce009e3 100644 --- a/sources/Application/Views/BaseClasses/UITempoField.cpp +++ b/sources/Application/Views/BaseClasses/UITempoField.cpp @@ -24,7 +24,11 @@ void UITempoField::OnBClick() { void UITempoField::Update(Observable &,I_ObservableData *data) { SetChanged() ; +#ifdef _64BIT + NotifyObservers((I_ObservableData *) &action_); +#else NotifyObservers((I_ObservableData *)action_) ; +#endif } void UITempoField::ProcessArrow(unsigned short mask) { diff --git a/sources/Application/Views/ProjectView.cpp b/sources/Application/Views/ProjectView.cpp index de45660c..b4d656dd 100644 --- a/sources/Application/Views/ProjectView.cpp +++ b/sources/Application/Views/ProjectView.cpp @@ -202,7 +202,11 @@ void ProjectView::Update(Observable &,I_ObservableData *data) { return ; } +# ifdef _64BIT + int fourcc=*((int*)data); +#else int fourcc=(unsigned int)data ; +#endif UIField *focus=GetFocus() ; if (fourcc!=ACTION_TEMPO_CHANGED) { diff --git a/sources/System/Console/Trace.cpp b/sources/System/Console/Trace.cpp index 30d6971a..d18a7ba8 100644 --- a/sources/System/Console/Trace.cpp +++ b/sources/System/Console/Trace.cpp @@ -38,16 +38,19 @@ Trace::Logger *Trace::SetLogger(Trace::Logger& logger) //------------------------------------------------------------------------------ +#ifdef _64BIT +void Trace::VLog(const char* category, const char *fmt, va_list& args) +#else void Trace::VLog(const char* category, const char *fmt, const va_list& args) +#endif { char buffer[4096] ; sprintf(buffer, "[%s] ",category); char *ptr = buffer+strlen(buffer); - vsprintf(ptr,fmt,args ); + vsprintf(ptr, fmt, args); GetInstance()->AddLine(buffer) ; - } //------------------------------------------------------------------------------ diff --git a/sources/System/Console/Trace.h b/sources/System/Console/Trace.h index 761d527b..c62bb7e8 100644 --- a/sources/System/Console/Trace.h +++ b/sources/System/Console/Trace.h @@ -32,7 +32,11 @@ class Trace: public T_Singleton { Trace::Logger *SetLogger(Trace::Logger&); protected: +#ifdef _64BIT + static void VLog(const char* category, const char *fmt, va_list& args); +#else static void VLog(const char* category, const char *fmt, const va_list& args); +#endif private: Trace::Logger* logger_; } ; From ff68c0da81bcf4b6037385ae0bbb232f567ef9c8 Mon Sep 17 00:00:00 2001 From: Nine-H Date: Thu, 6 Jun 2024 22:06:07 +1000 Subject: [PATCH 09/66] chore: better logging for midiservice and mixerservice, some whitespace cleanups and comments --- sources/Application/Mixer/MixerService.cpp | 83 +++++---- sources/Services/Midi/MidiService.cpp | 195 ++++++++++----------- 2 files changed, 135 insertions(+), 143 deletions(-) diff --git a/sources/Application/Mixer/MixerService.cpp b/sources/Application/Mixer/MixerService.cpp index fcd1cc61..82a7f1bc 100644 --- a/sources/Application/Mixer/MixerService.cpp +++ b/sources/Application/Mixer/MixerService.cpp @@ -32,66 +32,63 @@ MixerService::MixerService(): MixerService::~MixerService() { } ; +/* + * initializes the mixer service, config changes depending if we're in sequencer or render mode + */ bool MixerService::Init() { - - out_=0 ; - - // Create the output depending on rendering mode - + // create the output depending on rendering mode + out_ = 0; switch (mode_) { case MSM_FILE: case MSM_FILESPLIT: - out_=new DummyAudioOut() ; + out_ = new DummyAudioOut(); break; default: - Audio *audio=Audio::GetInstance() ; - out_=audio->GetFirst() ; - break ; + Audio *audio = Audio::GetInstance(); + out_ = audio->GetFirst(); + break; } - bool result=false ; - for (int i=0;iInit(); + if (result) { + out_->Insert(master_); + } - result=out_->Init() ; - if (result) { - out_->Insert(master_) ; - } - - switch(mode_) { - case MSM_AUDIO: - break ; - case MSM_FILERT: - case MSM_FILE: - out_->SetFileRenderer("project:mixdown.wav") ; + switch(mode_) { + case MSM_AUDIO: break ; - case MSM_FILESPLITRT: - case MSM_FILESPLIT: - for (int i=0;iAddObserver(*MidiService::GetInstance()); + case MSM_FILERT: + case MSM_FILE: + out_->SetFileRenderer("project:mixdown.wav"); + break; + case MSM_FILESPLITRT: + case MSM_FILESPLIT: + for (int i=0;iAddObserver(*MidiService::GetInstance()); } - sync_=SDL_CreateMutex() ; - NAssert(sync_) ; + sync_=SDL_CreateMutex(); + NAssert(sync_); - if (result) - { - Trace::Debug("Out initialized") ; - } else { - Trace::Debug("Failed to get output") ; - } - return (result) ; -} ; + if (result) { + Trace::Log("MixerService", "output initialized"); + } else { + Trace::Log("MixerService", "failed to initialize output"); + } + return (result); +}; void MixerService::Close() { if (out_) { diff --git a/sources/Services/Midi/MidiService.cpp b/sources/Services/Midi/MidiService.cpp index d305343b..d456804a 100644 --- a/sources/Services/Midi/MidiService.cpp +++ b/sources/Services/Midi/MidiService.cpp @@ -4,6 +4,7 @@ #include "System/Timer/Timer.h" #include "Application/Model/Config.h" #include "Services/Audio/AudioDriver.h" +#include "System/Console/Trace.h" #ifdef SendMessage #undef SendMessage @@ -16,156 +17,147 @@ MidiService::MidiService(): sendSync_(true) { for (int i=0;i(true) ; - } - - const char *delay = Config::GetInstance()->GetValue("MIDIDELAY") ; - midiDelay_ = delay?atoi(delay):1 ; - - const char *sendSync = Config::GetInstance()->GetValue("MIDISENDSYNC") ; - if (sendSync) - { - sendSync_ = (strcmp(sendSync,"YES")==0) ; + queues_[i]=new T_SimpleList(true); } -} ; + const char *delay = Config::GetInstance()->GetValue("MIDIDELAY"); + midiDelay_ = delay?atoi(delay):1; + + const char *sendSync = Config::GetInstance()->GetValue("MIDISENDSYNC"); + if (sendSync) { + sendSync_ = (strcmp(sendSync,"YES")==0); + } +}; MidiService::~MidiService() { - Close() ; -} ; + Close(); +}; bool MidiService::Init() { - Empty() ; + Empty(); inList_.Empty(); - buildDriverList() ; + buildDriverList(); // Add a merger for the input - merger_=new MidiInMerger() ; - IteratorPtrit(inList_.GetIterator()) ; - for (it->Begin();!it->IsDone();it->Next()) { - MidiInDevice ¤t=it->CurrentItem() ; - merger_->Insert(current) ; + merger_=new MidiInMerger(); + IteratorPtrit(inList_.GetIterator()); + for (it->Begin();!it->IsDone();it->Next()) { + MidiInDevice ¤t=it->CurrentItem(); + merger_->Insert(current); } - return true ; -} ; + return true; +}; void MidiService::Close() { - Stop() ; -} ; + Stop(); +}; I_Iterator *MidiService::GetInIterator() { - return inList_.GetIterator() ; -} ; + return inList_.GetIterator(); +}; void MidiService::SelectDevice(const std::string &name) { - deviceName_=name ; -} ; + deviceName_ = name; +}; bool MidiService::Start() { - currentPlayQueue_=0 ; - currentOutQueue_=0 ; - return true ; + currentPlayQueue_ = 0; + currentOutQueue_ = 0; + return true; } ; void MidiService::Stop() { - stopDevice() ; + stopDevice(); } ; void MidiService::QueueMessage(MidiMessage &m) { - if (device_) - { - T_SimpleList *queue=queues_[currentPlayQueue_] ; - MidiMessage *ms=new MidiMessage(m.status_,m.data1_,m.data2_) ; - queue->Insert(ms) ; - } -} ; + if (device_) { + T_SimpleList *queue=queues_[currentPlayQueue_]; + MidiMessage *ms=new MidiMessage(m.status_,m.data1_,m.data2_); + queue->Insert(ms); + } +}; + +void MidiService::Trigger() { + AdvancePlayQueue(); -void MidiService::Trigger() -{ - AdvancePlayQueue(); - if (device_&&sendSync_) { - SyncMaster *sm=SyncMaster::GetInstance() ; + SyncMaster *sm=SyncMaster::GetInstance(); if (sm->MidiSlice()) { MidiMessage msg; msg.status_ = 0xF8; QueueMessage(msg); } - } } -void MidiService::AdvancePlayQueue() -{ - currentPlayQueue_=(currentPlayQueue_+1)%MIDI_MAX_BUFFERS ; - T_SimpleList *queue=queues_[currentPlayQueue_] ; - queue->Empty() ; +void MidiService::AdvancePlayQueue() { + currentPlayQueue_=(currentPlayQueue_+1)%MIDI_MAX_BUFFERS; + T_SimpleList *queue=queues_[currentPlayQueue_]; + queue->Empty(); } -void MidiService::Update(Observable &o,I_ObservableData *d) -{ +void MidiService::Update(Observable &o,I_ObservableData *d) { AudioDriver::Event *event=(AudioDriver::Event *)d; - if (event->type_ == AudioDriver::Event::ADET_DRIVERTICK) - { + if (event->type_ == AudioDriver::Event::ADET_DRIVERTICK) { onAudioTick(); } -} +}; -void MidiService::onAudioTick() -{ - if (tickToFlush_>0) - { - if (--tickToFlush_ ==0) - { - flushOutQueue(); - } - } +void MidiService::onAudioTick() { + if (tickToFlush_>0) { + if (--tickToFlush_ ==0) { + flushOutQueue(); + } + } } void MidiService::Flush() { + tickToFlush_ = midiDelay_; + if (tickToFlush_ == 0) { + flushOutQueue(); + } +}; - tickToFlush_ = midiDelay_ ; - if (tickToFlush_ == 0) - { - flushOutQueue(); - } -} ; - -void MidiService::flushOutQueue() -{ +void MidiService::flushOutQueue() { // Move queue positions - currentOutQueue_=(currentOutQueue_+1)%MIDI_MAX_BUFFERS ; - T_SimpleList *flushQueue=queues_[currentOutQueue_] ; + currentOutQueue_ = (currentOutQueue_+1) % MIDI_MAX_BUFFERS; + T_SimpleList *flushQueue=queues_[currentOutQueue_]; if (device_) { // Send whatever is on the out queue - device_->SendQueue(*flushQueue) ; + device_->SendQueue(*flushQueue); } - flushQueue->Empty() ; + flushQueue->Empty(); } +/* + * starts midi device + */ void MidiService::startDevice() { - - // look for the device - IteratorPtrit(GetIterator()) ; - for (it->Begin();!it->IsDone();it->Next()) { - MidiOutDevice ¤t=it->CurrentItem() ; - if (!strcmp(deviceName_.c_str(),current.GetName())) { + + for (it->Begin(); !it->IsDone(); it->Next()) { + MidiOutDevice ¤t = it->CurrentItem(); + if (!strcmp(deviceName_.c_str(), current.GetName())) { if (current.Init()) { if (current.Start()) { - device_=¤t ; + Trace::Log("MidiService", "midi device %s started", deviceName_.c_str()); + device_ = ¤t; } else { - current.Close() ; + Trace::Log("MidiService", "midi device %s failed to start", deviceName_.c_str()); + current.Close(); } } - break ; + break; } } +}; -} ; - +/* + * closes midi device + */ void MidiService::stopDevice() { if (device_) { device_->Stop() ; @@ -174,29 +166,32 @@ void MidiService::stopDevice() { device_=0 ; } ; +/* + * starts midi device when playback starts + */ void MidiService::OnPlayerStart() { - if (deviceName_.size()!=0) { - stopDevice() ; - startDevice() ; - deviceName_="" ; - } + stopDevice(); + startDevice(); + deviceName_=""; + } else { + startDevice(); + } - if (sendSync_) - { + if (sendSync_) { MidiMessage msg ; msg.status_=0xFA ; QueueMessage(msg) ; - } }; +/* + * queues midi stop message when player stops + */ void MidiService::OnPlayerStop() { - - if (sendSync_) - { + if (sendSync_) { MidiMessage msg ; msg.status_=0xFC ; QueueMessage(msg) ; } -} ; +}; From c70db19cc0983d90104f03cf7dfcffc1e9ee2856 Mon Sep 17 00:00:00 2001 From: Nine-H Date: Thu, 6 Jun 2024 22:39:41 +1000 Subject: [PATCH 10/66] feature: 32 bit using generic linux adapter --- projects/Makefile | 16 +++++++++------- projects/Makefile.X86 | 22 ++++++++++++++++++++++ 2 files changed, 31 insertions(+), 7 deletions(-) create mode 100644 projects/Makefile.X86 diff --git a/projects/Makefile b/projects/Makefile index 50e3dd46..452c5b6f 100644 --- a/projects/Makefile +++ b/projects/Makefile @@ -92,6 +92,7 @@ DEBDIRS := $(LINUXDIRS) $(JACKDIRS) $(RTAUDIODIRS) $(RTMIDIDIRS) RASPIDIRS := $(LINUXDIRS) $(JACKDIRS) $(RTAUDIODIRS) $(RTMIDIDIRS) STEAMDIRS := $(LINUXDIRS) $(JACKDIRS) $(RTAUDIODIRS) $(RTMIDIDIRS) X64DIRS := $(LINUXDIRS) $(RTMIDIDIRS) $(SDLAUDIODIRS) +X86DIRS := $(LINUXDIRS) $(JACKDIRS) $(RTAUDIODIRS) $(RTMIDIDIRS) #--------------------------------------------------------------------------------- # Consoles/Embedded @@ -267,25 +268,26 @@ RTAUDIOFILES := \ RtAudio.o RTMIDIFILES := \ - RtMidi.o\ - RTMidiService.o\ - RTMidiOutDevice.o\ + RtMidi.o \ + RTMidiService.o \ + RTMidiOutDevice.o \ RTMidiInDevice.o JACKFILES := \ JackAudioDriver.o \ JackClient.o \ - JackAudio.o + JackAudio.o SDLAUDIOFILES := \ SDLAudioDriver.o \ SDLAudio.o -DEBFILES := $(LINUXFILES) $(RTMIDIFILES) $(JACKFILES) +DEBFILES := $(LINUXFILES) $(RTAUDIOFILES) $(RTMIDIFILES) $(JACKFILES) BEAGLEBOARDFILES := $(LINUXFILES) $(DUMMYMIDIFILES) -RASPIFILES := $(LINUXFILES) $(RTMIDIFILES) $(JACKFILES) -STEAMFILES := $(LINUXFILES) $(RTMIDIFILES) $(JACKFILES) +RASPIFILES := $(LINUXFILES) $(RTAUDIOFILES) $(RTMIDIFILES) $(JACKFILES) +STEAMFILES := $(LINUXFILES) $(RTAUDIOFILES) $(RTMIDIFILES) $(JACKFILES) X64FILES := $(LINUXFILES) $(SDLAUDIOFILES) $(RTMIDIFILES) +X86FILES := $(LINUXFILES) $(RTAUDIOFILES) $(RTMIDIFILES) $(JACKFILES) #--------------------------------------------------------------------------------- # Consoles/Embedded diff --git a/projects/Makefile.X86 b/projects/Makefile.X86 new file mode 100644 index 00000000..60d6f4de --- /dev/null +++ b/projects/Makefile.X86 @@ -0,0 +1,22 @@ +-include $(PWD)/rules_base + +# config +DEFINES := \ + -DCPP_MEMORY \ + -D__LINUX_ALSA__ \ + -D__LINUX_ALSASEQ__ \ + -DJACKAUDIO \ + -DRTAUDIO \ + -DRTMIDI + +# optimization +CFLAGS := -m32 -O3 -Wall -I/usr/local/include -I$(PWD)/../sources +CXXFLAGS := $(CFLAGS) +LIBS := -L/local/lib -Wl,-rpath,/usr/local/lib -lasound -lSDL -ljack -lpthread +LDFLAGS := -m32 +OUTPUT = ../lgpt +EXTENSION := x86 + +# build rule +%.x86: $(OFILES) + $(CXX) $(LDFLAGS) -o $@ $(OFILES) $(LIBS) From 6f31a2bce102931f42e24456d591bdfba9bb9afd Mon Sep 17 00:00:00 2001 From: Simon Lees Date: Fri, 7 Jun 2024 11:09:52 +0930 Subject: [PATCH 11/66] Makefile X64: Use pkg-config for flags By using pkg-config to set the cflags and libs, the Makefile should work across all Linux distro's even if they move some libraries into non standard locations --- projects/Makefile.X64 | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/projects/Makefile.X64 b/projects/Makefile.X64 index 54f40eab..f461e902 100644 --- a/projects/Makefile.X64 +++ b/projects/Makefile.X64 @@ -9,10 +9,17 @@ DEFINES := \ -DSDLAUDIO \ -DRTMIDI +ALSA_CFLAGS := $(shell pkg-config alsa --cflags) +ALSA_LIBS := $(shell pkg-config alsa --libs) +JACK_CFLAGS := $(shell pkg-config jack --cflags) +JACK_LIBS := $(shell pkg-config jack --libs) +SDL_CFLAGS := $(shell pkg-config sdl --cflags) +SDL_LIBS := $(shell pkg-config sdl --libs) + # optimization -CFLAGS := $(DEFINES) -g -O3 -Wall -I/usr/local/include -I$(PWD)/../sources +CFLAGS := $(DEFINES) -g -O3 -Wall $(ALSA_CFLAGS) $(JACK_CFLAGS) $(SDL_CFLAGS) -I$(PWD)/../sources CXXFLAGS := $(CFLAGS) -std=gnu++03 -LIBS := -L/local/lib -Wl,-rpath,/usr/local/lib -lasound -lSDL -ljack -lpthread +LIBS := $(ALSA_LIBS) $(JACK_LIBS) $(SDL_LIBS) OUTPUT := ../lgpt EXTENSION := x64 From 55c89bfb2ff2e9d0c8fce8651198540aa6f26131 Mon Sep 17 00:00:00 2001 From: Simon Lees Date: Fri, 7 Jun 2024 22:35:43 +0930 Subject: [PATCH 12/66] SDL Audio: Flush Midi Buffers. Both the RtAudio and Picotracker implementations flush there midi queues multiple times per audio buffer fill. So the SDL implementation should probably do the same. The midi implementation seems to still have issues related to key presses and releases. --- sources/Adapters/SDL/Audio/SDLAudioDriver.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/Adapters/SDL/Audio/SDLAudioDriver.cpp b/sources/Adapters/SDL/Audio/SDLAudioDriver.cpp index b454bcce..1fb2cbc3 100644 --- a/sources/Adapters/SDL/Audio/SDLAudioDriver.cpp +++ b/sources/Adapters/SDL/Audio/SDLAudioDriver.cpp @@ -119,6 +119,7 @@ bool SDLAudioDriver::StartDriver() { for (int i=0;iAdvancePlayQueue(); } if (settings_.preBufferCount_==0) { thread_->Notify() ; @@ -164,6 +165,7 @@ void SDLAudioDriver::OnChunkDone(Uint8 *stream,int len) { memcpy(mainBuffer_+bufferSize_-bufferPos_, pool_[poolPlayPosition_].buffer_,pool_[poolPlayPosition_].size_); + MidiService::GetInstance()->Flush() ; // Adapt buffer variables bufferSize_=bufferSize_-bufferPos_+pool_[poolPlayPosition_].size_ ; From d39e03b7db2b23d252fed19b340d93d3857d247b Mon Sep 17 00:00:00 2001 From: Simon Lees Date: Wed, 31 Jul 2024 20:49:28 +0930 Subject: [PATCH 13/66] SDL2: Add initial implementation This is based off the SDL code with the unsupported platforms removed. Currently this implementation isn't in use. --- sources/Adapters/Audio/SDLAudio.cpp | 39 ++ sources/Adapters/Audio/SDLAudio.h | 17 + sources/Adapters/Audio/SDLAudioDriver.cpp | 198 ++++++++ sources/Adapters/Audio/SDLAudioDriver.h | 51 ++ sources/Adapters/GUI/GUIFactory.cpp | 18 + sources/Adapters/GUI/GUIFactory.h | 18 + sources/Adapters/GUI/SDLEventManager.cpp | 171 +++++++ sources/Adapters/GUI/SDLEventManager.h | 36 ++ sources/Adapters/GUI/SDLGUIWindowImp.cpp | 543 ++++++++++++++++++++++ sources/Adapters/GUI/SDLGUIWindowImp.h | 69 +++ sources/Adapters/Input/SDLInput.cpp | 203 ++++++++ sources/Adapters/Input/SDLInput.h | 35 ++ sources/Adapters/Process/SDLProcess.cpp | 54 +++ sources/Adapters/Process/SDLProcess.h | 23 + sources/Adapters/Timer/SDLTimer.cpp | 73 +++ sources/Adapters/Timer/SDLTimer.h | 32 ++ 16 files changed, 1580 insertions(+) create mode 100644 sources/Adapters/Audio/SDLAudio.cpp create mode 100644 sources/Adapters/Audio/SDLAudio.h create mode 100644 sources/Adapters/Audio/SDLAudioDriver.cpp create mode 100644 sources/Adapters/Audio/SDLAudioDriver.h create mode 100644 sources/Adapters/GUI/GUIFactory.cpp create mode 100644 sources/Adapters/GUI/GUIFactory.h create mode 100644 sources/Adapters/GUI/SDLEventManager.cpp create mode 100644 sources/Adapters/GUI/SDLEventManager.h create mode 100644 sources/Adapters/GUI/SDLGUIWindowImp.cpp create mode 100644 sources/Adapters/GUI/SDLGUIWindowImp.h create mode 100644 sources/Adapters/Input/SDLInput.cpp create mode 100644 sources/Adapters/Input/SDLInput.h create mode 100644 sources/Adapters/Process/SDLProcess.cpp create mode 100644 sources/Adapters/Process/SDLProcess.h create mode 100644 sources/Adapters/Timer/SDLTimer.cpp create mode 100644 sources/Adapters/Timer/SDLTimer.h diff --git a/sources/Adapters/Audio/SDLAudio.cpp b/sources/Adapters/Audio/SDLAudio.cpp new file mode 100644 index 00000000..79d92088 --- /dev/null +++ b/sources/Adapters/Audio/SDLAudio.cpp @@ -0,0 +1,39 @@ + +#include "SDLAudio.h" +#include "SDLAudioDriver.h" +#include "Services/Audio/AudioOutDriver.h" + +SDLAudio::SDLAudio(AudioSettings &hints):Audio(hints) { + hints_=hints; +} + +SDLAudio::~SDLAudio() { +} + +void SDLAudio::Init() { + AudioSettings settings ; + settings.audioAPI_=GetAudioAPI(); + + settings.bufferSize_=GetAudioBufferSize() ; + settings.preBufferCount_=GetAudioPreBufferCount() ; + + + SDLAudioDriver *drv=new SDLAudioDriver(settings) ; + AudioOut *out=new AudioOutDriver(*drv) ; + Insert(out) ; +} ; + +void SDLAudio::Close() { + IteratorPtrit(GetIterator()) ; + for (it->Begin();!it->IsDone();it->Next()) { + AudioOut ¤t=it->CurrentItem() ; + current.Close() ; + } +} ; + +int SDLAudio::GetMixerVolume() { + return 100 ; +} ; + +void SDLAudio::SetMixerVolume(int volume) { +} ; diff --git a/sources/Adapters/Audio/SDLAudio.h b/sources/Adapters/Audio/SDLAudio.h new file mode 100644 index 00000000..b178b848 --- /dev/null +++ b/sources/Adapters/Audio/SDLAudio.h @@ -0,0 +1,17 @@ +#ifndef _SDL_AUDIO_H_ +#define _SDL_AUDIO_H_ + +#include "Services/Audio/Audio.h" + +class SDLAudio: public Audio { +public: + SDLAudio(AudioSettings &hints) ; // Allow for different default size for different platform + ~SDLAudio() ; + virtual void Init() ; + virtual void Close() ; + virtual int GetMixerVolume() ; + virtual void SetMixerVolume(int volume) ; +private: + AudioSettings hints_ ; +}; +#endif diff --git a/sources/Adapters/Audio/SDLAudioDriver.cpp b/sources/Adapters/Audio/SDLAudioDriver.cpp new file mode 100644 index 00000000..3755f822 --- /dev/null +++ b/sources/Adapters/Audio/SDLAudioDriver.cpp @@ -0,0 +1,198 @@ +#include "SDLAudioDriver.h" +#include "System/Console/Trace.h" +#include "Services/Time/TimeService.h" +#include "System/System/System.h" +#include "Services/Midi/MidiService.h" + +void sdl_callback(void *userdata, Uint8 *stream, int len) { + SDLAudioDriver *sound=(SDLAudioDriver *)userdata ; + sound->OnChunkDone(stream,len) ; +} ; + +SDLAudioDriverThread::SDLAudioDriverThread(SDLAudioDriver *driver) { + semaphore_=SysSemaphore::Create(0,4) ; + driver_=driver ; +} ; + +bool SDLAudioDriverThread::Execute() { + while (!shouldTerminate()) { + semaphore_->Wait() ; + driver_->OnNewBufferNeeded(); + } ; + SysSemaphore *semaphore=semaphore_ ; + semaphore_=0 ; + delete semaphore ; + return true ; +} ; + +void SDLAudioDriverThread::Notify() { + if (semaphore_) { + semaphore_->Post() ; + } +} ; + +void SDLAudioDriverThread::RequestTermination() { + SysThread::RequestTermination() ; + // post to be sure we're not locked + semaphore_->Post() ; + // Wait for thread to finish + SDL_Delay(10) ; +} + +//------------------------------------------------------------------------------------------------- + +SDLAudioDriver::SDLAudioDriver(AudioSettings &settings):AudioDriver(settings), + unalignedMain_(0), + miniBlank_(0) +{ + isPlaying_=false ; + thread_=0 ; +} + +SDLAudioDriver::~SDLAudioDriver() { +} + +struct SDL_AudioSpec input ; +struct SDL_AudioSpec returned ; + +bool SDLAudioDriver::InitDriver() { + + //set sound + input.freq=44100 ; + input.format=AUDIO_S16SYS ; + input.channels=2 ; + input.callback=sdl_callback ; + input.samples=settings_.bufferSize_ ; + input.userdata=this ; + + // On my machine this wasn't working. + // SDL_AudioDeviceID deviceId = SDL_OpenAudioDevice(NULL,0,&input,&returned,0); + // The above may return 0 meaning an error or success. + int ret = SDL_OpenAudio(&input,&returned); + if ( ret != 0 ) + { + Trace::Error("Couldn't open sdl audio: %s\n", SDL_GetError()); + return false ; + } + const char * driverName = SDL_GetCurrentAudioDriver() ; + + fragSize_=returned.size ; + // Allocates a rotating sound buffer + unalignedMain_=(char *)SYS_MALLOC(fragSize_+SOUND_BUFFER_MAX) ; + // Make sure the buffer is aligned +#ifdef _64BIT + mainBuffer_=(char *)unalignedMain_; +#else + mainBuffer_=(char *)((((int)unalignedMain_)+1)&(0xFFFFFFFC)) ; +#endif + + Trace::Log("AUDIO","%s successfully opened with %d samples",driverName,fragSize_/4 ) ; + + // Create mini blank buffer in case of underruns + + miniBlank_=(char *)malloc(fragSize_) ; + SYS_MEMSET(miniBlank_,0,fragSize_) ; + + return true ; +} ; + +void SDLAudioDriver::CloseDriver() { + + if (miniBlank_) { + SYS_FREE(miniBlank_) ; + miniBlank_=0 ; + } + + if (unalignedMain_) { + SYS_FREE (unalignedMain_) ; + unalignedMain_=0 ; + } ; + SDL_CloseAudio(); +} ; + +bool SDLAudioDriver::StartDriver() { + + thread_=new SDLAudioDriverThread(this) ; + thread_->Start() ; + + short blank[4000] ; + SYS_MEMSET(blank,0,4000) ; + bufferPos_=0 ; + bufferSize_=0 ; + + for (int i=0;iAdvancePlayQueue(); + } + if (settings_.preBufferCount_==0) { + thread_->Notify() ; + } + + SDL_PauseAudio(0); + startTime_=SDL_GetTicks() ; + + return 1 ; +} ; + +void SDLAudioDriver::StopDriver() { + if (thread_) { + thread_->RequestTermination() ; + SysThread *thread=thread_ ; + thread_=0 ; + SDL_PauseAudio(1); + delete thread ; + } ; +} ; + +double SDLAudioDriver::GetStreamTime() { + return (SDL_GetTicks()-startTime_)/1000.0 ; +} + +void SDLAudioDriver::OnChunkDone(Uint8 *stream,int len) { + + // Look if we have enough data in main buffer + + while (bufferSize_-bufferPos_Flush() ; + // Adapt buffer variables + + bufferSize_=bufferSize_-bufferPos_+pool_[poolPlayPosition_].size_ ; + bufferPos_=0 ; + + SYS_FREE( pool_[poolPlayPosition_].buffer_) ; + + pool_[poolPlayPosition_].buffer_=0 ; + poolPlayPosition_=(poolPlayPosition_+1)%SOUND_BUFFER_COUNT ; + if (thread_) thread_->Notify() ; + + } + } + // Now dump audio to the device + + SYS_MEMCPY(stream,(short *)(mainBuffer_+bufferPos_), len); + onAudioBufferTick(); + bufferPos_+=len ; +} + +int SDLAudioDriver::GetPlayedBufferPercentage() { +// return 100-(bufferSize_-bufferPos_-fragSize_)*100/(bufferSize_-fragSize_) ; + return 0 ; +} ; + + + diff --git a/sources/Adapters/Audio/SDLAudioDriver.h b/sources/Adapters/Audio/SDLAudioDriver.h new file mode 100644 index 00000000..6df6d530 --- /dev/null +++ b/sources/Adapters/Audio/SDLAudioDriver.h @@ -0,0 +1,51 @@ +#ifndef _SDL_SOUND_H_ +#define _SDL_SOUND_H_ + +#include "Services/Audio/AudioDriver.h" +#include +#include "System/Process/Process.h" + +class SDLAudioDriver ; + +class SDLAudioDriverThread: public SysThread { +public: + SDLAudioDriverThread(SDLAudioDriver *driver) ; + virtual ~SDLAudioDriverThread() {} ; + virtual bool Execute() ; + virtual void RequestTermination() ; + void Notify() ; +private: + SDLAudioDriver *driver_ ; + SysSemaphore *semaphore_ ; +} ; + +class SDLAudioDriver:public AudioDriver { +public: + SDLAudioDriver(AudioSettings &settings) ; + virtual ~SDLAudioDriver() ; + + // Sound implementation + virtual bool InitDriver() ; + virtual void CloseDriver(); + virtual bool StartDriver() ; + virtual void StopDriver(); + virtual int GetPlayedBufferPercentage() ; + virtual int GetSampleRate() { return 44100 ; } ; + virtual bool Interlaced() { return true ; } ; + virtual double GetStreamTime() ; + // Additional + void OnChunkDone(Uint8 *stream,int len) ; + +private: + int fragSize_ ; // Actual fragsize used by the driver + char *unalignedMain_ ; + char *mainBuffer_ ; + char *miniBlank_ ; + int bufferPos_ ; + int bufferSize_ ; + SDLAudioDriverThread *thread_ ; + Uint32 startTime_ ; +} ; + + +#endif diff --git a/sources/Adapters/GUI/GUIFactory.cpp b/sources/Adapters/GUI/GUIFactory.cpp new file mode 100644 index 00000000..bbc9f050 --- /dev/null +++ b/sources/Adapters/GUI/GUIFactory.cpp @@ -0,0 +1,18 @@ +#include "GUIFactory.h" +#include "SDLGUIWindowImp.h" +#include "SDLEventManager.h" +#ifndef _USE_NCURSES_ + + +GUIFactory::GUIFactory() { +} ; + + +I_GUIWindowImp &GUIFactory::CreateWindowImp(GUICreateWindowParams &p) { + return *(new SDLGUIWindowImp(p)) ; +} + +EventManager *GUIFactory::GetEventManager() { + return SDLEventManager::GetInstance() ; +} +#endif \ No newline at end of file diff --git a/sources/Adapters/GUI/GUIFactory.h b/sources/Adapters/GUI/GUIFactory.h new file mode 100644 index 00000000..5a484731 --- /dev/null +++ b/sources/Adapters/GUI/GUIFactory.h @@ -0,0 +1,18 @@ +#ifndef SDL_GUI_FACTORY_H_ +#define SDL_GUI_FACTORY_H_ + +#ifndef _USE_NCURSES_ + +#include "UIFramework/Interfaces/I_GUIWindowFactory.h" + +class GUIFactory: public I_GUIWindowFactory { + +public: + GUIFactory() ; + virtual I_GUIWindowImp &CreateWindowImp(GUICreateWindowParams &) ; + virtual EventManager *GetEventManager() ; + +} ; + +#endif +#endif diff --git a/sources/Adapters/GUI/SDLEventManager.cpp b/sources/Adapters/GUI/SDLEventManager.cpp new file mode 100644 index 00000000..21308f6a --- /dev/null +++ b/sources/Adapters/GUI/SDLEventManager.cpp @@ -0,0 +1,171 @@ + +#include "SDLEventManager.h" +#include "Application/Application.h" +#include "UIFramework/BasicDatas/GUIEvent.h" +#include "SDLGUIWindowImp.h" +#include "Application/Model/Config.h" +#include "System/Console/Trace.h" +bool SDLEventManager::finished_=false ; +bool SDLEventManager::dumpEvent_=false ; + +SDLEventManager::SDLEventManager() +{ +} + +SDLEventManager::~SDLEventManager() +{ +} + +bool SDLEventManager::Init() +{ + EventManager::Init() ; + + if ( SDL_Init(SDL_INIT_VIDEO|SDL_INIT_JOYSTICK|SDL_INIT_TIMER) < 0 ) + { + return false; + } + + SDL_ShowCursor(SDL_DISABLE); + + atexit(SDL_Quit) ; + + SDL_InitSubSystem(SDL_INIT_JOYSTICK); + + int joyCount=SDL_NumJoysticks() ; + joyCount=(joyCount>MAX_JOY_COUNT)?MAX_JOY_COUNT:joyCount ; + + keyboardCS_=new KeyboardControllerSource("keyboard") ; + const char *dumpIt=Config::GetInstance()->GetValue("DUMPEVENT") ; + if ((dumpIt)&&(!strcmp(dumpIt,"YES"))) + { + dumpEvent_=true ; + } + + for (int i=0;iGetWindow() ; + SDLGUIWindowImp *sdlWindow=(SDLGUIWindowImp *)appWindow->GetImpWindow() ; + while (!finished_) + { + SDL_Event event; + if (SDL_WaitEvent(&event)) + { + switch (event.type) { + case SDL_KEYDOWN: + if (dumpEvent_) + { + Trace::Log("EVENT","key(%s:%d):%d",SDL_GetScancodeName(event.key.keysym.scancode),event.key.keysym.scancode,1) ; + } + keyboardCS_->SetKey((int)event.key.keysym.scancode,true) ; + break ; + + case SDL_KEYUP: + if (dumpEvent_) + { + Trace::Log("EVENT","key(%s:%d):%d",SDL_GetScancodeName(event.key.keysym.scancode),event.key.keysym.scancode,0) ; + } + keyboardCS_->SetKey((int)event.key.keysym.scancode,false) ; + break ; + + + case SDL_JOYBUTTONDOWN: + buttonCS_[event.jbutton.which]->SetButton(event.jbutton.button,true) ; + break ; + case SDL_JOYBUTTONUP: + if (dumpEvent_) { + Trace::Log("EVENT","but(%d):%d",event.button.which,event.jbutton.button) ; + } + buttonCS_[event.jbutton.which]->SetButton(event.jbutton.button,false) ; + break ; + case SDL_JOYAXISMOTION: + if (dumpEvent_) { + Trace::Log("EVENT","joy(%d)::%d=%d",event.jaxis.which,event.jaxis.axis,event.jaxis.value) ; + } + joystickCS_[event.jaxis.which]->SetAxis(event.jaxis.axis,float(event.jaxis.value)/32767.0f) ; + break ; + case SDL_JOYHATMOTION: + if (dumpEvent_) + { + for (int i=0;i<4;i++) + { + int mask = 1<SetHat(event.jhat.hat,event.jhat.value) ; + break ; + case SDL_JOYBALLMOTION: + if (dumpEvent_) + { + Trace::Log("EVENT","ball(%d)::%d=(%d,%d)",event.jball.which,event.jball.ball,event.jball.xrel,event.jball.yrel) ; + } + break ; + } + + switch (event.type) + { + + case SDL_QUIT: + sdlWindow->ProcessQuit() ; + break ; + case SDL_WINDOWEVENT: + switch (event.window.event) + { + case SDL_WINDOWEVENT_EXPOSED: + case SDL_WINDOWEVENT_RESIZED: + case SDL_WINDOWEVENT_SIZE_CHANGED: + sdlWindow->ProcessExpose() ; + break; + } + break ; + case SDL_USEREVENT: + sdlWindow->ProcessUserEvent(event) ; + break ; + } + } + } + return 0 ; +} ; + + + +void SDLEventManager::PostQuitMessage() +{ + Trace::Log("EVENT","SDEM:PostQuitMessage()") ; + finished_=true ; +} ; + + +int SDLEventManager::GetKeyCode(const char *key) +{ + return SDL_GetScancodeFromName(key); +} diff --git a/sources/Adapters/GUI/SDLEventManager.h b/sources/Adapters/GUI/SDLEventManager.h new file mode 100644 index 00000000..60f6c146 --- /dev/null +++ b/sources/Adapters/GUI/SDLEventManager.h @@ -0,0 +1,36 @@ +#ifndef _SDL_EVENT_MANAGER_ +#define _SDL_EVENT_MANAGER_ + +#include "Foundation/T_Singleton.h" +#include "UIFramework/SimpleBaseClasses/EventManager.h" +#include "Services/Controllers/ButtonControllerSource.h" +#include "Services/Controllers/JoystickControllerSource.h" +#include "Services/Controllers/HatControllerSource.h" +#include "Services/Controllers/KeyboardControllerSource.h" +#include + +#include + +#define MAX_JOY_COUNT 4 + + + +class SDLEventManager: public T_Singleton,public EventManager { +public: + SDLEventManager() ; + ~SDLEventManager() ; + virtual bool Init() ; + virtual int MainLoop() ; + virtual void PostQuitMessage() ; + virtual int GetKeyCode(const char *name) ; + +private: + static bool finished_ ; + static bool dumpEvent_ ; + SDL_Joystick *joystick_[MAX_JOY_COUNT]; + ButtonControllerSource *buttonCS_[MAX_JOY_COUNT] ; + JoystickControllerSource *joystickCS_[MAX_JOY_COUNT] ; + HatControllerSource *hatCS_[MAX_JOY_COUNT] ; + KeyboardControllerSource *keyboardCS_ ; +} ; +#endif diff --git a/sources/Adapters/GUI/SDLGUIWindowImp.cpp b/sources/Adapters/GUI/SDLGUIWindowImp.cpp new file mode 100644 index 00000000..ed909143 --- /dev/null +++ b/sources/Adapters/GUI/SDLGUIWindowImp.cpp @@ -0,0 +1,543 @@ +#include "SDLGUIWindowImp.h" +#include "UIFramework/SimpleBaseClasses/GUIWindow.h" +#include "System/System/System.h" +#include "Application/Model/Config.h" +#include "System/Console/Trace.h" +#include +#include "System/Console/n_assert.h" +#include "Application/Utils/char.h" +#include +#include "UIFramework/BasicDatas/GUIEvent.h" + +SDLGUIWindowImp *instance_ ; + +unsigned short appWidth=320 ; +unsigned short appHeight=240 ; + +SDLGUIWindowImp::SDLGUIWindowImp(GUICreateWindowParams &p) +{ + + SDLCreateWindowParams &sdlP=(SDLCreateWindowParams &)p; + cacheFonts_=sdlP.cacheFonts_ ; + framebuffer_=sdlP.framebuffer_ ; + + // By default if we are not running a framebuffer device + // we assumed it's windowed + + windowed_ = !framebuffer_; + + + SDL_DisplayMode displayMode; + + // SDL Prioritises screens so just take the first for now. + int displayModeRet = SDL_GetDisplayMode(0, 0, &displayMode); + NAssert(displayModeRet != 0); + + #if defined(PLATFORM_PSP) + int screenWidth = 480; + int screenHeight = 272; + windowed_ = false; + #elif defined(RS97) + int screenWidth = 320; + int screenHeight = 240; + windowed_ = false; + #else + int screenWidth = displayMode.w; + int screenHeight = displayMode.h; + #endif + + #if defined(RS97) + /* Pick the best bitdepth for the RS97 as it will select 32 as its default, even though that's slow */ + bitDepth_ = 16; + #else + bitDepth_ = SDL_BITSPERPIXEL(displayMode.format); + #endif + + const char * driverName = SDL_GetVideoDriver(0); + + Trace::Log("DISPLAY","Using driver %s. Screen (%d,%d) Bpp:%d",driverName,screenWidth,screenHeight,bitDepth_); + + bool fullscreen=false ; + + const char *fullscreenValue=Config::GetInstance()->GetValue("FULLSCREEN") ; + if ((fullscreenValue)&&(!strcmp(fullscreenValue,"YES"))) + { + fullscreen=true ; + } + + if (!strcmp(driverName, "fbcon")) + { + framebuffer_ = true; + windowed_ = false; + } + + #ifdef PLATFORM_PSP + mult_ = 1; + #else + int multFromSize=MIN(screenHeight/appHeight,screenWidth/appWidth); + const char *mult=Config::GetInstance()->GetValue("SCREENMULT") ; + if (mult) + { + mult_=atoi(mult); + } + else + { + if (framebuffer_) + { + mult_ = multFromSize; + } + else + { + mult_ = 1; + } + } + #endif + // Create a window that is the requested size + + screenRect_._topLeft._x=0; + screenRect_._topLeft._y=0; + screenRect_._bottomRight._x=windowed_?appWidth*mult_:screenWidth; + screenRect_._bottomRight._y=windowed_?appHeight*mult_:screenHeight; + + Trace::Log("DISPLAY","Creating SDL Window (%d,%d)",screenRect_.Width(), screenRect_.Height()); + window_ = SDL_CreateWindow("LittleGPTracker",SDL_WINDOWPOS_UNDEFINED,SDL_WINDOWPOS_UNDEFINED, + screenRect_.Width(),screenRect_.Height(),fullscreen?SDL_WINDOW_FULLSCREEN:SDL_WINDOW_SHOWN); + NAssert(window_) ; + + // Compute the x & y offset to locate our app window + + appAnchorX_=(screenRect_.Width()-appWidth*mult_)/2 ; + appAnchorY_=(screenRect_.Height()-appHeight*mult_)/2 ; + + SDL_SetWindowIcon(window_, SDL_LoadBMP("lgpt_icon.bmp")); + surface_ = SDL_GetWindowSurface(window_); + + NAssert(surface_) ; + + Uint32 rmask, gmask, bmask, amask; + +#if SDL_BYTEORDER == SDL_BIG_ENDIAN + rmask = 0xff000000; + gmask = 0x00ff0000; + bmask = 0x0000ff00; + amask = 0x000000ff; +#else + rmask = 0x000000ff; + gmask = 0x0000ff00; + bmask = 0x00ff0000; + amask = 0xff000000; +#endif + + instance_=this ; + currentColor_=0; + backgroundColor_=0 ; + SDL_ShowCursor(SDL_DISABLE); + + + if (cacheFonts_) + { + Trace::Log("DISPLAY","Preparing fonts") ; + prepareFonts() ; + } + updateCount_=0 ; +} ; + +SDLGUIWindowImp::~SDLGUIWindowImp() { + +} + +#define FONT_WIDTH 1024 +#define FONT_COUNT 127 +static const unsigned char font[]= { + #include "Resources/font.h" +}; + +static SDL_Surface *fonts[FONT_COUNT] ; + +void SDLGUIWindowImp::prepareFullFonts() +{ + Trace::Log("DISPLAY","Preparing full font cache") ; + Uint32 rmask, gmask, bmask, amask; + +#if SDL_BYTEORDER == SDL_BIG_ENDIAN + rmask = 0xff000000; + gmask = 0x00ff0000; + bmask = 0x0000ff00; + amask = 0x000000ff; +#else + rmask = 0x000000ff; + gmask = 0x0000ff00; + bmask = 0x00ff0000; + amask = 0xff000000; +#endif + + for (int i=0;iformat->BytesPerPixel ; + unsigned char *bgPtr=(unsigned char *)&backgroundColor_ ; + unsigned char *fgPtr=(unsigned char *)&foregroundColor_ ; +#if SDL_BYTEORDER == SDL_BIG_ENDIAN + bgPtr+=(4-pixelSize) ; + fgPtr+=(4-pixelSize) ; +#endif + const unsigned char *src=font+i*8 ; + unsigned char *dest=(unsigned char *)fonts[i]->pixels; + for (int y = 0; y < 8; y++) + { + for (int n=0;npitch-8*pixelSize*mult_ ; + } + if (y<7) src+=FONT_WIDTH ; + } + SDL_UnlockSurface(fonts[i]) ; + }; + }; +} + +void SDLGUIWindowImp::prepareFonts() +{ + + Trace::Log("DISPLAY","Preparing font cache") ; + Config *config=Config::GetInstance() ; + + unsigned char r,g,b ; + const char *value=config->GetValue("BACKGROUND") ; + if (value) + { + char2hex(value,&r) ; + char2hex(value+2,&g) ; + char2hex(value+4,&b) ; + } + else + { + r=0xF1 ; + g=0xF1 ; + b=0x96 ; + } + backgroundColor_=SDL_MapRGB(surface_->format, r,g,b) ; + + value=config->GetValue("FOREGROUND") ; + if (value) + { + char2hex(value,&r) ; + char2hex(value+2,&g) ; + char2hex(value+4,&b) ; + } + else + { + r=0x77 ; + g=0x6B ; + b=0x56 ; + } + foregroundColor_=SDL_MapRGB(surface_->format, r,g,b) ; + + prepareFullFonts() ; +} + +void SDLGUIWindowImp::DrawChar(const char c, GUIPoint &pos, GUITextProperties &p) +{ + int xx,yy; + transform(pos, &xx, &yy); + + if ((xx<0) || (yy<0)) return; + if ((xx>=screenRect_._bottomRight._x) || (yy>=screenRect_._bottomRight._y)) + return ; + if ((!framebuffer_)&&(updateCount_x=xx ; + area->y=yy ; + area->h=8*mult_ ; + area->w=8*mult_ ; + } + + if (((cacheFonts_)&&(currentColor_==foregroundColor_)&&(!p.invert_))) { + + SDL_Rect srcRect ; + srcRect.x=0 ; + srcRect.y=0 ; + srcRect.w=8*mult_ ; + srcRect.h=8*mult_ ; + + SDL_Rect dstRect ; + dstRect.x=xx ; + dstRect.y=yy ; + dstRect.w=8*mult_ ; + dstRect.h=8*mult_ ; + + unsigned int fontID=c ; + if (fontIDformat->BytesPerPixel ; + unsigned char *bgPtr=(unsigned char *)&backgroundColor_ ; + unsigned char *fgPtr=(unsigned char *)¤tColor_ ; +#if SDL_BYTEORDER == SDL_BIG_ENDIAN + bgPtr+=(4-pixelSize) ; + fgPtr+=(4-pixelSize) ; +#endif + const unsigned char *src=font+c*8 ; + unsigned char *dest=((unsigned char *)surface_->pixels) + (yy*surface_->pitch) + xx*pixelSize; + + for (int y = 0; y < 8; y++) { + for (int n=0;npitch-8*pixelSize*mult_ ; + } + if (y<7) src+=FONT_WIDTH ; + } + + } +} + +void SDLGUIWindowImp::transform(const GUIRect &srcRect,SDL_Rect *dstRect) +{ + dstRect->x = srcRect.Left() * mult_ + appAnchorX_; + dstRect->y = srcRect.Top() * mult_ + appAnchorY_; + dstRect->w = srcRect.Width() * mult_ ; + dstRect->h = srcRect.Height() * mult_ ; +} + +void SDLGUIWindowImp::transform(const GUIPoint &srcPoint, int *x, int *y) +{ + *x=appAnchorX_ + srcPoint._x*mult_ ; + *y=appAnchorY_ + srcPoint._y*mult_ ; +} + +void SDLGUIWindowImp::DrawString(const char *string,GUIPoint &pos,GUITextProperties &p,bool overlay) +{ + + int len=int(strlen(string)) ; + int xx,yy; + transform(pos, &xx , &yy); + + if ((!framebuffer_)&&(updateCount_x=xx ; + area->y=yy ; + area->h=8*mult_ ; + area->w=len*8*mult_ ; + } + + for (int l=0;lformat->BytesPerPixel ; + unsigned char *bgPtr=(unsigned char *)&backgroundColor_ ; + unsigned char *fgPtr=(unsigned char *)¤tColor_ ; +#if SDL_BYTEORDER == SDL_BIG_ENDIAN + bgPtr+=(4-pixelSize) ; + fgPtr+=(4-pixelSize) ; +#endif + const unsigned char *src=font+(string[l]*8) ; + unsigned char *dest=((unsigned char *)surface_->pixels) + (yy*surface_->pitch) + xx*pixelSize; + + for (int y = 0; y < 8; y++) { + for (int n=0;npitch-8*pixelSize*mult_ ; + } + if (y<7) src+=FONT_WIDTH ; + } + + } + xx+=8*mult_ ; + } +} + +void SDLGUIWindowImp::DrawRect(GUIRect &r) +{ + SDL_Rect rect; + transform(r, &rect); + SDL_FillRect(surface_, &rect,currentColor_) ; +} ; + +void SDLGUIWindowImp::Clear(GUIColor &c,bool overlay) +{ + SDL_Rect rect; + rect.x = 0; + rect.y = 0; + rect.w = screenRect_.Width(); + rect.h = screenRect_.Height(); + + backgroundColor_=SDL_MapRGB(surface_->format,c._r&0xFF,c._g&0xFF,c._b&0xFF); + SDL_FillRect(surface_, &rect,backgroundColor_) ; + + if (!framebuffer_) + { + SDL_Rect *area=updateRects_; + area->x=rect.x ; + area->y=rect.y ; + area->w=rect.w ; + area->h=rect.h ; + updateCount_=1 ; + } +} + +void SDLGUIWindowImp::ClearRect(GUIRect &r) +{ + SDL_Rect rect; + transform(r, &rect); + SDL_FillRect(surface_, &rect,backgroundColor_) ; +} + +// To the app we might have a smaller window +// than the effective one (PSP) + +GUIRect SDLGUIWindowImp::GetRect() +{ + return GUIRect(0,0,appWidth,appHeight) ; +} + +// Pushback a SDL event to specify screen has to be redrawn. + +void SDLGUIWindowImp::Invalidate() +{ + // Todo: SL: Haven't found a good replacement here yet + SDL_Event event ; + event.type=SDL_WINDOWEVENT ; + event.window.event = SDL_WINDOWEVENT_EXPOSED; + SDL_PushEvent(&event) ; +} + +void SDLGUIWindowImp::SetColor(GUIColor &c) +{ + currentColor_=SDL_MapRGB(surface_->format,c._r&0xFF,c._g&0xFF,c._b&0xFF); +} + +void SDLGUIWindowImp::Lock() +{ + if (framebuffer_) + { + return; + } + + if (SDL_MUSTLOCK(surface_)) + { + SDL_LockSurface(surface_) ; + } +} + +void SDLGUIWindowImp::Unlock() +{ + if (framebuffer_) + { + return; + } + + if (SDL_MUSTLOCK(surface_)) + { + SDL_UnlockSurface(surface_) ; + } +} + +void SDLGUIWindowImp::Flush() +{ + // blit partial updates on resource constrained platforms + if ((!framebuffer_)&&(updateCount_!=0)) + { + if (updateCount_Update() ; +} + +void SDLGUIWindowImp::ProcessQuit() +{ + GUIPoint p; + GUIEvent e(p,ET_SYSQUIT) ; + _window->DispatchEvent(e) ; +} ; + +void SDLGUIWindowImp::PushEvent(GUIEvent &event) +{ + SDL_Event sdlevent ; + sdlevent.type=SDL_USEREVENT ; + sdlevent.user.data1=&event ; + SDL_PushEvent(&sdlevent) ; +} ; + +void SDLGUIWindowImp::ProcessUserEvent(SDL_Event &event) +{ + GUIEvent *guiEvent=(GUIEvent *)event.user.data1 ; + _window->DispatchEvent(*guiEvent) ; + delete(guiEvent) ; +} diff --git a/sources/Adapters/GUI/SDLGUIWindowImp.h b/sources/Adapters/GUI/SDLGUIWindowImp.h new file mode 100644 index 00000000..956348de --- /dev/null +++ b/sources/Adapters/GUI/SDLGUIWindowImp.h @@ -0,0 +1,69 @@ +#ifndef SDL_GUI_WINDOW_H_ +#define SDL_GUI_WINDOW_H_ + +#include "UIFramework/Interfaces/I_GUIWindowImp.h" +#include + +bool ProcessDEBEvent(SDL_Event &event) ; +void ProcessButtonChange(unsigned short,unsigned short) ; + +#define MAX_OVERLAYS 250 + +struct SDLCreateWindowParams: public GUICreateWindowParams { + SDLCreateWindowParams():cacheFonts_(true),framebuffer_(false) {} ; + bool cacheFonts_ ; + bool framebuffer_ ; +} ; + +class SDLGUIWindowImp: public I_GUIWindowImp { + +public: + + SDLGUIWindowImp(GUICreateWindowParams &p) ; + virtual ~SDLGUIWindowImp() ; + +public: // I_GUIWindowImp implementation + + virtual void SetColor(GUIColor &) ; + virtual void DrawRect(GUIRect &) ; + virtual void DrawChar(const char c,GUIPoint &pos,GUITextProperties &); + virtual void DrawString(const char *string,GUIPoint &pos,GUITextProperties &,bool overlay=false); + virtual GUIRect GetRect() ; + virtual void Invalidate() ; + virtual void Flush(); + virtual void Lock() ; + virtual void Unlock() ; + virtual void Clear(GUIColor &, bool overlay=false) ; + virtual void ClearRect(GUIRect &) ; + virtual void PushEvent(GUIEvent &event) ; + +public: // Added functionality + void ProcessExpose() ; + void ProcessQuit() ; + void ProcessUserEvent(SDL_Event &event) ; +protected: + void prepareFonts() ; + void prepareFullFonts() ; + void prepareBPP1Fonts() ; + void transform(const GUIRect &srcRect,SDL_Rect *dstRect); + void transform(const GUIPoint &srcPoint, int *x, int *y); + +private: + SDL_Window *window_; + SDL_Surface *surface_; +// SDL_Surface *offscreen_ ; + GUIRect screenRect_ ; + unsigned int currentColor_ ; + unsigned int backgroundColor_ ; + unsigned int foregroundColor_ ; + int bitDepth_ ; + bool cacheFonts_ ; + bool framebuffer_ ; + bool windowed_; + SDL_Rect updateRects_[MAX_OVERLAYS] ; + int updateCount_ ; + int appAnchorX_ ; + int appAnchorY_ ; + int mult_ ; +} ; +#endif diff --git a/sources/Adapters/Input/SDLInput.cpp b/sources/Adapters/Input/SDLInput.cpp new file mode 100644 index 00000000..2c3641b1 --- /dev/null +++ b/sources/Adapters/Input/SDLInput.cpp @@ -0,0 +1,203 @@ + +#include "SDLInput.h" +#include "Application/Model/Config.h" + +#ifndef PLATOFM_BITTBOY +int keyMapping[]={ + SDLK_a, + SDLK_s, + SDLK_LEFT, + SDLK_RIGHT, + SDLK_UP, + SDLK_DOWN, + SDLK_RCTRL, + SDLK_LCTRL, + SDLK_SPACE +} ; +#endif + +int eventMapping[]={ + SDLI_BUTTON_A, + SDLI_BUTTON_B, + SDLI_BUTTON_LEFT, + SDLI_BUTTON_RIGHT, + SDLI_BUTTON_UP, + SDLI_BUTTON_DOWN, + SDLI_BUTTON_L, + SDLI_BUTTON_R, + SDLI_BUTTON_START +} ; + +enum MappingType { + MT_KEY, + MT_JOYBUTTON, + MT_JOYHAT, + MT_JOYAXES +} ; + +int keyMappingType[9] ; + + +SDLInput::SDLInput() { + + // open first joystick if available + + if(SDL_NumJoysticks()>0){ + // Open joystick + joystick_=SDL_JoystickOpen(0); + Trace::Debug("Number of axis:%d",SDL_JoystickNumAxes(joystick_)) ; + Trace::Debug("Number of buttons:%d",SDL_JoystickNumButtons(joystick_)) ; + Trace::Debug("Number of hats:%d",SDL_JoystickNumHats(joystick_)) ; + } else { + joystick_=0 ; + } ; + Trace::Debug("Joystick: %s",joystick_?"opened":"not found") ; + + // initialises default mapping table + for (int i=0;i<9;i++) { + keyMappingType[i]=MT_KEY ; + } ; +} ; + +void SDLInput::ReadConfig() { + + mapKey(0,"KEY_A") ; + mapKey(1,"KEY_B") ; + mapKey(2,"KEY_LEFT") ; + mapKey(3,"KEY_RIGHT") ; + mapKey(4,"KEY_UP") ; + mapKey(5,"KEY_DOWN") ; + mapKey(6,"KEY_LSHOULDER") ; + mapKey(7,"KEY_RSHOULDER") ; + mapKey(8,"KEY_START") ; +} + +void SDLInput::mapKey(int index,const char *keyname) { + + Config *config=Config::GetInstance() ; + + // Read the configuration file and look if we got a definition + const char *key=config->GetValue(keyname) ; + if (key) { + // we found a key, let's find which type it is + + MappingType type=MT_KEY ; + if (key[3]==':') { + if (tolower(key[0])=='b') { // button + type=MT_JOYBUTTON ; + } + if (tolower(key[0])=='h') { // hat + type=MT_JOYHAT ; + } + if (tolower(key[0])=='j') { // joy + type=MT_JOYAXES ; + } + } ; + + keyMappingType[index]=type ; + switch(type) { + case MT_KEY: + for (int i=0;itrigger) { + mask|=eventMapping[i] ; + } + } + } + break ; + default: + break ; + } ; + } + return mask ; +} ; + diff --git a/sources/Adapters/Input/SDLInput.h b/sources/Adapters/Input/SDLInput.h new file mode 100644 index 00000000..b5cb246d --- /dev/null +++ b/sources/Adapters/Input/SDLInput.h @@ -0,0 +1,35 @@ + +#ifndef _SDL_INPUT_H_ +#define _SDL_INPUT_H_ + +#include "Foundation/T_Singleton.h" +#include "Externals/SDL/SDL.h" + +#define SDLI_BUTTON_A 0x1 +#define SDLI_BUTTON_B 0x2 +#define SDLI_BUTTON_LEFT 0x4 +#define SDLI_BUTTON_RIGHT 0x8 +#define SDLI_BUTTON_UP 0x10 +#define SDLI_BUTTON_DOWN 0x20 +#define SDLI_BUTTON_L 0x40 +#define SDLI_BUTTON_R 0x80 +#define SDLI_BUTTON_START 0x100 +#define SDLI_BUTTON_SELECT 0x200 + + +class SDLInput: public T_Singleton { +public: + SDLInput() ; + void ReadConfig(); + unsigned short GetButtonMask() ; + +private: + void mapKey(int index,const char *keyname) ; + + SDL_Joystick *joystick_; + + const char *keyname_[SDL_NUM_SCANCODES] ; + +} ; + +#endif \ No newline at end of file diff --git a/sources/Adapters/Process/SDLProcess.cpp b/sources/Adapters/Process/SDLProcess.cpp new file mode 100644 index 00000000..90719c30 --- /dev/null +++ b/sources/Adapters/Process/SDLProcess.cpp @@ -0,0 +1,54 @@ + +#include "SDLProcess.h" +#include + +int _SDLStartThread(void *argp) { + SysThread *play=(SysThread *)argp ; + play->startExecution() ; + return 0 ; +} + +bool SDLProcessFactory::BeginThread(SysThread& thread) { + SDL_CreateThread(_SDLStartThread,&thread); + return true ; +} + +SysSemaphore *SDLProcessFactory::CreateNewSemaphore(int initialcount, int maxcount) { + return new SDLSysSemaphore(initialcount,maxcount) ; +} ; + +SDLSysSemaphore::SDLSysSemaphore(int initialcount,int maxcount) { + handle_=SDL_CreateSemaphore(0) ; +} ; + +SDLSysSemaphore::~SDLSysSemaphore() { + handle_=0 ; +} ; + +SysSemaphoreResult SDLSysSemaphore::Wait() { + if (!handle_) { + return SSR_INVALID ; + } ; + return (SysSemaphoreResult)SDL_SemWait(handle_) ; +} ; + +SysSemaphoreResult SDLSysSemaphore::TryWait() { + if (!handle_) { + return SSR_INVALID ; + } ; + return (SysSemaphoreResult)0; +} + +SysSemaphoreResult SDLSysSemaphore::WaitTimeout(unsigned long timeout) { + if (!handle_) { + return SSR_INVALID ; + } ; + return (SysSemaphoreResult)0; +} ; + +SysSemaphoreResult SDLSysSemaphore::Post() { + if (!handle_) { + return SSR_INVALID ; + } ; + return (SysSemaphoreResult)SDL_SemPost(handle_) ; +} ; diff --git a/sources/Adapters/Process/SDLProcess.h b/sources/Adapters/Process/SDLProcess.h new file mode 100644 index 00000000..18744f73 --- /dev/null +++ b/sources/Adapters/Process/SDLProcess.h @@ -0,0 +1,23 @@ +#ifndef _SDL_PROCESS_H_ +#define _SDL_PROCESS_H_ + +#include "System/Process/Process.h" +#include + +class SDLProcessFactory:public SysProcessFactory { + bool BeginThread(SysThread &) ; + virtual SysSemaphore *CreateNewSemaphore(int initialcount = 0, int maxcount = 0) ; +} ; + +class SDLSysSemaphore:public SysSemaphore { +public: + SDLSysSemaphore(int initialcount = 0, int maxcount = 0) ; + virtual ~SDLSysSemaphore() ; + virtual SysSemaphoreResult Wait() ; + virtual SysSemaphoreResult TryWait() ; + virtual SysSemaphoreResult WaitTimeout(unsigned long) ; + virtual SysSemaphoreResult Post() ; +private: + SDL_sem *handle_ ; +} ; +#endif diff --git a/sources/Adapters/Timer/SDLTimer.cpp b/sources/Adapters/Timer/SDLTimer.cpp new file mode 100644 index 00000000..f2c1f7be --- /dev/null +++ b/sources/Adapters/Timer/SDLTimer.cpp @@ -0,0 +1,73 @@ + +#include "SDLTimer.h" +#include "System/Console/Trace.h" +#include "System/System/System.h" +#include "System/Console/n_assert.h" + +Uint32 SDLTimerCallback(Uint32 interval, void* param) { + SDLTimer *timer=(SDLTimer *)param ; + return timer->OnTimerTick() ; +} ; + +Uint32 SDLTriggerCallback(Uint32 interval, void* param) { + timerCallback tc=(timerCallback)param ; + (*tc)() ; + return 0 ; +} ; + +SDLTimer::SDLTimer() { + period_=-1 ; + timer_=0 ; + running_=false ; +} ; + +SDLTimer::~SDLTimer() { +} + +void SDLTimer::SetPeriod(float msec) { + period_=int(msec) ; + offset_=0 ; +} ; + +bool SDLTimer::Start() { + if (period_>0) { + offset_=period_ ; + Uint32 newcb=int(offset_) ; + offset_-=newcb ; + timer_=SDL_AddTimer(newcb,SDLTimerCallback,this); + lastTick_=System::GetInstance()->GetClock() ; + running_=true ; + } + return (timer_!=0) ; +} ; + +void SDLTimer::Stop() { + SDL_RemoveTimer(timer_) ; + timer_=0 ; + running_=false ; +} ; + +float SDLTimer::GetPeriod() { + return period_ ; +} ; + +Uint32 SDLTimer::OnTimerTick() { + Uint32 newcb=0 ; + if (running_) { + SetChanged() ; + NotifyObservers() ; + offset_+=period_ ; + newcb=int(offset_) ; + offset_-=newcb ; + NAssert(newcb>0) ; + } + return newcb ; +} ; + +I_Timer *SDLTimerService::CreateTimer() { + return new SDLTimer() ; +} ; + +void SDLTimerService::TriggerCallback(int msec,timerCallback cb) { + SDL_AddTimer(msec,SDLTriggerCallback,(void *)cb); +} diff --git a/sources/Adapters/Timer/SDLTimer.h b/sources/Adapters/Timer/SDLTimer.h new file mode 100644 index 00000000..0f4aaa73 --- /dev/null +++ b/sources/Adapters/Timer/SDLTimer.h @@ -0,0 +1,32 @@ +#ifndef _SDL_TIMER_H_ +#define _SDL_TIMER_H_ + +#include "System/Timer/Timer.h" +#include "SDL2/SDL.h" + +class SDLTimer: public I_Timer { +public: + SDLTimer() ; + virtual ~SDLTimer() ; + virtual void SetPeriod(float msec) ; + virtual bool Start() ; + virtual void Stop() ; + virtual float GetPeriod() ; + Uint32 OnTimerTick() ; + +private: + float period_ ; + float offset_ ; // Float offset taking into account + // period is an int + SDL_TimerID timer_ ; // NULL if not running + long lastTick_ ; + bool running_ ; +} ; + +class SDLTimerService: public TimerService { +public: + virtual I_Timer *CreateTimer() ; // Returns a timer + virtual void TriggerCallback(int msec,timerCallback cb) ; +}; + +#endif \ No newline at end of file From d98ef99a8378a3e1ef6ec2fba95bd6cdfdf8f969 Mon Sep 17 00:00:00 2001 From: Simon Lees Date: Sun, 4 Aug 2024 19:45:05 +0930 Subject: [PATCH 14/66] Cleanup #includes Now all header files are in the following order * Class Related * External Libs * Internal Libs --- .../CAANOO/Audio/CAANOOAudioDriver.cpp | 16 ++++---- .../Adapters/CAANOO/Audio/CAANOOAudioDriver.h | 1 - .../CAANOO/FileSystem/CAANOOFileSystem.cpp | 4 +- .../Adapters/CAANOO/Main/CAANOOSDLMain.cpp | 7 ++-- .../CAANOO/Midi/CAANOOSerialMidiDevice.cpp | 8 ++-- .../CAANOO/Midi/CAANOOSerialMidiDevice.h | 1 - .../Adapters/CAANOO/System/CAANOOSystem.cpp | 33 +++++++-------- sources/Adapters/CAANOO/System/CAANOOSystem.h | 2 +- .../Adapters/CAANOO/UI/CAANOOGUIWindowImp.cpp | 8 ++-- sources/Adapters/DEB/Main/DEBmain.cpp | 4 +- sources/Adapters/DEB/System/DEBSystem.cpp | 19 +++++---- sources/Adapters/DEB/System/DEBSystem.h | 2 +- sources/Adapters/DEB/UI/DEBGUIWindowImp.cpp | 6 +-- .../DINGOO/Audio/DINGOOAudioDriver.cpp | 15 ++++--- .../DINGOO/FileSystem/DINGOOFileSystem.cpp | 6 +-- sources/Adapters/DINGOO/Main/GPSDLMain.cpp | 8 ++-- .../DINGOO/Midi/BITTBOYSerialMidiDevice.cpp | 6 +-- .../DINGOO/Midi/DINGOOSerialMidiDevice.cpp | 8 ++-- .../DINGOO/Midi/DINGOOSerialMidiDevice.h | 1 - .../Adapters/DINGOO/System/BITTBOYSystem.cpp | 38 +++++++++--------- .../Adapters/DINGOO/System/DINGOOSystem.cpp | 32 +++++++-------- sources/Adapters/DINGOO/System/DINGOOSystem.h | 2 +- .../Adapters/DINGOO/System/MIYOOSystem.cpp | 40 +++++++++---------- .../Adapters/DINGOO/UI/DINGOOGUIWindowImp.cpp | 7 ++-- .../Dummy/FileSystem/DummyFileSystem.cpp | 2 +- sources/Adapters/Dummy/Sound/DummySound.h | 1 + .../Adapters/GP2X/Audio/GP2XAudioDriver.cpp | 20 ++++------ sources/Adapters/GP2X/Audio/GP2XAudioDriver.h | 1 - .../GP2X/FileSystem/GP2XFileSystem.cpp | 16 ++++---- sources/Adapters/GP2X/Main/GPSDLMain.cpp | 10 ++--- .../GP2X/Midi/GP2XSerialMidiDevice.cpp | 8 ++-- .../Adapters/GP2X/Midi/GP2XSerialMidiDevice.h | 1 - sources/Adapters/GP2X/System/GP2XSystem.cpp | 30 +++++++------- sources/Adapters/GP2X/System/GP2XSystem.h | 2 +- sources/Adapters/GP2X/UI/GP2XGUIWindowImp.cpp | 8 ++-- sources/Adapters/Jack/Audio/JackAudio.cpp | 2 +- sources/Adapters/Jack/Audio/JackAudio.h | 2 +- sources/Adapters/Jack/Audio/JackAudioDriver.h | 2 +- sources/Adapters/Jack/Client/JackClient.h | 2 +- sources/Adapters/Jack/Midi/JackMidiDevice.h | 2 +- .../Adapters/Jack/Midi/JackMidiService.cpp | 8 ++-- sources/Adapters/LINUX/Main/LINUXMain.cpp | 2 +- sources/Adapters/LINUX/System/LINUXSystem.cpp | 16 ++++---- sources/Adapters/LINUX/System/LINUXSystem.h | 2 +- .../Adapters/NDS/FileSystem/NDSFileSystem.cpp | 9 +++-- sources/Adapters/NDS/Main/NDSmain.cpp | 6 +-- sources/Adapters/NDS/Sound/NDSSound.cpp | 2 +- sources/Adapters/NDS/System/NDSSystem.cpp | 9 ++--- sources/Adapters/NDS/System/NDSSystem.h | 2 - sources/Adapters/NDS/UI/NDSGUIWindowImp.cpp | 6 +-- sources/Adapters/OSX/OSXMain/OSXmain.cpp | 3 +- sources/Adapters/OSX/OSXSystem/OSXSystem.cpp | 12 +++--- .../Adapters/PSP/FileSystem/PSPFileSystem.cpp | 9 ++--- sources/Adapters/PSP/Main/PSPmain.cpp | 15 +++---- sources/Adapters/PSP/System/PSPSystem.cpp | 14 +++---- sources/Adapters/RTAudio/RTAudioDriver.cpp | 10 ++--- sources/Adapters/RTAudio/RTAudioDriver.h | 4 +- sources/Adapters/RTAudio/RTAudioStub.cpp | 3 +- sources/Adapters/RTMidi/RTMidiService.cpp | 4 +- sources/Adapters/SDL/Audio/SDLAudioDriver.cpp | 4 +- sources/Adapters/SDL/GUI/GUIFactory.cpp | 4 +- sources/Adapters/SDL/GUI/SDLEventManager.cpp | 5 ++- sources/Adapters/SDL/GUI/SDLEventManager.h | 7 ++-- sources/Adapters/SDL/GUI/SDLGUIWindowImp.cpp | 12 +++--- sources/Adapters/SDL/Timer/SDLTimer.cpp | 2 +- sources/Adapters/SDL/Timer/SDLTimer.h | 4 +- .../Unix/FileSystem/UnixFileSystem.cpp | 13 +++--- sources/Adapters/Unix/Process/UnixProcess.cpp | 5 ++- sources/Adapters/W32/Audio/W32AudioDriver.cpp | 4 +- sources/Adapters/W32/Audio/W32AudioDriver.h | 2 +- sources/Adapters/W32/Main/WSDLmain.cpp | 7 ++-- sources/Adapters/W32/Timer/W32Timer.cpp | 4 +- .../Adapters/W32FileSystem/W32FileSystem.cpp | 8 ++-- sources/Adapters/WSDLSystem/WSDLSystem.cpp | 15 ++++--- sources/Adapters/WSDLSystem/WSDLSystem.h | 2 +- sources/Adapters/WSDLUI/WSDLGUIWindowImp.cpp | 6 +-- sources/Application/AppWindow.cpp | 24 +++++------ sources/Application/AppWindow.h | 12 +++--- sources/Application/Application.cpp | 8 ++-- sources/Application/Application.h | 2 +- .../Application/Audio/AudioFileStreamer.cpp | 2 +- sources/Application/Audio/AudioFileStreamer.h | 2 +- sources/Application/Audio/DummyAudioOut.cpp | 2 +- .../Commands/ApplicationCommandDispatcher.h | 4 +- .../Commands/CommandDispatcher.cpp | 1 - .../Application/Commands/CommandDispatcher.h | 2 +- .../Application/Commands/EventDispatcher.cpp | 4 +- .../Application/Commands/EventDispatcher.h | 6 +-- .../Application/Controllers/ControlRoom.cpp | 6 +-- .../Application/Instruments/I_Instrument.h | 7 ++-- .../Instruments/InstrumentBank.cpp | 4 +- .../Application/Instruments/InstrumentBank.h | 2 +- .../Instruments/MidiInstrument.cpp | 6 +-- sources/Application/Instruments/SRPUpdaters.h | 3 +- .../Instruments/SampleInstrument.cpp | 23 +++++------ .../Instruments/SampleInstrument.h | 10 ++--- .../Application/Instruments/SamplePool.cpp | 8 ++-- sources/Application/Instruments/SamplePool.h | 4 +- .../Instruments/SampleRenderingParams.h | 2 +- .../Application/Instruments/SampleVariable.h | 4 +- .../Instruments/SoundFontManager.cpp | 5 +-- .../Instruments/SoundFontManager.h | 4 +- .../Application/Instruments/SoundFontPreset.h | 2 +- .../Application/Instruments/SoundFontSample.h | 2 +- sources/Application/Instruments/WavFile.cpp | 6 +-- sources/Application/Instruments/WavFile.h | 2 +- .../Application/Instruments/WavFileWriter.h | 2 +- sources/Application/Mixer/MixerService.cpp | 6 +-- sources/Application/Mixer/MixerService.h | 6 +-- sources/Application/Model/Chain.cpp | 2 +- sources/Application/Model/Config.h | 2 +- sources/Application/Model/Groove.h | 4 +- sources/Application/Model/Mixer.h | 3 +- sources/Application/Model/Phrase.cpp | 2 +- sources/Application/Model/Phrase.h | 1 + sources/Application/Model/Project.cpp | 13 +++--- sources/Application/Model/Project.h | 4 +- sources/Application/Model/Song.cpp | 11 +++-- sources/Application/Model/Song.h | 2 +- sources/Application/Model/Table.cpp | 6 +-- sources/Application/Model/Table.h | 2 +- .../Persistency/PersistencyService.cpp | 2 +- .../Persistency/PersistencyService.h | 2 +- sources/Application/Player/Player.cpp | 17 ++++---- sources/Application/Player/Player.h | 5 ++- sources/Application/Player/PlayerChannel.cpp | 4 +- sources/Application/Player/PlayerMixer.cpp | 20 +++++----- sources/Application/Player/PlayerMixer.h | 8 ++-- sources/Application/Player/TablePlayback.h | 4 +- sources/Application/Utils/RandomNames.h | 2 +- sources/Application/Utils/char.h | 2 +- .../Application/Views/BaseClasses/UIField.h | 2 +- .../Views/BaseClasses/UIIntField.cpp | 5 ++- .../Views/BaseClasses/UIIntVarField.cpp | 4 +- .../Views/BaseClasses/UINoteVarField.cpp | 2 +- .../Views/BaseClasses/UITempoField.cpp | 2 +- .../Application/Views/BaseClasses/View.cpp | 6 +-- sources/Application/Views/BaseClasses/View.h | 9 +++-- sources/Application/Views/ChainView.cpp | 2 +- sources/Application/Views/InstrumentView.cpp | 10 ++--- sources/Application/Views/InstrumentView.h | 2 +- sources/Application/Views/MixerView.cpp | 6 +-- .../Views/ModalDialogs/ImportSampleDialog.cpp | 2 +- .../Views/ModalDialogs/ImportSampleDialog.h | 2 +- .../ModalDialogs/SelectProjectDialog.cpp | 4 +- .../Views/ModalDialogs/SelectProjectDialog.h | 2 +- sources/Application/Views/PhraseView.cpp | 12 +++--- sources/Application/Views/PhraseView.h | 2 +- sources/Application/Views/ProjectView.cpp | 10 ++--- sources/Application/Views/SongView.cpp | 12 +++--- sources/Application/Views/TableView.cpp | 2 +- sources/Application/Views/TableView.h | 4 +- sources/Application/Views/UIController.cpp | 1 - sources/Foundation/Observable.cpp | 1 - sources/Foundation/Variables/Variable.cpp | 2 +- sources/Services/Audio/AudioDriver.cpp | 4 +- sources/Services/Audio/AudioMixer.h | 3 +- sources/Services/Audio/AudioOutDriver.cpp | 7 ++-- .../Controllers/ButtonControllerSource.cpp | 2 +- sources/Services/Controllers/Channel.cpp | 7 ++-- sources/Services/Controllers/ControlNode.cpp | 2 +- sources/Services/Controllers/ControlNode.h | 2 +- .../Controllers/ControllerService.cpp | 5 +-- .../Services/Controllers/ControllerService.h | 3 +- .../Services/Controllers/ControllerSource.cpp | 3 +- .../Services/Controllers/ControllerSource.h | 2 +- .../Controllers/HatControllerSource.cpp | 2 +- .../Controllers/KeyboardControllerSource.cpp | 5 ++- sources/Services/Midi/MidiEvent.cpp | 2 +- sources/Services/Midi/MidiInDevice.cpp | 4 +- sources/Services/Midi/MidiInMerger.h | 6 +-- sources/Services/Midi/MidiMessage.h | 4 +- sources/Services/Midi/MidiService.cpp | 5 +-- sources/Services/Time/TimeService.cpp | 4 +- sources/System/Console/Trace.cpp | 5 +-- sources/System/Console/n_assert.cpp | 2 +- sources/System/FileSystem/FileSystem.cpp | 4 +- sources/System/FileSystem/FileSystem.h | 8 ++-- sources/System/Process/Process.cpp | 2 +- sources/System/Timer/Timer.h | 2 +- sources/System/_Midi/Midi.cpp | 2 +- sources/System/io/Status.cpp | 2 +- sources/UIFramework/BasicDatas/GUIBitmap.cpp | 2 +- sources/UIFramework/BasicDatas/GUIBitmap.h | 2 +- .../Framework/GUIParentGraphics.cpp | 2 +- .../UIFramework/Framework/GUIParentGraphics.h | 3 +- .../UIFramework/Interfaces/I_GUIGraphics.h | 2 +- .../Interfaces/I_GUIWindowFactory.h | 3 +- .../UIFramework/Interfaces/I_GUIWindowImp.h | 2 +- .../SimpleBaseClasses/EventManager.cpp | 6 +-- .../SimpleBaseClasses/GUIWindow.cpp | 4 +- 191 files changed, 558 insertions(+), 597 deletions(-) diff --git a/sources/Adapters/CAANOO/Audio/CAANOOAudioDriver.cpp b/sources/Adapters/CAANOO/Audio/CAANOOAudioDriver.cpp index c7ad1240..12f32c2e 100644 --- a/sources/Adapters/CAANOO/Audio/CAANOOAudioDriver.cpp +++ b/sources/Adapters/CAANOO/Audio/CAANOOAudioDriver.cpp @@ -1,25 +1,23 @@ #include "CAANOOAudioDriver.h" -#include "System/System/System.h" -#include "Services/Midi/MidiService.h" -#include "Application/Model/Config.h" -#include -#include -#include #include #include +#include #include +#include #include -#include +#include #include +#include #include #include #include #include #include #include -#include -#include +#include "Application/Model/Config.h" +#include "Services/Midi/MidiService.h" +#include "System/System/System.h" static unsigned long CAANOO_dev[2] ; diff --git a/sources/Adapters/CAANOO/Audio/CAANOOAudioDriver.h b/sources/Adapters/CAANOO/Audio/CAANOOAudioDriver.h index 5f4dacc0..703e3669 100644 --- a/sources/Adapters/CAANOO/Audio/CAANOOAudioDriver.h +++ b/sources/Adapters/CAANOO/Audio/CAANOOAudioDriver.h @@ -3,7 +3,6 @@ #include "Services/Audio/AudioDriver.h" - class CAANOOAudioDriver:public AudioDriver { public: CAANOOAudioDriver(AudioSettings &settings) ; diff --git a/sources/Adapters/CAANOO/FileSystem/CAANOOFileSystem.cpp b/sources/Adapters/CAANOO/FileSystem/CAANOOFileSystem.cpp index dec97f23..72fbc896 100644 --- a/sources/Adapters/CAANOO/FileSystem/CAANOOFileSystem.cpp +++ b/sources/Adapters/CAANOO/FileSystem/CAANOOFileSystem.cpp @@ -1,11 +1,11 @@ #include "CAANOOFileSystem.h" +#include #include #include -#include #include #include -#include +#include //#include #include "Application/Utils/wildcard.h" diff --git a/sources/Adapters/CAANOO/Main/CAANOOSDLMain.cpp b/sources/Adapters/CAANOO/Main/CAANOOSDLMain.cpp index 451b2a10..75c4ac0a 100644 --- a/sources/Adapters/CAANOO/Main/CAANOOSDLMain.cpp +++ b/sources/Adapters/CAANOO/Main/CAANOOSDLMain.cpp @@ -1,12 +1,11 @@ // VC6GUI.cpp : Defines the entry point for the application. // -#include "Application/Application.h" -#include "Adapters/CAANOO/System/CAANOOSystem.h" #include #include -#include "Adapters/SDL/GUI/SDLGUIWindowImp.h" -#include "Application/Persistency/PersistencyService.h" +#include "Adapters/CAANOO/System/CAANOOSystem.h" +#include "Application/Application.h" +#include "Application/Persistency/PersistencyService.h" #include "Adapters/SDL/GUI/SDLGUIWindowImp.h" int main(int argc,char *argv[]) diff --git a/sources/Adapters/CAANOO/Midi/CAANOOSerialMidiDevice.cpp b/sources/Adapters/CAANOO/Midi/CAANOOSerialMidiDevice.cpp index a1f75f24..1ac22b32 100644 --- a/sources/Adapters/CAANOO/Midi/CAANOOSerialMidiDevice.cpp +++ b/sources/Adapters/CAANOO/Midi/CAANOOSerialMidiDevice.cpp @@ -1,12 +1,12 @@ #include "CAANOOSerialMidiDevice.h" -#include "Application/Model/Config.h" -#include -#include #include +#include +#include #include #include -#include +#include +#include "Application/Model/Config.h" #define BAUDRATE B38400 diff --git a/sources/Adapters/CAANOO/Midi/CAANOOSerialMidiDevice.h b/sources/Adapters/CAANOO/Midi/CAANOOSerialMidiDevice.h index c2ae864a..00921fe5 100644 --- a/sources/Adapters/CAANOO/Midi/CAANOOSerialMidiDevice.h +++ b/sources/Adapters/CAANOO/Midi/CAANOOSerialMidiDevice.h @@ -2,7 +2,6 @@ #define _CAANOO_SERIAL_MIDI_DEVICE_H_ #include "Services/Midi/MidiOutDevice.h" - #include class CAANOOSerialMidiDevice: public MidiOutDevice { diff --git a/sources/Adapters/CAANOO/System/CAANOOSystem.cpp b/sources/Adapters/CAANOO/System/CAANOOSystem.cpp index 05866b21..63d503a9 100644 --- a/sources/Adapters/CAANOO/System/CAANOOSystem.cpp +++ b/sources/Adapters/CAANOO/System/CAANOOSystem.cpp @@ -1,27 +1,28 @@ #include "CAANOOSystem.h" -#include "Adapters/Unix/FileSystem/UnixFileSystem.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "Externals/TinyXML/tinyxml.h" +#include "Adapters/CAANOO/Audio/CAANOOAudio.h" +#include "Adapters/CAANOO/Midi/CAANOOMidiService.h" #include "Adapters/SDL/GUI/GUIFactory.h" #include "Adapters/SDL/GUI/SDLGUIWindowImp.h" #include "Adapters/SDL/GUI/SDLEventManager.h" -#include "Adapters/CAANOO/Audio/CAANOOAudio.h" -#include "Adapters/CAANOO/Midi/CAANOOMidiService.h" -#include "Externals/TinyXML/tinyxml.h" -#include "Application/Model/Config.h" +#include "Adapters/SDL/Timer/SDLTimer.h" +#include "Adapters/Unix/FileSystem/UnixFileSystem.h" +#include "Application/Commands/NodeList.h" #include "Application/Controllers/ControlRoom.h" +#include "Application/Model/Config.h" #include "Application/Player/SyncMaster.h" -#include "Application/Commands/NodeList.h" -#include "Adapters/SDL/Timer/SDLTimer.h" #include "System/Console/Logger.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include + #ifdef fopen #undef fopen diff --git a/sources/Adapters/CAANOO/System/CAANOOSystem.h b/sources/Adapters/CAANOO/System/CAANOOSystem.h index 4ec5327c..4c1598b9 100644 --- a/sources/Adapters/CAANOO/System/CAANOOSystem.h +++ b/sources/Adapters/CAANOO/System/CAANOOSystem.h @@ -2,8 +2,8 @@ #define _GPSDL_SYSTEM_H_ #include "System/System/System.h" -#include "UIFramework/SimpleBaseClasses/EventManager.h" #include +#include "UIFramework/SimpleBaseClasses/EventManager.h" #define USEREVENT_TIMER 0 #define USEREVENT_EXPOSE 1 diff --git a/sources/Adapters/CAANOO/UI/CAANOOGUIWindowImp.cpp b/sources/Adapters/CAANOO/UI/CAANOOGUIWindowImp.cpp index 562d4f40..bd6250c0 100644 --- a/sources/Adapters/CAANOO/UI/CAANOOGUIWindowImp.cpp +++ b/sources/Adapters/CAANOO/UI/CAANOOGUIWindowImp.cpp @@ -1,13 +1,13 @@ #include "CAANOOGUIWindowImp.h" -#include "Adapters/CAANOOSystem/CAANOOSystem.h" -#include "Adapters/CAANOOSystem/CAANOOEventQueue.h" -#include "UIFramework/SimpleBaseClasses/GUIWindow.h" -#include "System/io/Trace.h" #include +#include "Adapters/CAANOOSystem/CAANOOEventQueue.h" +#include "Adapters/CAANOOSystem/CAANOOSystem.h" #define NYI(s) n_assert("NYI: ##s##") #include "Application/Model/Config.h" #include "Application/Utils/char.h" +#include "System/io/Trace.h" +#include "UIFramework/SimpleBaseClasses/GUIWindow.h" CAANOOGUIWindowImp *instance_ ; diff --git a/sources/Adapters/DEB/Main/DEBmain.cpp b/sources/Adapters/DEB/Main/DEBmain.cpp index 85e81af3..86a1c8b7 100644 --- a/sources/Adapters/DEB/Main/DEBmain.cpp +++ b/sources/Adapters/DEB/Main/DEBmain.cpp @@ -1,7 +1,7 @@ -#include "Application/Application.h" -#include "Adapters/DEB/System/DEBSystem.h" #include +#include "Adapters/DEB/System/DEBSystem.h" #include "Adapters/SDL/GUI/SDLGUIWindowImp.h" +#include "Application/Application.h" int main(int argc,char *argv[]) { diff --git a/sources/Adapters/DEB/System/DEBSystem.cpp b/sources/Adapters/DEB/System/DEBSystem.cpp index 65d2cdde..4c4dde20 100644 --- a/sources/Adapters/DEB/System/DEBSystem.cpp +++ b/sources/Adapters/DEB/System/DEBSystem.cpp @@ -1,27 +1,26 @@ #include "DEBSystem.h" -#include "Adapters/RTMidi/RTMidiService.h" +#include +#include +#include +#include #ifndef _NO_JACK_ #include "Adapters/Jack/Audio/JackAudio.h" #include "Adapters/Jack/Midi/JackMidiService.h" #include "Adapters/Jack/Client/JackClient.h" #endif #include "Adapters/RTAudio/RTAudioStub.h" +#include "Adapters/RTMidi/RTMidiService.h" #include "Adapters/SDL/GUI/GUIFactory.h" -#include "Adapters/SDL/GUI/SDLGUIWindowImp.h" #include "Adapters/SDL/GUI/SDLEventManager.h" +#include "Adapters/SDL/GUI/SDLGUIWindowImp.h" +#include "Adapters/SDL/Timer/SDLTimer.h" #include "Adapters/Unix/FileSystem/UnixFileSystem.h" #include "Adapters/Unix/Process/UnixProcess.h" +#include "Application/Commands/NodeList.h" +#include "Application/Controllers/ControlRoom.h" #include "Application/Model/Config.h" #include "System/Console/Logger.h" -#include -#include -#include -#include -#include "Application/Model/Config.h" -#include "Application/Controllers/ControlRoom.h" -#include "Application/Commands/NodeList.h" -#include "Adapters/SDL/Timer/SDLTimer.h" EventManager *DEBSystem::eventManager_ = NULL ; diff --git a/sources/Adapters/DEB/System/DEBSystem.h b/sources/Adapters/DEB/System/DEBSystem.h index 228d6bad..fac6c8e6 100644 --- a/sources/Adapters/DEB/System/DEBSystem.h +++ b/sources/Adapters/DEB/System/DEBSystem.h @@ -2,8 +2,8 @@ #define _DEB_SYSTEM_H_ #include "System/System/System.h" -#include "UIFramework/SimpleBaseClasses/EventManager.h" #include +#include "UIFramework/SimpleBaseClasses/EventManager.h" class DEBSystem: public System { public: diff --git a/sources/Adapters/DEB/UI/DEBGUIWindowImp.cpp b/sources/Adapters/DEB/UI/DEBGUIWindowImp.cpp index 34551500..8daca116 100644 --- a/sources/Adapters/DEB/UI/DEBGUIWindowImp.cpp +++ b/sources/Adapters/DEB/UI/DEBGUIWindowImp.cpp @@ -1,8 +1,8 @@ #include "DEBGUIWindowImp.h" -#include "UIFramework/SimpleBaseClasses/GUIWindow.h" -#include "System/System/System.h" -#include "System/io/Trace.h" #include +#include "System/io/Trace.h" +#include "System/System/System.h" +#include "UIFramework/SimpleBaseClasses/GUIWindow.h" #define NYI(s) n_assert("NYI: ##s##") diff --git a/sources/Adapters/DINGOO/Audio/DINGOOAudioDriver.cpp b/sources/Adapters/DINGOO/Audio/DINGOOAudioDriver.cpp index 9b303c90..d9ae7f40 100644 --- a/sources/Adapters/DINGOO/Audio/DINGOOAudioDriver.cpp +++ b/sources/Adapters/DINGOO/Audio/DINGOOAudioDriver.cpp @@ -1,22 +1,21 @@ #include "DINGOOAudioDriver.h" -#include "System/Console/Trace.h" -#include "Application/Model/Config.h" - -#include #include #include +#include #include +#include #include -#include +#include #include +#include #include -#include #include +#include #include #include #include -#include -#include +#include "System/Console/Trace.h" +#include "Application/Model/Config.h" DINGOOAudioDriver::DINGOOAudioDriver(AudioSettings &settings):SDLAudioDriver(settings) diff --git a/sources/Adapters/DINGOO/FileSystem/DINGOOFileSystem.cpp b/sources/Adapters/DINGOO/FileSystem/DINGOOFileSystem.cpp index e0d002e9..692e59d8 100644 --- a/sources/Adapters/DINGOO/FileSystem/DINGOOFileSystem.cpp +++ b/sources/Adapters/DINGOO/FileSystem/DINGOOFileSystem.cpp @@ -1,12 +1,12 @@ #include "DINGOOFileSystem.h" -#include +#include #include -#include +#include #include #include -#include //#include +#include #include "Application/Utils/wildcard.h" DINGOODir::DINGOODir(const char *path):I_Dir(path) { diff --git a/sources/Adapters/DINGOO/Main/GPSDLMain.cpp b/sources/Adapters/DINGOO/Main/GPSDLMain.cpp index e05e6e1b..05e4588a 100644 --- a/sources/Adapters/DINGOO/Main/GPSDLMain.cpp +++ b/sources/Adapters/DINGOO/Main/GPSDLMain.cpp @@ -1,11 +1,11 @@ -#include "Application/Application.h" -#include "Adapters/DINGOO/System/DINGOOSystem.h" -#include "Foundation/T_Singleton.h" #include #include +#include "Adapters/DINGOO/System/DINGOOSystem.h" #include "Adapters/SDL/GUI/SDLGUIWindowImp.h" +#include "Application/Application.h" #include "Application/Persistency/PersistencyService.h" -#include "Adapters/SDL/GUI/SDLGUIWindowImp.h" +#include "Foundation/T_Singleton.h" + int main(int argc,char *argv[]) { diff --git a/sources/Adapters/DINGOO/Midi/BITTBOYSerialMidiDevice.cpp b/sources/Adapters/DINGOO/Midi/BITTBOYSerialMidiDevice.cpp index dbeef9fa..a0307585 100644 --- a/sources/Adapters/DINGOO/Midi/BITTBOYSerialMidiDevice.cpp +++ b/sources/Adapters/DINGOO/Midi/BITTBOYSerialMidiDevice.cpp @@ -1,11 +1,11 @@ #include "DINGOOSerialMidiDevice.h" -#include -#include #include +#include #include +#include #include -#include +#include #ifdef USB_TTY const char *port="/dev/usb/tts/0" ; diff --git a/sources/Adapters/DINGOO/Midi/DINGOOSerialMidiDevice.cpp b/sources/Adapters/DINGOO/Midi/DINGOOSerialMidiDevice.cpp index a9a03b2b..734696b3 100644 --- a/sources/Adapters/DINGOO/Midi/DINGOOSerialMidiDevice.cpp +++ b/sources/Adapters/DINGOO/Midi/DINGOOSerialMidiDevice.cpp @@ -1,12 +1,12 @@ #include "DINGOOSerialMidiDevice.h" -#include "System/io/Trace.h" -#include -#include #include +#include +#include #include #include -#include +#include +#include "System/io/Trace.h" const char *port="/dev/ttyS0" ; //const char *port="/dev/usb/tts/0" ; diff --git a/sources/Adapters/DINGOO/Midi/DINGOOSerialMidiDevice.h b/sources/Adapters/DINGOO/Midi/DINGOOSerialMidiDevice.h index 198face4..70236e2b 100644 --- a/sources/Adapters/DINGOO/Midi/DINGOOSerialMidiDevice.h +++ b/sources/Adapters/DINGOO/Midi/DINGOOSerialMidiDevice.h @@ -2,7 +2,6 @@ #define _DINGOO_SERIAL_MIDI_DEVICE_H_ #include "Services/Midi/MidiOutDevice.h" - #include class DINGOOSerialMidiDevice: public MidiOutDevice { diff --git a/sources/Adapters/DINGOO/System/BITTBOYSystem.cpp b/sources/Adapters/DINGOO/System/BITTBOYSystem.cpp index b17a3c7f..4f1afd3d 100644 --- a/sources/Adapters/DINGOO/System/BITTBOYSystem.cpp +++ b/sources/Adapters/DINGOO/System/BITTBOYSystem.cpp @@ -1,30 +1,28 @@ #include "DINGOOSystem.h" -#include "Adapters/Unix/FileSystem/UnixFileSystem.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "Externals/TinyXML/tinyxml.h" +#include "Adapters/DINGOO/Audio/DINGOOAudio.h" +#include "Adapters/DINGOO/Midi/DINGOOMidiService.h" #include "Adapters/SDL/GUI/GUIFactory.h" -#include "Adapters/SDL/GUI/SDLGUIWindowImp.h" #include "Adapters/SDL/GUI/SDLEventManager.h" +#include "Adapters/SDL/GUI/SDLGUIWindowImp.h" #include "Adapters/SDL/Process/SDLProcess.h" -#include "Adapters/DINGOO/Audio/DINGOOAudio.h" -#include "Adapters/DINGOO/Midi/DINGOOMidiService.h" -#include "Externals/TinyXML/tinyxml.h" -#include "Application/Model/Config.h" +#include "Adapters/SDL/Timer/SDLTimer.h" +#include "Adapters/Unix/FileSystem/UnixFileSystem.h" +#include "Application/Commands/NodeList.h" #include "Application/Controllers/ControlRoom.h" +#include "Application/Model/Config.h" #include "Application/Player/SyncMaster.h" -#include "Application/Commands/NodeList.h" -#include "Adapters/SDL/Timer/SDLTimer.h" #include "System/Console/Logger.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include EventManager *GPSDLSystem::eventManager_ = NULL ; bool GPSDLSystem::invert_=false ; diff --git a/sources/Adapters/DINGOO/System/DINGOOSystem.cpp b/sources/Adapters/DINGOO/System/DINGOOSystem.cpp index 30a7fbf5..7b349e0f 100644 --- a/sources/Adapters/DINGOO/System/DINGOOSystem.cpp +++ b/sources/Adapters/DINGOO/System/DINGOOSystem.cpp @@ -1,27 +1,27 @@ #include "DINGOOSystem.h" -#include "Adapters/Unix/FileSystem/UnixFileSystem.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "Externals/TinyXML/tinyxml.h" +#include "Adapters/DINGOO/Audio/DINGOOAudio.h" +#include "Adapters/Dummy/Midi/DummyMidi.h" #include "Adapters/SDL/GUI/GUIFactory.h" #include "Adapters/SDL/GUI/SDLGUIWindowImp.h" #include "Adapters/SDL/GUI/SDLEventManager.h" #include "Adapters/SDL/Process/SDLProcess.h" -#include "Adapters/DINGOO/Audio/DINGOOAudio.h" -#include "Adapters/Dummy/Midi/DummyMidi.h" -#include "Externals/TinyXML/tinyxml.h" -#include "Application/Model/Config.h" +#include "Adapters/SDL/Timer/SDLTimer.h" +#include "Adapters/Unix/FileSystem/UnixFileSystem.h" +#include "Application/Commands/NodeList.h" #include "Application/Controllers/ControlRoom.h" +#include "Application/Model/Config.h" #include "Application/Player/SyncMaster.h" -#include "Application/Commands/NodeList.h" -#include "Adapters/SDL/Timer/SDLTimer.h" #include "System/Console/Logger.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include EventManager *GPSDLSystem::eventManager_ = NULL ; bool GPSDLSystem::invert_=false ; diff --git a/sources/Adapters/DINGOO/System/DINGOOSystem.h b/sources/Adapters/DINGOO/System/DINGOOSystem.h index 8269c840..c61e2cf8 100644 --- a/sources/Adapters/DINGOO/System/DINGOOSystem.h +++ b/sources/Adapters/DINGOO/System/DINGOOSystem.h @@ -2,8 +2,8 @@ #define _GPSDL_SYSTEM_H_ #include "System/System/System.h" -#include "UIFramework/SimpleBaseClasses/EventManager.h" #include +#include "UIFramework/SimpleBaseClasses/EventManager.h" #define USEREVENT_TIMER 0 #define USEREVENT_EXPOSE 1 diff --git a/sources/Adapters/DINGOO/System/MIYOOSystem.cpp b/sources/Adapters/DINGOO/System/MIYOOSystem.cpp index f3c930cf..3f60a0ba 100644 --- a/sources/Adapters/DINGOO/System/MIYOOSystem.cpp +++ b/sources/Adapters/DINGOO/System/MIYOOSystem.cpp @@ -1,32 +1,32 @@ #include "DINGOOSystem.h" -#include "Adapters/Unix/FileSystem/UnixFileSystem.h" -#include "Adapters/SDL/GUI/GUIFactory.h" -#include "Adapters/SDL/GUI/SDLGUIWindowImp.h" -#include "Adapters/SDL/GUI/SDLEventManager.h" -#include "Adapters/SDL/Process/SDLProcess.h" -#include "Adapters/SDL/Audio/SDLAudio.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "Externals/TinyXML/tinyxml.h" #ifdef PLATFORM_MIYOO #include "Adapters/Dummy/Midi/DummyMidi.h" #elif defined(PLATFORM_RG35XX) #include "Adapters/Dummy/Midi/DummyMidi.h" // Re-enable at some point RTMidi/RTMidiService.h" #endif -#include "Externals/TinyXML/tinyxml.h" -#include "Application/Model/Config.h" +#include "Adapters/SDL/Audio/SDLAudio.h" +#include "Adapters/SDL/GUI/SDLEventManager.h" +#include "Adapters/SDL/GUI/GUIFactory.h" +#include "Adapters/SDL/GUI/SDLGUIWindowImp.h" +#include "Adapters/SDL/Process/SDLProcess.h" +#include "Adapters/SDL/Timer/SDLTimer.h" +#include "Adapters/Unix/FileSystem/UnixFileSystem.h" +#include "Application/Commands/NodeList.h" #include "Application/Controllers/ControlRoom.h" +#include "Application/Model/Config.h" #include "Application/Player/SyncMaster.h" -#include "Application/Commands/NodeList.h" -#include "Adapters/SDL/Timer/SDLTimer.h" #include "System/Console/Logger.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include EventManager *GPSDLSystem::eventManager_ = NULL; bool GPSDLSystem::invert_ = false; diff --git a/sources/Adapters/DINGOO/UI/DINGOOGUIWindowImp.cpp b/sources/Adapters/DINGOO/UI/DINGOOGUIWindowImp.cpp index f72a268a..7b1260d9 100644 --- a/sources/Adapters/DINGOO/UI/DINGOOGUIWindowImp.cpp +++ b/sources/Adapters/DINGOO/UI/DINGOOGUIWindowImp.cpp @@ -1,13 +1,14 @@ #include "DINGOOGUIWindowImp.h" +#include #include "Adapters/DINGOOSystem/DINGOOSystem.h" #include "Adapters/DINGOOSystem/DINGOOEventQueue.h" -#include "UIFramework/SimpleBaseClasses/GUIWindow.h" -#include "System/io/Trace.h" -#include #define NYI(s) n_assert("NYI: ##s##") #include "Application/Model/Config.h" #include "Application/Utils/char.h" +#include "System/io/Trace.h" +#include "UIFramework/SimpleBaseClasses/GUIWindow.h" + DINGOOGUIWindowImp *instance_ ; diff --git a/sources/Adapters/Dummy/FileSystem/DummyFileSystem.cpp b/sources/Adapters/Dummy/FileSystem/DummyFileSystem.cpp index 6a15f4fe..7c5b58c4 100644 --- a/sources/Adapters/Dummy/FileSystem/DummyFileSystem.cpp +++ b/sources/Adapters/Dummy/FileSystem/DummyFileSystem.cpp @@ -1,8 +1,8 @@ #include "DummyFileSystem.h" +#include #include "system/io/Trace.h" #include "Application/Utils/wildcard.h" -#include diff --git a/sources/Adapters/Dummy/Sound/DummySound.h b/sources/Adapters/Dummy/Sound/DummySound.h index b1159ebc..65b6f721 100644 --- a/sources/Adapters/Dummy/Sound/DummySound.h +++ b/sources/Adapters/Dummy/Sound/DummySound.h @@ -2,6 +2,7 @@ #define _DUMMY_SOUND_H_ #include "System/Sound/Sound.h" + class DummySound: public Sound { public: // Sound implementation diff --git a/sources/Adapters/GP2X/Audio/GP2XAudioDriver.cpp b/sources/Adapters/GP2X/Audio/GP2XAudioDriver.cpp index 3d203d8f..519fa110 100644 --- a/sources/Adapters/GP2X/Audio/GP2XAudioDriver.cpp +++ b/sources/Adapters/GP2X/Audio/GP2XAudioDriver.cpp @@ -1,27 +1,23 @@ #include "GP2XAudioDriver.h" -#include "System/System/System.h" -#include "Services/Midi/MidiService.h" -#include "Application/Model/Config.h" -#include -#include - -#include #include #include +#include #include +#include #include +#include #include #include #include -#include #include +#include #include #include #include -#include -#include - +#include "Application/Model/Config.h" +#include "Services/Midi/MidiService.h" +#include "System/System/System.h" static unsigned long gp2x_dev[2] ; static pthread_t gp2x_sound_thread,gp2x_engine_thread; @@ -266,4 +262,4 @@ void GP2XAudioDriver::NewBuffer() { double GP2XAudioDriver::GetStreamTime() { return (streamSampleTime_)/44100.0f ; -} \ No newline at end of file +} diff --git a/sources/Adapters/GP2X/Audio/GP2XAudioDriver.h b/sources/Adapters/GP2X/Audio/GP2XAudioDriver.h index 65465dcf..b09bbfa7 100644 --- a/sources/Adapters/GP2X/Audio/GP2XAudioDriver.h +++ b/sources/Adapters/GP2X/Audio/GP2XAudioDriver.h @@ -3,7 +3,6 @@ #include "Services/Audio/AudioDriver.h" - class GP2XAudioDriver:public AudioDriver { public: GP2XAudioDriver(AudioSettings &settings) ; diff --git a/sources/Adapters/GP2X/FileSystem/GP2XFileSystem.cpp b/sources/Adapters/GP2X/FileSystem/GP2XFileSystem.cpp index a94b5fc1..69933229 100644 --- a/sources/Adapters/GP2X/FileSystem/GP2XFileSystem.cpp +++ b/sources/Adapters/GP2X/FileSystem/GP2XFileSystem.cpp @@ -1,15 +1,15 @@ #include "GP2XFileSystem.h" -#include "System/Console/Trace.h" -#include -#include -#include -#include -#include #include #include +#include +#include +#include //#include -#include "Application/Utils/wildcard.h" +#include +#include +#include "Application/Utils/wildcard.h" +#include "System/Console/Trace.h" GP2XDir::GP2XDir(const char *path):I_Dir(path) { } ; @@ -137,4 +137,4 @@ Result GP2XFileSystem::MakeDir(const char *path) { return Result(oss.str()); } return Result::NoError; -} \ No newline at end of file +} diff --git a/sources/Adapters/GP2X/Main/GPSDLMain.cpp b/sources/Adapters/GP2X/Main/GPSDLMain.cpp index d73ecfd3..42916546 100644 --- a/sources/Adapters/GP2X/Main/GPSDLMain.cpp +++ b/sources/Adapters/GP2X/Main/GPSDLMain.cpp @@ -1,14 +1,12 @@ // VC6GUI.cpp : Defines the entry point for the application. // - -#include "Application/Application.h" -#include "Adapters/GP2X/System/GP2XSystem.h" -#include "Foundation/T_Singleton.h" #include #include +#include "Adapters/GP2X/System/GP2XSystem.h" #include "Adapters/SDL/GUI/SDLGUIWindowImp.h" -#include "Application/Persistency/PersistencyService.h" -#include "Adapters/SDL/GUI/SDLGUIWindowImp.h" +#include "Application/Application.h" +#include "Application/Persistency/PersistencyService.h" +#include "Foundation/T_Singleton.h" int main(int argc,char *argv[]) { diff --git a/sources/Adapters/GP2X/Midi/GP2XSerialMidiDevice.cpp b/sources/Adapters/GP2X/Midi/GP2XSerialMidiDevice.cpp index fa1660ee..f8425488 100644 --- a/sources/Adapters/GP2X/Midi/GP2XSerialMidiDevice.cpp +++ b/sources/Adapters/GP2X/Midi/GP2XSerialMidiDevice.cpp @@ -1,12 +1,12 @@ #include "GP2XSerialMidiDevice.h" -#include "System/Console/Trace.h" -#include -#include #include +#include +#include #include #include -#include +#include +#include "System/Console/Trace.h" const char *port="/dev/ttyS0" ; //const char *port="/dev/usb/tts/0" ; diff --git a/sources/Adapters/GP2X/Midi/GP2XSerialMidiDevice.h b/sources/Adapters/GP2X/Midi/GP2XSerialMidiDevice.h index 3a49fabe..829d12d4 100644 --- a/sources/Adapters/GP2X/Midi/GP2XSerialMidiDevice.h +++ b/sources/Adapters/GP2X/Midi/GP2XSerialMidiDevice.h @@ -2,7 +2,6 @@ #define _GP2X_SERIAL_MIDI_DEVICE_H_ #include "Services/Midi/MidiOutDevice.h" - #include class GP2XSerialMidiDevice: public MidiOutDevice { diff --git a/sources/Adapters/GP2X/System/GP2XSystem.cpp b/sources/Adapters/GP2X/System/GP2XSystem.cpp index 8a8e3ca3..cc3ef01e 100644 --- a/sources/Adapters/GP2X/System/GP2XSystem.cpp +++ b/sources/Adapters/GP2X/System/GP2XSystem.cpp @@ -1,26 +1,26 @@ #include "GP2XSystem.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "Externals/TinyXML/tinyxml.h" +#include "Adapters/GP2X/Audio/GP2XAudio.h" #include "Adapters/GP2X/FileSystem/GP2XFileSystem.h" +#include "Adapters/GP2X/Midi/GP2XMidiService.h" #include "Adapters/SDL/GUI/GUIFactory.h" #include "Adapters/SDL/GUI/SDLGUIWindowImp.h" -#include "Adapters/GP2X/Audio/GP2XAudio.h" -#include "Adapters/GP2X/Midi/GP2XMidiService.h" -#include "Externals/TinyXML/tinyxml.h" -#include "Application/Model/Config.h" +#include "Adapters/SDL/Timer/SDLTimer.h" +#include "Application/Commands/NodeList.h" #include "Application/Controllers/ControlRoom.h" +#include "Application/Model/Config.h" #include "Application/Player/SyncMaster.h" -#include "Application/Commands/NodeList.h" -#include "Adapters/SDL/Timer/SDLTimer.h" #include "System/Console/Logger.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include #ifdef fopen #undef fopen diff --git a/sources/Adapters/GP2X/System/GP2XSystem.h b/sources/Adapters/GP2X/System/GP2XSystem.h index 41688236..dc444540 100644 --- a/sources/Adapters/GP2X/System/GP2XSystem.h +++ b/sources/Adapters/GP2X/System/GP2XSystem.h @@ -2,8 +2,8 @@ #define _GPSDL_SYSTEM_H_ #include "System/System/System.h" -#include "UIFramework/SimpleBaseClasses/EventManager.h" #include +#include "UIFramework/SimpleBaseClasses/EventManager.h" #define USEREVENT_TIMER 0 #define USEREVENT_EXPOSE 1 diff --git a/sources/Adapters/GP2X/UI/GP2XGUIWindowImp.cpp b/sources/Adapters/GP2X/UI/GP2XGUIWindowImp.cpp index 997d9f75..a130bd2b 100644 --- a/sources/Adapters/GP2X/UI/GP2XGUIWindowImp.cpp +++ b/sources/Adapters/GP2X/UI/GP2XGUIWindowImp.cpp @@ -1,13 +1,13 @@ #include "GP2XGUIWindowImp.h" -#include "Adapters/GP2XSystem/GP2XSystem.h" -#include "Adapters/GP2XSystem/GP2XEventQueue.h" -#include "UIFramework/SimpleBaseClasses/GUIWindow.h" -#include "System/io/Trace.h" #include +#include "Adapters/GP2XSystem/GP2XEventQueue.h" +#include "Adapters/GP2XSystem/GP2XSystem.h" #define NYI(s) n_assert("NYI: ##s##") #include "Application/Model/Config.h" #include "Application/Utils/char.h" +#include "System/io/Trace.h" +#include "UIFramework/SimpleBaseClasses/GUIWindow.h" GP2XGUIWindowImp *instance_ ; diff --git a/sources/Adapters/Jack/Audio/JackAudio.cpp b/sources/Adapters/Jack/Audio/JackAudio.cpp index 3d34d4f3..62a9d467 100644 --- a/sources/Adapters/Jack/Audio/JackAudio.cpp +++ b/sources/Adapters/Jack/Audio/JackAudio.cpp @@ -1,10 +1,10 @@ #ifndef _NO_JACK_ #include "JackAudio.h" #include "JackAudioDriver.h" +#include "Adapters/Jack/Client/JackClient.h" #include "Services/Audio/AudioOutDriver.h" #include "System/Console/Trace.h" #include "System/Console/n_assert.h" -#include "Adapters/Jack/Client/JackClient.h" int jack_srate (jack_nframes_t nframes, void *arg) { Trace::Debug("Jack sample rate is now %lu/sec\n", nframes); diff --git a/sources/Adapters/Jack/Audio/JackAudio.h b/sources/Adapters/Jack/Audio/JackAudio.h index e30d0c24..cbb265ed 100644 --- a/sources/Adapters/Jack/Audio/JackAudio.h +++ b/sources/Adapters/Jack/Audio/JackAudio.h @@ -2,7 +2,7 @@ #define _JACK_AUDIO_H_ #include "Services/Audio/Audio.h" -#include "jack/jack.h" +#include class JackAudio: public Audio { public: diff --git a/sources/Adapters/Jack/Audio/JackAudioDriver.h b/sources/Adapters/Jack/Audio/JackAudioDriver.h index 858c31b3..d6a784b2 100644 --- a/sources/Adapters/Jack/Audio/JackAudioDriver.h +++ b/sources/Adapters/Jack/Audio/JackAudioDriver.h @@ -3,8 +3,8 @@ #include "Services/Audio/AudioDriver.h" #include -#include "System/Process/Process.h" #include "Adapters/Jack/Client/JackClient.h" +#include "System/Process/Process.h" class JackAudioDriver ; diff --git a/sources/Adapters/Jack/Client/JackClient.h b/sources/Adapters/Jack/Client/JackClient.h index 1f1eeb8b..677607b7 100644 --- a/sources/Adapters/Jack/Client/JackClient.h +++ b/sources/Adapters/Jack/Client/JackClient.h @@ -2,7 +2,7 @@ #ifndef _JACK_CLIENT_H_ #define _JACK_CLIENT_H_ -#include "jack/jack.h" +#include #include "Foundation/T_Singleton.h" #include "Foundation/T_SimpleList.h" diff --git a/sources/Adapters/Jack/Midi/JackMidiDevice.h b/sources/Adapters/Jack/Midi/JackMidiDevice.h index ef89272c..ef581275 100644 --- a/sources/Adapters/Jack/Midi/JackMidiDevice.h +++ b/sources/Adapters/Jack/Midi/JackMidiDevice.h @@ -3,8 +3,8 @@ #include "Services/Midi/MidiDevice.h" #include -#include "Adapters/Jack/Client/JackClient.h" #include +#include "Adapters/Jack/Client/JackClient.h" class JackMidiDevice: public MidiDevice { public: diff --git a/sources/Adapters/Jack/Midi/JackMidiService.cpp b/sources/Adapters/Jack/Midi/JackMidiService.cpp index d54d2d49..3bc22f81 100644 --- a/sources/Adapters/Jack/Midi/JackMidiService.cpp +++ b/sources/Adapters/Jack/Midi/JackMidiService.cpp @@ -1,9 +1,9 @@ #include "JackMidiService.h" -#include "JackMidiDevice.h" -#include "System/io/Trace.h" -#include "Adapters/Jack/Client/JackClient.h" #include +#include "Adapters/Jack/Client/JackClient.h" +#include "System/io/Trace.h" +#include "JackMidiDevice.h" JackMidiService::JackMidiService() { } ; @@ -33,4 +33,4 @@ void JackMidiService::OnNewFrame() { for (it->Begin();!it->IsDone();it->Next()) { JackMidiDevice ¤t=(JackMidiDevice &)it->CurrentItem() ; current.OnNewFrame() ; - }} ; \ No newline at end of file + }} ; diff --git a/sources/Adapters/LINUX/Main/LINUXMain.cpp b/sources/Adapters/LINUX/Main/LINUXMain.cpp index 20436639..7bde061d 100644 --- a/sources/Adapters/LINUX/Main/LINUXMain.cpp +++ b/sources/Adapters/LINUX/Main/LINUXMain.cpp @@ -1,7 +1,7 @@ #include +#include "Application/Application.h" #include "Adapters/LINUX/System/LINUXSystem.h" #include "Adapters/SDL/GUI/SDLGUIWindowImp.h" -#include "Application/Application.h" /* * generic entrypoint for linux based targets diff --git a/sources/Adapters/LINUX/System/LINUXSystem.cpp b/sources/Adapters/LINUX/System/LINUXSystem.cpp index ae6bc049..4ee9c22f 100644 --- a/sources/Adapters/LINUX/System/LINUXSystem.cpp +++ b/sources/Adapters/LINUX/System/LINUXSystem.cpp @@ -1,17 +1,17 @@ -#include +#include "LINUXSystem.h" +#include #include +#include #include -#include -#include "LINUXSystem.h" -#include "Application/Controllers/ControlRoom.h" -#include "Application/Commands/NodeList.h" -#include "Application/Model/Config.h" -#include "Adapters/SDL/Timer/SDLTimer.h" #include "Adapters/SDL/GUI/GUIFactory.h" -#include "Adapters/SDL/GUI/SDLGUIWindowImp.h" #include "Adapters/SDL/GUI/SDLEventManager.h" +#include "Adapters/SDL/GUI/SDLGUIWindowImp.h" +#include "Adapters/SDL/Timer/SDLTimer.h" #include "Adapters/Unix/FileSystem/UnixFileSystem.h" #include "Adapters/Unix/Process/UnixProcess.h" +#include "Application/Controllers/ControlRoom.h" +#include "Application/Commands/NodeList.h" +#include "Application/Model/Config.h" #include "System/Console/Logger.h" #ifdef DUMMYMIDI diff --git a/sources/Adapters/LINUX/System/LINUXSystem.h b/sources/Adapters/LINUX/System/LINUXSystem.h index 996e951f..de6d5493 100644 --- a/sources/Adapters/LINUX/System/LINUXSystem.h +++ b/sources/Adapters/LINUX/System/LINUXSystem.h @@ -1,8 +1,8 @@ #ifndef _LINUX_SYSTEM_H_ #define _LINUX_SYSTEM_H_ -#include #include "System/System/System.h" +#include #include "UIFramework/SimpleBaseClasses/EventManager.h" class LINUXSystem: public System { diff --git a/sources/Adapters/NDS/FileSystem/NDSFileSystem.cpp b/sources/Adapters/NDS/FileSystem/NDSFileSystem.cpp index 6630334b..70dc45da 100644 --- a/sources/Adapters/NDS/FileSystem/NDSFileSystem.cpp +++ b/sources/Adapters/NDS/FileSystem/NDSFileSystem.cpp @@ -1,10 +1,11 @@ #include "NDSFileSystem.h" -#include "System/io/Trace.h" -#include "Application/Utils/wildcard.h" -#include -#include #include +#include +#include +#include "Application/Utils/wildcard.h" +#include "System/io/Trace.h" + #include NDSDir::NDSDir(const char *path):I_Dir(path) { diff --git a/sources/Adapters/NDS/Main/NDSmain.cpp b/sources/Adapters/NDS/Main/NDSmain.cpp index 3464bc4e..844f6ccd 100644 --- a/sources/Adapters/NDS/Main/NDSmain.cpp +++ b/sources/Adapters/NDS/Main/NDSmain.cpp @@ -1,8 +1,8 @@ -#include "Application/Application.h" -#include "Adapters/NDS/System/NDSSystem.h" -#include #include #include +#include +#include "Application/Application.h" +#include "Adapters/NDS/System/NDSSystem.h" int main(int argc,char *argv[]) { diff --git a/sources/Adapters/NDS/Sound/NDSSound.cpp b/sources/Adapters/NDS/Sound/NDSSound.cpp index 1c56e1cc..becaf8b9 100644 --- a/sources/Adapters/NDS/Sound/NDSSound.cpp +++ b/sources/Adapters/NDS/Sound/NDSSound.cpp @@ -1,8 +1,8 @@ #include "NDSSound.h" #include -#include "System/System/System.h" #include "System/io/Trace.h" +#include "System/System/System.h" // Called when we need to fill the buffer diff --git a/sources/Adapters/NDS/System/NDSSystem.cpp b/sources/Adapters/NDS/System/NDSSystem.cpp index 8e42a133..48c7de3a 100644 --- a/sources/Adapters/NDS/System/NDSSystem.cpp +++ b/sources/Adapters/NDS/System/NDSSystem.cpp @@ -1,13 +1,12 @@ #include "NDSSystem.h" -#include "Adapters/NDS/UI/GUIFactory.h" -#include "Adapters/NDS/UI/NDSGUIWindowImp.h" -#include "Adapters/NDS/Sound/NDSSound.h" +#include #include "Adapters/Dummy/Midi/DummyMidi.h" #include "Adapters/NDS/FileSystem/NDSFileSystem.h" +#include "Adapters/NDS/Sound/NDSSound.h" +#include "Adapters/NDS/UI/GUIFactory.h" +#include "Adapters/NDS/UI/NDSGUIWindowImp.h" #include "System/io/Trace.h" #include "NDSEventQueue.h" -#include "Adapters/NDS/UI/NDSGUIWindowImp.h" -#include "nds.h" bool NDSSystem::finished_=false ; bool NDSSystem::redrawing_=false ; diff --git a/sources/Adapters/NDS/System/NDSSystem.h b/sources/Adapters/NDS/System/NDSSystem.h index 3b8363ca..27183ef2 100644 --- a/sources/Adapters/NDS/System/NDSSystem.h +++ b/sources/Adapters/NDS/System/NDSSystem.h @@ -1,8 +1,6 @@ #ifndef _NDS_SYSTEM_H_ #define _NDS_SYSTEM_H_ - - #include "System/System/System.h" #include "System/System/typedefs.h" diff --git a/sources/Adapters/NDS/UI/NDSGUIWindowImp.cpp b/sources/Adapters/NDS/UI/NDSGUIWindowImp.cpp index 3dff0d30..d108868c 100644 --- a/sources/Adapters/NDS/UI/NDSGUIWindowImp.cpp +++ b/sources/Adapters/NDS/UI/NDSGUIWindowImp.cpp @@ -1,10 +1,10 @@ #include "NDSGUIWindowImp.h" -#include "UIFramework/SimpleBaseClasses/GUIWindow.h" +#include +#include #include "System/IO/Trace.h" #include "System/System/System.h" -#include -#include +#include "UIFramework/SimpleBaseClasses/GUIWindow.h" NDSGUIWindowImp *instance_ ; diff --git a/sources/Adapters/OSX/OSXMain/OSXmain.cpp b/sources/Adapters/OSX/OSXMain/OSXmain.cpp index 8f3c7114..7dfd1e8b 100644 --- a/sources/Adapters/OSX/OSXMain/OSXmain.cpp +++ b/sources/Adapters/OSX/OSXMain/OSXmain.cpp @@ -1,9 +1,8 @@ +#include #include "Application/Application.h" #include "Adapters/OSX/OSXSystem/OSXSystem.h" #include "Adapters/SDL/GUI/SDLGUIWindowImp.h" -#include - int main(int argc,char *argv[]) { OSXSystem::Boot(argc,argv) ; diff --git a/sources/Adapters/OSX/OSXSystem/OSXSystem.cpp b/sources/Adapters/OSX/OSXSystem/OSXSystem.cpp index 9144474b..69ba6eaa 100644 --- a/sources/Adapters/OSX/OSXSystem/OSXSystem.cpp +++ b/sources/Adapters/OSX/OSXSystem/OSXSystem.cpp @@ -1,7 +1,12 @@ #include "OSXSystem.h" +#include +#include +#include +#include #include "Adapters/RTMidi/RTMidiService.h" #include "Adapters/RTAudio/RTAudioStub.h" +#include "Adapters/SDL/Timer/SDLTimer.h" #ifndef _USE_NCURSES_ #include "Adapters/SDL/GUI/GUIFactory.h" #include "Adapters/SDL/GUI/SDLGUIWindowImp.h" @@ -11,13 +16,8 @@ #include "Adapters/Unix/FileSystem/UnixFileSystem.h" #include "Adapters/Unix/Process/UnixProcess.h" #include "Application/Model/Config.h" -#include "Adapters/SDL/Timer/SDLTimer.h" #include "System/Console/Trace.h" #include "System/Console/Logger.h" -#include -#include -#include -#include EventManager *OSXSystem::eventManager_ = NULL ; @@ -215,4 +215,4 @@ void OSXSystem::PostQuitMessage() int unsigned OSXSystem::GetMemoryUsage() { return 0 ; -} \ No newline at end of file +} diff --git a/sources/Adapters/PSP/FileSystem/PSPFileSystem.cpp b/sources/Adapters/PSP/FileSystem/PSPFileSystem.cpp index 26fb5e56..34867220 100644 --- a/sources/Adapters/PSP/FileSystem/PSPFileSystem.cpp +++ b/sources/Adapters/PSP/FileSystem/PSPFileSystem.cpp @@ -1,13 +1,12 @@ #include "PSPFileSystem.h" -#include "System/Console/Trace.h" -#include #include #include -#include - +#include #include #include +#include "Application/Utils/wildcard.h" +#include "System/Console/Trace.h" PSPFile::PSPFile(SceUID file) { file_=file ; @@ -177,4 +176,4 @@ Result PSPFileSystem::MakeDir(const char *path) { return Result(oss.str()); } return Result::NoError; -} \ No newline at end of file +} diff --git a/sources/Adapters/PSP/Main/PSPmain.cpp b/sources/Adapters/PSP/Main/PSPmain.cpp index f09c06ff..bc5ab32d 100644 --- a/sources/Adapters/PSP/Main/PSPmain.cpp +++ b/sources/Adapters/PSP/Main/PSPmain.cpp @@ -1,17 +1,14 @@ // VC6GUI.cpp : Defines the entry point for the application. // - -#include "Application/Application.h" -#include "Adapters/PSP/System/PSPSystem.h" -#include "Foundation/T_Singleton.h" +#include +#include #include #include +#include "Application/Application.h" +#include "Adapters/PSP/System/PSPSystem.h" #include "Adapters/SDL/GUI/SDLGUIWindowImp.h" -#include "Application/Persistency/PersistencyService.h" -#include "Adapters/SDL/GUI/SDLGUIWindowImp.h" - -#include -#include +#include "Application/Persistency/PersistencyService.h" +#include "Foundation/T_Singleton.h" /* Define the module info section */ PSP_MODULE_INFO("AUDIOLIBDEMO", 0, 1, 1); diff --git a/sources/Adapters/PSP/System/PSPSystem.cpp b/sources/Adapters/PSP/System/PSPSystem.cpp index 0d5c3327..22083fce 100644 --- a/sources/Adapters/PSP/System/PSPSystem.cpp +++ b/sources/Adapters/PSP/System/PSPSystem.cpp @@ -1,20 +1,20 @@ #include "PSPSystem.h" +#include +#include +#include +#include +#include #include "Adapters/Dummy/Midi/DummyMidi.h" +#include "Adapters/PSP/FileSystem/PSPFileSystem.h" #include "Adapters/SDL/Audio/SDLAudio.h" #include "Adapters/SDL/GUI/SDLEventManager.h" #include "Adapters/SDL/GUI/GUIFactory.h" #include "Adapters/SDL/GUI/SDLGUIWindowImp.h" #include "Adapters/SDL/Process/SDLProcess.h" -#include "Adapters/PSP/FileSystem/PSPFileSystem.h" #include "Adapters/SDL/Timer/SDLTimer.h" #include "Application/Model/Config.h" #include "System/Console/Logger.h" -#include -#include -#include -#include -#include EventManager *PSPSystem::eventManager_ = NULL ; @@ -169,4 +169,4 @@ void PSPSystem::PostQuitMessage() { unsigned int PSPSystem::GetMemoryUsage() { struct mallinfo m=mallinfo(); return m.uordblks ; -} \ No newline at end of file +} diff --git a/sources/Adapters/RTAudio/RTAudioDriver.cpp b/sources/Adapters/RTAudio/RTAudioDriver.cpp index 92789f9e..f5ac568a 100644 --- a/sources/Adapters/RTAudio/RTAudioDriver.cpp +++ b/sources/Adapters/RTAudio/RTAudioDriver.cpp @@ -1,12 +1,12 @@ #include "RTAudioDriver.h" +#include +#include "Adapters/W32/Midi/W32MidiService.h" +#include "Application/Player/SyncMaster.h" +#include "Services/Audio/Audio.h" +#include "Services/Time/TimeService.h" #include "System/Console/Trace.h" #include "System/System/System.h" -#include "Services/Time/TimeService.h" -#include "Services/Audio/Audio.h" -#include "Application/Player/SyncMaster.h" -#include "Adapters/W32/Midi/W32MidiService.h" -#include int callback( void *outputBuffer, void *inputBuffer, unsigned int nBufferFrames, double streamTime, RtAudioStreamStatus status, void *userData ) diff --git a/sources/Adapters/RTAudio/RTAudioDriver.h b/sources/Adapters/RTAudio/RTAudioDriver.h index 9e8e96e5..3e3ae77d 100644 --- a/sources/Adapters/RTAudio/RTAudioDriver.h +++ b/sources/Adapters/RTAudio/RTAudioDriver.h @@ -3,10 +3,10 @@ #include "Services/Audio/AudioDriver.h" #include "Externals/RTAudio/RtAudio.h" -#include "System/Process/Process.h" #include "Foundation/Observable.h" -#include "System/Timer/Timer.h" #include "Services/Midi/MidiService.h" +#include "System/Process/Process.h" +#include "System/Timer/Timer.h" class RTAudioDriver ; diff --git a/sources/Adapters/RTAudio/RTAudioStub.cpp b/sources/Adapters/RTAudio/RTAudioStub.cpp index 83e60b55..0984c934 100644 --- a/sources/Adapters/RTAudio/RTAudioStub.cpp +++ b/sources/Adapters/RTAudio/RTAudioStub.cpp @@ -1,10 +1,9 @@ #include "RTAudioStub.h" #include "RTAudioDriver.h" +#include #include "Services/Audio/AudioOutDriver.h" #include "System/Console/Trace.h" -#include - RTAudioStub::RTAudioStub(AudioSettings &h):Audio(h), sampleRate_(0) diff --git a/sources/Adapters/RTMidi/RTMidiService.cpp b/sources/Adapters/RTMidi/RTMidiService.cpp index 722ee591..be6ddf20 100644 --- a/sources/Adapters/RTMidi/RTMidiService.cpp +++ b/sources/Adapters/RTMidi/RTMidiService.cpp @@ -1,8 +1,8 @@ #include "RTMidiService.h" -#include "RTMidiOutDevice.h" -#include "RTMidiInDevice.h" #include "System/Console/Trace.h" #include "Application/Model/Config.h" +#include "RTMidiInDevice.h" +#include "RTMidiOutDevice.h" //static void CALLBACK MidiFlushProc(UINT uiID, UINT uiMsg, DWORD // dwUser, DWORD dw1, DWORD dw2) { diff --git a/sources/Adapters/SDL/Audio/SDLAudioDriver.cpp b/sources/Adapters/SDL/Audio/SDLAudioDriver.cpp index 1fb2cbc3..9c187742 100644 --- a/sources/Adapters/SDL/Audio/SDLAudioDriver.cpp +++ b/sources/Adapters/SDL/Audio/SDLAudioDriver.cpp @@ -1,8 +1,8 @@ #include "SDLAudioDriver.h" -#include "System/Console/Trace.h" +#include "Services/Midi/MidiService.h" #include "Services/Time/TimeService.h" +#include "System/Console/Trace.h" #include "System/System/System.h" -#include "Services/Midi/MidiService.h" void sdl_callback(void *userdata, Uint8 *stream, int len) { SDLAudioDriver *sound=(SDLAudioDriver *)userdata ; diff --git a/sources/Adapters/SDL/GUI/GUIFactory.cpp b/sources/Adapters/SDL/GUI/GUIFactory.cpp index bbc9f050..1fb584a1 100644 --- a/sources/Adapters/SDL/GUI/GUIFactory.cpp +++ b/sources/Adapters/SDL/GUI/GUIFactory.cpp @@ -1,6 +1,6 @@ #include "GUIFactory.h" -#include "SDLGUIWindowImp.h" #include "SDLEventManager.h" +#include "SDLGUIWindowImp.h" #ifndef _USE_NCURSES_ @@ -15,4 +15,4 @@ I_GUIWindowImp &GUIFactory::CreateWindowImp(GUICreateWindowParams &p) { EventManager *GUIFactory::GetEventManager() { return SDLEventManager::GetInstance() ; } -#endif \ No newline at end of file +#endif diff --git a/sources/Adapters/SDL/GUI/SDLEventManager.cpp b/sources/Adapters/SDL/GUI/SDLEventManager.cpp index a598715d..326e66b0 100644 --- a/sources/Adapters/SDL/GUI/SDLEventManager.cpp +++ b/sources/Adapters/SDL/GUI/SDLEventManager.cpp @@ -1,10 +1,11 @@ #include "SDLEventManager.h" #include "Application/Application.h" -#include "UIFramework/BasicDatas/GUIEvent.h" -#include "SDLGUIWindowImp.h" #include "Application/Model/Config.h" #include "System/Console/Trace.h" +#include "UIFramework/BasicDatas/GUIEvent.h" +#include "SDLGUIWindowImp.h" + bool SDLEventManager::finished_=false ; bool SDLEventManager::dumpEvent_=false ; diff --git a/sources/Adapters/SDL/GUI/SDLEventManager.h b/sources/Adapters/SDL/GUI/SDLEventManager.h index 977db464..a4a87af9 100644 --- a/sources/Adapters/SDL/GUI/SDLEventManager.h +++ b/sources/Adapters/SDL/GUI/SDLEventManager.h @@ -1,15 +1,14 @@ #ifndef _SDL_EVENT_MANAGER_ #define _SDL_EVENT_MANAGER_ -#include "Foundation/T_Singleton.h" #include "UIFramework/SimpleBaseClasses/EventManager.h" +#include +#include +#include "Foundation/T_Singleton.h" #include "Services/Controllers/ButtonControllerSource.h" #include "Services/Controllers/JoystickControllerSource.h" #include "Services/Controllers/HatControllerSource.h" #include "Services/Controllers/KeyboardControllerSource.h" -#include - -#include #define MAX_JOY_COUNT 4 diff --git a/sources/Adapters/SDL/GUI/SDLGUIWindowImp.cpp b/sources/Adapters/SDL/GUI/SDLGUIWindowImp.cpp index 8ebf3af8..75d3694a 100644 --- a/sources/Adapters/SDL/GUI/SDLGUIWindowImp.cpp +++ b/sources/Adapters/SDL/GUI/SDLGUIWindowImp.cpp @@ -1,13 +1,13 @@ #include "SDLGUIWindowImp.h" -#include "UIFramework/SimpleBaseClasses/GUIWindow.h" -#include "System/System/System.h" -#include "Application/Model/Config.h" -#include "System/Console/Trace.h" +#include #include -#include "System/Console/n_assert.h" +#include "Application/Model/Config.h" #include "Application/Utils/char.h" -#include +#include "System/Console/n_assert.h" +#include "System/Console/Trace.h" +#include "System/System/System.h" #include "UIFramework/BasicDatas/GUIEvent.h" +#include "UIFramework/SimpleBaseClasses/GUIWindow.h" #ifdef _SHOW_GP2X_ #include diff --git a/sources/Adapters/SDL/Timer/SDLTimer.cpp b/sources/Adapters/SDL/Timer/SDLTimer.cpp index f2c1f7be..bf3031dc 100644 --- a/sources/Adapters/SDL/Timer/SDLTimer.cpp +++ b/sources/Adapters/SDL/Timer/SDLTimer.cpp @@ -1,8 +1,8 @@ #include "SDLTimer.h" +#include "System/Console/n_assert.h" #include "System/Console/Trace.h" #include "System/System/System.h" -#include "System/Console/n_assert.h" Uint32 SDLTimerCallback(Uint32 interval, void* param) { SDLTimer *timer=(SDLTimer *)param ; diff --git a/sources/Adapters/SDL/Timer/SDLTimer.h b/sources/Adapters/SDL/Timer/SDLTimer.h index 30960db5..a6510554 100644 --- a/sources/Adapters/SDL/Timer/SDLTimer.h +++ b/sources/Adapters/SDL/Timer/SDLTimer.h @@ -2,7 +2,7 @@ #define _SDL_TIMER_H_ #include "System/Timer/Timer.h" -#include "SDL/SDL.h" +#include class SDLTimer: public I_Timer { public: @@ -29,4 +29,4 @@ class SDLTimerService: public TimerService { virtual void TriggerCallback(int msec,timerCallback cb) ; }; -#endif \ No newline at end of file +#endif diff --git a/sources/Adapters/Unix/FileSystem/UnixFileSystem.cpp b/sources/Adapters/Unix/FileSystem/UnixFileSystem.cpp index c4a38950..11a50d06 100644 --- a/sources/Adapters/Unix/FileSystem/UnixFileSystem.cpp +++ b/sources/Adapters/Unix/FileSystem/UnixFileSystem.cpp @@ -1,19 +1,18 @@ #include "UnixFileSystem.h" -#include "System/Console/Trace.h" -#include +#include +#include #include -#include +#include #ifdef _64BIT #include #else #include #endif #include -#include -#include - -#include "Application/Utils/wildcard.h" +#include +#include "Application/Utils/wildcard.h" +#include "System/Console/Trace.h" UnixDir::UnixDir(const char *path):I_Dir(path) { } ; diff --git a/sources/Adapters/Unix/Process/UnixProcess.cpp b/sources/Adapters/Unix/Process/UnixProcess.cpp index 9912ded5..f4d4af76 100644 --- a/sources/Adapters/Unix/Process/UnixProcess.cpp +++ b/sources/Adapters/Unix/Process/UnixProcess.cpp @@ -1,8 +1,9 @@ #include "UnixProcess.h" -#include "System/Console/Trace.h" -#include #include +#include +#include "System/Console/Trace.h" + void *_UnixStartThread(void *p) { SysThread *play=(SysThread *)p ; diff --git a/sources/Adapters/W32/Audio/W32AudioDriver.cpp b/sources/Adapters/W32/Audio/W32AudioDriver.cpp index cabec42f..126004f1 100644 --- a/sources/Adapters/W32/Audio/W32AudioDriver.cpp +++ b/sources/Adapters/W32/Audio/W32AudioDriver.cpp @@ -1,10 +1,10 @@ #include "W32AudioDriver.h" +#include #include +#include "Services/Midi/MidiService.h" #include "System/Console/Trace.h" #include "System/System/System.h" -#include "Services/Midi/MidiService.h" -#include void CALLBACK winmm_cback(HWAVEOUT hwo, UINT uMsg, DWORD dwInstance, DWORD dwParam1, DWORD dwParam2) { diff --git a/sources/Adapters/W32/Audio/W32AudioDriver.h b/sources/Adapters/W32/Audio/W32AudioDriver.h index aec5964d..b4a4552e 100644 --- a/sources/Adapters/W32/Audio/W32AudioDriver.h +++ b/sources/Adapters/W32/Audio/W32AudioDriver.h @@ -2,8 +2,8 @@ #define _W32_SOUND_H_ #include "Services/Audio/AudioDriver.h" -#include "Foundation/T_Stack.h" #include +#include "Foundation/T_Stack.h" struct W32SoundBuffer { WAVEHDR *wavHeader_ ; diff --git a/sources/Adapters/W32/Main/WSDLmain.cpp b/sources/Adapters/W32/Main/WSDLmain.cpp index b7ecb74b..57d4bdc5 100644 --- a/sources/Adapters/W32/Main/WSDLmain.cpp +++ b/sources/Adapters/W32/Main/WSDLmain.cpp @@ -1,11 +1,10 @@ // VC6GUI.cpp : Defines the entry point for the application. // - -#include "Application/Application.h" -#include "Adapters/WSDLSystem/WSDLSystem.h" +#include #include "Externals/SDL/SDL.h" #include "Adapters/SDL/GUI/SDLGUIWindowImp.h" -#include +#include "Adapters/WSDLSystem/WSDLSystem.h" +#include "Application/Application.h" int main(int argc,char *argv[]) { diff --git a/sources/Adapters/W32/Timer/W32Timer.cpp b/sources/Adapters/W32/Timer/W32Timer.cpp index 7428ac18..ea97dd94 100644 --- a/sources/Adapters/W32/Timer/W32Timer.cpp +++ b/sources/Adapters/W32/Timer/W32Timer.cpp @@ -1,8 +1,8 @@ #include "W32Timer.h" +#include #include "System/Console/Trace.h" #include "System/System/System.h" -#include static void CALLBACK TimerProc(UINT uiID, UINT uiMsg, DWORD dwUser, DWORD dw1, DWORD dw2) { @@ -77,4 +77,4 @@ I_Timer *W32TimerService::CreateTimer() { void W32TimerService::TriggerCallback(int msec,timerCallback cb) { timeSetEvent(msec, 0, &TimerCallbackProc, (DWORD)cb,TIME_ONESHOT) ; -} ; \ No newline at end of file +} ; diff --git a/sources/Adapters/W32FileSystem/W32FileSystem.cpp b/sources/Adapters/W32FileSystem/W32FileSystem.cpp index 0e1075a6..6947b611 100644 --- a/sources/Adapters/W32FileSystem/W32FileSystem.cpp +++ b/sources/Adapters/W32FileSystem/W32FileSystem.cpp @@ -1,10 +1,10 @@ #include "W32FileSystem.h" -#include "Adapters/WSDLSystem/WSDLSystem.h" -#include "System/Console/Trace.h" -#include #include #include +#include +#include "Adapters/WSDLSystem/WSDLSystem.h" +#include "System/Console/Trace.h" W32File::W32File(FILE *file) { file_=file ; @@ -113,4 +113,4 @@ Result W32FileSystem::MakeDir(const char *path) { return Result(error); } return Result::NoError; -} \ No newline at end of file +} diff --git a/sources/Adapters/WSDLSystem/WSDLSystem.cpp b/sources/Adapters/WSDLSystem/WSDLSystem.cpp index 5d217dda..d2fc70f1 100644 --- a/sources/Adapters/WSDLSystem/WSDLSystem.cpp +++ b/sources/Adapters/WSDLSystem/WSDLSystem.cpp @@ -1,22 +1,21 @@ #include "WSDLSystem.h" +#include +#include +#include +#include #include "Adapters/RTAudio/RTAudioStub.h" +#include "Adapters/RTMidi/RTMidiService.h" #include "Adapters/SDL/GUI/SDLEventManager.h" #include "Adapters/SDL/GUI/GUIFactory.h" #include "Adapters/SDL/GUI/SDLGUIWindowImp.h" -#include "Adapters/RTAudio/RTAudioStub.h" -#include "Adapters/RTMidi/RTMidiService.h" -#include "Adapters/W32/Midi/W32MidiService.h" #include "Adapters/W32/Audio/W32Audio.h" #include "Adapters/W32FileSystem/W32FileSystem.h" +#include "Adapters/W32/Midi/W32MidiService.h" #include "Adapters/W32/Process/W32Process.h" #include "Adapters/W32/Timer/W32Timer.h" #include "Application/Model/Config.h" #include "System/Console/Logger.h" -#include -#include -#include -#include EventManager *WSDLSystem::eventManager_ = NULL ; @@ -212,4 +211,4 @@ std::string WSDLSystem::SGetLastErrorString() LocalFree(lpMsgBuf); return error; -} \ No newline at end of file +} diff --git a/sources/Adapters/WSDLSystem/WSDLSystem.h b/sources/Adapters/WSDLSystem/WSDLSystem.h index 170772f8..5486cb21 100644 --- a/sources/Adapters/WSDLSystem/WSDLSystem.h +++ b/sources/Adapters/WSDLSystem/WSDLSystem.h @@ -2,8 +2,8 @@ #define _WSDL_SYSTEM_H_ #include "System/System/System.h" -#include "Externals/SDL/SDL.h" #include +#include "Externals/SDL/SDL.h" #include "UIFramework/SimpleBaseClasses/EventManager.h" class WSDLSystem: public System { diff --git a/sources/Adapters/WSDLUI/WSDLGUIWindowImp.cpp b/sources/Adapters/WSDLUI/WSDLGUIWindowImp.cpp index 23c2e9d2..e037b3dc 100644 --- a/sources/Adapters/WSDLUI/WSDLGUIWindowImp.cpp +++ b/sources/Adapters/WSDLUI/WSDLGUIWindowImp.cpp @@ -1,10 +1,10 @@ #include "WSDLGUIWindowImp.h" -#include "Adapters/WSDLSystem/WSDLSystem.h" -#include "UIFramework/SimpleBaseClasses/GUIWindow.h" -#include "System/IO/Trace.h" #include #include +#include "Adapters/WSDLSystem/WSDLSystem.h" +#include "System/IO/Trace.h" +#include "UIFramework/SimpleBaseClasses/GUIWindow.h" #define NYI(s) n_assert("NYI: ##s##") diff --git a/sources/Application/AppWindow.cpp b/sources/Application/AppWindow.cpp index 7df772a0..040968b2 100644 --- a/sources/Application/AppWindow.cpp +++ b/sources/Application/AppWindow.cpp @@ -1,20 +1,20 @@ #include "AppWindow.h" -#include "UIFramework/Interfaces/I_GUIWindowFactory.h" -#include "System/Console/Trace.h" -#include "Player/Player.h" -#include "Foundation/Variables/WatchedVariable.h" -#include "Views/UIController.h" -#include "Application/Persistency/PersistencyService.h" +#include +#include "Application/Commands/EventDispatcher.h" +#include "Application/Commands/ApplicationCommandDispatcher.h" #include "Application/Instruments/SamplePool.h" +#include "Application/Mixer/MixerService.h" +#include "Application/Persistency/PersistencyService.h" #include "Application/Player/TablePlayback.h" -#include "Services/Midi/MidiService.h" +#include "Application/Utils/char.h" #include "Application/Views/ModalDialogs/MessageBox.h" -#include "Application/Commands/EventDispatcher.h" -#include "Application/Commands/ApplicationCommandDispatcher.h" #include "Application/Views/ModalDialogs/SelectProjectDialog.h" -#include "Application/Utils/char.h" -#include "Application/Mixer/MixerService.h" -#include +#include "Foundation/Variables/WatchedVariable.h" +#include "Player/Player.h" +#include "Services/Midi/MidiService.h" +#include "System/Console/Trace.h" +#include "UIFramework/Interfaces/I_GUIWindowFactory.h" +#include "Views/UIController.h" AppWindow *instance=0 ; diff --git a/sources/Application/AppWindow.h b/sources/Application/AppWindow.h index a60a1097..08daebab 100644 --- a/sources/Application/AppWindow.h +++ b/sources/Application/AppWindow.h @@ -4,16 +4,16 @@ #include "UIFramework/SimpleBaseClasses/GUIWindow.h" #include "Foundation/Observable.h" -#include "Application/Views/SongView.h" #include "Application/Views/ChainView.h" -#include "Application/Views/PhraseView.h" #include "Application/Views/ConsoleView.h" -#include "Application/Views/ProjectView.h" +#include "Application/Views/GrooveView.h" #include "Application/Views/InstrumentView.h" -#include "Application/Views/TableView.h" -#include "Application/Views/NullView.h" #include "Application/Views/MixerView.h" -#include "Application/Views/GrooveView.h" +#include "Application/Views/NullView.h" +#include "Application/Views/PhraseView.h" +#include "Application/Views/ProjectView.h" +#include "Application/Views/SongView.h" +#include "Application/Views/TableView.h" #include "Application/Views/ViewData.h" #include "System/io/Status.h" #include "System/Process/SysMutex.h" diff --git a/sources/Application/Application.cpp b/sources/Application/Application.cpp index 9f132a15..ddb8f8aa 100644 --- a/sources/Application/Application.cpp +++ b/sources/Application/Application.cpp @@ -1,12 +1,12 @@ #include "Application/Application.h" -#include "Application/AppWindow.h" -#include "UIFramework/Interfaces/I_GUIWindowFactory.h" -#include "Application/Persistency/PersistencyService.h" -#include "Services/Audio/Audio.h" +#include "Application/AppWindow.h" #include "Application/Commands/CommandDispatcher.h" #include "Application/Controllers/ControlRoom.h" #include "Application/Model/Config.h" +#include "Application/Persistency/PersistencyService.h" +#include "Services/Audio/Audio.h" #include "Services/Midi/MidiService.h" +#include "UIFramework/Interfaces/I_GUIWindowFactory.h" #include diff --git a/sources/Application/Application.h b/sources/Application/Application.h index 89391ef2..cf20078b 100644 --- a/sources/Application/Application.h +++ b/sources/Application/Application.h @@ -1,8 +1,8 @@ #ifndef _APPLICATION_H_ #define _APPLICATION_H_ -#include "UIFramework/SimpleBaseClasses/GUIWindow.h" #include "Foundation/T_Singleton.h" +#include "UIFramework/SimpleBaseClasses/GUIWindow.h" class Application:public T_Singleton { diff --git a/sources/Application/Audio/AudioFileStreamer.cpp b/sources/Application/Audio/AudioFileStreamer.cpp index 18996de6..89535d77 100644 --- a/sources/Application/Audio/AudioFileStreamer.cpp +++ b/sources/Application/Audio/AudioFileStreamer.cpp @@ -1,7 +1,7 @@ #include "AudioFileStreamer.h" +#include "Application/Model/Config.h" #include "Application/Utils/fixed.h" #include "System/Console/Trace.h" -#include "Application/Model/Config.h" AudioFileStreamer::AudioFileStreamer() { wav_=0 ; diff --git a/sources/Application/Audio/AudioFileStreamer.h b/sources/Application/Audio/AudioFileStreamer.h index 827503f9..4cb3282e 100644 --- a/sources/Application/Audio/AudioFileStreamer.h +++ b/sources/Application/Audio/AudioFileStreamer.h @@ -2,8 +2,8 @@ #define _AUDIO_FILE_STREAMER_H_ #include "Services/Audio/AudioModule.h" -#include "System/FileSystem/FileSystem.h" #include "Application/Instruments/WavFile.h" +#include "System/FileSystem/FileSystem.h" enum AudioFileStreamerMode { AFSM_STOPPED, diff --git a/sources/Application/Audio/DummyAudioOut.cpp b/sources/Application/Audio/DummyAudioOut.cpp index 5df429c9..86703ced 100644 --- a/sources/Application/Audio/DummyAudioOut.cpp +++ b/sources/Application/Audio/DummyAudioOut.cpp @@ -1,7 +1,7 @@ #include "DummyAudioOut.h" #include "Application/Player/SyncMaster.h" // Should be installable -#include "Services/Time/TimeService.h" #include "Services/Audio/AudioDriver.h" +#include "Services/Time/TimeService.h" static bool threadon=false ; diff --git a/sources/Application/Commands/ApplicationCommandDispatcher.h b/sources/Application/Commands/ApplicationCommandDispatcher.h index e0c67456..cd0803e3 100644 --- a/sources/Application/Commands/ApplicationCommandDispatcher.h +++ b/sources/Application/Commands/ApplicationCommandDispatcher.h @@ -2,8 +2,8 @@ #define _APPLICATION_COMMAND_DISPATCHER_H_ #include "CommandDispatcher.h" -#include "Foundation/T_Singleton.h" #include "Application/Model/Project.h" +#include "Foundation/T_Singleton.h" class ApplicationCommandDispatcher: public T_Singleton,public CommandExecuter { public: @@ -20,4 +20,4 @@ class ApplicationCommandDispatcher: public T_Singleton #include "Application/Model/Config.h" -#include "SDL/SDL.h" +#include "System/Console/Trace.h" int EventDispatcher::keyRepeat_=30 ; int EventDispatcher::keyDelay_=500 ; diff --git a/sources/Application/Commands/EventDispatcher.h b/sources/Application/Commands/EventDispatcher.h index 07248cfa..1893b9bc 100644 --- a/sources/Application/Commands/EventDispatcher.h +++ b/sources/Application/Commands/EventDispatcher.h @@ -2,10 +2,10 @@ #define _EVENT_DISPATCHER_H_ #include "CommandDispatcher.h" -#include "Foundation/T_Singleton.h" #include "Application/AppWindow.h" -#include "System/Timer/Timer.h" #include "Foundation/Observable.h" +#include "Foundation/T_Singleton.h" +#include "System/Timer/Timer.h" class EventDispatcher: public T_Singleton,public CommandExecuter,public I_Observer { public: @@ -25,4 +25,4 @@ class EventDispatcher: public T_Singleton,public CommandExecute I_Timer *timer_ ; } ; -#endif \ No newline at end of file +#endif diff --git a/sources/Application/Controllers/ControlRoom.cpp b/sources/Application/Controllers/ControlRoom.cpp index 8d83ec52..82023618 100644 --- a/sources/Application/Controllers/ControlRoom.cpp +++ b/sources/Application/Controllers/ControlRoom.cpp @@ -1,10 +1,10 @@ #include "ControlRoom.h" +#include +#include "Externals/TinyXML/tinyxml.h" #include "Services/Controllers/ControllerService.h" #include "Services/Controllers/MultiChannelAdapter.h" #include "System/Console/Trace.h" -#include "Externals/TinyXML/tinyxml.h" -#include ControlRoom::ControlRoom():ControlNode("",0) { @@ -114,4 +114,4 @@ bool ControlRoom::LoadMapping(const char *mappingFile) { } return true ; -} ; \ No newline at end of file +} ; diff --git a/sources/Application/Instruments/I_Instrument.h b/sources/Application/Instruments/I_Instrument.h index 4a3365d4..e3acb34a 100644 --- a/sources/Application/Instruments/I_Instrument.h +++ b/sources/Application/Instruments/I_Instrument.h @@ -1,11 +1,10 @@ #ifndef _I_INSTRUMENT_H_ #define _I_INSTRUMENT_H_ -#include "Foundation/Variables/VariableContainer.h" -#include "Foundation/Observable.h" -#include "Application/Utils/fixed.h" - #include "Application/Player/TablePlayback.h" +#include "Application/Utils/fixed.h" +#include "Foundation/Observable.h" +#include "Foundation/Variables/VariableContainer.h" enum InstrumentType { IT_SAMPLE=0, diff --git a/sources/Application/Instruments/InstrumentBank.cpp b/sources/Application/Instruments/InstrumentBank.cpp index ec65ba59..09d6ac5d 100644 --- a/sources/Application/Instruments/InstrumentBank.cpp +++ b/sources/Application/Instruments/InstrumentBank.cpp @@ -3,10 +3,10 @@ #include "Application/Instruments/SampleInstrument.h" #include "Application/Instruments/SamplePool.h" #include "Application/Instruments/MidiInstrument.h" -#include "System/io/Status.h" -#include "Application/Utils/char.h" #include "Application/Model/Config.h" #include "Application/Persistency/PersistencyService.h" +#include "Application/Utils/char.h" +#include "System/io/Status.h" #include "Filters.h" char *InstrumentTypeData[IT_LAST]= { diff --git a/sources/Application/Instruments/InstrumentBank.h b/sources/Application/Instruments/InstrumentBank.h index 52c03fdc..6053a076 100644 --- a/sources/Application/Instruments/InstrumentBank.h +++ b/sources/Application/Instruments/InstrumentBank.h @@ -2,8 +2,8 @@ #define _INSTRUMENT_BANK_H_ #include "Application/Persistency/Persistent.h" -#include "Application/Model/Song.h" #include "Application/Instruments/I_Instrument.h" +#include "Application/Model/Song.h" #define NO_MORE_INSTRUMENT 0x100 diff --git a/sources/Application/Instruments/MidiInstrument.cpp b/sources/Application/Instruments/MidiInstrument.cpp index dfdc2372..a07e1ce4 100644 --- a/sources/Application/Instruments/MidiInstrument.cpp +++ b/sources/Application/Instruments/MidiInstrument.cpp @@ -1,8 +1,8 @@ #include "MidiInstrument.h" -#include "CommandList.h" -#include "System/Console/Trace.h" -#include #include +#include +#include "System/Console/Trace.h" +#include "CommandList.h" MidiService *MidiInstrument::svc_=0 ; diff --git a/sources/Application/Instruments/SRPUpdaters.h b/sources/Application/Instruments/SRPUpdaters.h index 60c9f172..6214b930 100644 --- a/sources/Application/Instruments/SRPUpdaters.h +++ b/sources/Application/Instruments/SRPUpdaters.h @@ -1,9 +1,8 @@ #ifndef _SRP_UPDATERS_H_ #define _SRP_UPDATERS_H_ -#include "I_SRPUpdater.h" #include "Foundation/Types/Types.h" - +#include "I_SRPUpdater.h" class VolumeRamp: public I_SRPUpdater { public: diff --git a/sources/Application/Instruments/SampleInstrument.cpp b/sources/Application/Instruments/SampleInstrument.cpp index 7368f8fc..90635282 100644 --- a/sources/Application/Instruments/SampleInstrument.cpp +++ b/sources/Application/Instruments/SampleInstrument.cpp @@ -1,22 +1,19 @@ #include "SampleInstrument.h" -#include "SamplePool.h" -#include "System/Console/Trace.h" -#include "System/io/Status.h" -#include "CommandList.h" #include -#include "Application/Player/PlayerMixer.h" // For MIX_BUFFER_SIZE.. kick out pls -#include "Application/Player/SyncMaster.h" +#include +#include +#include #include "Application/Instruments/Filters.h" #include "Application/Model/Table.h" +#include "Application/Player/PlayerMixer.h" // For MIX_BUFFER_SIZE.. kick out pls +#include "Application/Player/SyncMaster.h" #include "Services/Audio/Audio.h" -#include "SampleVariable.h" - -#include -#include -#include - +#include "System/Console/Trace.h" +#include "System/io/Status.h" +#include "CommandList.h" #include "SampleInstrumentDatas.h" -#include "Application/Player/SyncMaster.h" +#include "SamplePool.h" +#include "SampleVariable.h" fixed SampleInstrument::feedback_[SONG_CHANNEL_COUNT][FB_BUFFER_LENGTH*2] ; diff --git a/sources/Application/Instruments/SampleInstrument.h b/sources/Application/Instruments/SampleInstrument.h index e4c16165..ead8f802 100644 --- a/sources/Application/Instruments/SampleInstrument.h +++ b/sources/Application/Instruments/SampleInstrument.h @@ -2,14 +2,14 @@ #define _SAMPLE_INSTRUMENT_H_ #include "I_Instrument.h" -#include "SampleRenderingParams.h" -#include "SRPUpdaters.h" - -#include "SoundSource.h" -#include "Application/Model/Song.h" +#include "Application/Model/Song.h" #include "Foundation/Observable.h" #include "Foundation/Types/Types.h" #include "Foundation/Variables/WatchedVariable.h" +#include "SampleRenderingParams.h" +#include "SRPUpdaters.h" +#include "SoundSource.h" + enum SampleInstrumentLoopMode { SILM_ONESHOT=0, diff --git a/sources/Application/Instruments/SamplePool.cpp b/sources/Application/Instruments/SamplePool.cpp index d3806933..01befa94 100644 --- a/sources/Application/Instruments/SamplePool.cpp +++ b/sources/Application/Instruments/SamplePool.cpp @@ -1,14 +1,14 @@ #include "SamplePool.h" -#include #include +#include +#include +#include "Application/Model/Config.h" +#include "Application/Persistency/PersistencyService.h" #include "System/Console/Trace.h" -#include "Application/Persistency/PersistencyService.h" #include "System/io/Status.h" -#include #include "SoundFontSample.h" #include "SoundFontPreset.h" #include "SoundFontManager.h" -#include "Application/Model/Config.h" #define SAMPLE_LIB "root:samplelib" diff --git a/sources/Application/Instruments/SamplePool.h b/sources/Application/Instruments/SamplePool.h index c3a8e7d5..be8a73f9 100644 --- a/sources/Application/Instruments/SamplePool.h +++ b/sources/Application/Instruments/SamplePool.h @@ -2,10 +2,10 @@ #ifndef _SAMPLE_POOL_H_ #define _SAMPLE_POOL_H_ -#include "Foundation/T_Singleton.h" -#include "WavFile.h" #include "Application/Model/Song.h" #include "Foundation/Observable.h" +#include "Foundation/T_Singleton.h" +#include "WavFile.h" #define MAX_PIG_SAMPLES MAX_SAMPLEINSTRUMENT_COUNT diff --git a/sources/Application/Instruments/SampleRenderingParams.h b/sources/Application/Instruments/SampleRenderingParams.h index e003afdd..25865ab7 100644 --- a/sources/Application/Instruments/SampleRenderingParams.h +++ b/sources/Application/Instruments/SampleRenderingParams.h @@ -2,9 +2,9 @@ #ifndef _SAMPLE_RENDER_PARAMS_H_ #define _SAMPLE_RENDER_PARAMS_H_ +#include #include "Foundation/Types/Types.h" #include "SRPUpdaters.h" -#include enum FeedbackMode { FB_NONE, diff --git a/sources/Application/Instruments/SampleVariable.h b/sources/Application/Instruments/SampleVariable.h index a65a3098..e89b82f0 100644 --- a/sources/Application/Instruments/SampleVariable.h +++ b/sources/Application/Instruments/SampleVariable.h @@ -2,8 +2,8 @@ #ifndef _SAMPLE_VARIABLE_H_ #define _SAMPLE_VARIABLE_H_ -#include "Foundation/Variables/WatchedVariable.h" #include "Foundation/Observable.h" +#include "Foundation/Variables/WatchedVariable.h" class SampleVariable:public WatchedVariable,public I_Observer { public: @@ -13,4 +13,4 @@ class SampleVariable:public WatchedVariable,public I_Observer { virtual void Update(Observable &o,I_ObservableData *d) ; } ; -#endif \ No newline at end of file +#endif diff --git a/sources/Application/Instruments/SoundFontManager.cpp b/sources/Application/Instruments/SoundFontManager.cpp index 0acec549..b7cafed2 100644 --- a/sources/Application/Instruments/SoundFontManager.cpp +++ b/sources/Application/Instruments/SoundFontManager.cpp @@ -1,10 +1,9 @@ #include "SoundFontManager.h" -#include "System/System/System.h" -#include "System/FileSystem/FileSystem.h" - #ifdef _64BIT #include #endif +#include "System/FileSystem/FileSystem.h" +#include "System/System/System.h" SoundFontManager::SoundFontManager() { } ; diff --git a/sources/Application/Instruments/SoundFontManager.h b/sources/Application/Instruments/SoundFontManager.h index f0100200..97322255 100644 --- a/sources/Application/Instruments/SoundFontManager.h +++ b/sources/Application/Instruments/SoundFontManager.h @@ -1,9 +1,9 @@ #ifndef _SOUND_FONT_MANAGER_H_ #define _SOUND_FONT_MANAGER_H_ -#include "Foundation/T_Singleton.h" -#include "Externals/Soundfont/ENAB.H" #include +#include "Externals/Soundfont/ENAB.H" +#include "Foundation/T_Singleton.h" class SoundFontManager:public T_Singleton { public: diff --git a/sources/Application/Instruments/SoundFontPreset.h b/sources/Application/Instruments/SoundFontPreset.h index 146d60d2..8e52fbb0 100644 --- a/sources/Application/Instruments/SoundFontPreset.h +++ b/sources/Application/Instruments/SoundFontPreset.h @@ -2,8 +2,8 @@ #define _SOUNDFONT_PRESET_H_ #include "SoundSource.h" -#include "Externals/Soundfont/SFNAV.H" #include "Externals/Soundfont/ENAB.H" +#include "Externals/Soundfont/SFNAV.H" class SoundFontPreset: public SoundSource { public: diff --git a/sources/Application/Instruments/SoundFontSample.h b/sources/Application/Instruments/SoundFontSample.h index 2c6ea210..bdf0ffd8 100644 --- a/sources/Application/Instruments/SoundFontSample.h +++ b/sources/Application/Instruments/SoundFontSample.h @@ -2,8 +2,8 @@ #define _SOUND_FONT_SAMPLE_H_ #include "SoundSource.h" -#include "System/FileSystem/FileSystem.h" #include "Externals/Soundfont/ENAB.H" +#include "System/FileSystem/FileSystem.h" class SoundFontSample: public SoundSource { public: diff --git a/sources/Application/Instruments/WavFile.cpp b/sources/Application/Instruments/WavFile.cpp index d60da859..38829e6c 100644 --- a/sources/Application/Instruments/WavFile.cpp +++ b/sources/Application/Instruments/WavFile.cpp @@ -1,10 +1,10 @@ #include "WavFile.h" -#include "System/Console/Trace.h" +#include +#include "Application/Model/Config.h" #include "Foundation/Types/Types.h" #include "Services/Time/TimeService.h" -#include "Application/Model/Config.h" -#include +#include "System/Console/Trace.h" int WavFile::bufferChunkSize_=-1 ; bool WavFile::initChunkSize_=true ; diff --git a/sources/Application/Instruments/WavFile.h b/sources/Application/Instruments/WavFile.h index 02b37924..106b89b8 100644 --- a/sources/Application/Instruments/WavFile.h +++ b/sources/Application/Instruments/WavFile.h @@ -2,8 +2,8 @@ #ifndef _WAV_FILE_H_ #define _WAV_FILE_H_ -#include "System/FileSystem/FileSystem.h" #include "SoundSource.h" +#include "System/FileSystem/FileSystem.h" class WavFile:public SoundSource { diff --git a/sources/Application/Instruments/WavFileWriter.h b/sources/Application/Instruments/WavFileWriter.h index 0dc8187e..d506fbbe 100644 --- a/sources/Application/Instruments/WavFileWriter.h +++ b/sources/Application/Instruments/WavFileWriter.h @@ -1,8 +1,8 @@ #ifndef _WAV_FILE_WRITER_H_ #define _WAV_FILE_WRITER_H_ -#include "System/FileSystem/FileSystem.h" #include "Application/Utils/fixed.h" +#include "System/FileSystem/FileSystem.h" class WavFileWriter { public: diff --git a/sources/Application/Mixer/MixerService.cpp b/sources/Application/Mixer/MixerService.cpp index 82a7f1bc..232c2d94 100644 --- a/sources/Application/Mixer/MixerService.cpp +++ b/sources/Application/Mixer/MixerService.cpp @@ -1,11 +1,11 @@ #include "MixerService.h" +#include "Application/Audio/DummyAudioOut.h" +#include "Application/Model/Config.h" +#include "Application/Model/Mixer.h" #include "Services/Audio/Audio.h" #include "Services/Audio/AudioDriver.h" #include "Services/Midi/MidiService.h" #include "System/Console/Trace.h" -#include "Application/Model/Config.h" -#include "Application/Audio/DummyAudioOut.h" -#include "Application/Model/Mixer.h" MixerService::MixerService(): out_(0), diff --git a/sources/Application/Mixer/MixerService.h b/sources/Application/Mixer/MixerService.h index 2fddaf77..e0020773 100644 --- a/sources/Application/Mixer/MixerService.h +++ b/sources/Application/Mixer/MixerService.h @@ -1,13 +1,13 @@ #ifndef _MIXER_SERVICE_H_ #define _MIXER_SERVICE_H_ -#include "Foundation/T_Singleton.h" +#include +#include "Application/Commands/CommandDispatcher.h" // Would be better done externally and call an API here #include "Foundation/Observable.h" +#include "Foundation/T_Singleton.h" #include "Services/Audio/AudioMixer.h" #include "Services/Audio/AudioOut.h" -#include "Application/Commands/CommandDispatcher.h" // Would be better done externally and call an API here #include "MixBus.h" -#include "SDL/SDL.h" enum MixerServiceMode { MSM_AUDIO, diff --git a/sources/Application/Model/Chain.cpp b/sources/Application/Model/Chain.cpp index c9313bec..91546c65 100644 --- a/sources/Application/Model/Chain.cpp +++ b/sources/Application/Model/Chain.cpp @@ -1,7 +1,7 @@ #include "Chain.h" -#include "System/System/System.h" #include #include +#include "System/System/System.h" Chain::Chain() { diff --git a/sources/Application/Model/Config.h b/sources/Application/Model/Config.h index a395731b..10c83651 100644 --- a/sources/Application/Model/Config.h +++ b/sources/Application/Model/Config.h @@ -1,10 +1,10 @@ #ifndef _CONFIG_H_ #define _CONFIG_H_ +#include "Externals/TinyXML/tinyxml.h" #include "Foundation/T_Singleton.h" #include "Foundation/Variables/VariableContainer.h" #include "System/Console/Trace.h" -#include "Externals/TinyXML/tinyxml.h" class Config: public T_Singleton,public VariableContainer { public: diff --git a/sources/Application/Model/Groove.h b/sources/Application/Model/Groove.h index 8d0779e9..a3013467 100644 --- a/sources/Application/Model/Groove.h +++ b/sources/Application/Model/Groove.h @@ -2,10 +2,10 @@ #ifndef _GROOVE_H_ #define _GROOVE_H_ -#include "Foundation/T_Singleton.h" -#include "Application/Persistency/Persistent.h" #include "Application/Model/Song.h" +#include "Application/Persistency/Persistent.h" #include "Application/Utils/HexBuffers.h" +#include "Foundation/T_Singleton.h" #define MAX_GROOVES 0x20 #define NO_GROOVE_DATA 0xFF diff --git a/sources/Application/Model/Mixer.h b/sources/Application/Model/Mixer.h index 393ce8d7..570d9e2e 100644 --- a/sources/Application/Model/Mixer.h +++ b/sources/Application/Model/Mixer.h @@ -4,9 +4,8 @@ #include "Foundation/T_Singleton.h" #include "Application/Persistency/Persistent.h" - -#include "Song.h" #include "Application/Utils/fixed.h" +#include "Song.h" class Mixer:public T_Singleton,Persistent { public: diff --git a/sources/Application/Model/Phrase.cpp b/sources/Application/Model/Phrase.cpp index a20887c0..a8497fab 100644 --- a/sources/Application/Model/Phrase.cpp +++ b/sources/Application/Model/Phrase.cpp @@ -1,7 +1,7 @@ #include "Phrase.h" -#include "System/System/System.h" #include #include +#include "System/System/System.h" Phrase::Phrase() { diff --git a/sources/Application/Model/Phrase.h b/sources/Application/Model/Phrase.h index 6d1e9f33..1610e226 100644 --- a/sources/Application/Model/Phrase.h +++ b/sources/Application/Model/Phrase.h @@ -2,6 +2,7 @@ #define _PHRASE_H_ #include "Foundation/Types/Types.h" + #define PHRASE_COUNT 0xFF #define NO_MORE_PHRASE 0x100 diff --git a/sources/Application/Model/Project.cpp b/sources/Application/Model/Project.cpp index cee834ac..bf506311 100644 --- a/sources/Application/Model/Project.cpp +++ b/sources/Application/Model/Project.cpp @@ -1,17 +1,16 @@ #include "Project.h" +#include +#include "Application/Instruments/SampleInstrument.h" +#include "Application/Instruments/SamplePool.h" +#include "Application/Persistency/PersistencyService.h" +#include "Application/Player/SyncMaster.h" +#include "Foundation/Variables/WatchedVariable.h" #include "Services/Midi/MidiService.h" #include "System/FileSystem/FileSystem.h" #include "System/Console/Trace.h" #include "System/io/Status.h" -#include "Foundation/Variables/WatchedVariable.h" -#include "Application/Player/SyncMaster.h" #include "Table.h" #include "Groove.h" -#include "Application/Persistency/PersistencyService.h" -#include "Application/Instruments/SamplePool.h" -#include "Application/Instruments/SampleInstrument.h" - -#include Project::Project() :Persistent("PROJECT") diff --git a/sources/Application/Model/Project.h b/sources/Application/Model/Project.h index 162fc43e..2a200f5e 100644 --- a/sources/Application/Model/Project.h +++ b/sources/Application/Model/Project.h @@ -1,12 +1,12 @@ #ifndef _PROJECT_H_ #define _PROJECT_H_ -#include "Song.h" -#include "Application/Instruments/InstrumentBank.h" #include "Application/Persistency/Persistent.h" #include "Foundation/Variables/VariableContainer.h" +#include "Application/Instruments/InstrumentBank.h" #include "Foundation/Types/Types.h" #include "Foundation/Observable.h" +#include "Song.h" #define VAR_TEMPO MAKE_FOURCC('T','M','P','O') diff --git a/sources/Application/Model/Song.cpp b/sources/Application/Model/Song.cpp index d1a08d9b..0a7d41d9 100644 --- a/sources/Application/Model/Song.cpp +++ b/sources/Application/Model/Song.cpp @@ -1,12 +1,11 @@ #include "Song.h" -#include "System/io/Status.h" -#include "Application/Utils/HexBuffers.h" -#include "Application/Instruments/CommandList.h" -#include "Table.h" +#include #include #include -#include - +#include "Application/Instruments/CommandList.h" +#include "Application/Utils/HexBuffers.h" +#include "System/io/Status.h" +#include "Table.h" Song::Song():Persistent("SONG") { diff --git a/sources/Application/Model/Song.h b/sources/Application/Model/Song.h index 68cf0c29..a54916fa 100644 --- a/sources/Application/Model/Song.h +++ b/sources/Application/Model/Song.h @@ -1,9 +1,9 @@ #ifndef _SONG_H_ #define _SONG_H_ +#include "Application/Persistency/Persistent.h" #include "Chain.h" #include "Phrase.h" -#include "Application/Persistency/Persistent.h" #define SONG_CHANNEL_COUNT 8 #define SONG_ROW_COUNT 256 diff --git a/sources/Application/Model/Table.cpp b/sources/Application/Model/Table.cpp index 41dc2ddd..4a209203 100644 --- a/sources/Application/Model/Table.cpp +++ b/sources/Application/Model/Table.cpp @@ -1,8 +1,8 @@ #include "Table.h" -#include "System/System/System.h" #include "Application/Instruments/CommandList.h" -#include "Application/Utils/HexBuffers.h" #include "Application/Utils/char.h" +#include "Application/Utils/HexBuffers.h" +#include "System/System/System.h" #include "Song.h" Table::Table() { @@ -180,4 +180,4 @@ int TableHolder::Clone(int table) { table_[target].Copy(table_[table]) ; } ; return target ; -} ; \ No newline at end of file +} ; diff --git a/sources/Application/Model/Table.h b/sources/Application/Model/Table.h index ccf36ade..8d8b3151 100644 --- a/sources/Application/Model/Table.h +++ b/sources/Application/Model/Table.h @@ -1,9 +1,9 @@ #ifndef _TABLE_H_ #define _TABLE_H_ -#include "Foundation/Types/Types.h" #include "Foundation/T_Singleton.h" #include "Application/Persistency/Persistent.h" +#include "Foundation/Types/Types.h" #define TABLE_COUNT 0x80 #define TABLE_STEPS 16 diff --git a/sources/Application/Persistency/PersistencyService.cpp b/sources/Application/Persistency/PersistencyService.cpp index ebcaaed6..a5c07b33 100644 --- a/sources/Application/Persistency/PersistencyService.cpp +++ b/sources/Application/Persistency/PersistencyService.cpp @@ -1,8 +1,8 @@ #include "PersistencyService.h" #include "Persistent.h" #include "Externals/Compression/lz.h" -#include "System/Console/Trace.h" #include "Foundation/Types/Types.h" +#include "System/Console/Trace.h" PersistencyService::PersistencyService():Service(MAKE_FOURCC('S','V','P','S')) { } ; diff --git a/sources/Application/Persistency/PersistencyService.h b/sources/Application/Persistency/PersistencyService.h index 27171df1..1686f09c 100644 --- a/sources/Application/Persistency/PersistencyService.h +++ b/sources/Application/Persistency/PersistencyService.h @@ -3,7 +3,7 @@ #include "Foundation/Services/Service.h" #include "Foundation/T_Singleton.h" - #include "Externals/TinyXML/tinyxml.h" +#include "Externals/TinyXML/tinyxml.h" class PersistencyService: public Service,public T_Singleton { public: diff --git a/sources/Application/Player/Player.cpp b/sources/Application/Player/Player.cpp index cd23982c..a07c3baa 100644 --- a/sources/Application/Player/Player.cpp +++ b/sources/Application/Player/Player.cpp @@ -1,17 +1,16 @@ #include "Player.h" -#include "Application/Views/BaseClasses/ViewEvent.h" -#include "System/io/Status.h" -#include "System/System/System.h" +#include +#include #include "Application/Instruments/CommandList.h" #include "Application/Instruments/I_Instrument.h" -#include "Application/Utils/char.h" -#include "System/Console/n_assert.h" -#include "Application/Player/TablePlayback.h" #include "Application/Model/Groove.h" -#include -#include +#include "Application/Player/TablePlayback.h" +#include "Application/Utils/char.h" +#include "Application/Views/BaseClasses/ViewEvent.h" #include "Services/Midi/MidiService.h" - +#include "System/Console/n_assert.h" +#include "System/io/Status.h" +#include "System/System/System.h" // Private constructor - Singleton Player::Player() { diff --git a/sources/Application/Player/Player.h b/sources/Application/Player/Player.h index a7b19f8e..e2975d14 100644 --- a/sources/Application/Player/Player.h +++ b/sources/Application/Player/Player.h @@ -1,10 +1,11 @@ #ifndef _PLAYER_H_ #define _PLAYER_H_ -#include "Foundation/T_Singleton.h" + #include "Foundation/Observable.h" -#include "System/Timer/Timer.h" +#include "Foundation/T_Singleton.h" #include "Application/Views/ViewData.h" #include "Application/Views/BaseClasses/ViewEvent.h" +#include "System/Timer/Timer.h" #include "PlayerMixer.h" #include "SyncMaster.h" diff --git a/sources/Application/Player/PlayerChannel.cpp b/sources/Application/Player/PlayerChannel.cpp index d673e109..02d911e3 100644 --- a/sources/Application/Player/PlayerChannel.cpp +++ b/sources/Application/Player/PlayerChannel.cpp @@ -1,8 +1,8 @@ #include "PlayerChannel.h" -#include "Application/Player/SyncMaster.h" #include "Application/Mixer/MixerService.h" #include "Application/Model/Mixer.h" +#include "Application/Player/SyncMaster.h" PlayerChannel::PlayerChannel(int index) { index_=index ; @@ -74,4 +74,4 @@ void PlayerChannel::Reset() { } muted_=false ; busIndex_=-1 ; -} ; \ No newline at end of file +} ; diff --git a/sources/Application/Player/PlayerMixer.cpp b/sources/Application/Player/PlayerMixer.cpp index 3e6a5289..b567e2f6 100644 --- a/sources/Application/Player/PlayerMixer.cpp +++ b/sources/Application/Player/PlayerMixer.cpp @@ -1,17 +1,15 @@ - #include "PlayerMixer.h" -#include "SyncMaster.h" -#include "System/Console/Trace.h" -#include "System/System/System.h" -#include "Application/Utils/fixed.h" -#include "Application/Utils/char.h" -#include "Services/Midi/MidiService.h" +#include +#include #include "Application/Mixer/MixerService.h" -#include "Application/Utils/char.h" #include "Application/Model/Mixer.h" -#include -#include +#include "Application/Utils/char.h" +#include "Application/Utils/fixed.h" +#include "Services/Midi/MidiService.h" +#include "System/Console/Trace.h" +#include "System/System/System.h" +#include "SyncMaster.h" PlayerMixer::PlayerMixer() { @@ -208,4 +206,4 @@ void PlayerMixer::Unlock() { MixerService *ms=MixerService::GetInstance() ; ms->Unlock() ; -} ; \ No newline at end of file +} ; diff --git a/sources/Application/Player/PlayerMixer.h b/sources/Application/Player/PlayerMixer.h index d8a45249..71944a1b 100644 --- a/sources/Application/Player/PlayerMixer.h +++ b/sources/Application/Player/PlayerMixer.h @@ -3,13 +3,13 @@ #define _APPLICATION_MIXER_H_ #include "Foundation/T_Singleton.h" +#include "Foundation/Observable.h" +#include "Application/Audio/AudioFileStreamer.h" #include "Application/Model/Project.h" -#include "Application/Views/ViewData.h" #include "Application/Utils/fixed.h" -#include "Application/Audio/AudioFileStreamer.h" -#include "PlayerChannel.h" -#include "Foundation/Observable.h" +#include "Application/Views/ViewData.h" #include "Services/Audio/AudioOut.h" +#include "PlayerChannel.h" #define STREAM_MIX_BUS 8 diff --git a/sources/Application/Player/TablePlayback.h b/sources/Application/Player/TablePlayback.h index 8dec1f6c..1bd7b0bb 100644 --- a/sources/Application/Player/TablePlayback.h +++ b/sources/Application/Player/TablePlayback.h @@ -1,9 +1,9 @@ #ifndef _TABLE_PLAYBACK_H_ #define _TABLE_PLAYBACK_H_ -#include "Application/Model/Table.h" -#include "Application/Model/Song.h" #include "Application/Model/Groove.h" +#include "Application/Model/Song.h" +#include "Application/Model/Table.h" class I_Instrument ; diff --git a/sources/Application/Utils/RandomNames.h b/sources/Application/Utils/RandomNames.h index 745734d1..22eefdb0 100644 --- a/sources/Application/Utils/RandomNames.h +++ b/sources/Application/Utils/RandomNames.h @@ -1,9 +1,9 @@ #ifndef _RANDOM_NAMES_H_ #define _RANDOM_NAMES_H_ +#include #include #include -#include #include "time.h" static const std::string adj[] = { diff --git a/sources/Application/Utils/char.h b/sources/Application/Utils/char.h index 78ebe78d..407a0570 100644 --- a/sources/Application/Utils/char.h +++ b/sources/Application/Utils/char.h @@ -1,8 +1,8 @@ #ifndef _CHAR_H_ #define _CHAR_H_ -#include "Foundation/Types/Types.h" #include +#include "Foundation/Types/Types.h" extern char h2c__[16] ; extern const char *notes__[12] ; diff --git a/sources/Application/Views/BaseClasses/UIField.h b/sources/Application/Views/BaseClasses/UIField.h index 5a78d39e..379bd995 100644 --- a/sources/Application/Views/BaseClasses/UIField.h +++ b/sources/Application/Views/BaseClasses/UIField.h @@ -1,10 +1,10 @@ #ifndef _UI_FIELD_H_ #define _UI_FIELD_H_ +#include "System/Console/Trace.h" #include "UIFramework/BasicDatas/GUIPoint.h" #include "UIFramework/SimpleBaseClasses/GUIWindow.h" #include "View.h" -#include "System/Console/Trace.h" class UIField { public: diff --git a/sources/Application/Views/BaseClasses/UIIntField.cpp b/sources/Application/Views/BaseClasses/UIIntField.cpp index fb72d3bb..5092c119 100644 --- a/sources/Application/Views/BaseClasses/UIIntField.cpp +++ b/sources/Application/Views/BaseClasses/UIIntField.cpp @@ -1,8 +1,9 @@ #include "UIIntField.h" -#include "UIFramework/Interfaces/I_GUIGraphics.h" -#include "System/Console/Trace.h" #include "Application/AppWindow.h" +#include "System/Console/Trace.h" +#include "UIFramework/Interfaces/I_GUIGraphics.h" + #define abs(x) (x<0?-x:x) diff --git a/sources/Application/Views/BaseClasses/UIIntVarField.cpp b/sources/Application/Views/BaseClasses/UIIntVarField.cpp index dc8b0b53..12393d23 100644 --- a/sources/Application/Views/BaseClasses/UIIntVarField.cpp +++ b/sources/Application/Views/BaseClasses/UIIntVarField.cpp @@ -2,9 +2,9 @@ #include "UIIntVarField.h" -#include "UIFramework/Interfaces/I_GUIGraphics.h" -#include "System/Console/Trace.h" #include "Application/AppWindow.h" +#include "System/Console/Trace.h" +#include "UIFramework/Interfaces/I_GUIGraphics.h" #define abs(x) (x<0?-x:x) diff --git a/sources/Application/Views/BaseClasses/UINoteVarField.cpp b/sources/Application/Views/BaseClasses/UINoteVarField.cpp index 682f9746..b4f4b4a0 100644 --- a/sources/Application/Views/BaseClasses/UINoteVarField.cpp +++ b/sources/Application/Views/BaseClasses/UINoteVarField.cpp @@ -1,7 +1,7 @@ #include "UINoteVarField.h" -#include "Application/Utils/char.h" #include "Application/AppWindow.h" +#include "Application/Utils/char.h" UINoteVarField::UINoteVarField(GUIPoint &position,Variable &v,const char *format,int min,int max,int xOffset,int yOffset) :UIIntVarField(position,v,format,min,max,xOffset,yOffset) { diff --git a/sources/Application/Views/BaseClasses/UITempoField.cpp b/sources/Application/Views/BaseClasses/UITempoField.cpp index 8ce009e3..7ab92b3b 100644 --- a/sources/Application/Views/BaseClasses/UITempoField.cpp +++ b/sources/Application/Views/BaseClasses/UITempoField.cpp @@ -1,6 +1,6 @@ #include "UITempoField.h" -#include "Application/Player/Player.h" #include "Application/Commands/ApplicationCommandDispatcher.h" +#include "Application/Player/Player.h" #include "System/System/System.h" UITempoField::UITempoField(FourCC action,GUIPoint &position,Variable &v,const char *format,int min,int max,int xOffset,int yOffset):UIIntVarField(position,v,format,min,max,xOffset,yOffset) { diff --git a/sources/Application/Views/BaseClasses/View.cpp b/sources/Application/Views/BaseClasses/View.cpp index 890ec3db..9b9d8075 100644 --- a/sources/Application/Views/BaseClasses/View.cpp +++ b/sources/Application/Views/BaseClasses/View.cpp @@ -1,9 +1,9 @@ #include "View.h" -#include "System/Console/Trace.h" -#include "Application/Player/Player.h" -#include "Application/Utils/char.h" #include "Application/AppWindow.h" #include "Application/Model/Config.h" +#include "Application/Player/Player.h" +#include "Application/Utils/char.h" +#include "System/Console/Trace.h" #include "ModalView.h" bool View::initPrivate_=false ; diff --git a/sources/Application/Views/BaseClasses/View.h b/sources/Application/Views/BaseClasses/View.h index 100ad6a5..d1ad1cda 100644 --- a/sources/Application/Views/BaseClasses/View.h +++ b/sources/Application/Views/BaseClasses/View.h @@ -2,14 +2,15 @@ #ifndef _VIEW_H_ #define _VIEW_H_ -#include "UIFramework/SimpleBaseClasses/GUIWindow.h" -#include "UIFramework/Interfaces/I_GUIGraphics.h" -#include "ViewEvent.h" +#include "Application/Model/Config.h" #include "Application/Model/Project.h" #include "Application/Player/Player.h" #include "Foundation/T_SimpleList.h" -#include "Application/Model/Config.h" +#include "UIFramework/Interfaces/I_GUIGraphics.h" +#include "UIFramework/SimpleBaseClasses/GUIWindow.h" #include "I_Action.h" +#include "ViewEvent.h" + enum GUIEventPadButtonMasks { EPBM_LEFT=1, diff --git a/sources/Application/Views/ChainView.cpp b/sources/Application/Views/ChainView.cpp index e95fbd2e..1138feaf 100644 --- a/sources/Application/Views/ChainView.cpp +++ b/sources/Application/Views/ChainView.cpp @@ -1,6 +1,6 @@ #include "ChainView.h" -#include "System/Console/Trace.h" #include "Application/Utils/char.h" +#include "System/Console/Trace.h" #include "UIController.h" diff --git a/sources/Application/Views/InstrumentView.cpp b/sources/Application/Views/InstrumentView.cpp index 5d00a4e6..d781e600 100644 --- a/sources/Application/Views/InstrumentView.cpp +++ b/sources/Application/Views/InstrumentView.cpp @@ -1,15 +1,15 @@ #include "InstrumentView.h" -#include "System/System/System.h" -#include "Application/Instruments/SampleInstrument.h" #include "Application/Instruments/MidiInstrument.h" +#include "Application/Instruments/SampleInstrument.h" #include "Application/Instruments/SamplePool.h" +#include "Application/Model/Config.h" #include "BaseClasses/UIBigHexVarField.h" +#include "BaseClasses/UIIntVarOffField.h" #include "BaseClasses/UINoteVarField.h" #include "BaseClasses/UIStaticField.h" -#include "BaseClasses/UIIntVarOffField.h" -#include "ModalDialogs/MessageBox.h" #include "ModalDialogs/ImportSampleDialog.h" -#include "Application/Model/Config.h" +#include "ModalDialogs/MessageBox.h" +#include "System/System/System.h" InstrumentView::InstrumentView(GUIWindow &w,ViewData *data):FieldView(w,data) { diff --git a/sources/Application/Views/InstrumentView.h b/sources/Application/Views/InstrumentView.h index 515c3fd2..ed4b897f 100644 --- a/sources/Application/Views/InstrumentView.h +++ b/sources/Application/Views/InstrumentView.h @@ -1,8 +1,8 @@ #ifndef _INSTRUMENT_VIEW_H_ #define _INSTRUMENT_VIEW_H_ -#include "Foundation/Observable.h" #include "BaseClasses/FieldView.h" +#include "Foundation/Observable.h" #include "ViewData.h" class InstrumentView: public FieldView, public I_Observer { diff --git a/sources/Application/Views/MixerView.cpp b/sources/Application/Views/MixerView.cpp index 7241ff53..fce7f83d 100644 --- a/sources/Application/Views/MixerView.cpp +++ b/sources/Application/Views/MixerView.cpp @@ -1,9 +1,9 @@ #include "MixerView.h" -#include "Application/Model/Mixer.h" -#include "Application/Utils/char.h" -#include #include #include +#include +#include "Application/Model/Mixer.h" +#include "Application/Utils/char.h" MixerView::MixerView(GUIWindow &w,ViewData *viewData):View(w,viewData) { clipboard_.active_=false ; diff --git a/sources/Application/Views/ModalDialogs/ImportSampleDialog.cpp b/sources/Application/Views/ModalDialogs/ImportSampleDialog.cpp index c9cfeb5a..b086de08 100644 --- a/sources/Application/Views/ModalDialogs/ImportSampleDialog.cpp +++ b/sources/Application/Views/ModalDialogs/ImportSampleDialog.cpp @@ -1,6 +1,6 @@ #include "ImportSampleDialog.h" -#include "Application/Instruments/SamplePool.h" #include "Application/Instruments/SampleInstrument.h" +#include "Application/Instruments/SamplePool.h" #define LIST_SIZE 15 #define LIST_WIDTH 28 diff --git a/sources/Application/Views/ModalDialogs/ImportSampleDialog.h b/sources/Application/Views/ModalDialogs/ImportSampleDialog.h index d31146d5..007d655d 100644 --- a/sources/Application/Views/ModalDialogs/ImportSampleDialog.h +++ b/sources/Application/Views/ModalDialogs/ImportSampleDialog.h @@ -2,9 +2,9 @@ #define _IMPORT_SAMPLE_DIALOG_H_ #include "Application/Views/BaseClasses/ModalView.h" +#include #include "Foundation/T_SimpleList.h" #include "System/FileSystem/FileSystem.h" -#include class ImportSampleDialog:public ModalView { public: diff --git a/sources/Application/Views/ModalDialogs/SelectProjectDialog.cpp b/sources/Application/Views/ModalDialogs/SelectProjectDialog.cpp index 218050f4..0a3a1daf 100644 --- a/sources/Application/Views/ModalDialogs/SelectProjectDialog.cpp +++ b/sources/Application/Views/ModalDialogs/SelectProjectDialog.cpp @@ -1,10 +1,10 @@ #include "SelectProjectDialog.h" #include "NewProjectDialog.h" -#include "System/Console/Trace.h" #include "Application/Views/ModalDialogs/MessageBox.h" - #include +#include "System/Console/Trace.h" + #define LIST_SIZE 20 #define LIST_WIDTH 32 diff --git a/sources/Application/Views/ModalDialogs/SelectProjectDialog.h b/sources/Application/Views/ModalDialogs/SelectProjectDialog.h index 437b227f..67831126 100644 --- a/sources/Application/Views/ModalDialogs/SelectProjectDialog.h +++ b/sources/Application/Views/ModalDialogs/SelectProjectDialog.h @@ -2,8 +2,8 @@ #define _SELECT_PROJECT_DIALOG_H_ #include "Application/Views/BaseClasses/ModalView.h" -#include "System/FileSystem/FileSystem.h" #include "System/Errors/Result.h" +#include "System/FileSystem/FileSystem.h" class SelectProjectDialog:public ModalView { public: diff --git a/sources/Application/Views/PhraseView.cpp b/sources/Application/Views/PhraseView.cpp index 230040c3..6e841b35 100644 --- a/sources/Application/Views/PhraseView.cpp +++ b/sources/Application/Views/PhraseView.cpp @@ -1,13 +1,13 @@ #include "PhraseView.h" -#include "System/Console/Trace.h" -#include "Application/Utils/char.h" +#include +#include #include "Application/Instruments/CommandList.h" -#include "UIController.h" #include "Application/Model/Table.h" +#include "Application/Utils/char.h" #include "Application/Utils/HelpLegend.h" -#include -#include - +#include "System/Console/Trace.h" +#include "UIController.h" + short PhraseView::offsets_[2][4] = { -1,1,12,-12, -1,1,16,-16 diff --git a/sources/Application/Views/PhraseView.h b/sources/Application/Views/PhraseView.h index 79598f87..cf1279c0 100644 --- a/sources/Application/Views/PhraseView.h +++ b/sources/Application/Views/PhraseView.h @@ -2,8 +2,8 @@ #ifndef _PHRASE_VIEW_H_ #define _PHRASE_VIEW_H_ -#include "BaseClasses/UIBigHexVarField.h" #include "BaseClasses/View.h" +#include "BaseClasses/UIBigHexVarField.h" #include "ViewData.h" #define FCC_EDIT MAKE_FOURCC('V','O','L','M') diff --git a/sources/Application/Views/ProjectView.cpp b/sources/Application/Views/ProjectView.cpp index b4d656dd..2a78542f 100644 --- a/sources/Application/Views/ProjectView.cpp +++ b/sources/Application/Views/ProjectView.cpp @@ -1,13 +1,13 @@ #include "ProjectView.h" -#include "BaseClasses/UIIntVarField.h" -#include "BaseClasses/UIActionField.h" -#include "BaseClasses/UITempoField.h" #include "Application/Persistency/PersistencyService.h" -#include "System/System/System.h" -#include "Services/Midi/MidiService.h" #include "Application/Views/ModalDialogs/MessageBox.h" #include "Application/Views/ModalDialogs/NewProjectDialog.h" #include "Application/Views/ModalDialogs/SelectProjectDialog.h" +#include "BaseClasses/UIActionField.h" +#include "BaseClasses/UIIntVarField.h" +#include "BaseClasses/UITempoField.h" +#include "Services/Midi/MidiService.h" +#include "System/System/System.h" #define ACTION_PURGE MAKE_FOURCC('P','U','R','G') #define ACTION_SAVE MAKE_FOURCC('S','A','V','E') diff --git a/sources/Application/Views/SongView.cpp b/sources/Application/Views/SongView.cpp index 04f80221..3433ad54 100644 --- a/sources/Application/Views/SongView.cpp +++ b/sources/Application/Views/SongView.cpp @@ -1,13 +1,13 @@ #include "SongView.h" +#include +#include +#include +#include +#include "Application/Player/Player.h" +#include "Application/Utils/char.h" #include "System/Console/Trace.h" #include "System/System/System.h" -#include "Application/Utils/char.h" -#include "Application/Player/Player.h" #include "UIController.h" -#include -#include -#include -#include /**************** Constructor diff --git a/sources/Application/Views/TableView.cpp b/sources/Application/Views/TableView.cpp index 379ac361..42305565 100644 --- a/sources/Application/Views/TableView.cpp +++ b/sources/Application/Views/TableView.cpp @@ -1,7 +1,7 @@ #include "TableView.h" -#include "Application/Utils/char.h" #include "Application/Instruments/CommandList.h" #include "Application/Player/TablePlayback.h" +#include "Application/Utils/char.h" #include "Application/Utils/HelpLegend.h" #define FCC_EDIT MAKE_FOURCC('T','B','E','D') diff --git a/sources/Application/Views/TableView.h b/sources/Application/Views/TableView.h index faa84c47..c9d89d79 100644 --- a/sources/Application/Views/TableView.h +++ b/sources/Application/Views/TableView.h @@ -1,10 +1,10 @@ #ifndef _TABLE_VIEW_H_ #define _TABLE_VIEW_H_ -#include "BaseClasses/UIBigHexVarField.h" #include "BaseClasses/View.h" -#include "ViewData.h" #include "Application/Model/Table.h" +#include "BaseClasses/UIBigHexVarField.h" +#include "ViewData.h" class TableView: public View { public: diff --git a/sources/Application/Views/UIController.cpp b/sources/Application/Views/UIController.cpp index 9276e3da..29330129 100644 --- a/sources/Application/Views/UIController.cpp +++ b/sources/Application/Views/UIController.cpp @@ -1,5 +1,4 @@ #include "UIController.h" - #include "Application/Player/Player.h" UIController::UIController() { diff --git a/sources/Foundation/Observable.cpp b/sources/Foundation/Observable.cpp index cb2cbf14..9a6d40a3 100644 --- a/sources/Foundation/Observable.cpp +++ b/sources/Foundation/Observable.cpp @@ -1,6 +1,5 @@ #include "Observable.h" - #include "T_SimpleList.h" Observable::Observable() { diff --git a/sources/Foundation/Variables/Variable.cpp b/sources/Foundation/Variables/Variable.cpp index 53f19ab6..8ade429e 100644 --- a/sources/Foundation/Variables/Variable.cpp +++ b/sources/Foundation/Variables/Variable.cpp @@ -1,8 +1,8 @@ #include "Variable.h" +#include #include #include #include -#include #include "System/Console/n_assert.h" #include "System/Console/Trace.h" diff --git a/sources/Services/Audio/AudioDriver.cpp b/sources/Services/Audio/AudioDriver.cpp index bd4b6da3..d820b12f 100644 --- a/sources/Services/Audio/AudioDriver.cpp +++ b/sources/Services/Audio/AudioDriver.cpp @@ -1,8 +1,8 @@ #include "AudioDriver.h" -#include "System/System/System.h" -#include "System/Console/Trace.h" #include "System/Console/n_assert.h" +#include "System/Console/Trace.h" +#include "System/System/System.h" AudioDriver::AudioDriver(AudioSettings &settings) { settings_=settings ; diff --git a/sources/Services/Audio/AudioMixer.h b/sources/Services/Audio/AudioMixer.h index a3abe92d..1f311c32 100644 --- a/sources/Services/Audio/AudioMixer.h +++ b/sources/Services/Audio/AudioMixer.h @@ -3,8 +3,9 @@ #include "AudioModule.h" #include "Foundation/T_SimpleList.h" -#include "Application/Instruments/WavFileWriter.h" #include +#include "Application/Instruments/WavFileWriter.h" + class AudioMixer: public AudioModule,public T_SimpleList { public: diff --git a/sources/Services/Audio/AudioOutDriver.cpp b/sources/Services/Audio/AudioOutDriver.cpp index d6211b06..29123075 100644 --- a/sources/Services/Audio/AudioOutDriver.cpp +++ b/sources/Services/Audio/AudioOutDriver.cpp @@ -1,10 +1,11 @@ #include "AudioOutDriver.h" -#include "System/System/System.h" #include "AudioDriver.h" #include "Application/Player/SyncMaster.h" // Should be installable -#include "System/Console/Trace.h" #include "Services/Time/TimeService.h" +#include "System/Console/Trace.h" +#include "System/System/System.h" + AudioOutDriver::AudioOutDriver(AudioDriver &driver) { driver_=&driver ; @@ -145,4 +146,4 @@ int AudioOutDriver::GetAudioPreBufferCount() { } ; double AudioOutDriver::GetStreamTime() { return driver_->GetStreamTime() ; -} ; \ No newline at end of file +} ; diff --git a/sources/Services/Controllers/ButtonControllerSource.cpp b/sources/Services/Controllers/ButtonControllerSource.cpp index 6a2fb90d..225385a0 100644 --- a/sources/Services/Controllers/ButtonControllerSource.cpp +++ b/sources/Services/Controllers/ButtonControllerSource.cpp @@ -1,6 +1,6 @@ #include "ButtonControllerSource.h" -#include "System/Console/Trace.h" #include +#include "System/Console/Trace.h" ButtonControllerSource::ButtonControllerSource(const char *name):ControllerSource("but",name) { } ; diff --git a/sources/Services/Controllers/Channel.cpp b/sources/Services/Controllers/Channel.cpp index 13d2a53e..8a7a037b 100644 --- a/sources/Services/Controllers/Channel.cpp +++ b/sources/Services/Controllers/Channel.cpp @@ -1,8 +1,9 @@ #include "Channel.h" -#include "System/Console/Trace.h" -#include #include +#include +#include "System/Console/Trace.h" + Channel::Channel() { name_="unnamed" ; } ; @@ -41,4 +42,4 @@ void Channel::SetName(const char *name) { const char *Channel::GetName() { return name_.c_str() ; -} ; \ No newline at end of file +} ; diff --git a/sources/Services/Controllers/ControlNode.cpp b/sources/Services/Controllers/ControlNode.cpp index 7503d41e..edea4c58 100644 --- a/sources/Services/Controllers/ControlNode.cpp +++ b/sources/Services/Controllers/ControlNode.cpp @@ -1,7 +1,7 @@ #include "Services/Controllers/ControllerService.h" #include "ControlNode.h" -#include "System/Console/Trace.h" #include +#include "System/Console/Trace.h" using namespace std; diff --git a/sources/Services/Controllers/ControlNode.h b/sources/Services/Controllers/ControlNode.h index 4b22f281..6a0b60c3 100644 --- a/sources/Services/Controllers/ControlNode.h +++ b/sources/Services/Controllers/ControlNode.h @@ -3,8 +3,8 @@ #define _CONTROL_NODE_H_ #include "Foundation/T_SimpleList.h" -#include "Services/Controllers/Channel.h" #include "Foundation/Observable.h" +#include "Services/Controllers/Channel.h" #include "Services/Controllers/ControllerService.h" enum ControlNodeType { diff --git a/sources/Services/Controllers/ControllerService.cpp b/sources/Services/Controllers/ControllerService.cpp index 01636e25..e529b1da 100644 --- a/sources/Services/Controllers/ControllerService.cpp +++ b/sources/Services/Controllers/ControllerService.cpp @@ -1,9 +1,8 @@ -#include "System/Console/Trace.h" -//#include "Framework/Types/Types.h" #include "ControllerService.h" +#include #include #include -#include +#include "System/Console/Trace.h" using namespace std; diff --git a/sources/Services/Controllers/ControllerService.h b/sources/Services/Controllers/ControllerService.h index 53c39c8d..ae374989 100644 --- a/sources/Services/Controllers/ControllerService.h +++ b/sources/Services/Controllers/ControllerService.h @@ -4,10 +4,9 @@ #include "Foundation/T_Singleton.h" #include "Foundation/T_SimpleList.h" - +#include "Services/Time/TimeService.h" #include "ControllerSource.h" #include "ControllableVariable.h" -#include "Services/Time/TimeService.h" class ControllerService: public T_Singleton,public T_SimpleList { public: diff --git a/sources/Services/Controllers/ControllerSource.cpp b/sources/Services/Controllers/ControllerSource.cpp index d83e7694..bf5eade0 100644 --- a/sources/Services/Controllers/ControllerSource.cpp +++ b/sources/Services/Controllers/ControllerSource.cpp @@ -1,7 +1,6 @@ #include "ControllerSource.h" #include "ControllerService.h" -//#include "System/Memory/Memory.h" #include ControllerSource::ControllerSource(const char *devclass,const char *name) { @@ -21,4 +20,4 @@ const char *ControllerSource::GetClass() { const char *ControllerSource::GetName() { return name_.c_str() ; -} ; \ No newline at end of file +} ; diff --git a/sources/Services/Controllers/ControllerSource.h b/sources/Services/Controllers/ControllerSource.h index 925ccc7e..8e5b19cc 100644 --- a/sources/Services/Controllers/ControllerSource.h +++ b/sources/Services/Controllers/ControllerSource.h @@ -1,9 +1,9 @@ #ifndef _CONTROLLER_SOURCE_H_ #define _CONTROLLER_SOURCE_H_ -#include "Channel.h" #include #include "Services/Time/TimeService.h" +#include "Channel.h" class ControllerSource { public: diff --git a/sources/Services/Controllers/HatControllerSource.cpp b/sources/Services/Controllers/HatControllerSource.cpp index c91a4603..b9c2c33d 100644 --- a/sources/Services/Controllers/HatControllerSource.cpp +++ b/sources/Services/Controllers/HatControllerSource.cpp @@ -1,6 +1,6 @@ #include "HatControllerSource.h" -#include "System/Console/Trace.h" #include +#include "System/Console/Trace.h" HatControllerSource::HatControllerSource(const char *name):ControllerSource("hat",name) { } ; diff --git a/sources/Services/Controllers/KeyboardControllerSource.cpp b/sources/Services/Controllers/KeyboardControllerSource.cpp index d0622c15..0e63248e 100644 --- a/sources/Services/Controllers/KeyboardControllerSource.cpp +++ b/sources/Services/Controllers/KeyboardControllerSource.cpp @@ -1,7 +1,8 @@ #include "KeyboardControllerSource.h" -#include "UIFramework/Interfaces/I_GUIWindowFactory.h" -#include "System/Console/Trace.h" #include +#include "System/Console/Trace.h" +#include "UIFramework/Interfaces/I_GUIWindowFactory.h" + KeyboardControllerSource::KeyboardControllerSource(const char *name):ControllerSource("key",name) { memset(channel_,0,MAX_KEY*sizeof(Channel *)) ; diff --git a/sources/Services/Midi/MidiEvent.cpp b/sources/Services/Midi/MidiEvent.cpp index 065fbe08..1ef12b93 100644 --- a/sources/Services/Midi/MidiEvent.cpp +++ b/sources/Services/Midi/MidiEvent.cpp @@ -1,7 +1,7 @@ #include "MidiEvent.h" -#include "System/System/System.h" #include +#include "System/System/System.h" MidiEvent::MidiEvent(unsigned char status,unsigned char data1,unsigned char data2) { diff --git a/sources/Services/Midi/MidiInDevice.cpp b/sources/Services/Midi/MidiInDevice.cpp index 3ba59658..87669eee 100644 --- a/sources/Services/Midi/MidiInDevice.cpp +++ b/sources/Services/Midi/MidiInDevice.cpp @@ -1,7 +1,7 @@ #include "MidiInDevice.h" -#include "System/System/System.h" -#include "System/Console/Trace.h" #include "Application/Model/Config.h" +#include "System/Console/Trace.h" +#include "System/System/System.h" using namespace std; diff --git a/sources/Services/Midi/MidiInMerger.h b/sources/Services/Midi/MidiInMerger.h index 3396ad05..6694285f 100644 --- a/sources/Services/Midi/MidiInMerger.h +++ b/sources/Services/Midi/MidiInMerger.h @@ -3,9 +3,9 @@ #include "MidiChannel.h" #include "MidiInDevice.h" - -#include #include +#include + typedef std::map tChannelMap ; @@ -20,4 +20,4 @@ class MidiInMerger: public Observable, public ControllerSource,public T_SimpleLi tChannelMap channels_ ; } ; -#endif \ No newline at end of file +#endif diff --git a/sources/Services/Midi/MidiMessage.h b/sources/Services/Midi/MidiMessage.h index 154788a3..fd423829 100644 --- a/sources/Services/Midi/MidiMessage.h +++ b/sources/Services/Midi/MidiMessage.h @@ -1,7 +1,7 @@ #pragma once -#include "Foundation/Types/Types.h" #include "Foundation/Observable.h" +#include "Foundation/Types/Types.h" #include "MidiMessage.h" struct MidiMessage:public I_ObservableData @@ -43,4 +43,4 @@ struct MidiMessage:public I_ObservableData unsigned char status_ ; unsigned char data1_ ; unsigned char data2_ ; -}; \ No newline at end of file +}; diff --git a/sources/Services/Midi/MidiService.cpp b/sources/Services/Midi/MidiService.cpp index d456804a..4f16732e 100644 --- a/sources/Services/Midi/MidiService.cpp +++ b/sources/Services/Midi/MidiService.cpp @@ -1,10 +1,9 @@ #include "MidiService.h" -#include "Application/Player/SyncMaster.h" -#include "System/Console/Trace.h" -#include "System/Timer/Timer.h" #include "Application/Model/Config.h" +#include "Application/Player/SyncMaster.h" #include "Services/Audio/AudioDriver.h" #include "System/Console/Trace.h" +#include "System/Timer/Timer.h" #ifdef SendMessage #undef SendMessage diff --git a/sources/Services/Time/TimeService.cpp b/sources/Services/Time/TimeService.cpp index 45a00dca..4bde2fa1 100644 --- a/sources/Services/Time/TimeService.cpp +++ b/sources/Services/Time/TimeService.cpp @@ -1,6 +1,6 @@ #include "TimeService.h" +#include #include "System/System/System.h" -#include "SDL/SDL.h" /*Date::Date() { } ; @@ -43,4 +43,4 @@ Time TimeService::GetTime() { void TimeService::Sleep(int msecs) { SDL_Delay(msecs) ; -} ; \ No newline at end of file +} ; diff --git a/sources/System/Console/Trace.cpp b/sources/System/Console/Trace.cpp index d18a7ba8..7fb75b86 100644 --- a/sources/System/Console/Trace.cpp +++ b/sources/System/Console/Trace.cpp @@ -1,9 +1,8 @@ -#include "System/System/System.h" #include "Trace.h" -#include #include +#include #include - +#include "System/System/System.h" Trace::Trace() :logger_(0) diff --git a/sources/System/Console/n_assert.cpp b/sources/System/Console/n_assert.cpp index ef503323..3a1c0582 100644 --- a/sources/System/Console/n_assert.cpp +++ b/sources/System/Console/n_assert.cpp @@ -1,7 +1,7 @@ #include "System/Console/Trace.h" -#include #include +#include void __NAssert(const char *exp, const char *file, unsigned line) { const char *filestr=file ; diff --git a/sources/System/FileSystem/FileSystem.cpp b/sources/System/FileSystem/FileSystem.cpp index 168c793f..a7c61b4e 100644 --- a/sources/System/FileSystem/FileSystem.cpp +++ b/sources/System/FileSystem/FileSystem.cpp @@ -1,7 +1,7 @@ #include "FileSystem.h" +#include #include "Application/Utils/wildcard.h" #include "System/Console/Trace.h" -#include T_SimpleList Path::aliases_(true) ; @@ -215,4 +215,4 @@ int FileSystemService::Copy(const Path &src,const Path &dst) isrc->Close(); idst->Close(); return nbwrite; -} \ No newline at end of file +} diff --git a/sources/System/FileSystem/FileSystem.h b/sources/System/FileSystem/FileSystem.h index a915ffc8..5a66038b 100644 --- a/sources/System/FileSystem/FileSystem.h +++ b/sources/System/FileSystem/FileSystem.h @@ -1,14 +1,14 @@ #ifndef _FILESYSTEM_H_ #define _FILESYSTEM_H_ -#include "System/System/System.h" +#include +#include +#include #include "Foundation/T_Factory.h" #include "Foundation/T_SimpleList.h" #include "Foundation/Types/Types.h" #include "System/Errors/Result.h" -#include -#include -#include +#include "System/System/System.h" #define MAX_FILENAME_SIZE 256 diff --git a/sources/System/Process/Process.cpp b/sources/System/Process/Process.cpp index c3a772ff..172dc281 100644 --- a/sources/System/Process/Process.cpp +++ b/sources/System/Process/Process.cpp @@ -1,7 +1,7 @@ #include "Process.h" -#include "System/Console/Trace.h" #include "System/Console/n_assert.h" +#include "System/Console/Trace.h" bool SysThread::Start() { return SysProcessFactory::GetInstance()->BeginThread(*this) ; diff --git a/sources/System/Timer/Timer.h b/sources/System/Timer/Timer.h index 2936dcd6..4bf57375 100644 --- a/sources/System/Timer/Timer.h +++ b/sources/System/Timer/Timer.h @@ -1,8 +1,8 @@ #ifndef _TIMER_H_ #define _TIMER_H_ -#include "Foundation/T_Factory.h" #include "Foundation/Observable.h" +#include "Foundation/T_Factory.h" typedef void (*timerCallback)() ; diff --git a/sources/System/_Midi/Midi.cpp b/sources/System/_Midi/Midi.cpp index 1e86572f..5575fb94 100644 --- a/sources/System/_Midi/Midi.cpp +++ b/sources/System/_Midi/Midi.cpp @@ -1,6 +1,6 @@ #include "Midi.h" -#include "System/io/Trace.h" #include "Application/Player/SyncMaster.h" +#include "System/io/Trace.h" Midi::Midi() { for (int i=0;i #include +#include //#include void Status::Set(char *fmt, ...) { diff --git a/sources/UIFramework/BasicDatas/GUIBitmap.cpp b/sources/UIFramework/BasicDatas/GUIBitmap.cpp index ca0cbb51..fe7c282e 100644 --- a/sources/UIFramework/BasicDatas/GUIBitmap.cpp +++ b/sources/UIFramework/BasicDatas/GUIBitmap.cpp @@ -1,9 +1,9 @@ #include "GUIBitmap.h" +#include #include "UIFramework/Interfaces/I_GUIWindowFactory.h" //#include "Engine/ENGBitmap.h" #define ENGBitmap int -#include // This constructor. We wrap the class around an Implementation class // That way, we can change the imps we use without changing the core code diff --git a/sources/UIFramework/BasicDatas/GUIBitmap.h b/sources/UIFramework/BasicDatas/GUIBitmap.h index b9486349..89c8f953 100644 --- a/sources/UIFramework/BasicDatas/GUIBitmap.h +++ b/sources/UIFramework/BasicDatas/GUIBitmap.h @@ -1,8 +1,8 @@ #ifndef _GUIBITMAP_H_ #define _GUIBITMAP_H_ -#include "UIFramework/Interfaces/I_GUIBitmapImp.h" #include "UIFramework/BasicDatas/GUIResourceID.h" +#include "UIFramework/Interfaces/I_GUIBitmapImp.h" // Class for Bitmap description in GUI. The bitmap is drawable so // it implements I_GUIGraphics diff --git a/sources/UIFramework/Framework/GUIParentGraphics.cpp b/sources/UIFramework/Framework/GUIParentGraphics.cpp index b6b09536..f4f1d5b6 100644 --- a/sources/UIFramework/Framework/GUIParentGraphics.cpp +++ b/sources/UIFramework/Framework/GUIParentGraphics.cpp @@ -1,7 +1,7 @@ #include "GUIParentGraphics.h" -#include "UIFramework/BasicDatas/GUIBitmap.h" #include "Application/utils/assert.h" +#include "UIFramework/BasicDatas/GUIBitmap.h" GUIParentGraphics::GUIParentGraphics() { diff --git a/sources/UIFramework/Framework/GUIParentGraphics.h b/sources/UIFramework/Framework/GUIParentGraphics.h index 96fbd98b..5eceff0e 100644 --- a/sources/UIFramework/Framework/GUIParentGraphics.h +++ b/sources/UIFramework/Framework/GUIParentGraphics.h @@ -3,9 +3,8 @@ #define _GUIPARENTGRAPHICS_H_ #include "UIFramework/Interfaces/I_GUIGraphics.h" -#include "UIFramework/Interfaces/I_GUIControl.h" - #include +#include "UIFramework/Interfaces/I_GUIControl.h" class GUIParentGraphics: public I_GUIGraphics { public: diff --git a/sources/UIFramework/Interfaces/I_GUIGraphics.h b/sources/UIFramework/Interfaces/I_GUIGraphics.h index 91abc43f..9b725e1f 100644 --- a/sources/UIFramework/Interfaces/I_GUIGraphics.h +++ b/sources/UIFramework/Interfaces/I_GUIGraphics.h @@ -1,8 +1,8 @@ #ifndef _I_GUIGRAPHICS_H_ #define _I_GUIGRAPHICS_H_ -#include "UIFramework/Framework/GUIColor.h" #include "UIFramework/BasicDatas/GUIRect.h" +#include "UIFramework/Framework/GUIColor.h" #include "UIFramework/Framework/GUITextProperties.h" //#include "Engine/ENGBitmap.h" diff --git a/sources/UIFramework/Interfaces/I_GUIWindowFactory.h b/sources/UIFramework/Interfaces/I_GUIWindowFactory.h index 2cf7dc2f..8ff9e9f4 100644 --- a/sources/UIFramework/Interfaces/I_GUIWindowFactory.h +++ b/sources/UIFramework/Interfaces/I_GUIWindowFactory.h @@ -3,9 +3,8 @@ #define _I_GUIWINDOWFACTORY_H_ #include "I_GUIWindowImp.h" -#include "UIFramework/SimpleBaseClasses/EventManager.h" - #include "UIFramework/BasicDatas/GUICreateWindowParams.h" +#include "UIFramework/SimpleBaseClasses/EventManager.h" #include "Foundation/T_Factory.h" // The GUI factory. This object is responsible for the creation of all diff --git a/sources/UIFramework/Interfaces/I_GUIWindowImp.h b/sources/UIFramework/Interfaces/I_GUIWindowImp.h index 93189ee8..bf343995 100644 --- a/sources/UIFramework/Interfaces/I_GUIWindowImp.h +++ b/sources/UIFramework/Interfaces/I_GUIWindowImp.h @@ -1,9 +1,9 @@ #ifndef _I_GUIWINDOWIMP_H_ #define _I_GUIWINDOWIMP_H_ +#include "UIFramework/BasicDatas/GUIEvent.h" #include "UIFramework/BasicDatas/GUICreateWindowParams.h" #include "I_GUIGraphics.h" -#include "UIFramework/BasicDatas/GUIEvent.h" class I_GUIWindowFactory ; // forward declaration class GUIWindow ; diff --git a/sources/UIFramework/SimpleBaseClasses/EventManager.cpp b/sources/UIFramework/SimpleBaseClasses/EventManager.cpp index fe55efb0..5aa24cd7 100644 --- a/sources/UIFramework/SimpleBaseClasses/EventManager.cpp +++ b/sources/UIFramework/SimpleBaseClasses/EventManager.cpp @@ -8,9 +8,9 @@ */ #include "EventManager.h" -#include "Application/Model/Config.h" -#include "Application/Controllers/ControlRoom.h" #include "Application/Commands/NodeList.h" +#include "Application/Controllers/ControlRoom.h" +#include "Application/Model/Config.h" bool EventManager::Init() { return true ; @@ -68,4 +68,4 @@ void EventManager::InstallMappings() { cr->Attach(URL_VOLUME_INCREASE,mapping_[APP_BUTTON_VOLINC].c_str()) ; cr->Attach(URL_VOLUME_DECREASE,mapping_[APP_BUTTON_VOLDEC].c_str()) ; -} \ No newline at end of file +} diff --git a/sources/UIFramework/SimpleBaseClasses/GUIWindow.cpp b/sources/UIFramework/SimpleBaseClasses/GUIWindow.cpp index e8361d2a..ff6f8062 100644 --- a/sources/UIFramework/SimpleBaseClasses/GUIWindow.cpp +++ b/sources/UIFramework/SimpleBaseClasses/GUIWindow.cpp @@ -1,7 +1,7 @@ #include "GUIWindow.h" -#include "UIFramework/Interfaces/I_GUIWindowImp.h" #include "UIFramework/Interfaces/I_GUIWindowFactory.h" +#include "UIFramework/Interfaces/I_GUIWindowImp.h" // Constructor: We wrap the window around an implementation that // will be used to provide system functionalities @@ -91,4 +91,4 @@ bool GUIWindow::DispatchEvent(GUIEvent &event) void GUIWindow::PushEvent(GUIEvent &event) { _imp->PushEvent(event) ; -} ; \ No newline at end of file +} ; From 25227fc692a6e16288da4a963b2f1557e91ae2bd Mon Sep 17 00:00:00 2001 From: Simon Lees Date: Sun, 4 Aug 2024 19:48:47 +0930 Subject: [PATCH 15/66] Revert "SDL2: Add initial implementation" This reverts commit d39e03b7db2b23d252fed19b340d93d3857d247b. --- sources/Adapters/Audio/SDLAudio.cpp | 39 -- sources/Adapters/Audio/SDLAudio.h | 17 - sources/Adapters/Audio/SDLAudioDriver.cpp | 198 -------- sources/Adapters/Audio/SDLAudioDriver.h | 51 -- sources/Adapters/GUI/GUIFactory.cpp | 18 - sources/Adapters/GUI/GUIFactory.h | 18 - sources/Adapters/GUI/SDLEventManager.cpp | 171 ------- sources/Adapters/GUI/SDLEventManager.h | 36 -- sources/Adapters/GUI/SDLGUIWindowImp.cpp | 543 ---------------------- sources/Adapters/GUI/SDLGUIWindowImp.h | 69 --- sources/Adapters/Input/SDLInput.cpp | 203 -------- sources/Adapters/Input/SDLInput.h | 35 -- sources/Adapters/Process/SDLProcess.cpp | 54 --- sources/Adapters/Process/SDLProcess.h | 23 - sources/Adapters/Timer/SDLTimer.cpp | 73 --- sources/Adapters/Timer/SDLTimer.h | 32 -- 16 files changed, 1580 deletions(-) delete mode 100644 sources/Adapters/Audio/SDLAudio.cpp delete mode 100644 sources/Adapters/Audio/SDLAudio.h delete mode 100644 sources/Adapters/Audio/SDLAudioDriver.cpp delete mode 100644 sources/Adapters/Audio/SDLAudioDriver.h delete mode 100644 sources/Adapters/GUI/GUIFactory.cpp delete mode 100644 sources/Adapters/GUI/GUIFactory.h delete mode 100644 sources/Adapters/GUI/SDLEventManager.cpp delete mode 100644 sources/Adapters/GUI/SDLEventManager.h delete mode 100644 sources/Adapters/GUI/SDLGUIWindowImp.cpp delete mode 100644 sources/Adapters/GUI/SDLGUIWindowImp.h delete mode 100644 sources/Adapters/Input/SDLInput.cpp delete mode 100644 sources/Adapters/Input/SDLInput.h delete mode 100644 sources/Adapters/Process/SDLProcess.cpp delete mode 100644 sources/Adapters/Process/SDLProcess.h delete mode 100644 sources/Adapters/Timer/SDLTimer.cpp delete mode 100644 sources/Adapters/Timer/SDLTimer.h diff --git a/sources/Adapters/Audio/SDLAudio.cpp b/sources/Adapters/Audio/SDLAudio.cpp deleted file mode 100644 index 79d92088..00000000 --- a/sources/Adapters/Audio/SDLAudio.cpp +++ /dev/null @@ -1,39 +0,0 @@ - -#include "SDLAudio.h" -#include "SDLAudioDriver.h" -#include "Services/Audio/AudioOutDriver.h" - -SDLAudio::SDLAudio(AudioSettings &hints):Audio(hints) { - hints_=hints; -} - -SDLAudio::~SDLAudio() { -} - -void SDLAudio::Init() { - AudioSettings settings ; - settings.audioAPI_=GetAudioAPI(); - - settings.bufferSize_=GetAudioBufferSize() ; - settings.preBufferCount_=GetAudioPreBufferCount() ; - - - SDLAudioDriver *drv=new SDLAudioDriver(settings) ; - AudioOut *out=new AudioOutDriver(*drv) ; - Insert(out) ; -} ; - -void SDLAudio::Close() { - IteratorPtrit(GetIterator()) ; - for (it->Begin();!it->IsDone();it->Next()) { - AudioOut ¤t=it->CurrentItem() ; - current.Close() ; - } -} ; - -int SDLAudio::GetMixerVolume() { - return 100 ; -} ; - -void SDLAudio::SetMixerVolume(int volume) { -} ; diff --git a/sources/Adapters/Audio/SDLAudio.h b/sources/Adapters/Audio/SDLAudio.h deleted file mode 100644 index b178b848..00000000 --- a/sources/Adapters/Audio/SDLAudio.h +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef _SDL_AUDIO_H_ -#define _SDL_AUDIO_H_ - -#include "Services/Audio/Audio.h" - -class SDLAudio: public Audio { -public: - SDLAudio(AudioSettings &hints) ; // Allow for different default size for different platform - ~SDLAudio() ; - virtual void Init() ; - virtual void Close() ; - virtual int GetMixerVolume() ; - virtual void SetMixerVolume(int volume) ; -private: - AudioSettings hints_ ; -}; -#endif diff --git a/sources/Adapters/Audio/SDLAudioDriver.cpp b/sources/Adapters/Audio/SDLAudioDriver.cpp deleted file mode 100644 index 3755f822..00000000 --- a/sources/Adapters/Audio/SDLAudioDriver.cpp +++ /dev/null @@ -1,198 +0,0 @@ -#include "SDLAudioDriver.h" -#include "System/Console/Trace.h" -#include "Services/Time/TimeService.h" -#include "System/System/System.h" -#include "Services/Midi/MidiService.h" - -void sdl_callback(void *userdata, Uint8 *stream, int len) { - SDLAudioDriver *sound=(SDLAudioDriver *)userdata ; - sound->OnChunkDone(stream,len) ; -} ; - -SDLAudioDriverThread::SDLAudioDriverThread(SDLAudioDriver *driver) { - semaphore_=SysSemaphore::Create(0,4) ; - driver_=driver ; -} ; - -bool SDLAudioDriverThread::Execute() { - while (!shouldTerminate()) { - semaphore_->Wait() ; - driver_->OnNewBufferNeeded(); - } ; - SysSemaphore *semaphore=semaphore_ ; - semaphore_=0 ; - delete semaphore ; - return true ; -} ; - -void SDLAudioDriverThread::Notify() { - if (semaphore_) { - semaphore_->Post() ; - } -} ; - -void SDLAudioDriverThread::RequestTermination() { - SysThread::RequestTermination() ; - // post to be sure we're not locked - semaphore_->Post() ; - // Wait for thread to finish - SDL_Delay(10) ; -} - -//------------------------------------------------------------------------------------------------- - -SDLAudioDriver::SDLAudioDriver(AudioSettings &settings):AudioDriver(settings), - unalignedMain_(0), - miniBlank_(0) -{ - isPlaying_=false ; - thread_=0 ; -} - -SDLAudioDriver::~SDLAudioDriver() { -} - -struct SDL_AudioSpec input ; -struct SDL_AudioSpec returned ; - -bool SDLAudioDriver::InitDriver() { - - //set sound - input.freq=44100 ; - input.format=AUDIO_S16SYS ; - input.channels=2 ; - input.callback=sdl_callback ; - input.samples=settings_.bufferSize_ ; - input.userdata=this ; - - // On my machine this wasn't working. - // SDL_AudioDeviceID deviceId = SDL_OpenAudioDevice(NULL,0,&input,&returned,0); - // The above may return 0 meaning an error or success. - int ret = SDL_OpenAudio(&input,&returned); - if ( ret != 0 ) - { - Trace::Error("Couldn't open sdl audio: %s\n", SDL_GetError()); - return false ; - } - const char * driverName = SDL_GetCurrentAudioDriver() ; - - fragSize_=returned.size ; - // Allocates a rotating sound buffer - unalignedMain_=(char *)SYS_MALLOC(fragSize_+SOUND_BUFFER_MAX) ; - // Make sure the buffer is aligned -#ifdef _64BIT - mainBuffer_=(char *)unalignedMain_; -#else - mainBuffer_=(char *)((((int)unalignedMain_)+1)&(0xFFFFFFFC)) ; -#endif - - Trace::Log("AUDIO","%s successfully opened with %d samples",driverName,fragSize_/4 ) ; - - // Create mini blank buffer in case of underruns - - miniBlank_=(char *)malloc(fragSize_) ; - SYS_MEMSET(miniBlank_,0,fragSize_) ; - - return true ; -} ; - -void SDLAudioDriver::CloseDriver() { - - if (miniBlank_) { - SYS_FREE(miniBlank_) ; - miniBlank_=0 ; - } - - if (unalignedMain_) { - SYS_FREE (unalignedMain_) ; - unalignedMain_=0 ; - } ; - SDL_CloseAudio(); -} ; - -bool SDLAudioDriver::StartDriver() { - - thread_=new SDLAudioDriverThread(this) ; - thread_->Start() ; - - short blank[4000] ; - SYS_MEMSET(blank,0,4000) ; - bufferPos_=0 ; - bufferSize_=0 ; - - for (int i=0;iAdvancePlayQueue(); - } - if (settings_.preBufferCount_==0) { - thread_->Notify() ; - } - - SDL_PauseAudio(0); - startTime_=SDL_GetTicks() ; - - return 1 ; -} ; - -void SDLAudioDriver::StopDriver() { - if (thread_) { - thread_->RequestTermination() ; - SysThread *thread=thread_ ; - thread_=0 ; - SDL_PauseAudio(1); - delete thread ; - } ; -} ; - -double SDLAudioDriver::GetStreamTime() { - return (SDL_GetTicks()-startTime_)/1000.0 ; -} - -void SDLAudioDriver::OnChunkDone(Uint8 *stream,int len) { - - // Look if we have enough data in main buffer - - while (bufferSize_-bufferPos_Flush() ; - // Adapt buffer variables - - bufferSize_=bufferSize_-bufferPos_+pool_[poolPlayPosition_].size_ ; - bufferPos_=0 ; - - SYS_FREE( pool_[poolPlayPosition_].buffer_) ; - - pool_[poolPlayPosition_].buffer_=0 ; - poolPlayPosition_=(poolPlayPosition_+1)%SOUND_BUFFER_COUNT ; - if (thread_) thread_->Notify() ; - - } - } - // Now dump audio to the device - - SYS_MEMCPY(stream,(short *)(mainBuffer_+bufferPos_), len); - onAudioBufferTick(); - bufferPos_+=len ; -} - -int SDLAudioDriver::GetPlayedBufferPercentage() { -// return 100-(bufferSize_-bufferPos_-fragSize_)*100/(bufferSize_-fragSize_) ; - return 0 ; -} ; - - - diff --git a/sources/Adapters/Audio/SDLAudioDriver.h b/sources/Adapters/Audio/SDLAudioDriver.h deleted file mode 100644 index 6df6d530..00000000 --- a/sources/Adapters/Audio/SDLAudioDriver.h +++ /dev/null @@ -1,51 +0,0 @@ -#ifndef _SDL_SOUND_H_ -#define _SDL_SOUND_H_ - -#include "Services/Audio/AudioDriver.h" -#include -#include "System/Process/Process.h" - -class SDLAudioDriver ; - -class SDLAudioDriverThread: public SysThread { -public: - SDLAudioDriverThread(SDLAudioDriver *driver) ; - virtual ~SDLAudioDriverThread() {} ; - virtual bool Execute() ; - virtual void RequestTermination() ; - void Notify() ; -private: - SDLAudioDriver *driver_ ; - SysSemaphore *semaphore_ ; -} ; - -class SDLAudioDriver:public AudioDriver { -public: - SDLAudioDriver(AudioSettings &settings) ; - virtual ~SDLAudioDriver() ; - - // Sound implementation - virtual bool InitDriver() ; - virtual void CloseDriver(); - virtual bool StartDriver() ; - virtual void StopDriver(); - virtual int GetPlayedBufferPercentage() ; - virtual int GetSampleRate() { return 44100 ; } ; - virtual bool Interlaced() { return true ; } ; - virtual double GetStreamTime() ; - // Additional - void OnChunkDone(Uint8 *stream,int len) ; - -private: - int fragSize_ ; // Actual fragsize used by the driver - char *unalignedMain_ ; - char *mainBuffer_ ; - char *miniBlank_ ; - int bufferPos_ ; - int bufferSize_ ; - SDLAudioDriverThread *thread_ ; - Uint32 startTime_ ; -} ; - - -#endif diff --git a/sources/Adapters/GUI/GUIFactory.cpp b/sources/Adapters/GUI/GUIFactory.cpp deleted file mode 100644 index bbc9f050..00000000 --- a/sources/Adapters/GUI/GUIFactory.cpp +++ /dev/null @@ -1,18 +0,0 @@ -#include "GUIFactory.h" -#include "SDLGUIWindowImp.h" -#include "SDLEventManager.h" -#ifndef _USE_NCURSES_ - - -GUIFactory::GUIFactory() { -} ; - - -I_GUIWindowImp &GUIFactory::CreateWindowImp(GUICreateWindowParams &p) { - return *(new SDLGUIWindowImp(p)) ; -} - -EventManager *GUIFactory::GetEventManager() { - return SDLEventManager::GetInstance() ; -} -#endif \ No newline at end of file diff --git a/sources/Adapters/GUI/GUIFactory.h b/sources/Adapters/GUI/GUIFactory.h deleted file mode 100644 index 5a484731..00000000 --- a/sources/Adapters/GUI/GUIFactory.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef SDL_GUI_FACTORY_H_ -#define SDL_GUI_FACTORY_H_ - -#ifndef _USE_NCURSES_ - -#include "UIFramework/Interfaces/I_GUIWindowFactory.h" - -class GUIFactory: public I_GUIWindowFactory { - -public: - GUIFactory() ; - virtual I_GUIWindowImp &CreateWindowImp(GUICreateWindowParams &) ; - virtual EventManager *GetEventManager() ; - -} ; - -#endif -#endif diff --git a/sources/Adapters/GUI/SDLEventManager.cpp b/sources/Adapters/GUI/SDLEventManager.cpp deleted file mode 100644 index 21308f6a..00000000 --- a/sources/Adapters/GUI/SDLEventManager.cpp +++ /dev/null @@ -1,171 +0,0 @@ - -#include "SDLEventManager.h" -#include "Application/Application.h" -#include "UIFramework/BasicDatas/GUIEvent.h" -#include "SDLGUIWindowImp.h" -#include "Application/Model/Config.h" -#include "System/Console/Trace.h" -bool SDLEventManager::finished_=false ; -bool SDLEventManager::dumpEvent_=false ; - -SDLEventManager::SDLEventManager() -{ -} - -SDLEventManager::~SDLEventManager() -{ -} - -bool SDLEventManager::Init() -{ - EventManager::Init() ; - - if ( SDL_Init(SDL_INIT_VIDEO|SDL_INIT_JOYSTICK|SDL_INIT_TIMER) < 0 ) - { - return false; - } - - SDL_ShowCursor(SDL_DISABLE); - - atexit(SDL_Quit) ; - - SDL_InitSubSystem(SDL_INIT_JOYSTICK); - - int joyCount=SDL_NumJoysticks() ; - joyCount=(joyCount>MAX_JOY_COUNT)?MAX_JOY_COUNT:joyCount ; - - keyboardCS_=new KeyboardControllerSource("keyboard") ; - const char *dumpIt=Config::GetInstance()->GetValue("DUMPEVENT") ; - if ((dumpIt)&&(!strcmp(dumpIt,"YES"))) - { - dumpEvent_=true ; - } - - for (int i=0;iGetWindow() ; - SDLGUIWindowImp *sdlWindow=(SDLGUIWindowImp *)appWindow->GetImpWindow() ; - while (!finished_) - { - SDL_Event event; - if (SDL_WaitEvent(&event)) - { - switch (event.type) { - case SDL_KEYDOWN: - if (dumpEvent_) - { - Trace::Log("EVENT","key(%s:%d):%d",SDL_GetScancodeName(event.key.keysym.scancode),event.key.keysym.scancode,1) ; - } - keyboardCS_->SetKey((int)event.key.keysym.scancode,true) ; - break ; - - case SDL_KEYUP: - if (dumpEvent_) - { - Trace::Log("EVENT","key(%s:%d):%d",SDL_GetScancodeName(event.key.keysym.scancode),event.key.keysym.scancode,0) ; - } - keyboardCS_->SetKey((int)event.key.keysym.scancode,false) ; - break ; - - - case SDL_JOYBUTTONDOWN: - buttonCS_[event.jbutton.which]->SetButton(event.jbutton.button,true) ; - break ; - case SDL_JOYBUTTONUP: - if (dumpEvent_) { - Trace::Log("EVENT","but(%d):%d",event.button.which,event.jbutton.button) ; - } - buttonCS_[event.jbutton.which]->SetButton(event.jbutton.button,false) ; - break ; - case SDL_JOYAXISMOTION: - if (dumpEvent_) { - Trace::Log("EVENT","joy(%d)::%d=%d",event.jaxis.which,event.jaxis.axis,event.jaxis.value) ; - } - joystickCS_[event.jaxis.which]->SetAxis(event.jaxis.axis,float(event.jaxis.value)/32767.0f) ; - break ; - case SDL_JOYHATMOTION: - if (dumpEvent_) - { - for (int i=0;i<4;i++) - { - int mask = 1<SetHat(event.jhat.hat,event.jhat.value) ; - break ; - case SDL_JOYBALLMOTION: - if (dumpEvent_) - { - Trace::Log("EVENT","ball(%d)::%d=(%d,%d)",event.jball.which,event.jball.ball,event.jball.xrel,event.jball.yrel) ; - } - break ; - } - - switch (event.type) - { - - case SDL_QUIT: - sdlWindow->ProcessQuit() ; - break ; - case SDL_WINDOWEVENT: - switch (event.window.event) - { - case SDL_WINDOWEVENT_EXPOSED: - case SDL_WINDOWEVENT_RESIZED: - case SDL_WINDOWEVENT_SIZE_CHANGED: - sdlWindow->ProcessExpose() ; - break; - } - break ; - case SDL_USEREVENT: - sdlWindow->ProcessUserEvent(event) ; - break ; - } - } - } - return 0 ; -} ; - - - -void SDLEventManager::PostQuitMessage() -{ - Trace::Log("EVENT","SDEM:PostQuitMessage()") ; - finished_=true ; -} ; - - -int SDLEventManager::GetKeyCode(const char *key) -{ - return SDL_GetScancodeFromName(key); -} diff --git a/sources/Adapters/GUI/SDLEventManager.h b/sources/Adapters/GUI/SDLEventManager.h deleted file mode 100644 index 60f6c146..00000000 --- a/sources/Adapters/GUI/SDLEventManager.h +++ /dev/null @@ -1,36 +0,0 @@ -#ifndef _SDL_EVENT_MANAGER_ -#define _SDL_EVENT_MANAGER_ - -#include "Foundation/T_Singleton.h" -#include "UIFramework/SimpleBaseClasses/EventManager.h" -#include "Services/Controllers/ButtonControllerSource.h" -#include "Services/Controllers/JoystickControllerSource.h" -#include "Services/Controllers/HatControllerSource.h" -#include "Services/Controllers/KeyboardControllerSource.h" -#include - -#include - -#define MAX_JOY_COUNT 4 - - - -class SDLEventManager: public T_Singleton,public EventManager { -public: - SDLEventManager() ; - ~SDLEventManager() ; - virtual bool Init() ; - virtual int MainLoop() ; - virtual void PostQuitMessage() ; - virtual int GetKeyCode(const char *name) ; - -private: - static bool finished_ ; - static bool dumpEvent_ ; - SDL_Joystick *joystick_[MAX_JOY_COUNT]; - ButtonControllerSource *buttonCS_[MAX_JOY_COUNT] ; - JoystickControllerSource *joystickCS_[MAX_JOY_COUNT] ; - HatControllerSource *hatCS_[MAX_JOY_COUNT] ; - KeyboardControllerSource *keyboardCS_ ; -} ; -#endif diff --git a/sources/Adapters/GUI/SDLGUIWindowImp.cpp b/sources/Adapters/GUI/SDLGUIWindowImp.cpp deleted file mode 100644 index ed909143..00000000 --- a/sources/Adapters/GUI/SDLGUIWindowImp.cpp +++ /dev/null @@ -1,543 +0,0 @@ -#include "SDLGUIWindowImp.h" -#include "UIFramework/SimpleBaseClasses/GUIWindow.h" -#include "System/System/System.h" -#include "Application/Model/Config.h" -#include "System/Console/Trace.h" -#include -#include "System/Console/n_assert.h" -#include "Application/Utils/char.h" -#include -#include "UIFramework/BasicDatas/GUIEvent.h" - -SDLGUIWindowImp *instance_ ; - -unsigned short appWidth=320 ; -unsigned short appHeight=240 ; - -SDLGUIWindowImp::SDLGUIWindowImp(GUICreateWindowParams &p) -{ - - SDLCreateWindowParams &sdlP=(SDLCreateWindowParams &)p; - cacheFonts_=sdlP.cacheFonts_ ; - framebuffer_=sdlP.framebuffer_ ; - - // By default if we are not running a framebuffer device - // we assumed it's windowed - - windowed_ = !framebuffer_; - - - SDL_DisplayMode displayMode; - - // SDL Prioritises screens so just take the first for now. - int displayModeRet = SDL_GetDisplayMode(0, 0, &displayMode); - NAssert(displayModeRet != 0); - - #if defined(PLATFORM_PSP) - int screenWidth = 480; - int screenHeight = 272; - windowed_ = false; - #elif defined(RS97) - int screenWidth = 320; - int screenHeight = 240; - windowed_ = false; - #else - int screenWidth = displayMode.w; - int screenHeight = displayMode.h; - #endif - - #if defined(RS97) - /* Pick the best bitdepth for the RS97 as it will select 32 as its default, even though that's slow */ - bitDepth_ = 16; - #else - bitDepth_ = SDL_BITSPERPIXEL(displayMode.format); - #endif - - const char * driverName = SDL_GetVideoDriver(0); - - Trace::Log("DISPLAY","Using driver %s. Screen (%d,%d) Bpp:%d",driverName,screenWidth,screenHeight,bitDepth_); - - bool fullscreen=false ; - - const char *fullscreenValue=Config::GetInstance()->GetValue("FULLSCREEN") ; - if ((fullscreenValue)&&(!strcmp(fullscreenValue,"YES"))) - { - fullscreen=true ; - } - - if (!strcmp(driverName, "fbcon")) - { - framebuffer_ = true; - windowed_ = false; - } - - #ifdef PLATFORM_PSP - mult_ = 1; - #else - int multFromSize=MIN(screenHeight/appHeight,screenWidth/appWidth); - const char *mult=Config::GetInstance()->GetValue("SCREENMULT") ; - if (mult) - { - mult_=atoi(mult); - } - else - { - if (framebuffer_) - { - mult_ = multFromSize; - } - else - { - mult_ = 1; - } - } - #endif - // Create a window that is the requested size - - screenRect_._topLeft._x=0; - screenRect_._topLeft._y=0; - screenRect_._bottomRight._x=windowed_?appWidth*mult_:screenWidth; - screenRect_._bottomRight._y=windowed_?appHeight*mult_:screenHeight; - - Trace::Log("DISPLAY","Creating SDL Window (%d,%d)",screenRect_.Width(), screenRect_.Height()); - window_ = SDL_CreateWindow("LittleGPTracker",SDL_WINDOWPOS_UNDEFINED,SDL_WINDOWPOS_UNDEFINED, - screenRect_.Width(),screenRect_.Height(),fullscreen?SDL_WINDOW_FULLSCREEN:SDL_WINDOW_SHOWN); - NAssert(window_) ; - - // Compute the x & y offset to locate our app window - - appAnchorX_=(screenRect_.Width()-appWidth*mult_)/2 ; - appAnchorY_=(screenRect_.Height()-appHeight*mult_)/2 ; - - SDL_SetWindowIcon(window_, SDL_LoadBMP("lgpt_icon.bmp")); - surface_ = SDL_GetWindowSurface(window_); - - NAssert(surface_) ; - - Uint32 rmask, gmask, bmask, amask; - -#if SDL_BYTEORDER == SDL_BIG_ENDIAN - rmask = 0xff000000; - gmask = 0x00ff0000; - bmask = 0x0000ff00; - amask = 0x000000ff; -#else - rmask = 0x000000ff; - gmask = 0x0000ff00; - bmask = 0x00ff0000; - amask = 0xff000000; -#endif - - instance_=this ; - currentColor_=0; - backgroundColor_=0 ; - SDL_ShowCursor(SDL_DISABLE); - - - if (cacheFonts_) - { - Trace::Log("DISPLAY","Preparing fonts") ; - prepareFonts() ; - } - updateCount_=0 ; -} ; - -SDLGUIWindowImp::~SDLGUIWindowImp() { - -} - -#define FONT_WIDTH 1024 -#define FONT_COUNT 127 -static const unsigned char font[]= { - #include "Resources/font.h" -}; - -static SDL_Surface *fonts[FONT_COUNT] ; - -void SDLGUIWindowImp::prepareFullFonts() -{ - Trace::Log("DISPLAY","Preparing full font cache") ; - Uint32 rmask, gmask, bmask, amask; - -#if SDL_BYTEORDER == SDL_BIG_ENDIAN - rmask = 0xff000000; - gmask = 0x00ff0000; - bmask = 0x0000ff00; - amask = 0x000000ff; -#else - rmask = 0x000000ff; - gmask = 0x0000ff00; - bmask = 0x00ff0000; - amask = 0xff000000; -#endif - - for (int i=0;iformat->BytesPerPixel ; - unsigned char *bgPtr=(unsigned char *)&backgroundColor_ ; - unsigned char *fgPtr=(unsigned char *)&foregroundColor_ ; -#if SDL_BYTEORDER == SDL_BIG_ENDIAN - bgPtr+=(4-pixelSize) ; - fgPtr+=(4-pixelSize) ; -#endif - const unsigned char *src=font+i*8 ; - unsigned char *dest=(unsigned char *)fonts[i]->pixels; - for (int y = 0; y < 8; y++) - { - for (int n=0;npitch-8*pixelSize*mult_ ; - } - if (y<7) src+=FONT_WIDTH ; - } - SDL_UnlockSurface(fonts[i]) ; - }; - }; -} - -void SDLGUIWindowImp::prepareFonts() -{ - - Trace::Log("DISPLAY","Preparing font cache") ; - Config *config=Config::GetInstance() ; - - unsigned char r,g,b ; - const char *value=config->GetValue("BACKGROUND") ; - if (value) - { - char2hex(value,&r) ; - char2hex(value+2,&g) ; - char2hex(value+4,&b) ; - } - else - { - r=0xF1 ; - g=0xF1 ; - b=0x96 ; - } - backgroundColor_=SDL_MapRGB(surface_->format, r,g,b) ; - - value=config->GetValue("FOREGROUND") ; - if (value) - { - char2hex(value,&r) ; - char2hex(value+2,&g) ; - char2hex(value+4,&b) ; - } - else - { - r=0x77 ; - g=0x6B ; - b=0x56 ; - } - foregroundColor_=SDL_MapRGB(surface_->format, r,g,b) ; - - prepareFullFonts() ; -} - -void SDLGUIWindowImp::DrawChar(const char c, GUIPoint &pos, GUITextProperties &p) -{ - int xx,yy; - transform(pos, &xx, &yy); - - if ((xx<0) || (yy<0)) return; - if ((xx>=screenRect_._bottomRight._x) || (yy>=screenRect_._bottomRight._y)) - return ; - if ((!framebuffer_)&&(updateCount_x=xx ; - area->y=yy ; - area->h=8*mult_ ; - area->w=8*mult_ ; - } - - if (((cacheFonts_)&&(currentColor_==foregroundColor_)&&(!p.invert_))) { - - SDL_Rect srcRect ; - srcRect.x=0 ; - srcRect.y=0 ; - srcRect.w=8*mult_ ; - srcRect.h=8*mult_ ; - - SDL_Rect dstRect ; - dstRect.x=xx ; - dstRect.y=yy ; - dstRect.w=8*mult_ ; - dstRect.h=8*mult_ ; - - unsigned int fontID=c ; - if (fontIDformat->BytesPerPixel ; - unsigned char *bgPtr=(unsigned char *)&backgroundColor_ ; - unsigned char *fgPtr=(unsigned char *)¤tColor_ ; -#if SDL_BYTEORDER == SDL_BIG_ENDIAN - bgPtr+=(4-pixelSize) ; - fgPtr+=(4-pixelSize) ; -#endif - const unsigned char *src=font+c*8 ; - unsigned char *dest=((unsigned char *)surface_->pixels) + (yy*surface_->pitch) + xx*pixelSize; - - for (int y = 0; y < 8; y++) { - for (int n=0;npitch-8*pixelSize*mult_ ; - } - if (y<7) src+=FONT_WIDTH ; - } - - } -} - -void SDLGUIWindowImp::transform(const GUIRect &srcRect,SDL_Rect *dstRect) -{ - dstRect->x = srcRect.Left() * mult_ + appAnchorX_; - dstRect->y = srcRect.Top() * mult_ + appAnchorY_; - dstRect->w = srcRect.Width() * mult_ ; - dstRect->h = srcRect.Height() * mult_ ; -} - -void SDLGUIWindowImp::transform(const GUIPoint &srcPoint, int *x, int *y) -{ - *x=appAnchorX_ + srcPoint._x*mult_ ; - *y=appAnchorY_ + srcPoint._y*mult_ ; -} - -void SDLGUIWindowImp::DrawString(const char *string,GUIPoint &pos,GUITextProperties &p,bool overlay) -{ - - int len=int(strlen(string)) ; - int xx,yy; - transform(pos, &xx , &yy); - - if ((!framebuffer_)&&(updateCount_x=xx ; - area->y=yy ; - area->h=8*mult_ ; - area->w=len*8*mult_ ; - } - - for (int l=0;lformat->BytesPerPixel ; - unsigned char *bgPtr=(unsigned char *)&backgroundColor_ ; - unsigned char *fgPtr=(unsigned char *)¤tColor_ ; -#if SDL_BYTEORDER == SDL_BIG_ENDIAN - bgPtr+=(4-pixelSize) ; - fgPtr+=(4-pixelSize) ; -#endif - const unsigned char *src=font+(string[l]*8) ; - unsigned char *dest=((unsigned char *)surface_->pixels) + (yy*surface_->pitch) + xx*pixelSize; - - for (int y = 0; y < 8; y++) { - for (int n=0;npitch-8*pixelSize*mult_ ; - } - if (y<7) src+=FONT_WIDTH ; - } - - } - xx+=8*mult_ ; - } -} - -void SDLGUIWindowImp::DrawRect(GUIRect &r) -{ - SDL_Rect rect; - transform(r, &rect); - SDL_FillRect(surface_, &rect,currentColor_) ; -} ; - -void SDLGUIWindowImp::Clear(GUIColor &c,bool overlay) -{ - SDL_Rect rect; - rect.x = 0; - rect.y = 0; - rect.w = screenRect_.Width(); - rect.h = screenRect_.Height(); - - backgroundColor_=SDL_MapRGB(surface_->format,c._r&0xFF,c._g&0xFF,c._b&0xFF); - SDL_FillRect(surface_, &rect,backgroundColor_) ; - - if (!framebuffer_) - { - SDL_Rect *area=updateRects_; - area->x=rect.x ; - area->y=rect.y ; - area->w=rect.w ; - area->h=rect.h ; - updateCount_=1 ; - } -} - -void SDLGUIWindowImp::ClearRect(GUIRect &r) -{ - SDL_Rect rect; - transform(r, &rect); - SDL_FillRect(surface_, &rect,backgroundColor_) ; -} - -// To the app we might have a smaller window -// than the effective one (PSP) - -GUIRect SDLGUIWindowImp::GetRect() -{ - return GUIRect(0,0,appWidth,appHeight) ; -} - -// Pushback a SDL event to specify screen has to be redrawn. - -void SDLGUIWindowImp::Invalidate() -{ - // Todo: SL: Haven't found a good replacement here yet - SDL_Event event ; - event.type=SDL_WINDOWEVENT ; - event.window.event = SDL_WINDOWEVENT_EXPOSED; - SDL_PushEvent(&event) ; -} - -void SDLGUIWindowImp::SetColor(GUIColor &c) -{ - currentColor_=SDL_MapRGB(surface_->format,c._r&0xFF,c._g&0xFF,c._b&0xFF); -} - -void SDLGUIWindowImp::Lock() -{ - if (framebuffer_) - { - return; - } - - if (SDL_MUSTLOCK(surface_)) - { - SDL_LockSurface(surface_) ; - } -} - -void SDLGUIWindowImp::Unlock() -{ - if (framebuffer_) - { - return; - } - - if (SDL_MUSTLOCK(surface_)) - { - SDL_UnlockSurface(surface_) ; - } -} - -void SDLGUIWindowImp::Flush() -{ - // blit partial updates on resource constrained platforms - if ((!framebuffer_)&&(updateCount_!=0)) - { - if (updateCount_Update() ; -} - -void SDLGUIWindowImp::ProcessQuit() -{ - GUIPoint p; - GUIEvent e(p,ET_SYSQUIT) ; - _window->DispatchEvent(e) ; -} ; - -void SDLGUIWindowImp::PushEvent(GUIEvent &event) -{ - SDL_Event sdlevent ; - sdlevent.type=SDL_USEREVENT ; - sdlevent.user.data1=&event ; - SDL_PushEvent(&sdlevent) ; -} ; - -void SDLGUIWindowImp::ProcessUserEvent(SDL_Event &event) -{ - GUIEvent *guiEvent=(GUIEvent *)event.user.data1 ; - _window->DispatchEvent(*guiEvent) ; - delete(guiEvent) ; -} diff --git a/sources/Adapters/GUI/SDLGUIWindowImp.h b/sources/Adapters/GUI/SDLGUIWindowImp.h deleted file mode 100644 index 956348de..00000000 --- a/sources/Adapters/GUI/SDLGUIWindowImp.h +++ /dev/null @@ -1,69 +0,0 @@ -#ifndef SDL_GUI_WINDOW_H_ -#define SDL_GUI_WINDOW_H_ - -#include "UIFramework/Interfaces/I_GUIWindowImp.h" -#include - -bool ProcessDEBEvent(SDL_Event &event) ; -void ProcessButtonChange(unsigned short,unsigned short) ; - -#define MAX_OVERLAYS 250 - -struct SDLCreateWindowParams: public GUICreateWindowParams { - SDLCreateWindowParams():cacheFonts_(true),framebuffer_(false) {} ; - bool cacheFonts_ ; - bool framebuffer_ ; -} ; - -class SDLGUIWindowImp: public I_GUIWindowImp { - -public: - - SDLGUIWindowImp(GUICreateWindowParams &p) ; - virtual ~SDLGUIWindowImp() ; - -public: // I_GUIWindowImp implementation - - virtual void SetColor(GUIColor &) ; - virtual void DrawRect(GUIRect &) ; - virtual void DrawChar(const char c,GUIPoint &pos,GUITextProperties &); - virtual void DrawString(const char *string,GUIPoint &pos,GUITextProperties &,bool overlay=false); - virtual GUIRect GetRect() ; - virtual void Invalidate() ; - virtual void Flush(); - virtual void Lock() ; - virtual void Unlock() ; - virtual void Clear(GUIColor &, bool overlay=false) ; - virtual void ClearRect(GUIRect &) ; - virtual void PushEvent(GUIEvent &event) ; - -public: // Added functionality - void ProcessExpose() ; - void ProcessQuit() ; - void ProcessUserEvent(SDL_Event &event) ; -protected: - void prepareFonts() ; - void prepareFullFonts() ; - void prepareBPP1Fonts() ; - void transform(const GUIRect &srcRect,SDL_Rect *dstRect); - void transform(const GUIPoint &srcPoint, int *x, int *y); - -private: - SDL_Window *window_; - SDL_Surface *surface_; -// SDL_Surface *offscreen_ ; - GUIRect screenRect_ ; - unsigned int currentColor_ ; - unsigned int backgroundColor_ ; - unsigned int foregroundColor_ ; - int bitDepth_ ; - bool cacheFonts_ ; - bool framebuffer_ ; - bool windowed_; - SDL_Rect updateRects_[MAX_OVERLAYS] ; - int updateCount_ ; - int appAnchorX_ ; - int appAnchorY_ ; - int mult_ ; -} ; -#endif diff --git a/sources/Adapters/Input/SDLInput.cpp b/sources/Adapters/Input/SDLInput.cpp deleted file mode 100644 index 2c3641b1..00000000 --- a/sources/Adapters/Input/SDLInput.cpp +++ /dev/null @@ -1,203 +0,0 @@ - -#include "SDLInput.h" -#include "Application/Model/Config.h" - -#ifndef PLATOFM_BITTBOY -int keyMapping[]={ - SDLK_a, - SDLK_s, - SDLK_LEFT, - SDLK_RIGHT, - SDLK_UP, - SDLK_DOWN, - SDLK_RCTRL, - SDLK_LCTRL, - SDLK_SPACE -} ; -#endif - -int eventMapping[]={ - SDLI_BUTTON_A, - SDLI_BUTTON_B, - SDLI_BUTTON_LEFT, - SDLI_BUTTON_RIGHT, - SDLI_BUTTON_UP, - SDLI_BUTTON_DOWN, - SDLI_BUTTON_L, - SDLI_BUTTON_R, - SDLI_BUTTON_START -} ; - -enum MappingType { - MT_KEY, - MT_JOYBUTTON, - MT_JOYHAT, - MT_JOYAXES -} ; - -int keyMappingType[9] ; - - -SDLInput::SDLInput() { - - // open first joystick if available - - if(SDL_NumJoysticks()>0){ - // Open joystick - joystick_=SDL_JoystickOpen(0); - Trace::Debug("Number of axis:%d",SDL_JoystickNumAxes(joystick_)) ; - Trace::Debug("Number of buttons:%d",SDL_JoystickNumButtons(joystick_)) ; - Trace::Debug("Number of hats:%d",SDL_JoystickNumHats(joystick_)) ; - } else { - joystick_=0 ; - } ; - Trace::Debug("Joystick: %s",joystick_?"opened":"not found") ; - - // initialises default mapping table - for (int i=0;i<9;i++) { - keyMappingType[i]=MT_KEY ; - } ; -} ; - -void SDLInput::ReadConfig() { - - mapKey(0,"KEY_A") ; - mapKey(1,"KEY_B") ; - mapKey(2,"KEY_LEFT") ; - mapKey(3,"KEY_RIGHT") ; - mapKey(4,"KEY_UP") ; - mapKey(5,"KEY_DOWN") ; - mapKey(6,"KEY_LSHOULDER") ; - mapKey(7,"KEY_RSHOULDER") ; - mapKey(8,"KEY_START") ; -} - -void SDLInput::mapKey(int index,const char *keyname) { - - Config *config=Config::GetInstance() ; - - // Read the configuration file and look if we got a definition - const char *key=config->GetValue(keyname) ; - if (key) { - // we found a key, let's find which type it is - - MappingType type=MT_KEY ; - if (key[3]==':') { - if (tolower(key[0])=='b') { // button - type=MT_JOYBUTTON ; - } - if (tolower(key[0])=='h') { // hat - type=MT_JOYHAT ; - } - if (tolower(key[0])=='j') { // joy - type=MT_JOYAXES ; - } - } ; - - keyMappingType[index]=type ; - switch(type) { - case MT_KEY: - for (int i=0;itrigger) { - mask|=eventMapping[i] ; - } - } - } - break ; - default: - break ; - } ; - } - return mask ; -} ; - diff --git a/sources/Adapters/Input/SDLInput.h b/sources/Adapters/Input/SDLInput.h deleted file mode 100644 index b5cb246d..00000000 --- a/sources/Adapters/Input/SDLInput.h +++ /dev/null @@ -1,35 +0,0 @@ - -#ifndef _SDL_INPUT_H_ -#define _SDL_INPUT_H_ - -#include "Foundation/T_Singleton.h" -#include "Externals/SDL/SDL.h" - -#define SDLI_BUTTON_A 0x1 -#define SDLI_BUTTON_B 0x2 -#define SDLI_BUTTON_LEFT 0x4 -#define SDLI_BUTTON_RIGHT 0x8 -#define SDLI_BUTTON_UP 0x10 -#define SDLI_BUTTON_DOWN 0x20 -#define SDLI_BUTTON_L 0x40 -#define SDLI_BUTTON_R 0x80 -#define SDLI_BUTTON_START 0x100 -#define SDLI_BUTTON_SELECT 0x200 - - -class SDLInput: public T_Singleton { -public: - SDLInput() ; - void ReadConfig(); - unsigned short GetButtonMask() ; - -private: - void mapKey(int index,const char *keyname) ; - - SDL_Joystick *joystick_; - - const char *keyname_[SDL_NUM_SCANCODES] ; - -} ; - -#endif \ No newline at end of file diff --git a/sources/Adapters/Process/SDLProcess.cpp b/sources/Adapters/Process/SDLProcess.cpp deleted file mode 100644 index 90719c30..00000000 --- a/sources/Adapters/Process/SDLProcess.cpp +++ /dev/null @@ -1,54 +0,0 @@ - -#include "SDLProcess.h" -#include - -int _SDLStartThread(void *argp) { - SysThread *play=(SysThread *)argp ; - play->startExecution() ; - return 0 ; -} - -bool SDLProcessFactory::BeginThread(SysThread& thread) { - SDL_CreateThread(_SDLStartThread,&thread); - return true ; -} - -SysSemaphore *SDLProcessFactory::CreateNewSemaphore(int initialcount, int maxcount) { - return new SDLSysSemaphore(initialcount,maxcount) ; -} ; - -SDLSysSemaphore::SDLSysSemaphore(int initialcount,int maxcount) { - handle_=SDL_CreateSemaphore(0) ; -} ; - -SDLSysSemaphore::~SDLSysSemaphore() { - handle_=0 ; -} ; - -SysSemaphoreResult SDLSysSemaphore::Wait() { - if (!handle_) { - return SSR_INVALID ; - } ; - return (SysSemaphoreResult)SDL_SemWait(handle_) ; -} ; - -SysSemaphoreResult SDLSysSemaphore::TryWait() { - if (!handle_) { - return SSR_INVALID ; - } ; - return (SysSemaphoreResult)0; -} - -SysSemaphoreResult SDLSysSemaphore::WaitTimeout(unsigned long timeout) { - if (!handle_) { - return SSR_INVALID ; - } ; - return (SysSemaphoreResult)0; -} ; - -SysSemaphoreResult SDLSysSemaphore::Post() { - if (!handle_) { - return SSR_INVALID ; - } ; - return (SysSemaphoreResult)SDL_SemPost(handle_) ; -} ; diff --git a/sources/Adapters/Process/SDLProcess.h b/sources/Adapters/Process/SDLProcess.h deleted file mode 100644 index 18744f73..00000000 --- a/sources/Adapters/Process/SDLProcess.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef _SDL_PROCESS_H_ -#define _SDL_PROCESS_H_ - -#include "System/Process/Process.h" -#include - -class SDLProcessFactory:public SysProcessFactory { - bool BeginThread(SysThread &) ; - virtual SysSemaphore *CreateNewSemaphore(int initialcount = 0, int maxcount = 0) ; -} ; - -class SDLSysSemaphore:public SysSemaphore { -public: - SDLSysSemaphore(int initialcount = 0, int maxcount = 0) ; - virtual ~SDLSysSemaphore() ; - virtual SysSemaphoreResult Wait() ; - virtual SysSemaphoreResult TryWait() ; - virtual SysSemaphoreResult WaitTimeout(unsigned long) ; - virtual SysSemaphoreResult Post() ; -private: - SDL_sem *handle_ ; -} ; -#endif diff --git a/sources/Adapters/Timer/SDLTimer.cpp b/sources/Adapters/Timer/SDLTimer.cpp deleted file mode 100644 index f2c1f7be..00000000 --- a/sources/Adapters/Timer/SDLTimer.cpp +++ /dev/null @@ -1,73 +0,0 @@ - -#include "SDLTimer.h" -#include "System/Console/Trace.h" -#include "System/System/System.h" -#include "System/Console/n_assert.h" - -Uint32 SDLTimerCallback(Uint32 interval, void* param) { - SDLTimer *timer=(SDLTimer *)param ; - return timer->OnTimerTick() ; -} ; - -Uint32 SDLTriggerCallback(Uint32 interval, void* param) { - timerCallback tc=(timerCallback)param ; - (*tc)() ; - return 0 ; -} ; - -SDLTimer::SDLTimer() { - period_=-1 ; - timer_=0 ; - running_=false ; -} ; - -SDLTimer::~SDLTimer() { -} - -void SDLTimer::SetPeriod(float msec) { - period_=int(msec) ; - offset_=0 ; -} ; - -bool SDLTimer::Start() { - if (period_>0) { - offset_=period_ ; - Uint32 newcb=int(offset_) ; - offset_-=newcb ; - timer_=SDL_AddTimer(newcb,SDLTimerCallback,this); - lastTick_=System::GetInstance()->GetClock() ; - running_=true ; - } - return (timer_!=0) ; -} ; - -void SDLTimer::Stop() { - SDL_RemoveTimer(timer_) ; - timer_=0 ; - running_=false ; -} ; - -float SDLTimer::GetPeriod() { - return period_ ; -} ; - -Uint32 SDLTimer::OnTimerTick() { - Uint32 newcb=0 ; - if (running_) { - SetChanged() ; - NotifyObservers() ; - offset_+=period_ ; - newcb=int(offset_) ; - offset_-=newcb ; - NAssert(newcb>0) ; - } - return newcb ; -} ; - -I_Timer *SDLTimerService::CreateTimer() { - return new SDLTimer() ; -} ; - -void SDLTimerService::TriggerCallback(int msec,timerCallback cb) { - SDL_AddTimer(msec,SDLTriggerCallback,(void *)cb); -} diff --git a/sources/Adapters/Timer/SDLTimer.h b/sources/Adapters/Timer/SDLTimer.h deleted file mode 100644 index 0f4aaa73..00000000 --- a/sources/Adapters/Timer/SDLTimer.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef _SDL_TIMER_H_ -#define _SDL_TIMER_H_ - -#include "System/Timer/Timer.h" -#include "SDL2/SDL.h" - -class SDLTimer: public I_Timer { -public: - SDLTimer() ; - virtual ~SDLTimer() ; - virtual void SetPeriod(float msec) ; - virtual bool Start() ; - virtual void Stop() ; - virtual float GetPeriod() ; - Uint32 OnTimerTick() ; - -private: - float period_ ; - float offset_ ; // Float offset taking into account - // period is an int - SDL_TimerID timer_ ; // NULL if not running - long lastTick_ ; - bool running_ ; -} ; - -class SDLTimerService: public TimerService { -public: - virtual I_Timer *CreateTimer() ; // Returns a timer - virtual void TriggerCallback(int msec,timerCallback cb) ; -}; - -#endif \ No newline at end of file From e04fbc560daabf93fb14aa4d887831db905aea5c Mon Sep 17 00:00:00 2001 From: Simon Lees Date: Sun, 4 Aug 2024 20:11:30 +0930 Subject: [PATCH 16/66] SDL2: Add initial implementation This is based off the SDL code with the unsupported platforms removed. Currently this implementation isn't in use. --- sources/Adapters/SDL2/Audio/SDLAudio.cpp | 39 ++ sources/Adapters/SDL2/Audio/SDLAudio.h | 17 + .../Adapters/SDL2/Audio/SDLAudioDriver.cpp | 198 +++++++ sources/Adapters/SDL2/Audio/SDLAudioDriver.h | 51 ++ sources/Adapters/SDL2/GUI/GUIFactory.cpp | 18 + sources/Adapters/SDL2/GUI/GUIFactory.h | 18 + sources/Adapters/SDL2/GUI/SDLEventManager.cpp | 171 ++++++ sources/Adapters/SDL2/GUI/SDLEventManager.h | 35 ++ sources/Adapters/SDL2/GUI/SDLGUIWindowImp.cpp | 543 ++++++++++++++++++ sources/Adapters/SDL2/GUI/SDLGUIWindowImp.h | 69 +++ sources/Adapters/SDL2/Input/SDLInput.cpp | 203 +++++++ sources/Adapters/SDL2/Input/SDLInput.h | 35 ++ sources/Adapters/SDL2/Process/SDLProcess.cpp | 54 ++ sources/Adapters/SDL2/Process/SDLProcess.h | 23 + sources/Adapters/SDL2/Timer/SDLTimer.cpp | 73 +++ sources/Adapters/SDL2/Timer/SDLTimer.h | 32 ++ 16 files changed, 1579 insertions(+) create mode 100644 sources/Adapters/SDL2/Audio/SDLAudio.cpp create mode 100644 sources/Adapters/SDL2/Audio/SDLAudio.h create mode 100644 sources/Adapters/SDL2/Audio/SDLAudioDriver.cpp create mode 100644 sources/Adapters/SDL2/Audio/SDLAudioDriver.h create mode 100644 sources/Adapters/SDL2/GUI/GUIFactory.cpp create mode 100644 sources/Adapters/SDL2/GUI/GUIFactory.h create mode 100644 sources/Adapters/SDL2/GUI/SDLEventManager.cpp create mode 100644 sources/Adapters/SDL2/GUI/SDLEventManager.h create mode 100644 sources/Adapters/SDL2/GUI/SDLGUIWindowImp.cpp create mode 100644 sources/Adapters/SDL2/GUI/SDLGUIWindowImp.h create mode 100644 sources/Adapters/SDL2/Input/SDLInput.cpp create mode 100644 sources/Adapters/SDL2/Input/SDLInput.h create mode 100644 sources/Adapters/SDL2/Process/SDLProcess.cpp create mode 100644 sources/Adapters/SDL2/Process/SDLProcess.h create mode 100644 sources/Adapters/SDL2/Timer/SDLTimer.cpp create mode 100644 sources/Adapters/SDL2/Timer/SDLTimer.h diff --git a/sources/Adapters/SDL2/Audio/SDLAudio.cpp b/sources/Adapters/SDL2/Audio/SDLAudio.cpp new file mode 100644 index 00000000..79d92088 --- /dev/null +++ b/sources/Adapters/SDL2/Audio/SDLAudio.cpp @@ -0,0 +1,39 @@ + +#include "SDLAudio.h" +#include "SDLAudioDriver.h" +#include "Services/Audio/AudioOutDriver.h" + +SDLAudio::SDLAudio(AudioSettings &hints):Audio(hints) { + hints_=hints; +} + +SDLAudio::~SDLAudio() { +} + +void SDLAudio::Init() { + AudioSettings settings ; + settings.audioAPI_=GetAudioAPI(); + + settings.bufferSize_=GetAudioBufferSize() ; + settings.preBufferCount_=GetAudioPreBufferCount() ; + + + SDLAudioDriver *drv=new SDLAudioDriver(settings) ; + AudioOut *out=new AudioOutDriver(*drv) ; + Insert(out) ; +} ; + +void SDLAudio::Close() { + IteratorPtrit(GetIterator()) ; + for (it->Begin();!it->IsDone();it->Next()) { + AudioOut ¤t=it->CurrentItem() ; + current.Close() ; + } +} ; + +int SDLAudio::GetMixerVolume() { + return 100 ; +} ; + +void SDLAudio::SetMixerVolume(int volume) { +} ; diff --git a/sources/Adapters/SDL2/Audio/SDLAudio.h b/sources/Adapters/SDL2/Audio/SDLAudio.h new file mode 100644 index 00000000..b178b848 --- /dev/null +++ b/sources/Adapters/SDL2/Audio/SDLAudio.h @@ -0,0 +1,17 @@ +#ifndef _SDL_AUDIO_H_ +#define _SDL_AUDIO_H_ + +#include "Services/Audio/Audio.h" + +class SDLAudio: public Audio { +public: + SDLAudio(AudioSettings &hints) ; // Allow for different default size for different platform + ~SDLAudio() ; + virtual void Init() ; + virtual void Close() ; + virtual int GetMixerVolume() ; + virtual void SetMixerVolume(int volume) ; +private: + AudioSettings hints_ ; +}; +#endif diff --git a/sources/Adapters/SDL2/Audio/SDLAudioDriver.cpp b/sources/Adapters/SDL2/Audio/SDLAudioDriver.cpp new file mode 100644 index 00000000..7b065bef --- /dev/null +++ b/sources/Adapters/SDL2/Audio/SDLAudioDriver.cpp @@ -0,0 +1,198 @@ +#include "SDLAudioDriver.h" +#include "Services/Midi/MidiService.h" +#include "Services/Time/TimeService.h" +#include "System/Console/Trace.h" +#include "System/System/System.h" + +void sdl_callback(void *userdata, Uint8 *stream, int len) { + SDLAudioDriver *sound=(SDLAudioDriver *)userdata ; + sound->OnChunkDone(stream,len) ; +} ; + +SDLAudioDriverThread::SDLAudioDriverThread(SDLAudioDriver *driver) { + semaphore_=SysSemaphore::Create(0,4) ; + driver_=driver ; +} ; + +bool SDLAudioDriverThread::Execute() { + while (!shouldTerminate()) { + semaphore_->Wait() ; + driver_->OnNewBufferNeeded(); + } ; + SysSemaphore *semaphore=semaphore_ ; + semaphore_=0 ; + delete semaphore ; + return true ; +} ; + +void SDLAudioDriverThread::Notify() { + if (semaphore_) { + semaphore_->Post() ; + } +} ; + +void SDLAudioDriverThread::RequestTermination() { + SysThread::RequestTermination() ; + // post to be sure we're not locked + semaphore_->Post() ; + // Wait for thread to finish + SDL_Delay(10) ; +} + +//------------------------------------------------------------------------------------------------- + +SDLAudioDriver::SDLAudioDriver(AudioSettings &settings):AudioDriver(settings), + unalignedMain_(0), + miniBlank_(0) +{ + isPlaying_=false ; + thread_=0 ; +} + +SDLAudioDriver::~SDLAudioDriver() { +} + +struct SDL_AudioSpec input ; +struct SDL_AudioSpec returned ; + +bool SDLAudioDriver::InitDriver() { + + //set sound + input.freq=44100 ; + input.format=AUDIO_S16SYS ; + input.channels=2 ; + input.callback=sdl_callback ; + input.samples=settings_.bufferSize_ ; + input.userdata=this ; + + // On my machine this wasn't working. + // SDL_AudioDeviceID deviceId = SDL_OpenAudioDevice(NULL,0,&input,&returned,0); + // The above may return 0 meaning an error or success. + int ret = SDL_OpenAudio(&input,&returned); + if ( ret != 0 ) + { + Trace::Error("Couldn't open sdl audio: %s\n", SDL_GetError()); + return false ; + } + const char * driverName = SDL_GetCurrentAudioDriver() ; + + fragSize_=returned.size ; + // Allocates a rotating sound buffer + unalignedMain_=(char *)SYS_MALLOC(fragSize_+SOUND_BUFFER_MAX) ; + // Make sure the buffer is aligned +#ifdef _64BIT + mainBuffer_=(char *)unalignedMain_; +#else + mainBuffer_=(char *)((((int)unalignedMain_)+1)&(0xFFFFFFFC)) ; +#endif + + Trace::Log("AUDIO","%s successfully opened with %d samples",driverName,fragSize_/4 ) ; + + // Create mini blank buffer in case of underruns + + miniBlank_=(char *)malloc(fragSize_) ; + SYS_MEMSET(miniBlank_,0,fragSize_) ; + + return true ; +} ; + +void SDLAudioDriver::CloseDriver() { + + if (miniBlank_) { + SYS_FREE(miniBlank_) ; + miniBlank_=0 ; + } + + if (unalignedMain_) { + SYS_FREE (unalignedMain_) ; + unalignedMain_=0 ; + } ; + SDL_CloseAudio(); +} ; + +bool SDLAudioDriver::StartDriver() { + + thread_=new SDLAudioDriverThread(this) ; + thread_->Start() ; + + short blank[4000] ; + SYS_MEMSET(blank,0,4000) ; + bufferPos_=0 ; + bufferSize_=0 ; + + for (int i=0;iAdvancePlayQueue(); + } + if (settings_.preBufferCount_==0) { + thread_->Notify() ; + } + + SDL_PauseAudio(0); + startTime_=SDL_GetTicks() ; + + return 1 ; +} ; + +void SDLAudioDriver::StopDriver() { + if (thread_) { + thread_->RequestTermination() ; + SysThread *thread=thread_ ; + thread_=0 ; + SDL_PauseAudio(1); + delete thread ; + } ; +} ; + +double SDLAudioDriver::GetStreamTime() { + return (SDL_GetTicks()-startTime_)/1000.0 ; +} + +void SDLAudioDriver::OnChunkDone(Uint8 *stream,int len) { + + // Look if we have enough data in main buffer + + while (bufferSize_-bufferPos_Flush() ; + // Adapt buffer variables + + bufferSize_=bufferSize_-bufferPos_+pool_[poolPlayPosition_].size_ ; + bufferPos_=0 ; + + SYS_FREE( pool_[poolPlayPosition_].buffer_) ; + + pool_[poolPlayPosition_].buffer_=0 ; + poolPlayPosition_=(poolPlayPosition_+1)%SOUND_BUFFER_COUNT ; + if (thread_) thread_->Notify() ; + + } + } + // Now dump audio to the device + + SYS_MEMCPY(stream,(short *)(mainBuffer_+bufferPos_), len); + onAudioBufferTick(); + bufferPos_+=len ; +} + +int SDLAudioDriver::GetPlayedBufferPercentage() { +// return 100-(bufferSize_-bufferPos_-fragSize_)*100/(bufferSize_-fragSize_) ; + return 0 ; +} ; + + + diff --git a/sources/Adapters/SDL2/Audio/SDLAudioDriver.h b/sources/Adapters/SDL2/Audio/SDLAudioDriver.h new file mode 100644 index 00000000..6df6d530 --- /dev/null +++ b/sources/Adapters/SDL2/Audio/SDLAudioDriver.h @@ -0,0 +1,51 @@ +#ifndef _SDL_SOUND_H_ +#define _SDL_SOUND_H_ + +#include "Services/Audio/AudioDriver.h" +#include +#include "System/Process/Process.h" + +class SDLAudioDriver ; + +class SDLAudioDriverThread: public SysThread { +public: + SDLAudioDriverThread(SDLAudioDriver *driver) ; + virtual ~SDLAudioDriverThread() {} ; + virtual bool Execute() ; + virtual void RequestTermination() ; + void Notify() ; +private: + SDLAudioDriver *driver_ ; + SysSemaphore *semaphore_ ; +} ; + +class SDLAudioDriver:public AudioDriver { +public: + SDLAudioDriver(AudioSettings &settings) ; + virtual ~SDLAudioDriver() ; + + // Sound implementation + virtual bool InitDriver() ; + virtual void CloseDriver(); + virtual bool StartDriver() ; + virtual void StopDriver(); + virtual int GetPlayedBufferPercentage() ; + virtual int GetSampleRate() { return 44100 ; } ; + virtual bool Interlaced() { return true ; } ; + virtual double GetStreamTime() ; + // Additional + void OnChunkDone(Uint8 *stream,int len) ; + +private: + int fragSize_ ; // Actual fragsize used by the driver + char *unalignedMain_ ; + char *mainBuffer_ ; + char *miniBlank_ ; + int bufferPos_ ; + int bufferSize_ ; + SDLAudioDriverThread *thread_ ; + Uint32 startTime_ ; +} ; + + +#endif diff --git a/sources/Adapters/SDL2/GUI/GUIFactory.cpp b/sources/Adapters/SDL2/GUI/GUIFactory.cpp new file mode 100644 index 00000000..4f19eed3 --- /dev/null +++ b/sources/Adapters/SDL2/GUI/GUIFactory.cpp @@ -0,0 +1,18 @@ +#include "GUIFactory.h" +#include "SDLGUIWindowImp.h" +#include "SDLEventManager.h" +#ifndef _USE_NCURSES_ + + +GUIFactory::GUIFactory() { +} ; + + +I_GUIWindowImp &GUIFactory::CreateWindowImp(GUICreateWindowParams &p) { + return *(new SDLGUIWindowImp(p)) ; +} + +EventManager *GUIFactory::GetEventManager() { + return SDLEventManager::GetInstance() ; +} +#endif diff --git a/sources/Adapters/SDL2/GUI/GUIFactory.h b/sources/Adapters/SDL2/GUI/GUIFactory.h new file mode 100644 index 00000000..5a484731 --- /dev/null +++ b/sources/Adapters/SDL2/GUI/GUIFactory.h @@ -0,0 +1,18 @@ +#ifndef SDL_GUI_FACTORY_H_ +#define SDL_GUI_FACTORY_H_ + +#ifndef _USE_NCURSES_ + +#include "UIFramework/Interfaces/I_GUIWindowFactory.h" + +class GUIFactory: public I_GUIWindowFactory { + +public: + GUIFactory() ; + virtual I_GUIWindowImp &CreateWindowImp(GUICreateWindowParams &) ; + virtual EventManager *GetEventManager() ; + +} ; + +#endif +#endif diff --git a/sources/Adapters/SDL2/GUI/SDLEventManager.cpp b/sources/Adapters/SDL2/GUI/SDLEventManager.cpp new file mode 100644 index 00000000..0c035b7e --- /dev/null +++ b/sources/Adapters/SDL2/GUI/SDLEventManager.cpp @@ -0,0 +1,171 @@ + +#include "SDLEventManager.h" +#include "Application/Application.h" +#include "Application/Model/Config.h" +#include "System/Console/Trace.h" +#include "UIFramework/BasicDatas/GUIEvent.h" +#include "SDLGUIWindowImp.h" +bool SDLEventManager::finished_=false ; +bool SDLEventManager::dumpEvent_=false ; + +SDLEventManager::SDLEventManager() +{ +} + +SDLEventManager::~SDLEventManager() +{ +} + +bool SDLEventManager::Init() +{ + EventManager::Init() ; + + if ( SDL_Init(SDL_INIT_VIDEO|SDL_INIT_JOYSTICK|SDL_INIT_TIMER) < 0 ) + { + return false; + } + + SDL_ShowCursor(SDL_DISABLE); + + atexit(SDL_Quit) ; + + SDL_InitSubSystem(SDL_INIT_JOYSTICK); + + int joyCount=SDL_NumJoysticks() ; + joyCount=(joyCount>MAX_JOY_COUNT)?MAX_JOY_COUNT:joyCount ; + + keyboardCS_=new KeyboardControllerSource("keyboard") ; + const char *dumpIt=Config::GetInstance()->GetValue("DUMPEVENT") ; + if ((dumpIt)&&(!strcmp(dumpIt,"YES"))) + { + dumpEvent_=true ; + } + + for (int i=0;iGetWindow() ; + SDLGUIWindowImp *sdlWindow=(SDLGUIWindowImp *)appWindow->GetImpWindow() ; + while (!finished_) + { + SDL_Event event; + if (SDL_WaitEvent(&event)) + { + switch (event.type) { + case SDL_KEYDOWN: + if (dumpEvent_) + { + Trace::Log("EVENT","key(%s:%d):%d",SDL_GetScancodeName(event.key.keysym.scancode),event.key.keysym.scancode,1) ; + } + keyboardCS_->SetKey((int)event.key.keysym.scancode,true) ; + break ; + + case SDL_KEYUP: + if (dumpEvent_) + { + Trace::Log("EVENT","key(%s:%d):%d",SDL_GetScancodeName(event.key.keysym.scancode),event.key.keysym.scancode,0) ; + } + keyboardCS_->SetKey((int)event.key.keysym.scancode,false) ; + break ; + + + case SDL_JOYBUTTONDOWN: + buttonCS_[event.jbutton.which]->SetButton(event.jbutton.button,true) ; + break ; + case SDL_JOYBUTTONUP: + if (dumpEvent_) { + Trace::Log("EVENT","but(%d):%d",event.button.which,event.jbutton.button) ; + } + buttonCS_[event.jbutton.which]->SetButton(event.jbutton.button,false) ; + break ; + case SDL_JOYAXISMOTION: + if (dumpEvent_) { + Trace::Log("EVENT","joy(%d)::%d=%d",event.jaxis.which,event.jaxis.axis,event.jaxis.value) ; + } + joystickCS_[event.jaxis.which]->SetAxis(event.jaxis.axis,float(event.jaxis.value)/32767.0f) ; + break ; + case SDL_JOYHATMOTION: + if (dumpEvent_) + { + for (int i=0;i<4;i++) + { + int mask = 1<SetHat(event.jhat.hat,event.jhat.value) ; + break ; + case SDL_JOYBALLMOTION: + if (dumpEvent_) + { + Trace::Log("EVENT","ball(%d)::%d=(%d,%d)",event.jball.which,event.jball.ball,event.jball.xrel,event.jball.yrel) ; + } + break ; + } + + switch (event.type) + { + + case SDL_QUIT: + sdlWindow->ProcessQuit() ; + break ; + case SDL_WINDOWEVENT: + switch (event.window.event) + { + case SDL_WINDOWEVENT_EXPOSED: + case SDL_WINDOWEVENT_RESIZED: + case SDL_WINDOWEVENT_SIZE_CHANGED: + sdlWindow->ProcessExpose() ; + break; + } + break ; + case SDL_USEREVENT: + sdlWindow->ProcessUserEvent(event) ; + break ; + } + } + } + return 0 ; +} ; + + + +void SDLEventManager::PostQuitMessage() +{ + Trace::Log("EVENT","SDEM:PostQuitMessage()") ; + finished_=true ; +} ; + + +int SDLEventManager::GetKeyCode(const char *key) +{ + return SDL_GetScancodeFromName(key); +} diff --git a/sources/Adapters/SDL2/GUI/SDLEventManager.h b/sources/Adapters/SDL2/GUI/SDLEventManager.h new file mode 100644 index 00000000..6ed26991 --- /dev/null +++ b/sources/Adapters/SDL2/GUI/SDLEventManager.h @@ -0,0 +1,35 @@ +#ifndef _SDL_EVENT_MANAGER_ +#define _SDL_EVENT_MANAGER_ + +#include +#include +#include "Foundation/T_Singleton.h" +#include "Services/Controllers/ButtonControllerSource.h" +#include "Services/Controllers/HatControllerSource.h" +#include "Services/Controllers/JoystickControllerSource.h" +#include "Services/Controllers/KeyboardControllerSource.h" +#include "UIFramework/SimpleBaseClasses/EventManager.h" + +#define MAX_JOY_COUNT 4 + + + +class SDLEventManager: public T_Singleton,public EventManager { +public: + SDLEventManager() ; + ~SDLEventManager() ; + virtual bool Init() ; + virtual int MainLoop() ; + virtual void PostQuitMessage() ; + virtual int GetKeyCode(const char *name) ; + +private: + static bool finished_ ; + static bool dumpEvent_ ; + SDL_Joystick *joystick_[MAX_JOY_COUNT]; + ButtonControllerSource *buttonCS_[MAX_JOY_COUNT] ; + JoystickControllerSource *joystickCS_[MAX_JOY_COUNT] ; + HatControllerSource *hatCS_[MAX_JOY_COUNT] ; + KeyboardControllerSource *keyboardCS_ ; +} ; +#endif diff --git a/sources/Adapters/SDL2/GUI/SDLGUIWindowImp.cpp b/sources/Adapters/SDL2/GUI/SDLGUIWindowImp.cpp new file mode 100644 index 00000000..5ca6cdbf --- /dev/null +++ b/sources/Adapters/SDL2/GUI/SDLGUIWindowImp.cpp @@ -0,0 +1,543 @@ +#include "SDLGUIWindowImp.h" +#include +#include +#include "Application/Model/Config.h" +#include "Application/Utils/char.h" +#include "System/Console/n_assert.h" +#include "System/Console/Trace.h" +#include "System/System/System.h" +#include "UIFramework/BasicDatas/GUIEvent.h" +#include "UIFramework/SimpleBaseClasses/GUIWindow.h" + +SDLGUIWindowImp *instance_ ; + +unsigned short appWidth=320 ; +unsigned short appHeight=240 ; + +SDLGUIWindowImp::SDLGUIWindowImp(GUICreateWindowParams &p) +{ + + SDLCreateWindowParams &sdlP=(SDLCreateWindowParams &)p; + cacheFonts_=sdlP.cacheFonts_ ; + framebuffer_=sdlP.framebuffer_ ; + + // By default if we are not running a framebuffer device + // we assumed it's windowed + + windowed_ = !framebuffer_; + + + SDL_DisplayMode displayMode; + + // SDL Prioritises screens so just take the first for now. + int displayModeRet = SDL_GetDisplayMode(0, 0, &displayMode); + NAssert(displayModeRet != 0); + + #if defined(PLATFORM_PSP) + int screenWidth = 480; + int screenHeight = 272; + windowed_ = false; + #elif defined(RS97) + int screenWidth = 320; + int screenHeight = 240; + windowed_ = false; + #else + int screenWidth = displayMode.w; + int screenHeight = displayMode.h; + #endif + + #if defined(RS97) + /* Pick the best bitdepth for the RS97 as it will select 32 as its default, even though that's slow */ + bitDepth_ = 16; + #else + bitDepth_ = SDL_BITSPERPIXEL(displayMode.format); + #endif + + const char * driverName = SDL_GetVideoDriver(0); + + Trace::Log("DISPLAY","Using driver %s. Screen (%d,%d) Bpp:%d",driverName,screenWidth,screenHeight,bitDepth_); + + bool fullscreen=false ; + + const char *fullscreenValue=Config::GetInstance()->GetValue("FULLSCREEN") ; + if ((fullscreenValue)&&(!strcmp(fullscreenValue,"YES"))) + { + fullscreen=true ; + } + + if (!strcmp(driverName, "fbcon")) + { + framebuffer_ = true; + windowed_ = false; + } + + #ifdef PLATFORM_PSP + mult_ = 1; + #else + int multFromSize=MIN(screenHeight/appHeight,screenWidth/appWidth); + const char *mult=Config::GetInstance()->GetValue("SCREENMULT") ; + if (mult) + { + mult_=atoi(mult); + } + else + { + if (framebuffer_) + { + mult_ = multFromSize; + } + else + { + mult_ = 1; + } + } + #endif + // Create a window that is the requested size + + screenRect_._topLeft._x=0; + screenRect_._topLeft._y=0; + screenRect_._bottomRight._x=windowed_?appWidth*mult_:screenWidth; + screenRect_._bottomRight._y=windowed_?appHeight*mult_:screenHeight; + + Trace::Log("DISPLAY","Creating SDL Window (%d,%d)",screenRect_.Width(), screenRect_.Height()); + window_ = SDL_CreateWindow("LittleGPTracker",SDL_WINDOWPOS_UNDEFINED,SDL_WINDOWPOS_UNDEFINED, + screenRect_.Width(),screenRect_.Height(),fullscreen?SDL_WINDOW_FULLSCREEN:SDL_WINDOW_SHOWN); + NAssert(window_) ; + + // Compute the x & y offset to locate our app window + + appAnchorX_=(screenRect_.Width()-appWidth*mult_)/2 ; + appAnchorY_=(screenRect_.Height()-appHeight*mult_)/2 ; + + SDL_SetWindowIcon(window_, SDL_LoadBMP("lgpt_icon.bmp")); + surface_ = SDL_GetWindowSurface(window_); + + NAssert(surface_) ; + + Uint32 rmask, gmask, bmask, amask; + +#if SDL_BYTEORDER == SDL_BIG_ENDIAN + rmask = 0xff000000; + gmask = 0x00ff0000; + bmask = 0x0000ff00; + amask = 0x000000ff; +#else + rmask = 0x000000ff; + gmask = 0x0000ff00; + bmask = 0x00ff0000; + amask = 0xff000000; +#endif + + instance_=this ; + currentColor_=0; + backgroundColor_=0 ; + SDL_ShowCursor(SDL_DISABLE); + + + if (cacheFonts_) + { + Trace::Log("DISPLAY","Preparing fonts") ; + prepareFonts() ; + } + updateCount_=0 ; +} ; + +SDLGUIWindowImp::~SDLGUIWindowImp() { + +} + +#define FONT_WIDTH 1024 +#define FONT_COUNT 127 +static const unsigned char font[]= { + #include "Resources/font.h" +}; + +static SDL_Surface *fonts[FONT_COUNT] ; + +void SDLGUIWindowImp::prepareFullFonts() +{ + Trace::Log("DISPLAY","Preparing full font cache") ; + Uint32 rmask, gmask, bmask, amask; + +#if SDL_BYTEORDER == SDL_BIG_ENDIAN + rmask = 0xff000000; + gmask = 0x00ff0000; + bmask = 0x0000ff00; + amask = 0x000000ff; +#else + rmask = 0x000000ff; + gmask = 0x0000ff00; + bmask = 0x00ff0000; + amask = 0xff000000; +#endif + + for (int i=0;iformat->BytesPerPixel ; + unsigned char *bgPtr=(unsigned char *)&backgroundColor_ ; + unsigned char *fgPtr=(unsigned char *)&foregroundColor_ ; +#if SDL_BYTEORDER == SDL_BIG_ENDIAN + bgPtr+=(4-pixelSize) ; + fgPtr+=(4-pixelSize) ; +#endif + const unsigned char *src=font+i*8 ; + unsigned char *dest=(unsigned char *)fonts[i]->pixels; + for (int y = 0; y < 8; y++) + { + for (int n=0;npitch-8*pixelSize*mult_ ; + } + if (y<7) src+=FONT_WIDTH ; + } + SDL_UnlockSurface(fonts[i]) ; + }; + }; +} + +void SDLGUIWindowImp::prepareFonts() +{ + + Trace::Log("DISPLAY","Preparing font cache") ; + Config *config=Config::GetInstance() ; + + unsigned char r,g,b ; + const char *value=config->GetValue("BACKGROUND") ; + if (value) + { + char2hex(value,&r) ; + char2hex(value+2,&g) ; + char2hex(value+4,&b) ; + } + else + { + r=0xF1 ; + g=0xF1 ; + b=0x96 ; + } + backgroundColor_=SDL_MapRGB(surface_->format, r,g,b) ; + + value=config->GetValue("FOREGROUND") ; + if (value) + { + char2hex(value,&r) ; + char2hex(value+2,&g) ; + char2hex(value+4,&b) ; + } + else + { + r=0x77 ; + g=0x6B ; + b=0x56 ; + } + foregroundColor_=SDL_MapRGB(surface_->format, r,g,b) ; + + prepareFullFonts() ; +} + +void SDLGUIWindowImp::DrawChar(const char c, GUIPoint &pos, GUITextProperties &p) +{ + int xx,yy; + transform(pos, &xx, &yy); + + if ((xx<0) || (yy<0)) return; + if ((xx>=screenRect_._bottomRight._x) || (yy>=screenRect_._bottomRight._y)) + return ; + if ((!framebuffer_)&&(updateCount_x=xx ; + area->y=yy ; + area->h=8*mult_ ; + area->w=8*mult_ ; + } + + if (((cacheFonts_)&&(currentColor_==foregroundColor_)&&(!p.invert_))) { + + SDL_Rect srcRect ; + srcRect.x=0 ; + srcRect.y=0 ; + srcRect.w=8*mult_ ; + srcRect.h=8*mult_ ; + + SDL_Rect dstRect ; + dstRect.x=xx ; + dstRect.y=yy ; + dstRect.w=8*mult_ ; + dstRect.h=8*mult_ ; + + unsigned int fontID=c ; + if (fontIDformat->BytesPerPixel ; + unsigned char *bgPtr=(unsigned char *)&backgroundColor_ ; + unsigned char *fgPtr=(unsigned char *)¤tColor_ ; +#if SDL_BYTEORDER == SDL_BIG_ENDIAN + bgPtr+=(4-pixelSize) ; + fgPtr+=(4-pixelSize) ; +#endif + const unsigned char *src=font+c*8 ; + unsigned char *dest=((unsigned char *)surface_->pixels) + (yy*surface_->pitch) + xx*pixelSize; + + for (int y = 0; y < 8; y++) { + for (int n=0;npitch-8*pixelSize*mult_ ; + } + if (y<7) src+=FONT_WIDTH ; + } + + } +} + +void SDLGUIWindowImp::transform(const GUIRect &srcRect,SDL_Rect *dstRect) +{ + dstRect->x = srcRect.Left() * mult_ + appAnchorX_; + dstRect->y = srcRect.Top() * mult_ + appAnchorY_; + dstRect->w = srcRect.Width() * mult_ ; + dstRect->h = srcRect.Height() * mult_ ; +} + +void SDLGUIWindowImp::transform(const GUIPoint &srcPoint, int *x, int *y) +{ + *x=appAnchorX_ + srcPoint._x*mult_ ; + *y=appAnchorY_ + srcPoint._y*mult_ ; +} + +void SDLGUIWindowImp::DrawString(const char *string,GUIPoint &pos,GUITextProperties &p,bool overlay) +{ + + int len=int(strlen(string)) ; + int xx,yy; + transform(pos, &xx , &yy); + + if ((!framebuffer_)&&(updateCount_x=xx ; + area->y=yy ; + area->h=8*mult_ ; + area->w=len*8*mult_ ; + } + + for (int l=0;lformat->BytesPerPixel ; + unsigned char *bgPtr=(unsigned char *)&backgroundColor_ ; + unsigned char *fgPtr=(unsigned char *)¤tColor_ ; +#if SDL_BYTEORDER == SDL_BIG_ENDIAN + bgPtr+=(4-pixelSize) ; + fgPtr+=(4-pixelSize) ; +#endif + const unsigned char *src=font+(string[l]*8) ; + unsigned char *dest=((unsigned char *)surface_->pixels) + (yy*surface_->pitch) + xx*pixelSize; + + for (int y = 0; y < 8; y++) { + for (int n=0;npitch-8*pixelSize*mult_ ; + } + if (y<7) src+=FONT_WIDTH ; + } + + } + xx+=8*mult_ ; + } +} + +void SDLGUIWindowImp::DrawRect(GUIRect &r) +{ + SDL_Rect rect; + transform(r, &rect); + SDL_FillRect(surface_, &rect,currentColor_) ; +} ; + +void SDLGUIWindowImp::Clear(GUIColor &c,bool overlay) +{ + SDL_Rect rect; + rect.x = 0; + rect.y = 0; + rect.w = screenRect_.Width(); + rect.h = screenRect_.Height(); + + backgroundColor_=SDL_MapRGB(surface_->format,c._r&0xFF,c._g&0xFF,c._b&0xFF); + SDL_FillRect(surface_, &rect,backgroundColor_) ; + + if (!framebuffer_) + { + SDL_Rect *area=updateRects_; + area->x=rect.x ; + area->y=rect.y ; + area->w=rect.w ; + area->h=rect.h ; + updateCount_=1 ; + } +} + +void SDLGUIWindowImp::ClearRect(GUIRect &r) +{ + SDL_Rect rect; + transform(r, &rect); + SDL_FillRect(surface_, &rect,backgroundColor_) ; +} + +// To the app we might have a smaller window +// than the effective one (PSP) + +GUIRect SDLGUIWindowImp::GetRect() +{ + return GUIRect(0,0,appWidth,appHeight) ; +} + +// Pushback a SDL event to specify screen has to be redrawn. + +void SDLGUIWindowImp::Invalidate() +{ + // Todo: SL: Haven't found a good replacement here yet + SDL_Event event ; + event.type=SDL_WINDOWEVENT ; + event.window.event = SDL_WINDOWEVENT_EXPOSED; + SDL_PushEvent(&event) ; +} + +void SDLGUIWindowImp::SetColor(GUIColor &c) +{ + currentColor_=SDL_MapRGB(surface_->format,c._r&0xFF,c._g&0xFF,c._b&0xFF); +} + +void SDLGUIWindowImp::Lock() +{ + if (framebuffer_) + { + return; + } + + if (SDL_MUSTLOCK(surface_)) + { + SDL_LockSurface(surface_) ; + } +} + +void SDLGUIWindowImp::Unlock() +{ + if (framebuffer_) + { + return; + } + + if (SDL_MUSTLOCK(surface_)) + { + SDL_UnlockSurface(surface_) ; + } +} + +void SDLGUIWindowImp::Flush() +{ + // blit partial updates on resource constrained platforms + if ((!framebuffer_)&&(updateCount_!=0)) + { + if (updateCount_Update() ; +} + +void SDLGUIWindowImp::ProcessQuit() +{ + GUIPoint p; + GUIEvent e(p,ET_SYSQUIT) ; + _window->DispatchEvent(e) ; +} ; + +void SDLGUIWindowImp::PushEvent(GUIEvent &event) +{ + SDL_Event sdlevent ; + sdlevent.type=SDL_USEREVENT ; + sdlevent.user.data1=&event ; + SDL_PushEvent(&sdlevent) ; +} ; + +void SDLGUIWindowImp::ProcessUserEvent(SDL_Event &event) +{ + GUIEvent *guiEvent=(GUIEvent *)event.user.data1 ; + _window->DispatchEvent(*guiEvent) ; + delete(guiEvent) ; +} diff --git a/sources/Adapters/SDL2/GUI/SDLGUIWindowImp.h b/sources/Adapters/SDL2/GUI/SDLGUIWindowImp.h new file mode 100644 index 00000000..956348de --- /dev/null +++ b/sources/Adapters/SDL2/GUI/SDLGUIWindowImp.h @@ -0,0 +1,69 @@ +#ifndef SDL_GUI_WINDOW_H_ +#define SDL_GUI_WINDOW_H_ + +#include "UIFramework/Interfaces/I_GUIWindowImp.h" +#include + +bool ProcessDEBEvent(SDL_Event &event) ; +void ProcessButtonChange(unsigned short,unsigned short) ; + +#define MAX_OVERLAYS 250 + +struct SDLCreateWindowParams: public GUICreateWindowParams { + SDLCreateWindowParams():cacheFonts_(true),framebuffer_(false) {} ; + bool cacheFonts_ ; + bool framebuffer_ ; +} ; + +class SDLGUIWindowImp: public I_GUIWindowImp { + +public: + + SDLGUIWindowImp(GUICreateWindowParams &p) ; + virtual ~SDLGUIWindowImp() ; + +public: // I_GUIWindowImp implementation + + virtual void SetColor(GUIColor &) ; + virtual void DrawRect(GUIRect &) ; + virtual void DrawChar(const char c,GUIPoint &pos,GUITextProperties &); + virtual void DrawString(const char *string,GUIPoint &pos,GUITextProperties &,bool overlay=false); + virtual GUIRect GetRect() ; + virtual void Invalidate() ; + virtual void Flush(); + virtual void Lock() ; + virtual void Unlock() ; + virtual void Clear(GUIColor &, bool overlay=false) ; + virtual void ClearRect(GUIRect &) ; + virtual void PushEvent(GUIEvent &event) ; + +public: // Added functionality + void ProcessExpose() ; + void ProcessQuit() ; + void ProcessUserEvent(SDL_Event &event) ; +protected: + void prepareFonts() ; + void prepareFullFonts() ; + void prepareBPP1Fonts() ; + void transform(const GUIRect &srcRect,SDL_Rect *dstRect); + void transform(const GUIPoint &srcPoint, int *x, int *y); + +private: + SDL_Window *window_; + SDL_Surface *surface_; +// SDL_Surface *offscreen_ ; + GUIRect screenRect_ ; + unsigned int currentColor_ ; + unsigned int backgroundColor_ ; + unsigned int foregroundColor_ ; + int bitDepth_ ; + bool cacheFonts_ ; + bool framebuffer_ ; + bool windowed_; + SDL_Rect updateRects_[MAX_OVERLAYS] ; + int updateCount_ ; + int appAnchorX_ ; + int appAnchorY_ ; + int mult_ ; +} ; +#endif diff --git a/sources/Adapters/SDL2/Input/SDLInput.cpp b/sources/Adapters/SDL2/Input/SDLInput.cpp new file mode 100644 index 00000000..2c3641b1 --- /dev/null +++ b/sources/Adapters/SDL2/Input/SDLInput.cpp @@ -0,0 +1,203 @@ + +#include "SDLInput.h" +#include "Application/Model/Config.h" + +#ifndef PLATOFM_BITTBOY +int keyMapping[]={ + SDLK_a, + SDLK_s, + SDLK_LEFT, + SDLK_RIGHT, + SDLK_UP, + SDLK_DOWN, + SDLK_RCTRL, + SDLK_LCTRL, + SDLK_SPACE +} ; +#endif + +int eventMapping[]={ + SDLI_BUTTON_A, + SDLI_BUTTON_B, + SDLI_BUTTON_LEFT, + SDLI_BUTTON_RIGHT, + SDLI_BUTTON_UP, + SDLI_BUTTON_DOWN, + SDLI_BUTTON_L, + SDLI_BUTTON_R, + SDLI_BUTTON_START +} ; + +enum MappingType { + MT_KEY, + MT_JOYBUTTON, + MT_JOYHAT, + MT_JOYAXES +} ; + +int keyMappingType[9] ; + + +SDLInput::SDLInput() { + + // open first joystick if available + + if(SDL_NumJoysticks()>0){ + // Open joystick + joystick_=SDL_JoystickOpen(0); + Trace::Debug("Number of axis:%d",SDL_JoystickNumAxes(joystick_)) ; + Trace::Debug("Number of buttons:%d",SDL_JoystickNumButtons(joystick_)) ; + Trace::Debug("Number of hats:%d",SDL_JoystickNumHats(joystick_)) ; + } else { + joystick_=0 ; + } ; + Trace::Debug("Joystick: %s",joystick_?"opened":"not found") ; + + // initialises default mapping table + for (int i=0;i<9;i++) { + keyMappingType[i]=MT_KEY ; + } ; +} ; + +void SDLInput::ReadConfig() { + + mapKey(0,"KEY_A") ; + mapKey(1,"KEY_B") ; + mapKey(2,"KEY_LEFT") ; + mapKey(3,"KEY_RIGHT") ; + mapKey(4,"KEY_UP") ; + mapKey(5,"KEY_DOWN") ; + mapKey(6,"KEY_LSHOULDER") ; + mapKey(7,"KEY_RSHOULDER") ; + mapKey(8,"KEY_START") ; +} + +void SDLInput::mapKey(int index,const char *keyname) { + + Config *config=Config::GetInstance() ; + + // Read the configuration file and look if we got a definition + const char *key=config->GetValue(keyname) ; + if (key) { + // we found a key, let's find which type it is + + MappingType type=MT_KEY ; + if (key[3]==':') { + if (tolower(key[0])=='b') { // button + type=MT_JOYBUTTON ; + } + if (tolower(key[0])=='h') { // hat + type=MT_JOYHAT ; + } + if (tolower(key[0])=='j') { // joy + type=MT_JOYAXES ; + } + } ; + + keyMappingType[index]=type ; + switch(type) { + case MT_KEY: + for (int i=0;itrigger) { + mask|=eventMapping[i] ; + } + } + } + break ; + default: + break ; + } ; + } + return mask ; +} ; + diff --git a/sources/Adapters/SDL2/Input/SDLInput.h b/sources/Adapters/SDL2/Input/SDLInput.h new file mode 100644 index 00000000..7ce7b838 --- /dev/null +++ b/sources/Adapters/SDL2/Input/SDLInput.h @@ -0,0 +1,35 @@ + +#ifndef _SDL_INPUT_H_ +#define _SDL_INPUT_H_ + +#include "Externals/SDL/SDL.h" +#include "Foundation/T_Singleton.h" + +#define SDLI_BUTTON_A 0x1 +#define SDLI_BUTTON_B 0x2 +#define SDLI_BUTTON_LEFT 0x4 +#define SDLI_BUTTON_RIGHT 0x8 +#define SDLI_BUTTON_UP 0x10 +#define SDLI_BUTTON_DOWN 0x20 +#define SDLI_BUTTON_L 0x40 +#define SDLI_BUTTON_R 0x80 +#define SDLI_BUTTON_START 0x100 +#define SDLI_BUTTON_SELECT 0x200 + + +class SDLInput: public T_Singleton { +public: + SDLInput() ; + void ReadConfig(); + unsigned short GetButtonMask() ; + +private: + void mapKey(int index,const char *keyname) ; + + SDL_Joystick *joystick_; + + const char *keyname_[SDL_NUM_SCANCODES] ; + +} ; + +#endif diff --git a/sources/Adapters/SDL2/Process/SDLProcess.cpp b/sources/Adapters/SDL2/Process/SDLProcess.cpp new file mode 100644 index 00000000..90719c30 --- /dev/null +++ b/sources/Adapters/SDL2/Process/SDLProcess.cpp @@ -0,0 +1,54 @@ + +#include "SDLProcess.h" +#include + +int _SDLStartThread(void *argp) { + SysThread *play=(SysThread *)argp ; + play->startExecution() ; + return 0 ; +} + +bool SDLProcessFactory::BeginThread(SysThread& thread) { + SDL_CreateThread(_SDLStartThread,&thread); + return true ; +} + +SysSemaphore *SDLProcessFactory::CreateNewSemaphore(int initialcount, int maxcount) { + return new SDLSysSemaphore(initialcount,maxcount) ; +} ; + +SDLSysSemaphore::SDLSysSemaphore(int initialcount,int maxcount) { + handle_=SDL_CreateSemaphore(0) ; +} ; + +SDLSysSemaphore::~SDLSysSemaphore() { + handle_=0 ; +} ; + +SysSemaphoreResult SDLSysSemaphore::Wait() { + if (!handle_) { + return SSR_INVALID ; + } ; + return (SysSemaphoreResult)SDL_SemWait(handle_) ; +} ; + +SysSemaphoreResult SDLSysSemaphore::TryWait() { + if (!handle_) { + return SSR_INVALID ; + } ; + return (SysSemaphoreResult)0; +} + +SysSemaphoreResult SDLSysSemaphore::WaitTimeout(unsigned long timeout) { + if (!handle_) { + return SSR_INVALID ; + } ; + return (SysSemaphoreResult)0; +} ; + +SysSemaphoreResult SDLSysSemaphore::Post() { + if (!handle_) { + return SSR_INVALID ; + } ; + return (SysSemaphoreResult)SDL_SemPost(handle_) ; +} ; diff --git a/sources/Adapters/SDL2/Process/SDLProcess.h b/sources/Adapters/SDL2/Process/SDLProcess.h new file mode 100644 index 00000000..18744f73 --- /dev/null +++ b/sources/Adapters/SDL2/Process/SDLProcess.h @@ -0,0 +1,23 @@ +#ifndef _SDL_PROCESS_H_ +#define _SDL_PROCESS_H_ + +#include "System/Process/Process.h" +#include + +class SDLProcessFactory:public SysProcessFactory { + bool BeginThread(SysThread &) ; + virtual SysSemaphore *CreateNewSemaphore(int initialcount = 0, int maxcount = 0) ; +} ; + +class SDLSysSemaphore:public SysSemaphore { +public: + SDLSysSemaphore(int initialcount = 0, int maxcount = 0) ; + virtual ~SDLSysSemaphore() ; + virtual SysSemaphoreResult Wait() ; + virtual SysSemaphoreResult TryWait() ; + virtual SysSemaphoreResult WaitTimeout(unsigned long) ; + virtual SysSemaphoreResult Post() ; +private: + SDL_sem *handle_ ; +} ; +#endif diff --git a/sources/Adapters/SDL2/Timer/SDLTimer.cpp b/sources/Adapters/SDL2/Timer/SDLTimer.cpp new file mode 100644 index 00000000..bf3031dc --- /dev/null +++ b/sources/Adapters/SDL2/Timer/SDLTimer.cpp @@ -0,0 +1,73 @@ + +#include "SDLTimer.h" +#include "System/Console/n_assert.h" +#include "System/Console/Trace.h" +#include "System/System/System.h" + +Uint32 SDLTimerCallback(Uint32 interval, void* param) { + SDLTimer *timer=(SDLTimer *)param ; + return timer->OnTimerTick() ; +} ; + +Uint32 SDLTriggerCallback(Uint32 interval, void* param) { + timerCallback tc=(timerCallback)param ; + (*tc)() ; + return 0 ; +} ; + +SDLTimer::SDLTimer() { + period_=-1 ; + timer_=0 ; + running_=false ; +} ; + +SDLTimer::~SDLTimer() { +} + +void SDLTimer::SetPeriod(float msec) { + period_=int(msec) ; + offset_=0 ; +} ; + +bool SDLTimer::Start() { + if (period_>0) { + offset_=period_ ; + Uint32 newcb=int(offset_) ; + offset_-=newcb ; + timer_=SDL_AddTimer(newcb,SDLTimerCallback,this); + lastTick_=System::GetInstance()->GetClock() ; + running_=true ; + } + return (timer_!=0) ; +} ; + +void SDLTimer::Stop() { + SDL_RemoveTimer(timer_) ; + timer_=0 ; + running_=false ; +} ; + +float SDLTimer::GetPeriod() { + return period_ ; +} ; + +Uint32 SDLTimer::OnTimerTick() { + Uint32 newcb=0 ; + if (running_) { + SetChanged() ; + NotifyObservers() ; + offset_+=period_ ; + newcb=int(offset_) ; + offset_-=newcb ; + NAssert(newcb>0) ; + } + return newcb ; +} ; + +I_Timer *SDLTimerService::CreateTimer() { + return new SDLTimer() ; +} ; + +void SDLTimerService::TriggerCallback(int msec,timerCallback cb) { + SDL_AddTimer(msec,SDLTriggerCallback,(void *)cb); +} diff --git a/sources/Adapters/SDL2/Timer/SDLTimer.h b/sources/Adapters/SDL2/Timer/SDLTimer.h new file mode 100644 index 00000000..5366cb38 --- /dev/null +++ b/sources/Adapters/SDL2/Timer/SDLTimer.h @@ -0,0 +1,32 @@ +#ifndef _SDL_TIMER_H_ +#define _SDL_TIMER_H_ + +#include +#include "System/Timer/Timer.h" + +class SDLTimer: public I_Timer { +public: + SDLTimer() ; + virtual ~SDLTimer() ; + virtual void SetPeriod(float msec) ; + virtual bool Start() ; + virtual void Stop() ; + virtual float GetPeriod() ; + Uint32 OnTimerTick() ; + +private: + float period_ ; + float offset_ ; // Float offset taking into account + // period is an int + SDL_TimerID timer_ ; // NULL if not running + long lastTick_ ; + bool running_ ; +} ; + +class SDLTimerService: public TimerService { +public: + virtual I_Timer *CreateTimer() ; // Returns a timer + virtual void TriggerCallback(int msec,timerCallback cb) ; +}; + +#endif From ad1c02b99995298649fb655843858fe294471e18 Mon Sep 17 00:00:00 2001 From: Simon Lees Date: Sun, 4 Aug 2024 20:27:03 +0930 Subject: [PATCH 17/66] Use SDL or SDL2 for non platform specific code --- sources/Application/Commands/EventDispatcher.cpp | 4 ++++ sources/Application/Mixer/MixerService.h | 4 ++++ sources/Services/Time/TimeService.cpp | 4 ++++ sources/System/Process/SysMutex.h | 6 +++++- 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/sources/Application/Commands/EventDispatcher.cpp b/sources/Application/Commands/EventDispatcher.cpp index b0e44545..113bc46b 100644 --- a/sources/Application/Commands/EventDispatcher.cpp +++ b/sources/Application/Commands/EventDispatcher.cpp @@ -1,5 +1,9 @@ #include "EventDispatcher.h" +#ifdef SDL2 +#include +#else #include +#endif #include "Application/Model/Config.h" #include "System/Console/Trace.h" diff --git a/sources/Application/Mixer/MixerService.h b/sources/Application/Mixer/MixerService.h index e0020773..4e819404 100644 --- a/sources/Application/Mixer/MixerService.h +++ b/sources/Application/Mixer/MixerService.h @@ -1,7 +1,11 @@ #ifndef _MIXER_SERVICE_H_ #define _MIXER_SERVICE_H_ +#ifdef SDL2 +#include +#else #include +#endif #include "Application/Commands/CommandDispatcher.h" // Would be better done externally and call an API here #include "Foundation/Observable.h" #include "Foundation/T_Singleton.h" diff --git a/sources/Services/Time/TimeService.cpp b/sources/Services/Time/TimeService.cpp index 4bde2fa1..56b1f883 100644 --- a/sources/Services/Time/TimeService.cpp +++ b/sources/Services/Time/TimeService.cpp @@ -1,5 +1,9 @@ #include "TimeService.h" +#ifdef SDL2 +#include +#else #include +#endif #include "System/System/System.h" /*Date::Date() { diff --git a/sources/System/Process/SysMutex.h b/sources/System/Process/SysMutex.h index f79cea3e..c5720fd7 100644 --- a/sources/System/Process/SysMutex.h +++ b/sources/System/Process/SysMutex.h @@ -7,7 +7,11 @@ * */ +#ifdef SDL2 +#include +#else #include +#endif class SysMutex { public: @@ -25,4 +29,4 @@ class SysMutexLocker { ~SysMutexLocker() ; private: SysMutex *mutex_ ; -} ; \ No newline at end of file +} ; From 00e40cdb0224b37b926291371f1cd8ebd49870e6 Mon Sep 17 00:00:00 2001 From: Simon Lees Date: Sun, 4 Aug 2024 22:34:42 +0930 Subject: [PATCH 18/66] X64: Move X64 to using SDL2 --- projects/Makefile.X64 | 5 +++-- sources/Adapters/LINUX/Main/LINUXMain.cpp | 2 +- sources/Adapters/LINUX/System/LINUXSystem.cpp | 13 ++++++------- sources/Adapters/LINUX/System/LINUXSystem.h | 2 +- .../Services/Controllers/KeyboardControllerSource.h | 5 +++++ 5 files changed, 16 insertions(+), 11 deletions(-) diff --git a/projects/Makefile.X64 b/projects/Makefile.X64 index f461e902..cec00ca9 100644 --- a/projects/Makefile.X64 +++ b/projects/Makefile.X64 @@ -7,14 +7,15 @@ DEFINES := \ -D__LINUX_ALSASEQ__ \ -D_64BIT \ -DSDLAUDIO \ + -DSDL2 \ -DRTMIDI ALSA_CFLAGS := $(shell pkg-config alsa --cflags) ALSA_LIBS := $(shell pkg-config alsa --libs) JACK_CFLAGS := $(shell pkg-config jack --cflags) JACK_LIBS := $(shell pkg-config jack --libs) -SDL_CFLAGS := $(shell pkg-config sdl --cflags) -SDL_LIBS := $(shell pkg-config sdl --libs) +SDL_CFLAGS := $(shell pkg-config sdl2 --cflags) +SDL_LIBS := $(shell pkg-config sdl2 --libs) # optimization CFLAGS := $(DEFINES) -g -O3 -Wall $(ALSA_CFLAGS) $(JACK_CFLAGS) $(SDL_CFLAGS) -I$(PWD)/../sources diff --git a/sources/Adapters/LINUX/Main/LINUXMain.cpp b/sources/Adapters/LINUX/Main/LINUXMain.cpp index 7bde061d..0cbac5af 100644 --- a/sources/Adapters/LINUX/Main/LINUXMain.cpp +++ b/sources/Adapters/LINUX/Main/LINUXMain.cpp @@ -1,7 +1,7 @@ #include #include "Application/Application.h" #include "Adapters/LINUX/System/LINUXSystem.h" -#include "Adapters/SDL/GUI/SDLGUIWindowImp.h" +#include "Adapters/SDL2/GUI/SDLGUIWindowImp.h" /* * generic entrypoint for linux based targets diff --git a/sources/Adapters/LINUX/System/LINUXSystem.cpp b/sources/Adapters/LINUX/System/LINUXSystem.cpp index 4ee9c22f..39031ff1 100644 --- a/sources/Adapters/LINUX/System/LINUXSystem.cpp +++ b/sources/Adapters/LINUX/System/LINUXSystem.cpp @@ -3,10 +3,10 @@ #include #include #include -#include "Adapters/SDL/GUI/GUIFactory.h" -#include "Adapters/SDL/GUI/SDLEventManager.h" -#include "Adapters/SDL/GUI/SDLGUIWindowImp.h" -#include "Adapters/SDL/Timer/SDLTimer.h" +#include "Adapters/SDL2/GUI/GUIFactory.h" +#include "Adapters/SDL2/GUI/SDLEventManager.h" +#include "Adapters/SDL2/GUI/SDLGUIWindowImp.h" +#include "Adapters/SDL2/Timer/SDLTimer.h" #include "Adapters/Unix/FileSystem/UnixFileSystem.h" #include "Adapters/Unix/Process/UnixProcess.h" #include "Application/Controllers/ControlRoom.h" @@ -36,7 +36,7 @@ #endif #ifdef SDLAUDIO -#include "Adapters/SDL/Audio/SDLAudio.h" +#include "Adapters/SDL2/Audio/SDLAudio.h" #endif EventManager *LINUXSystem::eventManager_ = NULL; @@ -55,7 +55,7 @@ int LINUXSystem::MainLoop() { */ void LINUXSystem::Boot(int argc,char **argv) { - SDL_putenv((char *)"SDL_VIDEO_X11_WMCLASS=LittleGPTracker") ; + SDL_setenv((char *)"SDL_VIDEO_X11_WMCLASS",(char *)"LittleGPTracker",1) ; // Install System System::Install(new LINUXSystem()); @@ -131,7 +131,6 @@ void LINUXSystem::Boot(int argc,char **argv) { if ( SDL_Init(SDL_INIT_VIDEO|SDL_INIT_TIMER) < 0 ) { return; } - SDL_EnableUNICODE(1); SDL_ShowCursor(SDL_DISABLE); atexit(SDL_Quit); diff --git a/sources/Adapters/LINUX/System/LINUXSystem.h b/sources/Adapters/LINUX/System/LINUXSystem.h index de6d5493..ac9e0b77 100644 --- a/sources/Adapters/LINUX/System/LINUXSystem.h +++ b/sources/Adapters/LINUX/System/LINUXSystem.h @@ -2,7 +2,7 @@ #define _LINUX_SYSTEM_H_ #include "System/System/System.h" -#include +#include #include "UIFramework/SimpleBaseClasses/EventManager.h" class LINUXSystem: public System { diff --git a/sources/Services/Controllers/KeyboardControllerSource.h b/sources/Services/Controllers/KeyboardControllerSource.h index 9824a3bc..e22e2b71 100644 --- a/sources/Services/Controllers/KeyboardControllerSource.h +++ b/sources/Services/Controllers/KeyboardControllerSource.h @@ -3,7 +3,12 @@ #include "ControllerSource.h" +#ifdef SDL2 +// SDL_NUM_SCANCODES is currently 512 +#define MAX_KEY 512 +#else #define MAX_KEY 400 +#endif class KeyboardControllerSource: public ControllerSource { public: From 733425c282a3a312e92f7be3b37fbf3da20f1d5c Mon Sep 17 00:00:00 2001 From: Simon Lees Date: Mon, 5 Aug 2024 19:57:06 +0930 Subject: [PATCH 19/66] x64 Move to SDL2 disable Midi Currently on a multicore system RTMidi seems to add a number of race conditions so disable it until resolved. --- projects/Makefile | 35 +++++++++++++++++++++++------------ projects/Makefile.X64 | 4 ++-- 2 files changed, 25 insertions(+), 14 deletions(-) diff --git a/projects/Makefile b/projects/Makefile index 452c5b6f..193b5871 100644 --- a/projects/Makefile +++ b/projects/Makefile @@ -60,13 +60,11 @@ COMMONDIRS := \ #--------------------------------------------------------------------------------- LINUXDIRS := \ - ../sources/Adapters/Unix/FileSystem \ ../sources/Adapters/LINUX/Main \ + ../sources/Adapters/LINUX/System \ + ../sources/Adapters/Unix/FileSystem \ ../sources/Adapters/Unix/Process \ - ../sources/System/Process \ - ../sources/Adapters/LINUX/System \ - ../sources/Adapters/SDL/Timer \ - ../sources/Adapters/SDL/GUI + ../sources/System/Process DUMMYMIDIDIRS := \ ../sources/Adapters/Dummy/Midi @@ -84,15 +82,27 @@ RTMIDIDIRS := \ ../sources/Adapters/RTMidi \ ../sources/Externals/RtMidi +SDLDIRS := \ + ../sources/Adapters/SDL/Timer \ + ../sources/Adapters/SDL/GUI + +SDL2DIRS := \ + ../sources/Adapters/SDL2/Timer \ + ../sources/Adapters/SDL2/GUI + SDLAUDIODIRS := \ ../sources/Adapters/SDL/Audio + +SDL2AUDIODIRS := \ + ../sources/Adapters/SDL2/Audio -BEAGLEBOARDDIRS := $(LINUXDIRS) $(RTAUDIODIRS) -DEBDIRS := $(LINUXDIRS) $(JACKDIRS) $(RTAUDIODIRS) $(RTMIDIDIRS) -RASPIDIRS := $(LINUXDIRS) $(JACKDIRS) $(RTAUDIODIRS) $(RTMIDIDIRS) -STEAMDIRS := $(LINUXDIRS) $(JACKDIRS) $(RTAUDIODIRS) $(RTMIDIDIRS) -X64DIRS := $(LINUXDIRS) $(RTMIDIDIRS) $(SDLAUDIODIRS) -X86DIRS := $(LINUXDIRS) $(JACKDIRS) $(RTAUDIODIRS) $(RTMIDIDIRS) +BEAGLEBOARDDIRS := $(LINUXDIRS) $(RTAUDIODIRS) $(SDLDIRS) +DEBDIRS := $(LINUXDIRS) $(JACKDIRS) $(RTAUDIODIRS) $(RTMIDIDIRS) $(SDLDIRS) +RASPIDIRS := $(LINUXDIRS) $(JACKDIRS) $(RTAUDIODIRS) $(RTMIDIDIRS) $(SDLDIRS) +STEAMDIRS := $(LINUXDIRS) $(JACKDIRS) $(RTAUDIODIRS) $(RTMIDIDIRS) $(SDLDIRS) +#X64DIRS := $(LINUXDIRS) $(RTMIDIDIRS) $(SDL2DIRS) $(SDL2AUDIODIRS) +X64DIRS := $(LINUXDIRS) $(DUMMYMIDIDIRS) $(SDL2DIRS) $(SDL2AUDIODIRS) +X86DIRS := $(LINUXDIRS) $(JACKDIRS) $(RTAUDIODIRS) $(RTMIDIDIRS) $(SDLDIRS) #--------------------------------------------------------------------------------- # Consoles/Embedded @@ -286,7 +296,8 @@ DEBFILES := $(LINUXFILES) $(RTAUDIOFILES) $(RTMIDIFILES) $(JACKFILES) BEAGLEBOARDFILES := $(LINUXFILES) $(DUMMYMIDIFILES) RASPIFILES := $(LINUXFILES) $(RTAUDIOFILES) $(RTMIDIFILES) $(JACKFILES) STEAMFILES := $(LINUXFILES) $(RTAUDIOFILES) $(RTMIDIFILES) $(JACKFILES) -X64FILES := $(LINUXFILES) $(SDLAUDIOFILES) $(RTMIDIFILES) +#X64FILES := $(LINUXFILES) $(RTMIDIFILES) $(SDLAUDIOFILES) +X64FILES := $(LINUXFILES) $(SDLAUDIOFILES) $(DUMMYMIDIFILES) X86FILES := $(LINUXFILES) $(RTAUDIOFILES) $(RTMIDIFILES) $(JACKFILES) #--------------------------------------------------------------------------------- diff --git a/projects/Makefile.X64 b/projects/Makefile.X64 index cec00ca9..02f16314 100644 --- a/projects/Makefile.X64 +++ b/projects/Makefile.X64 @@ -6,9 +6,9 @@ DEFINES := \ -D__LINUX_ALSA__ \ -D__LINUX_ALSASEQ__ \ -D_64BIT \ - -DSDLAUDIO \ -DSDL2 \ - -DRTMIDI + -DSDLAUDIO \ + -DDUMMYMIDI ALSA_CFLAGS := $(shell pkg-config alsa --cflags) ALSA_LIBS := $(shell pkg-config alsa --libs) From bef8a3d082396b7d8ec09d6847960b46523191ae Mon Sep 17 00:00:00 2001 From: Simon Lees Date: Mon, 5 Aug 2024 20:14:32 +0930 Subject: [PATCH 20/66] SDL2: Don't call SDL_EnableUNICODE() on platforms SDL2 doesn't support SDL_EnableUNICODE() so conditionally don't include it when building with SDL2. SDL2 is still not tested on any of these platforms but hopefully this change makes someones life easier in the future. --- sources/Adapters/CAANOO/System/CAANOOSystem.cpp | 2 ++ sources/Adapters/DINGOO/System/BITTBOYSystem.cpp | 4 +++- sources/Adapters/DINGOO/System/DINGOOSystem.cpp | 4 +++- sources/Adapters/DINGOO/System/MIYOOSystem.cpp | 2 ++ sources/Adapters/PSP/System/PSPSystem.cpp | 6 ++++-- 5 files changed, 14 insertions(+), 4 deletions(-) diff --git a/sources/Adapters/CAANOO/System/CAANOOSystem.cpp b/sources/Adapters/CAANOO/System/CAANOOSystem.cpp index 63d503a9..73820445 100644 --- a/sources/Adapters/CAANOO/System/CAANOOSystem.cpp +++ b/sources/Adapters/CAANOO/System/CAANOOSystem.cpp @@ -104,7 +104,9 @@ void GPSDLSystem::Boot(int argc,char **argv) { return; } +#ifndef SDL2 SDL_EnableUNICODE(1); +#endif atexit(SDL_Quit); diff --git a/sources/Adapters/DINGOO/System/BITTBOYSystem.cpp b/sources/Adapters/DINGOO/System/BITTBOYSystem.cpp index 4f1afd3d..8d4242e3 100644 --- a/sources/Adapters/DINGOO/System/BITTBOYSystem.cpp +++ b/sources/Adapters/DINGOO/System/BITTBOYSystem.cpp @@ -87,7 +87,9 @@ void GPSDLSystem::Boot(int argc,char **argv) { return; } - SDL_EnableUNICODE(1); +#ifndef SDL2 + SDL_EnableUNICODE(1); +#endif atexit(SDL_Quit); diff --git a/sources/Adapters/DINGOO/System/DINGOOSystem.cpp b/sources/Adapters/DINGOO/System/DINGOOSystem.cpp index 7b349e0f..fb1f9f30 100644 --- a/sources/Adapters/DINGOO/System/DINGOOSystem.cpp +++ b/sources/Adapters/DINGOO/System/DINGOOSystem.cpp @@ -86,7 +86,9 @@ void GPSDLSystem::Boot(int argc,char **argv) { return; } - SDL_EnableUNICODE(1); +#ifndef SDL2 + SDL_EnableUNICODE(1); +#endif atexit(SDL_Quit); diff --git a/sources/Adapters/DINGOO/System/MIYOOSystem.cpp b/sources/Adapters/DINGOO/System/MIYOOSystem.cpp index 3f60a0ba..99020c1e 100644 --- a/sources/Adapters/DINGOO/System/MIYOOSystem.cpp +++ b/sources/Adapters/DINGOO/System/MIYOOSystem.cpp @@ -88,7 +88,9 @@ void GPSDLSystem::Boot(int argc,char **argv) { if (SDL_Init(SDL_INIT_EVENTTHREAD | SDL_INIT_VIDEO | SDL_INIT_JOYSTICK | SDL_INIT_TIMER) < 0) { return; } +#ifndef SDL2 SDL_EnableUNICODE(1); +#endif atexit(SDL_Quit); eventManager_ = I_GUIWindowFactory::GetInstance() -> GetEventManager(); diff --git a/sources/Adapters/PSP/System/PSPSystem.cpp b/sources/Adapters/PSP/System/PSPSystem.cpp index 22083fce..b9174154 100644 --- a/sources/Adapters/PSP/System/PSPSystem.cpp +++ b/sources/Adapters/PSP/System/PSPSystem.cpp @@ -74,8 +74,10 @@ void PSPSystem::Boot(int argc,char **argv) { if ( SDL_Init(SDL_INIT_VIDEO|SDL_INIT_JOYSTICK|SDL_INIT_TIMER) < 0 ) { return; } - SDL_EnableUNICODE(1); - SDL_ShowCursor(SDL_DISABLE); +#ifndef SDL2 + SDL_EnableUNICODE(1); +#endif + SDL_ShowCursor(SDL_DISABLE); atexit(SDL_Quit); From 4356e891505906dea200511711682aa6fa02b61d Mon Sep 17 00:00:00 2001 From: Simon Lees Date: Mon, 5 Aug 2024 21:18:36 +0930 Subject: [PATCH 21/66] Revert "Cleanup #includes" This reverts commit d98ef99a8378a3e1ef6ec2fba95bd6cdfdf8f969. This is mostly to make the SDL2 review cleaner --- .../CAANOO/Audio/CAANOOAudioDriver.cpp | 16 ++++---- .../Adapters/CAANOO/Audio/CAANOOAudioDriver.h | 1 + .../CAANOO/FileSystem/CAANOOFileSystem.cpp | 4 +- .../Adapters/CAANOO/Main/CAANOOSDLMain.cpp | 7 ++-- .../CAANOO/Midi/CAANOOSerialMidiDevice.cpp | 8 ++-- .../CAANOO/Midi/CAANOOSerialMidiDevice.h | 1 + .../Adapters/CAANOO/System/CAANOOSystem.cpp | 33 ++++++++------- sources/Adapters/CAANOO/System/CAANOOSystem.h | 2 +- .../Adapters/CAANOO/UI/CAANOOGUIWindowImp.cpp | 8 ++-- sources/Adapters/DEB/Main/DEBmain.cpp | 4 +- sources/Adapters/DEB/System/DEBSystem.cpp | 19 ++++----- sources/Adapters/DEB/System/DEBSystem.h | 2 +- sources/Adapters/DEB/UI/DEBGUIWindowImp.cpp | 6 +-- .../DINGOO/Audio/DINGOOAudioDriver.cpp | 15 +++---- .../DINGOO/FileSystem/DINGOOFileSystem.cpp | 6 +-- sources/Adapters/DINGOO/Main/GPSDLMain.cpp | 8 ++-- .../DINGOO/Midi/BITTBOYSerialMidiDevice.cpp | 6 +-- .../DINGOO/Midi/DINGOOSerialMidiDevice.cpp | 8 ++-- .../DINGOO/Midi/DINGOOSerialMidiDevice.h | 1 + .../Adapters/DINGOO/System/BITTBOYSystem.cpp | 38 +++++++++--------- .../Adapters/DINGOO/System/DINGOOSystem.cpp | 32 +++++++-------- sources/Adapters/DINGOO/System/DINGOOSystem.h | 2 +- .../Adapters/DINGOO/System/MIYOOSystem.cpp | 40 +++++++++---------- .../Adapters/DINGOO/UI/DINGOOGUIWindowImp.cpp | 7 ++-- .../Dummy/FileSystem/DummyFileSystem.cpp | 2 +- sources/Adapters/Dummy/Sound/DummySound.h | 1 - .../Adapters/GP2X/Audio/GP2XAudioDriver.cpp | 20 ++++++---- sources/Adapters/GP2X/Audio/GP2XAudioDriver.h | 1 + .../GP2X/FileSystem/GP2XFileSystem.cpp | 16 ++++---- sources/Adapters/GP2X/Main/GPSDLMain.cpp | 10 +++-- .../GP2X/Midi/GP2XSerialMidiDevice.cpp | 8 ++-- .../Adapters/GP2X/Midi/GP2XSerialMidiDevice.h | 1 + sources/Adapters/GP2X/System/GP2XSystem.cpp | 30 +++++++------- sources/Adapters/GP2X/System/GP2XSystem.h | 2 +- sources/Adapters/GP2X/UI/GP2XGUIWindowImp.cpp | 8 ++-- sources/Adapters/Jack/Audio/JackAudio.cpp | 2 +- sources/Adapters/Jack/Audio/JackAudio.h | 2 +- sources/Adapters/Jack/Audio/JackAudioDriver.h | 2 +- sources/Adapters/Jack/Client/JackClient.h | 2 +- sources/Adapters/Jack/Midi/JackMidiDevice.h | 2 +- .../Adapters/Jack/Midi/JackMidiService.cpp | 8 ++-- sources/Adapters/LINUX/Main/LINUXMain.cpp | 3 +- sources/Adapters/LINUX/System/LINUXSystem.h | 2 +- .../Adapters/NDS/FileSystem/NDSFileSystem.cpp | 9 ++--- sources/Adapters/NDS/Main/NDSmain.cpp | 6 +-- sources/Adapters/NDS/Sound/NDSSound.cpp | 2 +- sources/Adapters/NDS/System/NDSSystem.cpp | 9 +++-- sources/Adapters/NDS/System/NDSSystem.h | 2 + sources/Adapters/NDS/UI/NDSGUIWindowImp.cpp | 6 +-- sources/Adapters/OSX/OSXMain/OSXmain.cpp | 3 +- sources/Adapters/OSX/OSXSystem/OSXSystem.cpp | 12 +++--- .../Adapters/PSP/FileSystem/PSPFileSystem.cpp | 9 +++-- sources/Adapters/PSP/Main/PSPmain.cpp | 15 ++++--- sources/Adapters/PSP/System/PSPSystem.cpp | 14 +++---- sources/Adapters/RTAudio/RTAudioDriver.cpp | 10 ++--- sources/Adapters/RTAudio/RTAudioDriver.h | 4 +- sources/Adapters/RTAudio/RTAudioStub.cpp | 3 +- sources/Adapters/RTMidi/RTMidiService.cpp | 4 +- sources/Adapters/SDL/Audio/SDLAudioDriver.cpp | 4 +- sources/Adapters/SDL/GUI/GUIFactory.cpp | 4 +- sources/Adapters/SDL/GUI/SDLEventManager.cpp | 5 +-- sources/Adapters/SDL/GUI/SDLEventManager.h | 7 ++-- sources/Adapters/SDL/GUI/SDLGUIWindowImp.cpp | 12 +++--- sources/Adapters/SDL/Timer/SDLTimer.cpp | 2 +- sources/Adapters/SDL/Timer/SDLTimer.h | 4 +- .../Unix/FileSystem/UnixFileSystem.cpp | 13 +++--- sources/Adapters/Unix/Process/UnixProcess.cpp | 5 +-- sources/Adapters/W32/Audio/W32AudioDriver.cpp | 4 +- sources/Adapters/W32/Audio/W32AudioDriver.h | 2 +- sources/Adapters/W32/Main/WSDLmain.cpp | 7 ++-- sources/Adapters/W32/Timer/W32Timer.cpp | 4 +- .../Adapters/W32FileSystem/W32FileSystem.cpp | 8 ++-- sources/Adapters/WSDLSystem/WSDLSystem.cpp | 15 +++---- sources/Adapters/WSDLSystem/WSDLSystem.h | 2 +- sources/Adapters/WSDLUI/WSDLGUIWindowImp.cpp | 6 +-- sources/Application/AppWindow.cpp | 24 +++++------ sources/Application/AppWindow.h | 12 +++--- sources/Application/Application.cpp | 8 ++-- sources/Application/Application.h | 2 +- .../Application/Audio/AudioFileStreamer.cpp | 2 +- sources/Application/Audio/AudioFileStreamer.h | 2 +- sources/Application/Audio/DummyAudioOut.cpp | 2 +- .../Commands/ApplicationCommandDispatcher.h | 4 +- .../Commands/CommandDispatcher.cpp | 1 + .../Application/Commands/CommandDispatcher.h | 2 +- .../Application/Commands/EventDispatcher.h | 6 +-- .../Application/Controllers/ControlRoom.cpp | 6 +-- .../Application/Instruments/I_Instrument.h | 7 ++-- .../Instruments/InstrumentBank.cpp | 4 +- .../Application/Instruments/InstrumentBank.h | 2 +- .../Instruments/MidiInstrument.cpp | 6 +-- sources/Application/Instruments/SRPUpdaters.h | 3 +- .../Instruments/SampleInstrument.cpp | 23 ++++++----- .../Instruments/SampleInstrument.h | 10 ++--- .../Application/Instruments/SamplePool.cpp | 8 ++-- sources/Application/Instruments/SamplePool.h | 4 +- .../Instruments/SampleRenderingParams.h | 2 +- .../Application/Instruments/SampleVariable.h | 4 +- .../Instruments/SoundFontManager.cpp | 5 ++- .../Instruments/SoundFontManager.h | 4 +- .../Application/Instruments/SoundFontPreset.h | 2 +- .../Application/Instruments/SoundFontSample.h | 2 +- sources/Application/Instruments/WavFile.cpp | 6 +-- sources/Application/Instruments/WavFile.h | 2 +- .../Application/Instruments/WavFileWriter.h | 2 +- sources/Application/Mixer/MixerService.cpp | 6 +-- sources/Application/Model/Chain.cpp | 2 +- sources/Application/Model/Config.h | 2 +- sources/Application/Model/Groove.h | 4 +- sources/Application/Model/Mixer.h | 3 +- sources/Application/Model/Phrase.cpp | 2 +- sources/Application/Model/Phrase.h | 1 - sources/Application/Model/Project.cpp | 13 +++--- sources/Application/Model/Project.h | 4 +- sources/Application/Model/Song.cpp | 11 ++--- sources/Application/Model/Song.h | 2 +- sources/Application/Model/Table.cpp | 6 +-- sources/Application/Model/Table.h | 2 +- .../Persistency/PersistencyService.cpp | 2 +- .../Persistency/PersistencyService.h | 2 +- sources/Application/Player/Player.cpp | 17 ++++---- sources/Application/Player/Player.h | 5 +-- sources/Application/Player/PlayerChannel.cpp | 4 +- sources/Application/Player/PlayerMixer.cpp | 20 +++++----- sources/Application/Player/PlayerMixer.h | 8 ++-- sources/Application/Player/TablePlayback.h | 4 +- sources/Application/Utils/RandomNames.h | 2 +- sources/Application/Utils/char.h | 2 +- .../Application/Views/BaseClasses/UIField.h | 2 +- .../Views/BaseClasses/UIIntField.cpp | 5 +-- .../Views/BaseClasses/UIIntVarField.cpp | 4 +- .../Views/BaseClasses/UINoteVarField.cpp | 2 +- .../Views/BaseClasses/UITempoField.cpp | 2 +- .../Application/Views/BaseClasses/View.cpp | 6 +-- sources/Application/Views/BaseClasses/View.h | 9 ++--- sources/Application/Views/ChainView.cpp | 2 +- sources/Application/Views/InstrumentView.cpp | 10 ++--- sources/Application/Views/InstrumentView.h | 2 +- sources/Application/Views/MixerView.cpp | 6 +-- .../Views/ModalDialogs/ImportSampleDialog.cpp | 2 +- .../Views/ModalDialogs/ImportSampleDialog.h | 2 +- .../ModalDialogs/SelectProjectDialog.cpp | 4 +- .../Views/ModalDialogs/SelectProjectDialog.h | 2 +- sources/Application/Views/PhraseView.cpp | 12 +++--- sources/Application/Views/PhraseView.h | 2 +- sources/Application/Views/ProjectView.cpp | 10 ++--- sources/Application/Views/SongView.cpp | 12 +++--- sources/Application/Views/TableView.cpp | 2 +- sources/Application/Views/TableView.h | 4 +- sources/Application/Views/UIController.cpp | 1 + sources/Foundation/Observable.cpp | 1 + sources/Foundation/Variables/Variable.cpp | 2 +- sources/Services/Audio/AudioDriver.cpp | 4 +- sources/Services/Audio/AudioMixer.h | 3 +- sources/Services/Audio/AudioOutDriver.cpp | 7 ++-- .../Controllers/ButtonControllerSource.cpp | 2 +- sources/Services/Controllers/Channel.cpp | 7 ++-- sources/Services/Controllers/ControlNode.cpp | 2 +- sources/Services/Controllers/ControlNode.h | 2 +- .../Controllers/ControllerService.cpp | 5 ++- .../Services/Controllers/ControllerService.h | 3 +- .../Services/Controllers/ControllerSource.cpp | 3 +- .../Services/Controllers/ControllerSource.h | 2 +- .../Controllers/HatControllerSource.cpp | 2 +- .../Controllers/KeyboardControllerSource.cpp | 5 +-- sources/Services/Midi/MidiEvent.cpp | 2 +- sources/Services/Midi/MidiInDevice.cpp | 4 +- sources/Services/Midi/MidiInMerger.h | 6 +-- sources/Services/Midi/MidiMessage.h | 4 +- sources/Services/Midi/MidiService.cpp | 5 ++- sources/System/Console/Trace.cpp | 5 ++- sources/System/Console/n_assert.cpp | 2 +- sources/System/FileSystem/FileSystem.cpp | 4 +- sources/System/FileSystem/FileSystem.h | 8 ++-- sources/System/Process/Process.cpp | 2 +- sources/System/Timer/Timer.h | 2 +- sources/System/_Midi/Midi.cpp | 2 +- sources/System/io/Status.cpp | 2 +- sources/UIFramework/BasicDatas/GUIBitmap.cpp | 2 +- sources/UIFramework/BasicDatas/GUIBitmap.h | 2 +- .../Framework/GUIParentGraphics.cpp | 2 +- .../UIFramework/Framework/GUIParentGraphics.h | 3 +- .../UIFramework/Interfaces/I_GUIGraphics.h | 2 +- .../Interfaces/I_GUIWindowFactory.h | 3 +- .../UIFramework/Interfaces/I_GUIWindowImp.h | 2 +- .../SimpleBaseClasses/EventManager.cpp | 6 +-- .../SimpleBaseClasses/GUIWindow.cpp | 4 +- 187 files changed, 582 insertions(+), 544 deletions(-) diff --git a/sources/Adapters/CAANOO/Audio/CAANOOAudioDriver.cpp b/sources/Adapters/CAANOO/Audio/CAANOOAudioDriver.cpp index 12f32c2e..c7ad1240 100644 --- a/sources/Adapters/CAANOO/Audio/CAANOOAudioDriver.cpp +++ b/sources/Adapters/CAANOO/Audio/CAANOOAudioDriver.cpp @@ -1,23 +1,25 @@ #include "CAANOOAudioDriver.h" +#include "System/System/System.h" +#include "Services/Midi/MidiService.h" +#include "Application/Model/Config.h" +#include +#include +#include #include #include -#include #include -#include #include -#include -#include #include +#include #include #include #include #include #include #include -#include "Application/Model/Config.h" -#include "Services/Midi/MidiService.h" -#include "System/System/System.h" +#include +#include static unsigned long CAANOO_dev[2] ; diff --git a/sources/Adapters/CAANOO/Audio/CAANOOAudioDriver.h b/sources/Adapters/CAANOO/Audio/CAANOOAudioDriver.h index 703e3669..5f4dacc0 100644 --- a/sources/Adapters/CAANOO/Audio/CAANOOAudioDriver.h +++ b/sources/Adapters/CAANOO/Audio/CAANOOAudioDriver.h @@ -3,6 +3,7 @@ #include "Services/Audio/AudioDriver.h" + class CAANOOAudioDriver:public AudioDriver { public: CAANOOAudioDriver(AudioSettings &settings) ; diff --git a/sources/Adapters/CAANOO/FileSystem/CAANOOFileSystem.cpp b/sources/Adapters/CAANOO/FileSystem/CAANOOFileSystem.cpp index 72fbc896..dec97f23 100644 --- a/sources/Adapters/CAANOO/FileSystem/CAANOOFileSystem.cpp +++ b/sources/Adapters/CAANOO/FileSystem/CAANOOFileSystem.cpp @@ -1,11 +1,11 @@ #include "CAANOOFileSystem.h" -#include #include #include +#include #include #include -#include +#include //#include #include "Application/Utils/wildcard.h" diff --git a/sources/Adapters/CAANOO/Main/CAANOOSDLMain.cpp b/sources/Adapters/CAANOO/Main/CAANOOSDLMain.cpp index 75c4ac0a..451b2a10 100644 --- a/sources/Adapters/CAANOO/Main/CAANOOSDLMain.cpp +++ b/sources/Adapters/CAANOO/Main/CAANOOSDLMain.cpp @@ -1,11 +1,12 @@ // VC6GUI.cpp : Defines the entry point for the application. // +#include "Application/Application.h" +#include "Adapters/CAANOO/System/CAANOOSystem.h" #include #include -#include "Adapters/CAANOO/System/CAANOOSystem.h" -#include "Application/Application.h" -#include "Application/Persistency/PersistencyService.h" +#include "Adapters/SDL/GUI/SDLGUIWindowImp.h" +#include "Application/Persistency/PersistencyService.h" #include "Adapters/SDL/GUI/SDLGUIWindowImp.h" int main(int argc,char *argv[]) diff --git a/sources/Adapters/CAANOO/Midi/CAANOOSerialMidiDevice.cpp b/sources/Adapters/CAANOO/Midi/CAANOOSerialMidiDevice.cpp index 1ac22b32..a1f75f24 100644 --- a/sources/Adapters/CAANOO/Midi/CAANOOSerialMidiDevice.cpp +++ b/sources/Adapters/CAANOO/Midi/CAANOOSerialMidiDevice.cpp @@ -1,12 +1,12 @@ #include "CAANOOSerialMidiDevice.h" -#include -#include +#include "Application/Model/Config.h" #include +#include +#include #include #include -#include -#include "Application/Model/Config.h" +#include #define BAUDRATE B38400 diff --git a/sources/Adapters/CAANOO/Midi/CAANOOSerialMidiDevice.h b/sources/Adapters/CAANOO/Midi/CAANOOSerialMidiDevice.h index 00921fe5..c2ae864a 100644 --- a/sources/Adapters/CAANOO/Midi/CAANOOSerialMidiDevice.h +++ b/sources/Adapters/CAANOO/Midi/CAANOOSerialMidiDevice.h @@ -2,6 +2,7 @@ #define _CAANOO_SERIAL_MIDI_DEVICE_H_ #include "Services/Midi/MidiOutDevice.h" + #include class CAANOOSerialMidiDevice: public MidiOutDevice { diff --git a/sources/Adapters/CAANOO/System/CAANOOSystem.cpp b/sources/Adapters/CAANOO/System/CAANOOSystem.cpp index 73820445..e6bdc2e9 100644 --- a/sources/Adapters/CAANOO/System/CAANOOSystem.cpp +++ b/sources/Adapters/CAANOO/System/CAANOOSystem.cpp @@ -1,28 +1,27 @@ #include "CAANOOSystem.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "Externals/TinyXML/tinyxml.h" -#include "Adapters/CAANOO/Audio/CAANOOAudio.h" -#include "Adapters/CAANOO/Midi/CAANOOMidiService.h" +#include "Adapters/Unix/FileSystem/UnixFileSystem.h" #include "Adapters/SDL/GUI/GUIFactory.h" #include "Adapters/SDL/GUI/SDLGUIWindowImp.h" #include "Adapters/SDL/GUI/SDLEventManager.h" -#include "Adapters/SDL/Timer/SDLTimer.h" -#include "Adapters/Unix/FileSystem/UnixFileSystem.h" -#include "Application/Commands/NodeList.h" -#include "Application/Controllers/ControlRoom.h" +#include "Adapters/CAANOO/Audio/CAANOOAudio.h" +#include "Adapters/CAANOO/Midi/CAANOOMidiService.h" +#include "Externals/TinyXML/tinyxml.h" #include "Application/Model/Config.h" +#include "Application/Controllers/ControlRoom.h" #include "Application/Player/SyncMaster.h" +#include "Application/Commands/NodeList.h" +#include "Adapters/SDL/Timer/SDLTimer.h" #include "System/Console/Logger.h" - +#include +#include +#include +#include +#include +#include +#include +#include +#include #ifdef fopen #undef fopen diff --git a/sources/Adapters/CAANOO/System/CAANOOSystem.h b/sources/Adapters/CAANOO/System/CAANOOSystem.h index 4c1598b9..4ec5327c 100644 --- a/sources/Adapters/CAANOO/System/CAANOOSystem.h +++ b/sources/Adapters/CAANOO/System/CAANOOSystem.h @@ -2,8 +2,8 @@ #define _GPSDL_SYSTEM_H_ #include "System/System/System.h" -#include #include "UIFramework/SimpleBaseClasses/EventManager.h" +#include #define USEREVENT_TIMER 0 #define USEREVENT_EXPOSE 1 diff --git a/sources/Adapters/CAANOO/UI/CAANOOGUIWindowImp.cpp b/sources/Adapters/CAANOO/UI/CAANOOGUIWindowImp.cpp index bd6250c0..562d4f40 100644 --- a/sources/Adapters/CAANOO/UI/CAANOOGUIWindowImp.cpp +++ b/sources/Adapters/CAANOO/UI/CAANOOGUIWindowImp.cpp @@ -1,13 +1,13 @@ #include "CAANOOGUIWindowImp.h" -#include -#include "Adapters/CAANOOSystem/CAANOOEventQueue.h" #include "Adapters/CAANOOSystem/CAANOOSystem.h" +#include "Adapters/CAANOOSystem/CAANOOEventQueue.h" +#include "UIFramework/SimpleBaseClasses/GUIWindow.h" +#include "System/io/Trace.h" +#include #define NYI(s) n_assert("NYI: ##s##") #include "Application/Model/Config.h" #include "Application/Utils/char.h" -#include "System/io/Trace.h" -#include "UIFramework/SimpleBaseClasses/GUIWindow.h" CAANOOGUIWindowImp *instance_ ; diff --git a/sources/Adapters/DEB/Main/DEBmain.cpp b/sources/Adapters/DEB/Main/DEBmain.cpp index 86a1c8b7..85e81af3 100644 --- a/sources/Adapters/DEB/Main/DEBmain.cpp +++ b/sources/Adapters/DEB/Main/DEBmain.cpp @@ -1,7 +1,7 @@ -#include +#include "Application/Application.h" #include "Adapters/DEB/System/DEBSystem.h" +#include #include "Adapters/SDL/GUI/SDLGUIWindowImp.h" -#include "Application/Application.h" int main(int argc,char *argv[]) { diff --git a/sources/Adapters/DEB/System/DEBSystem.cpp b/sources/Adapters/DEB/System/DEBSystem.cpp index 4c4dde20..65d2cdde 100644 --- a/sources/Adapters/DEB/System/DEBSystem.cpp +++ b/sources/Adapters/DEB/System/DEBSystem.cpp @@ -1,26 +1,27 @@ #include "DEBSystem.h" -#include -#include -#include -#include +#include "Adapters/RTMidi/RTMidiService.h" #ifndef _NO_JACK_ #include "Adapters/Jack/Audio/JackAudio.h" #include "Adapters/Jack/Midi/JackMidiService.h" #include "Adapters/Jack/Client/JackClient.h" #endif #include "Adapters/RTAudio/RTAudioStub.h" -#include "Adapters/RTMidi/RTMidiService.h" #include "Adapters/SDL/GUI/GUIFactory.h" -#include "Adapters/SDL/GUI/SDLEventManager.h" #include "Adapters/SDL/GUI/SDLGUIWindowImp.h" -#include "Adapters/SDL/Timer/SDLTimer.h" +#include "Adapters/SDL/GUI/SDLEventManager.h" #include "Adapters/Unix/FileSystem/UnixFileSystem.h" #include "Adapters/Unix/Process/UnixProcess.h" -#include "Application/Commands/NodeList.h" -#include "Application/Controllers/ControlRoom.h" #include "Application/Model/Config.h" #include "System/Console/Logger.h" +#include +#include +#include +#include +#include "Application/Model/Config.h" +#include "Application/Controllers/ControlRoom.h" +#include "Application/Commands/NodeList.h" +#include "Adapters/SDL/Timer/SDLTimer.h" EventManager *DEBSystem::eventManager_ = NULL ; diff --git a/sources/Adapters/DEB/System/DEBSystem.h b/sources/Adapters/DEB/System/DEBSystem.h index fac6c8e6..228d6bad 100644 --- a/sources/Adapters/DEB/System/DEBSystem.h +++ b/sources/Adapters/DEB/System/DEBSystem.h @@ -2,8 +2,8 @@ #define _DEB_SYSTEM_H_ #include "System/System/System.h" -#include #include "UIFramework/SimpleBaseClasses/EventManager.h" +#include class DEBSystem: public System { public: diff --git a/sources/Adapters/DEB/UI/DEBGUIWindowImp.cpp b/sources/Adapters/DEB/UI/DEBGUIWindowImp.cpp index 8daca116..34551500 100644 --- a/sources/Adapters/DEB/UI/DEBGUIWindowImp.cpp +++ b/sources/Adapters/DEB/UI/DEBGUIWindowImp.cpp @@ -1,8 +1,8 @@ #include "DEBGUIWindowImp.h" -#include -#include "System/io/Trace.h" -#include "System/System/System.h" #include "UIFramework/SimpleBaseClasses/GUIWindow.h" +#include "System/System/System.h" +#include "System/io/Trace.h" +#include #define NYI(s) n_assert("NYI: ##s##") diff --git a/sources/Adapters/DINGOO/Audio/DINGOOAudioDriver.cpp b/sources/Adapters/DINGOO/Audio/DINGOOAudioDriver.cpp index d9ae7f40..9b303c90 100644 --- a/sources/Adapters/DINGOO/Audio/DINGOOAudioDriver.cpp +++ b/sources/Adapters/DINGOO/Audio/DINGOOAudioDriver.cpp @@ -1,21 +1,22 @@ #include "DINGOOAudioDriver.h" +#include "System/Console/Trace.h" +#include "Application/Model/Config.h" + +#include #include #include -#include #include -#include #include -#include -#include #include +#include #include -#include #include +#include #include #include #include -#include "System/Console/Trace.h" -#include "Application/Model/Config.h" +#include +#include DINGOOAudioDriver::DINGOOAudioDriver(AudioSettings &settings):SDLAudioDriver(settings) diff --git a/sources/Adapters/DINGOO/FileSystem/DINGOOFileSystem.cpp b/sources/Adapters/DINGOO/FileSystem/DINGOOFileSystem.cpp index 692e59d8..e0d002e9 100644 --- a/sources/Adapters/DINGOO/FileSystem/DINGOOFileSystem.cpp +++ b/sources/Adapters/DINGOO/FileSystem/DINGOOFileSystem.cpp @@ -1,12 +1,12 @@ #include "DINGOOFileSystem.h" -#include -#include #include +#include +#include #include #include +#include //#include -#include #include "Application/Utils/wildcard.h" DINGOODir::DINGOODir(const char *path):I_Dir(path) { diff --git a/sources/Adapters/DINGOO/Main/GPSDLMain.cpp b/sources/Adapters/DINGOO/Main/GPSDLMain.cpp index 05e4588a..e05e6e1b 100644 --- a/sources/Adapters/DINGOO/Main/GPSDLMain.cpp +++ b/sources/Adapters/DINGOO/Main/GPSDLMain.cpp @@ -1,11 +1,11 @@ +#include "Application/Application.h" +#include "Adapters/DINGOO/System/DINGOOSystem.h" +#include "Foundation/T_Singleton.h" #include #include -#include "Adapters/DINGOO/System/DINGOOSystem.h" #include "Adapters/SDL/GUI/SDLGUIWindowImp.h" -#include "Application/Application.h" #include "Application/Persistency/PersistencyService.h" -#include "Foundation/T_Singleton.h" - +#include "Adapters/SDL/GUI/SDLGUIWindowImp.h" int main(int argc,char *argv[]) { diff --git a/sources/Adapters/DINGOO/Midi/BITTBOYSerialMidiDevice.cpp b/sources/Adapters/DINGOO/Midi/BITTBOYSerialMidiDevice.cpp index a0307585..dbeef9fa 100644 --- a/sources/Adapters/DINGOO/Midi/BITTBOYSerialMidiDevice.cpp +++ b/sources/Adapters/DINGOO/Midi/BITTBOYSerialMidiDevice.cpp @@ -1,11 +1,11 @@ #include "DINGOOSerialMidiDevice.h" +#include +#include #include -#include #include -#include #include -#include +#include #ifdef USB_TTY const char *port="/dev/usb/tts/0" ; diff --git a/sources/Adapters/DINGOO/Midi/DINGOOSerialMidiDevice.cpp b/sources/Adapters/DINGOO/Midi/DINGOOSerialMidiDevice.cpp index 734696b3..a9a03b2b 100644 --- a/sources/Adapters/DINGOO/Midi/DINGOOSerialMidiDevice.cpp +++ b/sources/Adapters/DINGOO/Midi/DINGOOSerialMidiDevice.cpp @@ -1,12 +1,12 @@ #include "DINGOOSerialMidiDevice.h" -#include -#include +#include "System/io/Trace.h" #include +#include +#include #include #include -#include -#include "System/io/Trace.h" +#include const char *port="/dev/ttyS0" ; //const char *port="/dev/usb/tts/0" ; diff --git a/sources/Adapters/DINGOO/Midi/DINGOOSerialMidiDevice.h b/sources/Adapters/DINGOO/Midi/DINGOOSerialMidiDevice.h index 70236e2b..198face4 100644 --- a/sources/Adapters/DINGOO/Midi/DINGOOSerialMidiDevice.h +++ b/sources/Adapters/DINGOO/Midi/DINGOOSerialMidiDevice.h @@ -2,6 +2,7 @@ #define _DINGOO_SERIAL_MIDI_DEVICE_H_ #include "Services/Midi/MidiOutDevice.h" + #include class DINGOOSerialMidiDevice: public MidiOutDevice { diff --git a/sources/Adapters/DINGOO/System/BITTBOYSystem.cpp b/sources/Adapters/DINGOO/System/BITTBOYSystem.cpp index 8d4242e3..d29ba099 100644 --- a/sources/Adapters/DINGOO/System/BITTBOYSystem.cpp +++ b/sources/Adapters/DINGOO/System/BITTBOYSystem.cpp @@ -1,28 +1,30 @@ #include "DINGOOSystem.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "Externals/TinyXML/tinyxml.h" -#include "Adapters/DINGOO/Audio/DINGOOAudio.h" -#include "Adapters/DINGOO/Midi/DINGOOMidiService.h" +#include "Adapters/Unix/FileSystem/UnixFileSystem.h" #include "Adapters/SDL/GUI/GUIFactory.h" -#include "Adapters/SDL/GUI/SDLEventManager.h" #include "Adapters/SDL/GUI/SDLGUIWindowImp.h" +#include "Adapters/SDL/GUI/SDLEventManager.h" #include "Adapters/SDL/Process/SDLProcess.h" -#include "Adapters/SDL/Timer/SDLTimer.h" -#include "Adapters/Unix/FileSystem/UnixFileSystem.h" -#include "Application/Commands/NodeList.h" -#include "Application/Controllers/ControlRoom.h" +#include "Adapters/DINGOO/Audio/DINGOOAudio.h" +#include "Adapters/DINGOO/Midi/DINGOOMidiService.h" +#include "Externals/TinyXML/tinyxml.h" #include "Application/Model/Config.h" +#include "Application/Controllers/ControlRoom.h" #include "Application/Player/SyncMaster.h" +#include "Application/Commands/NodeList.h" +#include "Adapters/SDL/Timer/SDLTimer.h" #include "System/Console/Logger.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include EventManager *GPSDLSystem::eventManager_ = NULL ; bool GPSDLSystem::invert_=false ; diff --git a/sources/Adapters/DINGOO/System/DINGOOSystem.cpp b/sources/Adapters/DINGOO/System/DINGOOSystem.cpp index fb1f9f30..45b83dca 100644 --- a/sources/Adapters/DINGOO/System/DINGOOSystem.cpp +++ b/sources/Adapters/DINGOO/System/DINGOOSystem.cpp @@ -1,27 +1,27 @@ #include "DINGOOSystem.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "Externals/TinyXML/tinyxml.h" -#include "Adapters/DINGOO/Audio/DINGOOAudio.h" -#include "Adapters/Dummy/Midi/DummyMidi.h" +#include "Adapters/Unix/FileSystem/UnixFileSystem.h" #include "Adapters/SDL/GUI/GUIFactory.h" #include "Adapters/SDL/GUI/SDLGUIWindowImp.h" #include "Adapters/SDL/GUI/SDLEventManager.h" #include "Adapters/SDL/Process/SDLProcess.h" -#include "Adapters/SDL/Timer/SDLTimer.h" -#include "Adapters/Unix/FileSystem/UnixFileSystem.h" -#include "Application/Commands/NodeList.h" -#include "Application/Controllers/ControlRoom.h" +#include "Adapters/DINGOO/Audio/DINGOOAudio.h" +#include "Adapters/Dummy/Midi/DummyMidi.h" +#include "Externals/TinyXML/tinyxml.h" #include "Application/Model/Config.h" +#include "Application/Controllers/ControlRoom.h" #include "Application/Player/SyncMaster.h" +#include "Application/Commands/NodeList.h" +#include "Adapters/SDL/Timer/SDLTimer.h" #include "System/Console/Logger.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include EventManager *GPSDLSystem::eventManager_ = NULL ; bool GPSDLSystem::invert_=false ; diff --git a/sources/Adapters/DINGOO/System/DINGOOSystem.h b/sources/Adapters/DINGOO/System/DINGOOSystem.h index c61e2cf8..8269c840 100644 --- a/sources/Adapters/DINGOO/System/DINGOOSystem.h +++ b/sources/Adapters/DINGOO/System/DINGOOSystem.h @@ -2,8 +2,8 @@ #define _GPSDL_SYSTEM_H_ #include "System/System/System.h" -#include #include "UIFramework/SimpleBaseClasses/EventManager.h" +#include #define USEREVENT_TIMER 0 #define USEREVENT_EXPOSE 1 diff --git a/sources/Adapters/DINGOO/System/MIYOOSystem.cpp b/sources/Adapters/DINGOO/System/MIYOOSystem.cpp index 99020c1e..8df92763 100644 --- a/sources/Adapters/DINGOO/System/MIYOOSystem.cpp +++ b/sources/Adapters/DINGOO/System/MIYOOSystem.cpp @@ -1,32 +1,32 @@ #include "DINGOOSystem.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "Externals/TinyXML/tinyxml.h" +#include "Adapters/Unix/FileSystem/UnixFileSystem.h" +#include "Adapters/SDL/GUI/GUIFactory.h" +#include "Adapters/SDL/GUI/SDLGUIWindowImp.h" +#include "Adapters/SDL/GUI/SDLEventManager.h" +#include "Adapters/SDL/Process/SDLProcess.h" +#include "Adapters/SDL/Audio/SDLAudio.h" #ifdef PLATFORM_MIYOO #include "Adapters/Dummy/Midi/DummyMidi.h" #elif defined(PLATFORM_RG35XX) #include "Adapters/Dummy/Midi/DummyMidi.h" // Re-enable at some point RTMidi/RTMidiService.h" #endif -#include "Adapters/SDL/Audio/SDLAudio.h" -#include "Adapters/SDL/GUI/SDLEventManager.h" -#include "Adapters/SDL/GUI/GUIFactory.h" -#include "Adapters/SDL/GUI/SDLGUIWindowImp.h" -#include "Adapters/SDL/Process/SDLProcess.h" -#include "Adapters/SDL/Timer/SDLTimer.h" -#include "Adapters/Unix/FileSystem/UnixFileSystem.h" -#include "Application/Commands/NodeList.h" -#include "Application/Controllers/ControlRoom.h" +#include "Externals/TinyXML/tinyxml.h" #include "Application/Model/Config.h" +#include "Application/Controllers/ControlRoom.h" #include "Application/Player/SyncMaster.h" +#include "Application/Commands/NodeList.h" +#include "Adapters/SDL/Timer/SDLTimer.h" #include "System/Console/Logger.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include EventManager *GPSDLSystem::eventManager_ = NULL; bool GPSDLSystem::invert_ = false; diff --git a/sources/Adapters/DINGOO/UI/DINGOOGUIWindowImp.cpp b/sources/Adapters/DINGOO/UI/DINGOOGUIWindowImp.cpp index 7b1260d9..f72a268a 100644 --- a/sources/Adapters/DINGOO/UI/DINGOOGUIWindowImp.cpp +++ b/sources/Adapters/DINGOO/UI/DINGOOGUIWindowImp.cpp @@ -1,14 +1,13 @@ #include "DINGOOGUIWindowImp.h" -#include #include "Adapters/DINGOOSystem/DINGOOSystem.h" #include "Adapters/DINGOOSystem/DINGOOEventQueue.h" +#include "UIFramework/SimpleBaseClasses/GUIWindow.h" +#include "System/io/Trace.h" +#include #define NYI(s) n_assert("NYI: ##s##") #include "Application/Model/Config.h" #include "Application/Utils/char.h" -#include "System/io/Trace.h" -#include "UIFramework/SimpleBaseClasses/GUIWindow.h" - DINGOOGUIWindowImp *instance_ ; diff --git a/sources/Adapters/Dummy/FileSystem/DummyFileSystem.cpp b/sources/Adapters/Dummy/FileSystem/DummyFileSystem.cpp index 7c5b58c4..6a15f4fe 100644 --- a/sources/Adapters/Dummy/FileSystem/DummyFileSystem.cpp +++ b/sources/Adapters/Dummy/FileSystem/DummyFileSystem.cpp @@ -1,8 +1,8 @@ #include "DummyFileSystem.h" -#include #include "system/io/Trace.h" #include "Application/Utils/wildcard.h" +#include diff --git a/sources/Adapters/Dummy/Sound/DummySound.h b/sources/Adapters/Dummy/Sound/DummySound.h index 65b6f721..b1159ebc 100644 --- a/sources/Adapters/Dummy/Sound/DummySound.h +++ b/sources/Adapters/Dummy/Sound/DummySound.h @@ -2,7 +2,6 @@ #define _DUMMY_SOUND_H_ #include "System/Sound/Sound.h" - class DummySound: public Sound { public: // Sound implementation diff --git a/sources/Adapters/GP2X/Audio/GP2XAudioDriver.cpp b/sources/Adapters/GP2X/Audio/GP2XAudioDriver.cpp index 519fa110..3d203d8f 100644 --- a/sources/Adapters/GP2X/Audio/GP2XAudioDriver.cpp +++ b/sources/Adapters/GP2X/Audio/GP2XAudioDriver.cpp @@ -1,23 +1,27 @@ #include "GP2XAudioDriver.h" +#include "System/System/System.h" +#include "Services/Midi/MidiService.h" +#include "Application/Model/Config.h" +#include +#include + +#include #include #include -#include #include -#include #include -#include #include #include #include -#include #include +#include #include #include #include -#include "Application/Model/Config.h" -#include "Services/Midi/MidiService.h" -#include "System/System/System.h" +#include +#include + static unsigned long gp2x_dev[2] ; static pthread_t gp2x_sound_thread,gp2x_engine_thread; @@ -262,4 +266,4 @@ void GP2XAudioDriver::NewBuffer() { double GP2XAudioDriver::GetStreamTime() { return (streamSampleTime_)/44100.0f ; -} +} \ No newline at end of file diff --git a/sources/Adapters/GP2X/Audio/GP2XAudioDriver.h b/sources/Adapters/GP2X/Audio/GP2XAudioDriver.h index b09bbfa7..65465dcf 100644 --- a/sources/Adapters/GP2X/Audio/GP2XAudioDriver.h +++ b/sources/Adapters/GP2X/Audio/GP2XAudioDriver.h @@ -3,6 +3,7 @@ #include "Services/Audio/AudioDriver.h" + class GP2XAudioDriver:public AudioDriver { public: GP2XAudioDriver(AudioSettings &settings) ; diff --git a/sources/Adapters/GP2X/FileSystem/GP2XFileSystem.cpp b/sources/Adapters/GP2X/FileSystem/GP2XFileSystem.cpp index 69933229..a94b5fc1 100644 --- a/sources/Adapters/GP2X/FileSystem/GP2XFileSystem.cpp +++ b/sources/Adapters/GP2X/FileSystem/GP2XFileSystem.cpp @@ -1,15 +1,15 @@ #include "GP2XFileSystem.h" -#include -#include -#include +#include "System/Console/Trace.h" #include +#include +#include #include -//#include #include -#include -#include "Application/Utils/wildcard.h" -#include "System/Console/Trace.h" +#include +#include +//#include +#include "Application/Utils/wildcard.h" GP2XDir::GP2XDir(const char *path):I_Dir(path) { } ; @@ -137,4 +137,4 @@ Result GP2XFileSystem::MakeDir(const char *path) { return Result(oss.str()); } return Result::NoError; -} +} \ No newline at end of file diff --git a/sources/Adapters/GP2X/Main/GPSDLMain.cpp b/sources/Adapters/GP2X/Main/GPSDLMain.cpp index 42916546..d73ecfd3 100644 --- a/sources/Adapters/GP2X/Main/GPSDLMain.cpp +++ b/sources/Adapters/GP2X/Main/GPSDLMain.cpp @@ -1,12 +1,14 @@ // VC6GUI.cpp : Defines the entry point for the application. // + +#include "Application/Application.h" +#include "Adapters/GP2X/System/GP2XSystem.h" +#include "Foundation/T_Singleton.h" #include #include -#include "Adapters/GP2X/System/GP2XSystem.h" #include "Adapters/SDL/GUI/SDLGUIWindowImp.h" -#include "Application/Application.h" -#include "Application/Persistency/PersistencyService.h" -#include "Foundation/T_Singleton.h" +#include "Application/Persistency/PersistencyService.h" +#include "Adapters/SDL/GUI/SDLGUIWindowImp.h" int main(int argc,char *argv[]) { diff --git a/sources/Adapters/GP2X/Midi/GP2XSerialMidiDevice.cpp b/sources/Adapters/GP2X/Midi/GP2XSerialMidiDevice.cpp index f8425488..fa1660ee 100644 --- a/sources/Adapters/GP2X/Midi/GP2XSerialMidiDevice.cpp +++ b/sources/Adapters/GP2X/Midi/GP2XSerialMidiDevice.cpp @@ -1,12 +1,12 @@ #include "GP2XSerialMidiDevice.h" -#include -#include +#include "System/Console/Trace.h" #include +#include +#include #include #include -#include -#include "System/Console/Trace.h" +#include const char *port="/dev/ttyS0" ; //const char *port="/dev/usb/tts/0" ; diff --git a/sources/Adapters/GP2X/Midi/GP2XSerialMidiDevice.h b/sources/Adapters/GP2X/Midi/GP2XSerialMidiDevice.h index 829d12d4..3a49fabe 100644 --- a/sources/Adapters/GP2X/Midi/GP2XSerialMidiDevice.h +++ b/sources/Adapters/GP2X/Midi/GP2XSerialMidiDevice.h @@ -2,6 +2,7 @@ #define _GP2X_SERIAL_MIDI_DEVICE_H_ #include "Services/Midi/MidiOutDevice.h" + #include class GP2XSerialMidiDevice: public MidiOutDevice { diff --git a/sources/Adapters/GP2X/System/GP2XSystem.cpp b/sources/Adapters/GP2X/System/GP2XSystem.cpp index cc3ef01e..8a8e3ca3 100644 --- a/sources/Adapters/GP2X/System/GP2XSystem.cpp +++ b/sources/Adapters/GP2X/System/GP2XSystem.cpp @@ -1,26 +1,26 @@ #include "GP2XSystem.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "Externals/TinyXML/tinyxml.h" -#include "Adapters/GP2X/Audio/GP2XAudio.h" #include "Adapters/GP2X/FileSystem/GP2XFileSystem.h" -#include "Adapters/GP2X/Midi/GP2XMidiService.h" #include "Adapters/SDL/GUI/GUIFactory.h" #include "Adapters/SDL/GUI/SDLGUIWindowImp.h" -#include "Adapters/SDL/Timer/SDLTimer.h" -#include "Application/Commands/NodeList.h" -#include "Application/Controllers/ControlRoom.h" +#include "Adapters/GP2X/Audio/GP2XAudio.h" +#include "Adapters/GP2X/Midi/GP2XMidiService.h" +#include "Externals/TinyXML/tinyxml.h" #include "Application/Model/Config.h" +#include "Application/Controllers/ControlRoom.h" #include "Application/Player/SyncMaster.h" +#include "Application/Commands/NodeList.h" +#include "Adapters/SDL/Timer/SDLTimer.h" #include "System/Console/Logger.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include #ifdef fopen #undef fopen diff --git a/sources/Adapters/GP2X/System/GP2XSystem.h b/sources/Adapters/GP2X/System/GP2XSystem.h index dc444540..41688236 100644 --- a/sources/Adapters/GP2X/System/GP2XSystem.h +++ b/sources/Adapters/GP2X/System/GP2XSystem.h @@ -2,8 +2,8 @@ #define _GPSDL_SYSTEM_H_ #include "System/System/System.h" -#include #include "UIFramework/SimpleBaseClasses/EventManager.h" +#include #define USEREVENT_TIMER 0 #define USEREVENT_EXPOSE 1 diff --git a/sources/Adapters/GP2X/UI/GP2XGUIWindowImp.cpp b/sources/Adapters/GP2X/UI/GP2XGUIWindowImp.cpp index a130bd2b..997d9f75 100644 --- a/sources/Adapters/GP2X/UI/GP2XGUIWindowImp.cpp +++ b/sources/Adapters/GP2X/UI/GP2XGUIWindowImp.cpp @@ -1,13 +1,13 @@ #include "GP2XGUIWindowImp.h" -#include -#include "Adapters/GP2XSystem/GP2XEventQueue.h" #include "Adapters/GP2XSystem/GP2XSystem.h" +#include "Adapters/GP2XSystem/GP2XEventQueue.h" +#include "UIFramework/SimpleBaseClasses/GUIWindow.h" +#include "System/io/Trace.h" +#include #define NYI(s) n_assert("NYI: ##s##") #include "Application/Model/Config.h" #include "Application/Utils/char.h" -#include "System/io/Trace.h" -#include "UIFramework/SimpleBaseClasses/GUIWindow.h" GP2XGUIWindowImp *instance_ ; diff --git a/sources/Adapters/Jack/Audio/JackAudio.cpp b/sources/Adapters/Jack/Audio/JackAudio.cpp index 62a9d467..3d34d4f3 100644 --- a/sources/Adapters/Jack/Audio/JackAudio.cpp +++ b/sources/Adapters/Jack/Audio/JackAudio.cpp @@ -1,10 +1,10 @@ #ifndef _NO_JACK_ #include "JackAudio.h" #include "JackAudioDriver.h" -#include "Adapters/Jack/Client/JackClient.h" #include "Services/Audio/AudioOutDriver.h" #include "System/Console/Trace.h" #include "System/Console/n_assert.h" +#include "Adapters/Jack/Client/JackClient.h" int jack_srate (jack_nframes_t nframes, void *arg) { Trace::Debug("Jack sample rate is now %lu/sec\n", nframes); diff --git a/sources/Adapters/Jack/Audio/JackAudio.h b/sources/Adapters/Jack/Audio/JackAudio.h index cbb265ed..e30d0c24 100644 --- a/sources/Adapters/Jack/Audio/JackAudio.h +++ b/sources/Adapters/Jack/Audio/JackAudio.h @@ -2,7 +2,7 @@ #define _JACK_AUDIO_H_ #include "Services/Audio/Audio.h" -#include +#include "jack/jack.h" class JackAudio: public Audio { public: diff --git a/sources/Adapters/Jack/Audio/JackAudioDriver.h b/sources/Adapters/Jack/Audio/JackAudioDriver.h index d6a784b2..858c31b3 100644 --- a/sources/Adapters/Jack/Audio/JackAudioDriver.h +++ b/sources/Adapters/Jack/Audio/JackAudioDriver.h @@ -3,8 +3,8 @@ #include "Services/Audio/AudioDriver.h" #include -#include "Adapters/Jack/Client/JackClient.h" #include "System/Process/Process.h" +#include "Adapters/Jack/Client/JackClient.h" class JackAudioDriver ; diff --git a/sources/Adapters/Jack/Client/JackClient.h b/sources/Adapters/Jack/Client/JackClient.h index 677607b7..1f1eeb8b 100644 --- a/sources/Adapters/Jack/Client/JackClient.h +++ b/sources/Adapters/Jack/Client/JackClient.h @@ -2,7 +2,7 @@ #ifndef _JACK_CLIENT_H_ #define _JACK_CLIENT_H_ -#include +#include "jack/jack.h" #include "Foundation/T_Singleton.h" #include "Foundation/T_SimpleList.h" diff --git a/sources/Adapters/Jack/Midi/JackMidiDevice.h b/sources/Adapters/Jack/Midi/JackMidiDevice.h index ef581275..ef89272c 100644 --- a/sources/Adapters/Jack/Midi/JackMidiDevice.h +++ b/sources/Adapters/Jack/Midi/JackMidiDevice.h @@ -3,8 +3,8 @@ #include "Services/Midi/MidiDevice.h" #include -#include #include "Adapters/Jack/Client/JackClient.h" +#include class JackMidiDevice: public MidiDevice { public: diff --git a/sources/Adapters/Jack/Midi/JackMidiService.cpp b/sources/Adapters/Jack/Midi/JackMidiService.cpp index 3bc22f81..d54d2d49 100644 --- a/sources/Adapters/Jack/Midi/JackMidiService.cpp +++ b/sources/Adapters/Jack/Midi/JackMidiService.cpp @@ -1,9 +1,9 @@ #include "JackMidiService.h" -#include -#include "Adapters/Jack/Client/JackClient.h" -#include "System/io/Trace.h" #include "JackMidiDevice.h" +#include "System/io/Trace.h" +#include "Adapters/Jack/Client/JackClient.h" +#include JackMidiService::JackMidiService() { } ; @@ -33,4 +33,4 @@ void JackMidiService::OnNewFrame() { for (it->Begin();!it->IsDone();it->Next()) { JackMidiDevice ¤t=(JackMidiDevice &)it->CurrentItem() ; current.OnNewFrame() ; - }} ; + }} ; \ No newline at end of file diff --git a/sources/Adapters/LINUX/Main/LINUXMain.cpp b/sources/Adapters/LINUX/Main/LINUXMain.cpp index 0cbac5af..2891417a 100644 --- a/sources/Adapters/LINUX/Main/LINUXMain.cpp +++ b/sources/Adapters/LINUX/Main/LINUXMain.cpp @@ -1,8 +1,7 @@ #include -#include "Application/Application.h" #include "Adapters/LINUX/System/LINUXSystem.h" #include "Adapters/SDL2/GUI/SDLGUIWindowImp.h" - +#include "Application/Application.h" /* * generic entrypoint for linux based targets */ diff --git a/sources/Adapters/LINUX/System/LINUXSystem.h b/sources/Adapters/LINUX/System/LINUXSystem.h index ac9e0b77..42f86834 100644 --- a/sources/Adapters/LINUX/System/LINUXSystem.h +++ b/sources/Adapters/LINUX/System/LINUXSystem.h @@ -1,8 +1,8 @@ #ifndef _LINUX_SYSTEM_H_ #define _LINUX_SYSTEM_H_ -#include "System/System/System.h" #include +#include "System/System/System.h" #include "UIFramework/SimpleBaseClasses/EventManager.h" class LINUXSystem: public System { diff --git a/sources/Adapters/NDS/FileSystem/NDSFileSystem.cpp b/sources/Adapters/NDS/FileSystem/NDSFileSystem.cpp index 70dc45da..6630334b 100644 --- a/sources/Adapters/NDS/FileSystem/NDSFileSystem.cpp +++ b/sources/Adapters/NDS/FileSystem/NDSFileSystem.cpp @@ -1,11 +1,10 @@ #include "NDSFileSystem.h" -#include -#include -#include -#include "Application/Utils/wildcard.h" #include "System/io/Trace.h" - +#include "Application/Utils/wildcard.h" +#include +#include +#include #include NDSDir::NDSDir(const char *path):I_Dir(path) { diff --git a/sources/Adapters/NDS/Main/NDSmain.cpp b/sources/Adapters/NDS/Main/NDSmain.cpp index 844f6ccd..3464bc4e 100644 --- a/sources/Adapters/NDS/Main/NDSmain.cpp +++ b/sources/Adapters/NDS/Main/NDSmain.cpp @@ -1,8 +1,8 @@ -#include -#include -#include #include "Application/Application.h" #include "Adapters/NDS/System/NDSSystem.h" +#include +#include +#include int main(int argc,char *argv[]) { diff --git a/sources/Adapters/NDS/Sound/NDSSound.cpp b/sources/Adapters/NDS/Sound/NDSSound.cpp index becaf8b9..1c56e1cc 100644 --- a/sources/Adapters/NDS/Sound/NDSSound.cpp +++ b/sources/Adapters/NDS/Sound/NDSSound.cpp @@ -1,8 +1,8 @@ #include "NDSSound.h" #include -#include "System/io/Trace.h" #include "System/System/System.h" +#include "System/io/Trace.h" // Called when we need to fill the buffer diff --git a/sources/Adapters/NDS/System/NDSSystem.cpp b/sources/Adapters/NDS/System/NDSSystem.cpp index 48c7de3a..8e42a133 100644 --- a/sources/Adapters/NDS/System/NDSSystem.cpp +++ b/sources/Adapters/NDS/System/NDSSystem.cpp @@ -1,12 +1,13 @@ #include "NDSSystem.h" -#include -#include "Adapters/Dummy/Midi/DummyMidi.h" -#include "Adapters/NDS/FileSystem/NDSFileSystem.h" -#include "Adapters/NDS/Sound/NDSSound.h" #include "Adapters/NDS/UI/GUIFactory.h" #include "Adapters/NDS/UI/NDSGUIWindowImp.h" +#include "Adapters/NDS/Sound/NDSSound.h" +#include "Adapters/Dummy/Midi/DummyMidi.h" +#include "Adapters/NDS/FileSystem/NDSFileSystem.h" #include "System/io/Trace.h" #include "NDSEventQueue.h" +#include "Adapters/NDS/UI/NDSGUIWindowImp.h" +#include "nds.h" bool NDSSystem::finished_=false ; bool NDSSystem::redrawing_=false ; diff --git a/sources/Adapters/NDS/System/NDSSystem.h b/sources/Adapters/NDS/System/NDSSystem.h index 27183ef2..3b8363ca 100644 --- a/sources/Adapters/NDS/System/NDSSystem.h +++ b/sources/Adapters/NDS/System/NDSSystem.h @@ -1,6 +1,8 @@ #ifndef _NDS_SYSTEM_H_ #define _NDS_SYSTEM_H_ + + #include "System/System/System.h" #include "System/System/typedefs.h" diff --git a/sources/Adapters/NDS/UI/NDSGUIWindowImp.cpp b/sources/Adapters/NDS/UI/NDSGUIWindowImp.cpp index d108868c..3dff0d30 100644 --- a/sources/Adapters/NDS/UI/NDSGUIWindowImp.cpp +++ b/sources/Adapters/NDS/UI/NDSGUIWindowImp.cpp @@ -1,10 +1,10 @@ #include "NDSGUIWindowImp.h" -#include -#include +#include "UIFramework/SimpleBaseClasses/GUIWindow.h" #include "System/IO/Trace.h" #include "System/System/System.h" -#include "UIFramework/SimpleBaseClasses/GUIWindow.h" +#include +#include NDSGUIWindowImp *instance_ ; diff --git a/sources/Adapters/OSX/OSXMain/OSXmain.cpp b/sources/Adapters/OSX/OSXMain/OSXmain.cpp index 7dfd1e8b..8f3c7114 100644 --- a/sources/Adapters/OSX/OSXMain/OSXmain.cpp +++ b/sources/Adapters/OSX/OSXMain/OSXmain.cpp @@ -1,8 +1,9 @@ -#include #include "Application/Application.h" #include "Adapters/OSX/OSXSystem/OSXSystem.h" #include "Adapters/SDL/GUI/SDLGUIWindowImp.h" +#include + int main(int argc,char *argv[]) { OSXSystem::Boot(argc,argv) ; diff --git a/sources/Adapters/OSX/OSXSystem/OSXSystem.cpp b/sources/Adapters/OSX/OSXSystem/OSXSystem.cpp index 69ba6eaa..9144474b 100644 --- a/sources/Adapters/OSX/OSXSystem/OSXSystem.cpp +++ b/sources/Adapters/OSX/OSXSystem/OSXSystem.cpp @@ -1,12 +1,7 @@ #include "OSXSystem.h" -#include -#include -#include -#include #include "Adapters/RTMidi/RTMidiService.h" #include "Adapters/RTAudio/RTAudioStub.h" -#include "Adapters/SDL/Timer/SDLTimer.h" #ifndef _USE_NCURSES_ #include "Adapters/SDL/GUI/GUIFactory.h" #include "Adapters/SDL/GUI/SDLGUIWindowImp.h" @@ -16,8 +11,13 @@ #include "Adapters/Unix/FileSystem/UnixFileSystem.h" #include "Adapters/Unix/Process/UnixProcess.h" #include "Application/Model/Config.h" +#include "Adapters/SDL/Timer/SDLTimer.h" #include "System/Console/Trace.h" #include "System/Console/Logger.h" +#include +#include +#include +#include EventManager *OSXSystem::eventManager_ = NULL ; @@ -215,4 +215,4 @@ void OSXSystem::PostQuitMessage() int unsigned OSXSystem::GetMemoryUsage() { return 0 ; -} +} \ No newline at end of file diff --git a/sources/Adapters/PSP/FileSystem/PSPFileSystem.cpp b/sources/Adapters/PSP/FileSystem/PSPFileSystem.cpp index 34867220..26fb5e56 100644 --- a/sources/Adapters/PSP/FileSystem/PSPFileSystem.cpp +++ b/sources/Adapters/PSP/FileSystem/PSPFileSystem.cpp @@ -1,12 +1,13 @@ #include "PSPFileSystem.h" +#include "System/Console/Trace.h" +#include #include #include -#include +#include + #include #include -#include "Application/Utils/wildcard.h" -#include "System/Console/Trace.h" PSPFile::PSPFile(SceUID file) { file_=file ; @@ -176,4 +177,4 @@ Result PSPFileSystem::MakeDir(const char *path) { return Result(oss.str()); } return Result::NoError; -} +} \ No newline at end of file diff --git a/sources/Adapters/PSP/Main/PSPmain.cpp b/sources/Adapters/PSP/Main/PSPmain.cpp index bc5ab32d..f09c06ff 100644 --- a/sources/Adapters/PSP/Main/PSPmain.cpp +++ b/sources/Adapters/PSP/Main/PSPmain.cpp @@ -1,14 +1,17 @@ // VC6GUI.cpp : Defines the entry point for the application. // -#include -#include -#include -#include + #include "Application/Application.h" #include "Adapters/PSP/System/PSPSystem.h" -#include "Adapters/SDL/GUI/SDLGUIWindowImp.h" -#include "Application/Persistency/PersistencyService.h" #include "Foundation/T_Singleton.h" +#include +#include +#include "Adapters/SDL/GUI/SDLGUIWindowImp.h" +#include "Application/Persistency/PersistencyService.h" +#include "Adapters/SDL/GUI/SDLGUIWindowImp.h" + +#include +#include /* Define the module info section */ PSP_MODULE_INFO("AUDIOLIBDEMO", 0, 1, 1); diff --git a/sources/Adapters/PSP/System/PSPSystem.cpp b/sources/Adapters/PSP/System/PSPSystem.cpp index b9174154..2f6c9124 100644 --- a/sources/Adapters/PSP/System/PSPSystem.cpp +++ b/sources/Adapters/PSP/System/PSPSystem.cpp @@ -1,20 +1,20 @@ #include "PSPSystem.h" -#include -#include -#include -#include -#include #include "Adapters/Dummy/Midi/DummyMidi.h" -#include "Adapters/PSP/FileSystem/PSPFileSystem.h" #include "Adapters/SDL/Audio/SDLAudio.h" #include "Adapters/SDL/GUI/SDLEventManager.h" #include "Adapters/SDL/GUI/GUIFactory.h" #include "Adapters/SDL/GUI/SDLGUIWindowImp.h" #include "Adapters/SDL/Process/SDLProcess.h" +#include "Adapters/PSP/FileSystem/PSPFileSystem.h" #include "Adapters/SDL/Timer/SDLTimer.h" #include "Application/Model/Config.h" #include "System/Console/Logger.h" +#include +#include +#include +#include +#include EventManager *PSPSystem::eventManager_ = NULL ; @@ -171,4 +171,4 @@ void PSPSystem::PostQuitMessage() { unsigned int PSPSystem::GetMemoryUsage() { struct mallinfo m=mallinfo(); return m.uordblks ; -} +} \ No newline at end of file diff --git a/sources/Adapters/RTAudio/RTAudioDriver.cpp b/sources/Adapters/RTAudio/RTAudioDriver.cpp index f5ac568a..92789f9e 100644 --- a/sources/Adapters/RTAudio/RTAudioDriver.cpp +++ b/sources/Adapters/RTAudio/RTAudioDriver.cpp @@ -1,12 +1,12 @@ #include "RTAudioDriver.h" -#include -#include "Adapters/W32/Midi/W32MidiService.h" -#include "Application/Player/SyncMaster.h" -#include "Services/Audio/Audio.h" -#include "Services/Time/TimeService.h" #include "System/Console/Trace.h" #include "System/System/System.h" +#include "Services/Time/TimeService.h" +#include "Services/Audio/Audio.h" +#include "Application/Player/SyncMaster.h" +#include "Adapters/W32/Midi/W32MidiService.h" +#include int callback( void *outputBuffer, void *inputBuffer, unsigned int nBufferFrames, double streamTime, RtAudioStreamStatus status, void *userData ) diff --git a/sources/Adapters/RTAudio/RTAudioDriver.h b/sources/Adapters/RTAudio/RTAudioDriver.h index 3e3ae77d..9e8e96e5 100644 --- a/sources/Adapters/RTAudio/RTAudioDriver.h +++ b/sources/Adapters/RTAudio/RTAudioDriver.h @@ -3,10 +3,10 @@ #include "Services/Audio/AudioDriver.h" #include "Externals/RTAudio/RtAudio.h" -#include "Foundation/Observable.h" -#include "Services/Midi/MidiService.h" #include "System/Process/Process.h" +#include "Foundation/Observable.h" #include "System/Timer/Timer.h" +#include "Services/Midi/MidiService.h" class RTAudioDriver ; diff --git a/sources/Adapters/RTAudio/RTAudioStub.cpp b/sources/Adapters/RTAudio/RTAudioStub.cpp index 0984c934..83e60b55 100644 --- a/sources/Adapters/RTAudio/RTAudioStub.cpp +++ b/sources/Adapters/RTAudio/RTAudioStub.cpp @@ -1,9 +1,10 @@ #include "RTAudioStub.h" #include "RTAudioDriver.h" -#include #include "Services/Audio/AudioOutDriver.h" #include "System/Console/Trace.h" +#include + RTAudioStub::RTAudioStub(AudioSettings &h):Audio(h), sampleRate_(0) diff --git a/sources/Adapters/RTMidi/RTMidiService.cpp b/sources/Adapters/RTMidi/RTMidiService.cpp index be6ddf20..722ee591 100644 --- a/sources/Adapters/RTMidi/RTMidiService.cpp +++ b/sources/Adapters/RTMidi/RTMidiService.cpp @@ -1,8 +1,8 @@ #include "RTMidiService.h" +#include "RTMidiOutDevice.h" +#include "RTMidiInDevice.h" #include "System/Console/Trace.h" #include "Application/Model/Config.h" -#include "RTMidiInDevice.h" -#include "RTMidiOutDevice.h" //static void CALLBACK MidiFlushProc(UINT uiID, UINT uiMsg, DWORD // dwUser, DWORD dw1, DWORD dw2) { diff --git a/sources/Adapters/SDL/Audio/SDLAudioDriver.cpp b/sources/Adapters/SDL/Audio/SDLAudioDriver.cpp index 9c187742..1fb2cbc3 100644 --- a/sources/Adapters/SDL/Audio/SDLAudioDriver.cpp +++ b/sources/Adapters/SDL/Audio/SDLAudioDriver.cpp @@ -1,8 +1,8 @@ #include "SDLAudioDriver.h" -#include "Services/Midi/MidiService.h" -#include "Services/Time/TimeService.h" #include "System/Console/Trace.h" +#include "Services/Time/TimeService.h" #include "System/System/System.h" +#include "Services/Midi/MidiService.h" void sdl_callback(void *userdata, Uint8 *stream, int len) { SDLAudioDriver *sound=(SDLAudioDriver *)userdata ; diff --git a/sources/Adapters/SDL/GUI/GUIFactory.cpp b/sources/Adapters/SDL/GUI/GUIFactory.cpp index 1fb584a1..bbc9f050 100644 --- a/sources/Adapters/SDL/GUI/GUIFactory.cpp +++ b/sources/Adapters/SDL/GUI/GUIFactory.cpp @@ -1,6 +1,6 @@ #include "GUIFactory.h" -#include "SDLEventManager.h" #include "SDLGUIWindowImp.h" +#include "SDLEventManager.h" #ifndef _USE_NCURSES_ @@ -15,4 +15,4 @@ I_GUIWindowImp &GUIFactory::CreateWindowImp(GUICreateWindowParams &p) { EventManager *GUIFactory::GetEventManager() { return SDLEventManager::GetInstance() ; } -#endif +#endif \ No newline at end of file diff --git a/sources/Adapters/SDL/GUI/SDLEventManager.cpp b/sources/Adapters/SDL/GUI/SDLEventManager.cpp index 326e66b0..a598715d 100644 --- a/sources/Adapters/SDL/GUI/SDLEventManager.cpp +++ b/sources/Adapters/SDL/GUI/SDLEventManager.cpp @@ -1,11 +1,10 @@ #include "SDLEventManager.h" #include "Application/Application.h" -#include "Application/Model/Config.h" -#include "System/Console/Trace.h" #include "UIFramework/BasicDatas/GUIEvent.h" #include "SDLGUIWindowImp.h" - +#include "Application/Model/Config.h" +#include "System/Console/Trace.h" bool SDLEventManager::finished_=false ; bool SDLEventManager::dumpEvent_=false ; diff --git a/sources/Adapters/SDL/GUI/SDLEventManager.h b/sources/Adapters/SDL/GUI/SDLEventManager.h index a4a87af9..977db464 100644 --- a/sources/Adapters/SDL/GUI/SDLEventManager.h +++ b/sources/Adapters/SDL/GUI/SDLEventManager.h @@ -1,14 +1,15 @@ #ifndef _SDL_EVENT_MANAGER_ #define _SDL_EVENT_MANAGER_ -#include "UIFramework/SimpleBaseClasses/EventManager.h" -#include -#include #include "Foundation/T_Singleton.h" +#include "UIFramework/SimpleBaseClasses/EventManager.h" #include "Services/Controllers/ButtonControllerSource.h" #include "Services/Controllers/JoystickControllerSource.h" #include "Services/Controllers/HatControllerSource.h" #include "Services/Controllers/KeyboardControllerSource.h" +#include + +#include #define MAX_JOY_COUNT 4 diff --git a/sources/Adapters/SDL/GUI/SDLGUIWindowImp.cpp b/sources/Adapters/SDL/GUI/SDLGUIWindowImp.cpp index 75d3694a..8ebf3af8 100644 --- a/sources/Adapters/SDL/GUI/SDLGUIWindowImp.cpp +++ b/sources/Adapters/SDL/GUI/SDLGUIWindowImp.cpp @@ -1,13 +1,13 @@ #include "SDLGUIWindowImp.h" -#include -#include +#include "UIFramework/SimpleBaseClasses/GUIWindow.h" +#include "System/System/System.h" #include "Application/Model/Config.h" -#include "Application/Utils/char.h" -#include "System/Console/n_assert.h" #include "System/Console/Trace.h" -#include "System/System/System.h" +#include +#include "System/Console/n_assert.h" +#include "Application/Utils/char.h" +#include #include "UIFramework/BasicDatas/GUIEvent.h" -#include "UIFramework/SimpleBaseClasses/GUIWindow.h" #ifdef _SHOW_GP2X_ #include diff --git a/sources/Adapters/SDL/Timer/SDLTimer.cpp b/sources/Adapters/SDL/Timer/SDLTimer.cpp index bf3031dc..f2c1f7be 100644 --- a/sources/Adapters/SDL/Timer/SDLTimer.cpp +++ b/sources/Adapters/SDL/Timer/SDLTimer.cpp @@ -1,8 +1,8 @@ #include "SDLTimer.h" -#include "System/Console/n_assert.h" #include "System/Console/Trace.h" #include "System/System/System.h" +#include "System/Console/n_assert.h" Uint32 SDLTimerCallback(Uint32 interval, void* param) { SDLTimer *timer=(SDLTimer *)param ; diff --git a/sources/Adapters/SDL/Timer/SDLTimer.h b/sources/Adapters/SDL/Timer/SDLTimer.h index a6510554..30960db5 100644 --- a/sources/Adapters/SDL/Timer/SDLTimer.h +++ b/sources/Adapters/SDL/Timer/SDLTimer.h @@ -2,7 +2,7 @@ #define _SDL_TIMER_H_ #include "System/Timer/Timer.h" -#include +#include "SDL/SDL.h" class SDLTimer: public I_Timer { public: @@ -29,4 +29,4 @@ class SDLTimerService: public TimerService { virtual void TriggerCallback(int msec,timerCallback cb) ; }; -#endif +#endif \ No newline at end of file diff --git a/sources/Adapters/Unix/FileSystem/UnixFileSystem.cpp b/sources/Adapters/Unix/FileSystem/UnixFileSystem.cpp index 11a50d06..c4a38950 100644 --- a/sources/Adapters/Unix/FileSystem/UnixFileSystem.cpp +++ b/sources/Adapters/Unix/FileSystem/UnixFileSystem.cpp @@ -1,18 +1,19 @@ #include "UnixFileSystem.h" -#include -#include -#include +#include "System/Console/Trace.h" #include +#include +#include #ifdef _64BIT #include #else #include #endif #include -#include -#include "Application/Utils/wildcard.h" -#include "System/Console/Trace.h" +#include +#include + +#include "Application/Utils/wildcard.h" UnixDir::UnixDir(const char *path):I_Dir(path) { } ; diff --git a/sources/Adapters/Unix/Process/UnixProcess.cpp b/sources/Adapters/Unix/Process/UnixProcess.cpp index f4d4af76..9912ded5 100644 --- a/sources/Adapters/Unix/Process/UnixProcess.cpp +++ b/sources/Adapters/Unix/Process/UnixProcess.cpp @@ -1,9 +1,8 @@ #include "UnixProcess.h" -#include -#include #include "System/Console/Trace.h" - +#include +#include void *_UnixStartThread(void *p) { SysThread *play=(SysThread *)p ; diff --git a/sources/Adapters/W32/Audio/W32AudioDriver.cpp b/sources/Adapters/W32/Audio/W32AudioDriver.cpp index 126004f1..cabec42f 100644 --- a/sources/Adapters/W32/Audio/W32AudioDriver.cpp +++ b/sources/Adapters/W32/Audio/W32AudioDriver.cpp @@ -1,10 +1,10 @@ #include "W32AudioDriver.h" -#include #include -#include "Services/Midi/MidiService.h" #include "System/Console/Trace.h" #include "System/System/System.h" +#include "Services/Midi/MidiService.h" +#include void CALLBACK winmm_cback(HWAVEOUT hwo, UINT uMsg, DWORD dwInstance, DWORD dwParam1, DWORD dwParam2) { diff --git a/sources/Adapters/W32/Audio/W32AudioDriver.h b/sources/Adapters/W32/Audio/W32AudioDriver.h index b4a4552e..aec5964d 100644 --- a/sources/Adapters/W32/Audio/W32AudioDriver.h +++ b/sources/Adapters/W32/Audio/W32AudioDriver.h @@ -2,8 +2,8 @@ #define _W32_SOUND_H_ #include "Services/Audio/AudioDriver.h" -#include #include "Foundation/T_Stack.h" +#include struct W32SoundBuffer { WAVEHDR *wavHeader_ ; diff --git a/sources/Adapters/W32/Main/WSDLmain.cpp b/sources/Adapters/W32/Main/WSDLmain.cpp index 57d4bdc5..b7ecb74b 100644 --- a/sources/Adapters/W32/Main/WSDLmain.cpp +++ b/sources/Adapters/W32/Main/WSDLmain.cpp @@ -1,10 +1,11 @@ // VC6GUI.cpp : Defines the entry point for the application. // -#include + +#include "Application/Application.h" +#include "Adapters/WSDLSystem/WSDLSystem.h" #include "Externals/SDL/SDL.h" #include "Adapters/SDL/GUI/SDLGUIWindowImp.h" -#include "Adapters/WSDLSystem/WSDLSystem.h" -#include "Application/Application.h" +#include int main(int argc,char *argv[]) { diff --git a/sources/Adapters/W32/Timer/W32Timer.cpp b/sources/Adapters/W32/Timer/W32Timer.cpp index ea97dd94..7428ac18 100644 --- a/sources/Adapters/W32/Timer/W32Timer.cpp +++ b/sources/Adapters/W32/Timer/W32Timer.cpp @@ -1,8 +1,8 @@ #include "W32Timer.h" -#include #include "System/Console/Trace.h" #include "System/System/System.h" +#include static void CALLBACK TimerProc(UINT uiID, UINT uiMsg, DWORD dwUser, DWORD dw1, DWORD dw2) { @@ -77,4 +77,4 @@ I_Timer *W32TimerService::CreateTimer() { void W32TimerService::TriggerCallback(int msec,timerCallback cb) { timeSetEvent(msec, 0, &TimerCallbackProc, (DWORD)cb,TIME_ONESHOT) ; -} ; +} ; \ No newline at end of file diff --git a/sources/Adapters/W32FileSystem/W32FileSystem.cpp b/sources/Adapters/W32FileSystem/W32FileSystem.cpp index 6947b611..0e1075a6 100644 --- a/sources/Adapters/W32FileSystem/W32FileSystem.cpp +++ b/sources/Adapters/W32FileSystem/W32FileSystem.cpp @@ -1,10 +1,10 @@ #include "W32FileSystem.h" -#include -#include -#include #include "Adapters/WSDLSystem/WSDLSystem.h" #include "System/Console/Trace.h" +#include +#include +#include W32File::W32File(FILE *file) { file_=file ; @@ -113,4 +113,4 @@ Result W32FileSystem::MakeDir(const char *path) { return Result(error); } return Result::NoError; -} +} \ No newline at end of file diff --git a/sources/Adapters/WSDLSystem/WSDLSystem.cpp b/sources/Adapters/WSDLSystem/WSDLSystem.cpp index d2fc70f1..5d217dda 100644 --- a/sources/Adapters/WSDLSystem/WSDLSystem.cpp +++ b/sources/Adapters/WSDLSystem/WSDLSystem.cpp @@ -1,21 +1,22 @@ #include "WSDLSystem.h" -#include -#include -#include -#include #include "Adapters/RTAudio/RTAudioStub.h" -#include "Adapters/RTMidi/RTMidiService.h" #include "Adapters/SDL/GUI/SDLEventManager.h" #include "Adapters/SDL/GUI/GUIFactory.h" #include "Adapters/SDL/GUI/SDLGUIWindowImp.h" +#include "Adapters/RTAudio/RTAudioStub.h" +#include "Adapters/RTMidi/RTMidiService.h" +#include "Adapters/W32/Midi/W32MidiService.h" #include "Adapters/W32/Audio/W32Audio.h" #include "Adapters/W32FileSystem/W32FileSystem.h" -#include "Adapters/W32/Midi/W32MidiService.h" #include "Adapters/W32/Process/W32Process.h" #include "Adapters/W32/Timer/W32Timer.h" #include "Application/Model/Config.h" #include "System/Console/Logger.h" +#include +#include +#include +#include EventManager *WSDLSystem::eventManager_ = NULL ; @@ -211,4 +212,4 @@ std::string WSDLSystem::SGetLastErrorString() LocalFree(lpMsgBuf); return error; -} +} \ No newline at end of file diff --git a/sources/Adapters/WSDLSystem/WSDLSystem.h b/sources/Adapters/WSDLSystem/WSDLSystem.h index 5486cb21..170772f8 100644 --- a/sources/Adapters/WSDLSystem/WSDLSystem.h +++ b/sources/Adapters/WSDLSystem/WSDLSystem.h @@ -2,8 +2,8 @@ #define _WSDL_SYSTEM_H_ #include "System/System/System.h" -#include #include "Externals/SDL/SDL.h" +#include #include "UIFramework/SimpleBaseClasses/EventManager.h" class WSDLSystem: public System { diff --git a/sources/Adapters/WSDLUI/WSDLGUIWindowImp.cpp b/sources/Adapters/WSDLUI/WSDLGUIWindowImp.cpp index e037b3dc..23c2e9d2 100644 --- a/sources/Adapters/WSDLUI/WSDLGUIWindowImp.cpp +++ b/sources/Adapters/WSDLUI/WSDLGUIWindowImp.cpp @@ -1,10 +1,10 @@ #include "WSDLGUIWindowImp.h" -#include -#include #include "Adapters/WSDLSystem/WSDLSystem.h" -#include "System/IO/Trace.h" #include "UIFramework/SimpleBaseClasses/GUIWindow.h" +#include "System/IO/Trace.h" +#include +#include #define NYI(s) n_assert("NYI: ##s##") diff --git a/sources/Application/AppWindow.cpp b/sources/Application/AppWindow.cpp index 040968b2..7df772a0 100644 --- a/sources/Application/AppWindow.cpp +++ b/sources/Application/AppWindow.cpp @@ -1,20 +1,20 @@ #include "AppWindow.h" -#include -#include "Application/Commands/EventDispatcher.h" -#include "Application/Commands/ApplicationCommandDispatcher.h" +#include "UIFramework/Interfaces/I_GUIWindowFactory.h" +#include "System/Console/Trace.h" +#include "Player/Player.h" +#include "Foundation/Variables/WatchedVariable.h" +#include "Views/UIController.h" +#include "Application/Persistency/PersistencyService.h" #include "Application/Instruments/SamplePool.h" -#include "Application/Mixer/MixerService.h" -#include "Application/Persistency/PersistencyService.h" #include "Application/Player/TablePlayback.h" -#include "Application/Utils/char.h" +#include "Services/Midi/MidiService.h" #include "Application/Views/ModalDialogs/MessageBox.h" +#include "Application/Commands/EventDispatcher.h" +#include "Application/Commands/ApplicationCommandDispatcher.h" #include "Application/Views/ModalDialogs/SelectProjectDialog.h" -#include "Foundation/Variables/WatchedVariable.h" -#include "Player/Player.h" -#include "Services/Midi/MidiService.h" -#include "System/Console/Trace.h" -#include "UIFramework/Interfaces/I_GUIWindowFactory.h" -#include "Views/UIController.h" +#include "Application/Utils/char.h" +#include "Application/Mixer/MixerService.h" +#include AppWindow *instance=0 ; diff --git a/sources/Application/AppWindow.h b/sources/Application/AppWindow.h index 08daebab..a60a1097 100644 --- a/sources/Application/AppWindow.h +++ b/sources/Application/AppWindow.h @@ -4,16 +4,16 @@ #include "UIFramework/SimpleBaseClasses/GUIWindow.h" #include "Foundation/Observable.h" +#include "Application/Views/SongView.h" #include "Application/Views/ChainView.h" -#include "Application/Views/ConsoleView.h" -#include "Application/Views/GrooveView.h" -#include "Application/Views/InstrumentView.h" -#include "Application/Views/MixerView.h" -#include "Application/Views/NullView.h" #include "Application/Views/PhraseView.h" +#include "Application/Views/ConsoleView.h" #include "Application/Views/ProjectView.h" -#include "Application/Views/SongView.h" +#include "Application/Views/InstrumentView.h" #include "Application/Views/TableView.h" +#include "Application/Views/NullView.h" +#include "Application/Views/MixerView.h" +#include "Application/Views/GrooveView.h" #include "Application/Views/ViewData.h" #include "System/io/Status.h" #include "System/Process/SysMutex.h" diff --git a/sources/Application/Application.cpp b/sources/Application/Application.cpp index ddb8f8aa..9f132a15 100644 --- a/sources/Application/Application.cpp +++ b/sources/Application/Application.cpp @@ -1,12 +1,12 @@ #include "Application/Application.h" -#include "Application/AppWindow.h" +#include "Application/AppWindow.h" +#include "UIFramework/Interfaces/I_GUIWindowFactory.h" +#include "Application/Persistency/PersistencyService.h" +#include "Services/Audio/Audio.h" #include "Application/Commands/CommandDispatcher.h" #include "Application/Controllers/ControlRoom.h" #include "Application/Model/Config.h" -#include "Application/Persistency/PersistencyService.h" -#include "Services/Audio/Audio.h" #include "Services/Midi/MidiService.h" -#include "UIFramework/Interfaces/I_GUIWindowFactory.h" #include diff --git a/sources/Application/Application.h b/sources/Application/Application.h index cf20078b..89391ef2 100644 --- a/sources/Application/Application.h +++ b/sources/Application/Application.h @@ -1,8 +1,8 @@ #ifndef _APPLICATION_H_ #define _APPLICATION_H_ -#include "Foundation/T_Singleton.h" #include "UIFramework/SimpleBaseClasses/GUIWindow.h" +#include "Foundation/T_Singleton.h" class Application:public T_Singleton { diff --git a/sources/Application/Audio/AudioFileStreamer.cpp b/sources/Application/Audio/AudioFileStreamer.cpp index 89535d77..18996de6 100644 --- a/sources/Application/Audio/AudioFileStreamer.cpp +++ b/sources/Application/Audio/AudioFileStreamer.cpp @@ -1,7 +1,7 @@ #include "AudioFileStreamer.h" -#include "Application/Model/Config.h" #include "Application/Utils/fixed.h" #include "System/Console/Trace.h" +#include "Application/Model/Config.h" AudioFileStreamer::AudioFileStreamer() { wav_=0 ; diff --git a/sources/Application/Audio/AudioFileStreamer.h b/sources/Application/Audio/AudioFileStreamer.h index 4cb3282e..827503f9 100644 --- a/sources/Application/Audio/AudioFileStreamer.h +++ b/sources/Application/Audio/AudioFileStreamer.h @@ -2,8 +2,8 @@ #define _AUDIO_FILE_STREAMER_H_ #include "Services/Audio/AudioModule.h" -#include "Application/Instruments/WavFile.h" #include "System/FileSystem/FileSystem.h" +#include "Application/Instruments/WavFile.h" enum AudioFileStreamerMode { AFSM_STOPPED, diff --git a/sources/Application/Audio/DummyAudioOut.cpp b/sources/Application/Audio/DummyAudioOut.cpp index 86703ced..5df429c9 100644 --- a/sources/Application/Audio/DummyAudioOut.cpp +++ b/sources/Application/Audio/DummyAudioOut.cpp @@ -1,7 +1,7 @@ #include "DummyAudioOut.h" #include "Application/Player/SyncMaster.h" // Should be installable -#include "Services/Audio/AudioDriver.h" #include "Services/Time/TimeService.h" +#include "Services/Audio/AudioDriver.h" static bool threadon=false ; diff --git a/sources/Application/Commands/ApplicationCommandDispatcher.h b/sources/Application/Commands/ApplicationCommandDispatcher.h index cd0803e3..e0c67456 100644 --- a/sources/Application/Commands/ApplicationCommandDispatcher.h +++ b/sources/Application/Commands/ApplicationCommandDispatcher.h @@ -2,8 +2,8 @@ #define _APPLICATION_COMMAND_DISPATCHER_H_ #include "CommandDispatcher.h" -#include "Application/Model/Project.h" #include "Foundation/T_Singleton.h" +#include "Application/Model/Project.h" class ApplicationCommandDispatcher: public T_Singleton,public CommandExecuter { public: @@ -20,4 +20,4 @@ class ApplicationCommandDispatcher: public T_Singleton,public CommandExecuter,public I_Observer { public: @@ -25,4 +25,4 @@ class EventDispatcher: public T_Singleton,public CommandExecute I_Timer *timer_ ; } ; -#endif +#endif \ No newline at end of file diff --git a/sources/Application/Controllers/ControlRoom.cpp b/sources/Application/Controllers/ControlRoom.cpp index 82023618..8d83ec52 100644 --- a/sources/Application/Controllers/ControlRoom.cpp +++ b/sources/Application/Controllers/ControlRoom.cpp @@ -1,10 +1,10 @@ #include "ControlRoom.h" -#include -#include "Externals/TinyXML/tinyxml.h" #include "Services/Controllers/ControllerService.h" #include "Services/Controllers/MultiChannelAdapter.h" #include "System/Console/Trace.h" +#include "Externals/TinyXML/tinyxml.h" +#include ControlRoom::ControlRoom():ControlNode("",0) { @@ -114,4 +114,4 @@ bool ControlRoom::LoadMapping(const char *mappingFile) { } return true ; -} ; +} ; \ No newline at end of file diff --git a/sources/Application/Instruments/I_Instrument.h b/sources/Application/Instruments/I_Instrument.h index e3acb34a..4a3365d4 100644 --- a/sources/Application/Instruments/I_Instrument.h +++ b/sources/Application/Instruments/I_Instrument.h @@ -1,10 +1,11 @@ #ifndef _I_INSTRUMENT_H_ #define _I_INSTRUMENT_H_ -#include "Application/Player/TablePlayback.h" -#include "Application/Utils/fixed.h" -#include "Foundation/Observable.h" #include "Foundation/Variables/VariableContainer.h" +#include "Foundation/Observable.h" +#include "Application/Utils/fixed.h" + +#include "Application/Player/TablePlayback.h" enum InstrumentType { IT_SAMPLE=0, diff --git a/sources/Application/Instruments/InstrumentBank.cpp b/sources/Application/Instruments/InstrumentBank.cpp index 09d6ac5d..ec65ba59 100644 --- a/sources/Application/Instruments/InstrumentBank.cpp +++ b/sources/Application/Instruments/InstrumentBank.cpp @@ -3,10 +3,10 @@ #include "Application/Instruments/SampleInstrument.h" #include "Application/Instruments/SamplePool.h" #include "Application/Instruments/MidiInstrument.h" +#include "System/io/Status.h" +#include "Application/Utils/char.h" #include "Application/Model/Config.h" #include "Application/Persistency/PersistencyService.h" -#include "Application/Utils/char.h" -#include "System/io/Status.h" #include "Filters.h" char *InstrumentTypeData[IT_LAST]= { diff --git a/sources/Application/Instruments/InstrumentBank.h b/sources/Application/Instruments/InstrumentBank.h index 6053a076..52c03fdc 100644 --- a/sources/Application/Instruments/InstrumentBank.h +++ b/sources/Application/Instruments/InstrumentBank.h @@ -2,8 +2,8 @@ #define _INSTRUMENT_BANK_H_ #include "Application/Persistency/Persistent.h" -#include "Application/Instruments/I_Instrument.h" #include "Application/Model/Song.h" +#include "Application/Instruments/I_Instrument.h" #define NO_MORE_INSTRUMENT 0x100 diff --git a/sources/Application/Instruments/MidiInstrument.cpp b/sources/Application/Instruments/MidiInstrument.cpp index a07e1ce4..dfdc2372 100644 --- a/sources/Application/Instruments/MidiInstrument.cpp +++ b/sources/Application/Instruments/MidiInstrument.cpp @@ -1,8 +1,8 @@ #include "MidiInstrument.h" -#include -#include -#include "System/Console/Trace.h" #include "CommandList.h" +#include "System/Console/Trace.h" +#include +#include MidiService *MidiInstrument::svc_=0 ; diff --git a/sources/Application/Instruments/SRPUpdaters.h b/sources/Application/Instruments/SRPUpdaters.h index 6214b930..60c9f172 100644 --- a/sources/Application/Instruments/SRPUpdaters.h +++ b/sources/Application/Instruments/SRPUpdaters.h @@ -1,8 +1,9 @@ #ifndef _SRP_UPDATERS_H_ #define _SRP_UPDATERS_H_ -#include "Foundation/Types/Types.h" #include "I_SRPUpdater.h" +#include "Foundation/Types/Types.h" + class VolumeRamp: public I_SRPUpdater { public: diff --git a/sources/Application/Instruments/SampleInstrument.cpp b/sources/Application/Instruments/SampleInstrument.cpp index 90635282..7368f8fc 100644 --- a/sources/Application/Instruments/SampleInstrument.cpp +++ b/sources/Application/Instruments/SampleInstrument.cpp @@ -1,20 +1,23 @@ #include "SampleInstrument.h" +#include "SamplePool.h" +#include "System/Console/Trace.h" +#include "System/io/Status.h" +#include "CommandList.h" #include -#include -#include -#include -#include "Application/Instruments/Filters.h" -#include "Application/Model/Table.h" #include "Application/Player/PlayerMixer.h" // For MIX_BUFFER_SIZE.. kick out pls #include "Application/Player/SyncMaster.h" +#include "Application/Instruments/Filters.h" +#include "Application/Model/Table.h" #include "Services/Audio/Audio.h" -#include "System/Console/Trace.h" -#include "System/io/Status.h" -#include "CommandList.h" -#include "SampleInstrumentDatas.h" -#include "SamplePool.h" #include "SampleVariable.h" +#include +#include +#include + +#include "SampleInstrumentDatas.h" +#include "Application/Player/SyncMaster.h" + fixed SampleInstrument::feedback_[SONG_CHANNEL_COUNT][FB_BUFFER_LENGTH*2] ; bool SampleInstrument::useDirtyDownsampling_ = false; diff --git a/sources/Application/Instruments/SampleInstrument.h b/sources/Application/Instruments/SampleInstrument.h index ead8f802..e4c16165 100644 --- a/sources/Application/Instruments/SampleInstrument.h +++ b/sources/Application/Instruments/SampleInstrument.h @@ -2,14 +2,14 @@ #define _SAMPLE_INSTRUMENT_H_ #include "I_Instrument.h" -#include "Application/Model/Song.h" -#include "Foundation/Observable.h" -#include "Foundation/Types/Types.h" -#include "Foundation/Variables/WatchedVariable.h" #include "SampleRenderingParams.h" #include "SRPUpdaters.h" -#include "SoundSource.h" +#include "SoundSource.h" +#include "Application/Model/Song.h" +#include "Foundation/Observable.h" +#include "Foundation/Types/Types.h" +#include "Foundation/Variables/WatchedVariable.h" enum SampleInstrumentLoopMode { SILM_ONESHOT=0, diff --git a/sources/Application/Instruments/SamplePool.cpp b/sources/Application/Instruments/SamplePool.cpp index 01befa94..d3806933 100644 --- a/sources/Application/Instruments/SamplePool.cpp +++ b/sources/Application/Instruments/SamplePool.cpp @@ -1,14 +1,14 @@ #include "SamplePool.h" -#include -#include #include -#include "Application/Model/Config.h" -#include "Application/Persistency/PersistencyService.h" +#include #include "System/Console/Trace.h" +#include "Application/Persistency/PersistencyService.h" #include "System/io/Status.h" +#include #include "SoundFontSample.h" #include "SoundFontPreset.h" #include "SoundFontManager.h" +#include "Application/Model/Config.h" #define SAMPLE_LIB "root:samplelib" diff --git a/sources/Application/Instruments/SamplePool.h b/sources/Application/Instruments/SamplePool.h index be8a73f9..c3a8e7d5 100644 --- a/sources/Application/Instruments/SamplePool.h +++ b/sources/Application/Instruments/SamplePool.h @@ -2,10 +2,10 @@ #ifndef _SAMPLE_POOL_H_ #define _SAMPLE_POOL_H_ -#include "Application/Model/Song.h" -#include "Foundation/Observable.h" #include "Foundation/T_Singleton.h" #include "WavFile.h" +#include "Application/Model/Song.h" +#include "Foundation/Observable.h" #define MAX_PIG_SAMPLES MAX_SAMPLEINSTRUMENT_COUNT diff --git a/sources/Application/Instruments/SampleRenderingParams.h b/sources/Application/Instruments/SampleRenderingParams.h index 25865ab7..e003afdd 100644 --- a/sources/Application/Instruments/SampleRenderingParams.h +++ b/sources/Application/Instruments/SampleRenderingParams.h @@ -2,9 +2,9 @@ #ifndef _SAMPLE_RENDER_PARAMS_H_ #define _SAMPLE_RENDER_PARAMS_H_ -#include #include "Foundation/Types/Types.h" #include "SRPUpdaters.h" +#include enum FeedbackMode { FB_NONE, diff --git a/sources/Application/Instruments/SampleVariable.h b/sources/Application/Instruments/SampleVariable.h index e89b82f0..a65a3098 100644 --- a/sources/Application/Instruments/SampleVariable.h +++ b/sources/Application/Instruments/SampleVariable.h @@ -2,8 +2,8 @@ #ifndef _SAMPLE_VARIABLE_H_ #define _SAMPLE_VARIABLE_H_ -#include "Foundation/Observable.h" #include "Foundation/Variables/WatchedVariable.h" +#include "Foundation/Observable.h" class SampleVariable:public WatchedVariable,public I_Observer { public: @@ -13,4 +13,4 @@ class SampleVariable:public WatchedVariable,public I_Observer { virtual void Update(Observable &o,I_ObservableData *d) ; } ; -#endif +#endif \ No newline at end of file diff --git a/sources/Application/Instruments/SoundFontManager.cpp b/sources/Application/Instruments/SoundFontManager.cpp index b7cafed2..0acec549 100644 --- a/sources/Application/Instruments/SoundFontManager.cpp +++ b/sources/Application/Instruments/SoundFontManager.cpp @@ -1,9 +1,10 @@ #include "SoundFontManager.h" +#include "System/System/System.h" +#include "System/FileSystem/FileSystem.h" + #ifdef _64BIT #include #endif -#include "System/FileSystem/FileSystem.h" -#include "System/System/System.h" SoundFontManager::SoundFontManager() { } ; diff --git a/sources/Application/Instruments/SoundFontManager.h b/sources/Application/Instruments/SoundFontManager.h index 97322255..f0100200 100644 --- a/sources/Application/Instruments/SoundFontManager.h +++ b/sources/Application/Instruments/SoundFontManager.h @@ -1,9 +1,9 @@ #ifndef _SOUND_FONT_MANAGER_H_ #define _SOUND_FONT_MANAGER_H_ -#include -#include "Externals/Soundfont/ENAB.H" #include "Foundation/T_Singleton.h" +#include "Externals/Soundfont/ENAB.H" +#include class SoundFontManager:public T_Singleton { public: diff --git a/sources/Application/Instruments/SoundFontPreset.h b/sources/Application/Instruments/SoundFontPreset.h index 8e52fbb0..146d60d2 100644 --- a/sources/Application/Instruments/SoundFontPreset.h +++ b/sources/Application/Instruments/SoundFontPreset.h @@ -2,8 +2,8 @@ #define _SOUNDFONT_PRESET_H_ #include "SoundSource.h" -#include "Externals/Soundfont/ENAB.H" #include "Externals/Soundfont/SFNAV.H" +#include "Externals/Soundfont/ENAB.H" class SoundFontPreset: public SoundSource { public: diff --git a/sources/Application/Instruments/SoundFontSample.h b/sources/Application/Instruments/SoundFontSample.h index bdf0ffd8..2c6ea210 100644 --- a/sources/Application/Instruments/SoundFontSample.h +++ b/sources/Application/Instruments/SoundFontSample.h @@ -2,8 +2,8 @@ #define _SOUND_FONT_SAMPLE_H_ #include "SoundSource.h" -#include "Externals/Soundfont/ENAB.H" #include "System/FileSystem/FileSystem.h" +#include "Externals/Soundfont/ENAB.H" class SoundFontSample: public SoundSource { public: diff --git a/sources/Application/Instruments/WavFile.cpp b/sources/Application/Instruments/WavFile.cpp index 38829e6c..d60da859 100644 --- a/sources/Application/Instruments/WavFile.cpp +++ b/sources/Application/Instruments/WavFile.cpp @@ -1,10 +1,10 @@ #include "WavFile.h" -#include -#include "Application/Model/Config.h" +#include "System/Console/Trace.h" #include "Foundation/Types/Types.h" #include "Services/Time/TimeService.h" -#include "System/Console/Trace.h" +#include "Application/Model/Config.h" +#include int WavFile::bufferChunkSize_=-1 ; bool WavFile::initChunkSize_=true ; diff --git a/sources/Application/Instruments/WavFile.h b/sources/Application/Instruments/WavFile.h index 106b89b8..02b37924 100644 --- a/sources/Application/Instruments/WavFile.h +++ b/sources/Application/Instruments/WavFile.h @@ -2,8 +2,8 @@ #ifndef _WAV_FILE_H_ #define _WAV_FILE_H_ -#include "SoundSource.h" #include "System/FileSystem/FileSystem.h" +#include "SoundSource.h" class WavFile:public SoundSource { diff --git a/sources/Application/Instruments/WavFileWriter.h b/sources/Application/Instruments/WavFileWriter.h index d506fbbe..0dc8187e 100644 --- a/sources/Application/Instruments/WavFileWriter.h +++ b/sources/Application/Instruments/WavFileWriter.h @@ -1,8 +1,8 @@ #ifndef _WAV_FILE_WRITER_H_ #define _WAV_FILE_WRITER_H_ -#include "Application/Utils/fixed.h" #include "System/FileSystem/FileSystem.h" +#include "Application/Utils/fixed.h" class WavFileWriter { public: diff --git a/sources/Application/Mixer/MixerService.cpp b/sources/Application/Mixer/MixerService.cpp index 232c2d94..82a7f1bc 100644 --- a/sources/Application/Mixer/MixerService.cpp +++ b/sources/Application/Mixer/MixerService.cpp @@ -1,11 +1,11 @@ #include "MixerService.h" -#include "Application/Audio/DummyAudioOut.h" -#include "Application/Model/Config.h" -#include "Application/Model/Mixer.h" #include "Services/Audio/Audio.h" #include "Services/Audio/AudioDriver.h" #include "Services/Midi/MidiService.h" #include "System/Console/Trace.h" +#include "Application/Model/Config.h" +#include "Application/Audio/DummyAudioOut.h" +#include "Application/Model/Mixer.h" MixerService::MixerService(): out_(0), diff --git a/sources/Application/Model/Chain.cpp b/sources/Application/Model/Chain.cpp index 91546c65..c9313bec 100644 --- a/sources/Application/Model/Chain.cpp +++ b/sources/Application/Model/Chain.cpp @@ -1,7 +1,7 @@ #include "Chain.h" +#include "System/System/System.h" #include #include -#include "System/System/System.h" Chain::Chain() { diff --git a/sources/Application/Model/Config.h b/sources/Application/Model/Config.h index 10c83651..a395731b 100644 --- a/sources/Application/Model/Config.h +++ b/sources/Application/Model/Config.h @@ -1,10 +1,10 @@ #ifndef _CONFIG_H_ #define _CONFIG_H_ -#include "Externals/TinyXML/tinyxml.h" #include "Foundation/T_Singleton.h" #include "Foundation/Variables/VariableContainer.h" #include "System/Console/Trace.h" +#include "Externals/TinyXML/tinyxml.h" class Config: public T_Singleton,public VariableContainer { public: diff --git a/sources/Application/Model/Groove.h b/sources/Application/Model/Groove.h index a3013467..8d0779e9 100644 --- a/sources/Application/Model/Groove.h +++ b/sources/Application/Model/Groove.h @@ -2,10 +2,10 @@ #ifndef _GROOVE_H_ #define _GROOVE_H_ -#include "Application/Model/Song.h" +#include "Foundation/T_Singleton.h" #include "Application/Persistency/Persistent.h" +#include "Application/Model/Song.h" #include "Application/Utils/HexBuffers.h" -#include "Foundation/T_Singleton.h" #define MAX_GROOVES 0x20 #define NO_GROOVE_DATA 0xFF diff --git a/sources/Application/Model/Mixer.h b/sources/Application/Model/Mixer.h index 570d9e2e..393ce8d7 100644 --- a/sources/Application/Model/Mixer.h +++ b/sources/Application/Model/Mixer.h @@ -4,8 +4,9 @@ #include "Foundation/T_Singleton.h" #include "Application/Persistency/Persistent.h" -#include "Application/Utils/fixed.h" + #include "Song.h" +#include "Application/Utils/fixed.h" class Mixer:public T_Singleton,Persistent { public: diff --git a/sources/Application/Model/Phrase.cpp b/sources/Application/Model/Phrase.cpp index a8497fab..a20887c0 100644 --- a/sources/Application/Model/Phrase.cpp +++ b/sources/Application/Model/Phrase.cpp @@ -1,7 +1,7 @@ #include "Phrase.h" +#include "System/System/System.h" #include #include -#include "System/System/System.h" Phrase::Phrase() { diff --git a/sources/Application/Model/Phrase.h b/sources/Application/Model/Phrase.h index 1610e226..6d1e9f33 100644 --- a/sources/Application/Model/Phrase.h +++ b/sources/Application/Model/Phrase.h @@ -2,7 +2,6 @@ #define _PHRASE_H_ #include "Foundation/Types/Types.h" - #define PHRASE_COUNT 0xFF #define NO_MORE_PHRASE 0x100 diff --git a/sources/Application/Model/Project.cpp b/sources/Application/Model/Project.cpp index bf506311..cee834ac 100644 --- a/sources/Application/Model/Project.cpp +++ b/sources/Application/Model/Project.cpp @@ -1,16 +1,17 @@ #include "Project.h" -#include -#include "Application/Instruments/SampleInstrument.h" -#include "Application/Instruments/SamplePool.h" -#include "Application/Persistency/PersistencyService.h" -#include "Application/Player/SyncMaster.h" -#include "Foundation/Variables/WatchedVariable.h" #include "Services/Midi/MidiService.h" #include "System/FileSystem/FileSystem.h" #include "System/Console/Trace.h" #include "System/io/Status.h" +#include "Foundation/Variables/WatchedVariable.h" +#include "Application/Player/SyncMaster.h" #include "Table.h" #include "Groove.h" +#include "Application/Persistency/PersistencyService.h" +#include "Application/Instruments/SamplePool.h" +#include "Application/Instruments/SampleInstrument.h" + +#include Project::Project() :Persistent("PROJECT") diff --git a/sources/Application/Model/Project.h b/sources/Application/Model/Project.h index 2a200f5e..162fc43e 100644 --- a/sources/Application/Model/Project.h +++ b/sources/Application/Model/Project.h @@ -1,12 +1,12 @@ #ifndef _PROJECT_H_ #define _PROJECT_H_ +#include "Song.h" +#include "Application/Instruments/InstrumentBank.h" #include "Application/Persistency/Persistent.h" #include "Foundation/Variables/VariableContainer.h" -#include "Application/Instruments/InstrumentBank.h" #include "Foundation/Types/Types.h" #include "Foundation/Observable.h" -#include "Song.h" #define VAR_TEMPO MAKE_FOURCC('T','M','P','O') diff --git a/sources/Application/Model/Song.cpp b/sources/Application/Model/Song.cpp index 0a7d41d9..d1a08d9b 100644 --- a/sources/Application/Model/Song.cpp +++ b/sources/Application/Model/Song.cpp @@ -1,11 +1,12 @@ #include "Song.h" -#include -#include -#include -#include "Application/Instruments/CommandList.h" -#include "Application/Utils/HexBuffers.h" #include "System/io/Status.h" +#include "Application/Utils/HexBuffers.h" +#include "Application/Instruments/CommandList.h" #include "Table.h" +#include +#include +#include + Song::Song():Persistent("SONG") { diff --git a/sources/Application/Model/Song.h b/sources/Application/Model/Song.h index a54916fa..68cf0c29 100644 --- a/sources/Application/Model/Song.h +++ b/sources/Application/Model/Song.h @@ -1,9 +1,9 @@ #ifndef _SONG_H_ #define _SONG_H_ -#include "Application/Persistency/Persistent.h" #include "Chain.h" #include "Phrase.h" +#include "Application/Persistency/Persistent.h" #define SONG_CHANNEL_COUNT 8 #define SONG_ROW_COUNT 256 diff --git a/sources/Application/Model/Table.cpp b/sources/Application/Model/Table.cpp index 4a209203..41dc2ddd 100644 --- a/sources/Application/Model/Table.cpp +++ b/sources/Application/Model/Table.cpp @@ -1,8 +1,8 @@ #include "Table.h" +#include "System/System/System.h" #include "Application/Instruments/CommandList.h" -#include "Application/Utils/char.h" #include "Application/Utils/HexBuffers.h" -#include "System/System/System.h" +#include "Application/Utils/char.h" #include "Song.h" Table::Table() { @@ -180,4 +180,4 @@ int TableHolder::Clone(int table) { table_[target].Copy(table_[table]) ; } ; return target ; -} ; +} ; \ No newline at end of file diff --git a/sources/Application/Model/Table.h b/sources/Application/Model/Table.h index 8d8b3151..ccf36ade 100644 --- a/sources/Application/Model/Table.h +++ b/sources/Application/Model/Table.h @@ -1,9 +1,9 @@ #ifndef _TABLE_H_ #define _TABLE_H_ +#include "Foundation/Types/Types.h" #include "Foundation/T_Singleton.h" #include "Application/Persistency/Persistent.h" -#include "Foundation/Types/Types.h" #define TABLE_COUNT 0x80 #define TABLE_STEPS 16 diff --git a/sources/Application/Persistency/PersistencyService.cpp b/sources/Application/Persistency/PersistencyService.cpp index a5c07b33..ebcaaed6 100644 --- a/sources/Application/Persistency/PersistencyService.cpp +++ b/sources/Application/Persistency/PersistencyService.cpp @@ -1,8 +1,8 @@ #include "PersistencyService.h" #include "Persistent.h" #include "Externals/Compression/lz.h" -#include "Foundation/Types/Types.h" #include "System/Console/Trace.h" +#include "Foundation/Types/Types.h" PersistencyService::PersistencyService():Service(MAKE_FOURCC('S','V','P','S')) { } ; diff --git a/sources/Application/Persistency/PersistencyService.h b/sources/Application/Persistency/PersistencyService.h index 1686f09c..27171df1 100644 --- a/sources/Application/Persistency/PersistencyService.h +++ b/sources/Application/Persistency/PersistencyService.h @@ -3,7 +3,7 @@ #include "Foundation/Services/Service.h" #include "Foundation/T_Singleton.h" -#include "Externals/TinyXML/tinyxml.h" + #include "Externals/TinyXML/tinyxml.h" class PersistencyService: public Service,public T_Singleton { public: diff --git a/sources/Application/Player/Player.cpp b/sources/Application/Player/Player.cpp index a07c3baa..cd23982c 100644 --- a/sources/Application/Player/Player.cpp +++ b/sources/Application/Player/Player.cpp @@ -1,16 +1,17 @@ #include "Player.h" -#include -#include +#include "Application/Views/BaseClasses/ViewEvent.h" +#include "System/io/Status.h" +#include "System/System/System.h" #include "Application/Instruments/CommandList.h" #include "Application/Instruments/I_Instrument.h" -#include "Application/Model/Groove.h" -#include "Application/Player/TablePlayback.h" #include "Application/Utils/char.h" -#include "Application/Views/BaseClasses/ViewEvent.h" -#include "Services/Midi/MidiService.h" #include "System/Console/n_assert.h" -#include "System/io/Status.h" -#include "System/System/System.h" +#include "Application/Player/TablePlayback.h" +#include "Application/Model/Groove.h" +#include +#include +#include "Services/Midi/MidiService.h" + // Private constructor - Singleton Player::Player() { diff --git a/sources/Application/Player/Player.h b/sources/Application/Player/Player.h index e2975d14..a7b19f8e 100644 --- a/sources/Application/Player/Player.h +++ b/sources/Application/Player/Player.h @@ -1,11 +1,10 @@ #ifndef _PLAYER_H_ #define _PLAYER_H_ - -#include "Foundation/Observable.h" #include "Foundation/T_Singleton.h" +#include "Foundation/Observable.h" +#include "System/Timer/Timer.h" #include "Application/Views/ViewData.h" #include "Application/Views/BaseClasses/ViewEvent.h" -#include "System/Timer/Timer.h" #include "PlayerMixer.h" #include "SyncMaster.h" diff --git a/sources/Application/Player/PlayerChannel.cpp b/sources/Application/Player/PlayerChannel.cpp index 02d911e3..d673e109 100644 --- a/sources/Application/Player/PlayerChannel.cpp +++ b/sources/Application/Player/PlayerChannel.cpp @@ -1,8 +1,8 @@ #include "PlayerChannel.h" +#include "Application/Player/SyncMaster.h" #include "Application/Mixer/MixerService.h" #include "Application/Model/Mixer.h" -#include "Application/Player/SyncMaster.h" PlayerChannel::PlayerChannel(int index) { index_=index ; @@ -74,4 +74,4 @@ void PlayerChannel::Reset() { } muted_=false ; busIndex_=-1 ; -} ; +} ; \ No newline at end of file diff --git a/sources/Application/Player/PlayerMixer.cpp b/sources/Application/Player/PlayerMixer.cpp index b567e2f6..3e6a5289 100644 --- a/sources/Application/Player/PlayerMixer.cpp +++ b/sources/Application/Player/PlayerMixer.cpp @@ -1,15 +1,17 @@ + #include "PlayerMixer.h" -#include -#include -#include "Application/Mixer/MixerService.h" -#include "Application/Model/Mixer.h" -#include "Application/Utils/char.h" -#include "Application/Utils/fixed.h" -#include "Services/Midi/MidiService.h" +#include "SyncMaster.h" #include "System/Console/Trace.h" #include "System/System/System.h" -#include "SyncMaster.h" +#include "Application/Utils/fixed.h" +#include "Application/Utils/char.h" +#include "Services/Midi/MidiService.h" +#include "Application/Mixer/MixerService.h" +#include "Application/Utils/char.h" +#include "Application/Model/Mixer.h" +#include +#include PlayerMixer::PlayerMixer() { @@ -206,4 +208,4 @@ void PlayerMixer::Unlock() { MixerService *ms=MixerService::GetInstance() ; ms->Unlock() ; -} ; +} ; \ No newline at end of file diff --git a/sources/Application/Player/PlayerMixer.h b/sources/Application/Player/PlayerMixer.h index 71944a1b..d8a45249 100644 --- a/sources/Application/Player/PlayerMixer.h +++ b/sources/Application/Player/PlayerMixer.h @@ -3,13 +3,13 @@ #define _APPLICATION_MIXER_H_ #include "Foundation/T_Singleton.h" -#include "Foundation/Observable.h" -#include "Application/Audio/AudioFileStreamer.h" #include "Application/Model/Project.h" -#include "Application/Utils/fixed.h" #include "Application/Views/ViewData.h" -#include "Services/Audio/AudioOut.h" +#include "Application/Utils/fixed.h" +#include "Application/Audio/AudioFileStreamer.h" #include "PlayerChannel.h" +#include "Foundation/Observable.h" +#include "Services/Audio/AudioOut.h" #define STREAM_MIX_BUS 8 diff --git a/sources/Application/Player/TablePlayback.h b/sources/Application/Player/TablePlayback.h index 1bd7b0bb..8dec1f6c 100644 --- a/sources/Application/Player/TablePlayback.h +++ b/sources/Application/Player/TablePlayback.h @@ -1,9 +1,9 @@ #ifndef _TABLE_PLAYBACK_H_ #define _TABLE_PLAYBACK_H_ -#include "Application/Model/Groove.h" -#include "Application/Model/Song.h" #include "Application/Model/Table.h" +#include "Application/Model/Song.h" +#include "Application/Model/Groove.h" class I_Instrument ; diff --git a/sources/Application/Utils/RandomNames.h b/sources/Application/Utils/RandomNames.h index 22eefdb0..745734d1 100644 --- a/sources/Application/Utils/RandomNames.h +++ b/sources/Application/Utils/RandomNames.h @@ -1,9 +1,9 @@ #ifndef _RANDOM_NAMES_H_ #define _RANDOM_NAMES_H_ -#include #include #include +#include #include "time.h" static const std::string adj[] = { diff --git a/sources/Application/Utils/char.h b/sources/Application/Utils/char.h index 407a0570..78ebe78d 100644 --- a/sources/Application/Utils/char.h +++ b/sources/Application/Utils/char.h @@ -1,8 +1,8 @@ #ifndef _CHAR_H_ #define _CHAR_H_ -#include #include "Foundation/Types/Types.h" +#include extern char h2c__[16] ; extern const char *notes__[12] ; diff --git a/sources/Application/Views/BaseClasses/UIField.h b/sources/Application/Views/BaseClasses/UIField.h index 379bd995..5a78d39e 100644 --- a/sources/Application/Views/BaseClasses/UIField.h +++ b/sources/Application/Views/BaseClasses/UIField.h @@ -1,10 +1,10 @@ #ifndef _UI_FIELD_H_ #define _UI_FIELD_H_ -#include "System/Console/Trace.h" #include "UIFramework/BasicDatas/GUIPoint.h" #include "UIFramework/SimpleBaseClasses/GUIWindow.h" #include "View.h" +#include "System/Console/Trace.h" class UIField { public: diff --git a/sources/Application/Views/BaseClasses/UIIntField.cpp b/sources/Application/Views/BaseClasses/UIIntField.cpp index 5092c119..fb72d3bb 100644 --- a/sources/Application/Views/BaseClasses/UIIntField.cpp +++ b/sources/Application/Views/BaseClasses/UIIntField.cpp @@ -1,9 +1,8 @@ #include "UIIntField.h" -#include "Application/AppWindow.h" -#include "System/Console/Trace.h" #include "UIFramework/Interfaces/I_GUIGraphics.h" - +#include "System/Console/Trace.h" +#include "Application/AppWindow.h" #define abs(x) (x<0?-x:x) diff --git a/sources/Application/Views/BaseClasses/UIIntVarField.cpp b/sources/Application/Views/BaseClasses/UIIntVarField.cpp index 12393d23..dc8b0b53 100644 --- a/sources/Application/Views/BaseClasses/UIIntVarField.cpp +++ b/sources/Application/Views/BaseClasses/UIIntVarField.cpp @@ -2,9 +2,9 @@ #include "UIIntVarField.h" -#include "Application/AppWindow.h" -#include "System/Console/Trace.h" #include "UIFramework/Interfaces/I_GUIGraphics.h" +#include "System/Console/Trace.h" +#include "Application/AppWindow.h" #define abs(x) (x<0?-x:x) diff --git a/sources/Application/Views/BaseClasses/UINoteVarField.cpp b/sources/Application/Views/BaseClasses/UINoteVarField.cpp index b4f4b4a0..682f9746 100644 --- a/sources/Application/Views/BaseClasses/UINoteVarField.cpp +++ b/sources/Application/Views/BaseClasses/UINoteVarField.cpp @@ -1,7 +1,7 @@ #include "UINoteVarField.h" -#include "Application/AppWindow.h" #include "Application/Utils/char.h" +#include "Application/AppWindow.h" UINoteVarField::UINoteVarField(GUIPoint &position,Variable &v,const char *format,int min,int max,int xOffset,int yOffset) :UIIntVarField(position,v,format,min,max,xOffset,yOffset) { diff --git a/sources/Application/Views/BaseClasses/UITempoField.cpp b/sources/Application/Views/BaseClasses/UITempoField.cpp index 7ab92b3b..8ce009e3 100644 --- a/sources/Application/Views/BaseClasses/UITempoField.cpp +++ b/sources/Application/Views/BaseClasses/UITempoField.cpp @@ -1,6 +1,6 @@ #include "UITempoField.h" -#include "Application/Commands/ApplicationCommandDispatcher.h" #include "Application/Player/Player.h" +#include "Application/Commands/ApplicationCommandDispatcher.h" #include "System/System/System.h" UITempoField::UITempoField(FourCC action,GUIPoint &position,Variable &v,const char *format,int min,int max,int xOffset,int yOffset):UIIntVarField(position,v,format,min,max,xOffset,yOffset) { diff --git a/sources/Application/Views/BaseClasses/View.cpp b/sources/Application/Views/BaseClasses/View.cpp index 9b9d8075..890ec3db 100644 --- a/sources/Application/Views/BaseClasses/View.cpp +++ b/sources/Application/Views/BaseClasses/View.cpp @@ -1,9 +1,9 @@ #include "View.h" -#include "Application/AppWindow.h" -#include "Application/Model/Config.h" +#include "System/Console/Trace.h" #include "Application/Player/Player.h" #include "Application/Utils/char.h" -#include "System/Console/Trace.h" +#include "Application/AppWindow.h" +#include "Application/Model/Config.h" #include "ModalView.h" bool View::initPrivate_=false ; diff --git a/sources/Application/Views/BaseClasses/View.h b/sources/Application/Views/BaseClasses/View.h index d1ad1cda..100ad6a5 100644 --- a/sources/Application/Views/BaseClasses/View.h +++ b/sources/Application/Views/BaseClasses/View.h @@ -2,15 +2,14 @@ #ifndef _VIEW_H_ #define _VIEW_H_ -#include "Application/Model/Config.h" +#include "UIFramework/SimpleBaseClasses/GUIWindow.h" +#include "UIFramework/Interfaces/I_GUIGraphics.h" +#include "ViewEvent.h" #include "Application/Model/Project.h" #include "Application/Player/Player.h" #include "Foundation/T_SimpleList.h" -#include "UIFramework/Interfaces/I_GUIGraphics.h" -#include "UIFramework/SimpleBaseClasses/GUIWindow.h" +#include "Application/Model/Config.h" #include "I_Action.h" -#include "ViewEvent.h" - enum GUIEventPadButtonMasks { EPBM_LEFT=1, diff --git a/sources/Application/Views/ChainView.cpp b/sources/Application/Views/ChainView.cpp index 1138feaf..e95fbd2e 100644 --- a/sources/Application/Views/ChainView.cpp +++ b/sources/Application/Views/ChainView.cpp @@ -1,6 +1,6 @@ #include "ChainView.h" -#include "Application/Utils/char.h" #include "System/Console/Trace.h" +#include "Application/Utils/char.h" #include "UIController.h" diff --git a/sources/Application/Views/InstrumentView.cpp b/sources/Application/Views/InstrumentView.cpp index d781e600..5d00a4e6 100644 --- a/sources/Application/Views/InstrumentView.cpp +++ b/sources/Application/Views/InstrumentView.cpp @@ -1,15 +1,15 @@ #include "InstrumentView.h" -#include "Application/Instruments/MidiInstrument.h" +#include "System/System/System.h" #include "Application/Instruments/SampleInstrument.h" +#include "Application/Instruments/MidiInstrument.h" #include "Application/Instruments/SamplePool.h" -#include "Application/Model/Config.h" #include "BaseClasses/UIBigHexVarField.h" -#include "BaseClasses/UIIntVarOffField.h" #include "BaseClasses/UINoteVarField.h" #include "BaseClasses/UIStaticField.h" -#include "ModalDialogs/ImportSampleDialog.h" +#include "BaseClasses/UIIntVarOffField.h" #include "ModalDialogs/MessageBox.h" -#include "System/System/System.h" +#include "ModalDialogs/ImportSampleDialog.h" +#include "Application/Model/Config.h" InstrumentView::InstrumentView(GUIWindow &w,ViewData *data):FieldView(w,data) { diff --git a/sources/Application/Views/InstrumentView.h b/sources/Application/Views/InstrumentView.h index ed4b897f..515c3fd2 100644 --- a/sources/Application/Views/InstrumentView.h +++ b/sources/Application/Views/InstrumentView.h @@ -1,8 +1,8 @@ #ifndef _INSTRUMENT_VIEW_H_ #define _INSTRUMENT_VIEW_H_ -#include "BaseClasses/FieldView.h" #include "Foundation/Observable.h" +#include "BaseClasses/FieldView.h" #include "ViewData.h" class InstrumentView: public FieldView, public I_Observer { diff --git a/sources/Application/Views/MixerView.cpp b/sources/Application/Views/MixerView.cpp index fce7f83d..7241ff53 100644 --- a/sources/Application/Views/MixerView.cpp +++ b/sources/Application/Views/MixerView.cpp @@ -1,9 +1,9 @@ #include "MixerView.h" -#include -#include -#include #include "Application/Model/Mixer.h" #include "Application/Utils/char.h" +#include +#include +#include MixerView::MixerView(GUIWindow &w,ViewData *viewData):View(w,viewData) { clipboard_.active_=false ; diff --git a/sources/Application/Views/ModalDialogs/ImportSampleDialog.cpp b/sources/Application/Views/ModalDialogs/ImportSampleDialog.cpp index b086de08..c9cfeb5a 100644 --- a/sources/Application/Views/ModalDialogs/ImportSampleDialog.cpp +++ b/sources/Application/Views/ModalDialogs/ImportSampleDialog.cpp @@ -1,6 +1,6 @@ #include "ImportSampleDialog.h" -#include "Application/Instruments/SampleInstrument.h" #include "Application/Instruments/SamplePool.h" +#include "Application/Instruments/SampleInstrument.h" #define LIST_SIZE 15 #define LIST_WIDTH 28 diff --git a/sources/Application/Views/ModalDialogs/ImportSampleDialog.h b/sources/Application/Views/ModalDialogs/ImportSampleDialog.h index 007d655d..d31146d5 100644 --- a/sources/Application/Views/ModalDialogs/ImportSampleDialog.h +++ b/sources/Application/Views/ModalDialogs/ImportSampleDialog.h @@ -2,9 +2,9 @@ #define _IMPORT_SAMPLE_DIALOG_H_ #include "Application/Views/BaseClasses/ModalView.h" -#include #include "Foundation/T_SimpleList.h" #include "System/FileSystem/FileSystem.h" +#include class ImportSampleDialog:public ModalView { public: diff --git a/sources/Application/Views/ModalDialogs/SelectProjectDialog.cpp b/sources/Application/Views/ModalDialogs/SelectProjectDialog.cpp index 0a3a1daf..218050f4 100644 --- a/sources/Application/Views/ModalDialogs/SelectProjectDialog.cpp +++ b/sources/Application/Views/ModalDialogs/SelectProjectDialog.cpp @@ -1,10 +1,10 @@ #include "SelectProjectDialog.h" #include "NewProjectDialog.h" -#include "Application/Views/ModalDialogs/MessageBox.h" -#include #include "System/Console/Trace.h" +#include "Application/Views/ModalDialogs/MessageBox.h" +#include #define LIST_SIZE 20 #define LIST_WIDTH 32 diff --git a/sources/Application/Views/ModalDialogs/SelectProjectDialog.h b/sources/Application/Views/ModalDialogs/SelectProjectDialog.h index 67831126..437b227f 100644 --- a/sources/Application/Views/ModalDialogs/SelectProjectDialog.h +++ b/sources/Application/Views/ModalDialogs/SelectProjectDialog.h @@ -2,8 +2,8 @@ #define _SELECT_PROJECT_DIALOG_H_ #include "Application/Views/BaseClasses/ModalView.h" -#include "System/Errors/Result.h" #include "System/FileSystem/FileSystem.h" +#include "System/Errors/Result.h" class SelectProjectDialog:public ModalView { public: diff --git a/sources/Application/Views/PhraseView.cpp b/sources/Application/Views/PhraseView.cpp index 6e841b35..230040c3 100644 --- a/sources/Application/Views/PhraseView.cpp +++ b/sources/Application/Views/PhraseView.cpp @@ -1,13 +1,13 @@ #include "PhraseView.h" -#include -#include +#include "System/Console/Trace.h" +#include "Application/Utils/char.h" #include "Application/Instruments/CommandList.h" +#include "UIController.h" #include "Application/Model/Table.h" -#include "Application/Utils/char.h" #include "Application/Utils/HelpLegend.h" -#include "System/Console/Trace.h" -#include "UIController.h" - +#include +#include + short PhraseView::offsets_[2][4] = { -1,1,12,-12, -1,1,16,-16 diff --git a/sources/Application/Views/PhraseView.h b/sources/Application/Views/PhraseView.h index cf1279c0..79598f87 100644 --- a/sources/Application/Views/PhraseView.h +++ b/sources/Application/Views/PhraseView.h @@ -2,8 +2,8 @@ #ifndef _PHRASE_VIEW_H_ #define _PHRASE_VIEW_H_ -#include "BaseClasses/View.h" #include "BaseClasses/UIBigHexVarField.h" +#include "BaseClasses/View.h" #include "ViewData.h" #define FCC_EDIT MAKE_FOURCC('V','O','L','M') diff --git a/sources/Application/Views/ProjectView.cpp b/sources/Application/Views/ProjectView.cpp index 2a78542f..b4d656dd 100644 --- a/sources/Application/Views/ProjectView.cpp +++ b/sources/Application/Views/ProjectView.cpp @@ -1,13 +1,13 @@ #include "ProjectView.h" +#include "BaseClasses/UIIntVarField.h" +#include "BaseClasses/UIActionField.h" +#include "BaseClasses/UITempoField.h" #include "Application/Persistency/PersistencyService.h" +#include "System/System/System.h" +#include "Services/Midi/MidiService.h" #include "Application/Views/ModalDialogs/MessageBox.h" #include "Application/Views/ModalDialogs/NewProjectDialog.h" #include "Application/Views/ModalDialogs/SelectProjectDialog.h" -#include "BaseClasses/UIActionField.h" -#include "BaseClasses/UIIntVarField.h" -#include "BaseClasses/UITempoField.h" -#include "Services/Midi/MidiService.h" -#include "System/System/System.h" #define ACTION_PURGE MAKE_FOURCC('P','U','R','G') #define ACTION_SAVE MAKE_FOURCC('S','A','V','E') diff --git a/sources/Application/Views/SongView.cpp b/sources/Application/Views/SongView.cpp index 3433ad54..04f80221 100644 --- a/sources/Application/Views/SongView.cpp +++ b/sources/Application/Views/SongView.cpp @@ -1,13 +1,13 @@ #include "SongView.h" -#include -#include -#include -#include -#include "Application/Player/Player.h" -#include "Application/Utils/char.h" #include "System/Console/Trace.h" #include "System/System/System.h" +#include "Application/Utils/char.h" +#include "Application/Player/Player.h" #include "UIController.h" +#include +#include +#include +#include /**************** Constructor diff --git a/sources/Application/Views/TableView.cpp b/sources/Application/Views/TableView.cpp index 42305565..379ac361 100644 --- a/sources/Application/Views/TableView.cpp +++ b/sources/Application/Views/TableView.cpp @@ -1,7 +1,7 @@ #include "TableView.h" +#include "Application/Utils/char.h" #include "Application/Instruments/CommandList.h" #include "Application/Player/TablePlayback.h" -#include "Application/Utils/char.h" #include "Application/Utils/HelpLegend.h" #define FCC_EDIT MAKE_FOURCC('T','B','E','D') diff --git a/sources/Application/Views/TableView.h b/sources/Application/Views/TableView.h index c9d89d79..faa84c47 100644 --- a/sources/Application/Views/TableView.h +++ b/sources/Application/Views/TableView.h @@ -1,10 +1,10 @@ #ifndef _TABLE_VIEW_H_ #define _TABLE_VIEW_H_ -#include "BaseClasses/View.h" -#include "Application/Model/Table.h" #include "BaseClasses/UIBigHexVarField.h" +#include "BaseClasses/View.h" #include "ViewData.h" +#include "Application/Model/Table.h" class TableView: public View { public: diff --git a/sources/Application/Views/UIController.cpp b/sources/Application/Views/UIController.cpp index 29330129..9276e3da 100644 --- a/sources/Application/Views/UIController.cpp +++ b/sources/Application/Views/UIController.cpp @@ -1,4 +1,5 @@ #include "UIController.h" + #include "Application/Player/Player.h" UIController::UIController() { diff --git a/sources/Foundation/Observable.cpp b/sources/Foundation/Observable.cpp index 9a6d40a3..cb2cbf14 100644 --- a/sources/Foundation/Observable.cpp +++ b/sources/Foundation/Observable.cpp @@ -1,5 +1,6 @@ #include "Observable.h" + #include "T_SimpleList.h" Observable::Observable() { diff --git a/sources/Foundation/Variables/Variable.cpp b/sources/Foundation/Variables/Variable.cpp index 8ade429e..53f19ab6 100644 --- a/sources/Foundation/Variables/Variable.cpp +++ b/sources/Foundation/Variables/Variable.cpp @@ -1,8 +1,8 @@ #include "Variable.h" -#include #include #include #include +#include #include "System/Console/n_assert.h" #include "System/Console/Trace.h" diff --git a/sources/Services/Audio/AudioDriver.cpp b/sources/Services/Audio/AudioDriver.cpp index d820b12f..bd4b6da3 100644 --- a/sources/Services/Audio/AudioDriver.cpp +++ b/sources/Services/Audio/AudioDriver.cpp @@ -1,8 +1,8 @@ #include "AudioDriver.h" -#include "System/Console/n_assert.h" -#include "System/Console/Trace.h" #include "System/System/System.h" +#include "System/Console/Trace.h" +#include "System/Console/n_assert.h" AudioDriver::AudioDriver(AudioSettings &settings) { settings_=settings ; diff --git a/sources/Services/Audio/AudioMixer.h b/sources/Services/Audio/AudioMixer.h index 1f311c32..a3abe92d 100644 --- a/sources/Services/Audio/AudioMixer.h +++ b/sources/Services/Audio/AudioMixer.h @@ -3,9 +3,8 @@ #include "AudioModule.h" #include "Foundation/T_SimpleList.h" -#include #include "Application/Instruments/WavFileWriter.h" - +#include class AudioMixer: public AudioModule,public T_SimpleList { public: diff --git a/sources/Services/Audio/AudioOutDriver.cpp b/sources/Services/Audio/AudioOutDriver.cpp index 29123075..d6211b06 100644 --- a/sources/Services/Audio/AudioOutDriver.cpp +++ b/sources/Services/Audio/AudioOutDriver.cpp @@ -1,11 +1,10 @@ #include "AudioOutDriver.h" +#include "System/System/System.h" #include "AudioDriver.h" #include "Application/Player/SyncMaster.h" // Should be installable -#include "Services/Time/TimeService.h" #include "System/Console/Trace.h" -#include "System/System/System.h" - +#include "Services/Time/TimeService.h" AudioOutDriver::AudioOutDriver(AudioDriver &driver) { driver_=&driver ; @@ -146,4 +145,4 @@ int AudioOutDriver::GetAudioPreBufferCount() { } ; double AudioOutDriver::GetStreamTime() { return driver_->GetStreamTime() ; -} ; +} ; \ No newline at end of file diff --git a/sources/Services/Controllers/ButtonControllerSource.cpp b/sources/Services/Controllers/ButtonControllerSource.cpp index 225385a0..6a2fb90d 100644 --- a/sources/Services/Controllers/ButtonControllerSource.cpp +++ b/sources/Services/Controllers/ButtonControllerSource.cpp @@ -1,6 +1,6 @@ #include "ButtonControllerSource.h" -#include #include "System/Console/Trace.h" +#include ButtonControllerSource::ButtonControllerSource(const char *name):ControllerSource("but",name) { } ; diff --git a/sources/Services/Controllers/Channel.cpp b/sources/Services/Controllers/Channel.cpp index 8a7a037b..13d2a53e 100644 --- a/sources/Services/Controllers/Channel.cpp +++ b/sources/Services/Controllers/Channel.cpp @@ -1,9 +1,8 @@ #include "Channel.h" -#include -#include #include "System/Console/Trace.h" - +#include +#include Channel::Channel() { name_="unnamed" ; } ; @@ -42,4 +41,4 @@ void Channel::SetName(const char *name) { const char *Channel::GetName() { return name_.c_str() ; -} ; +} ; \ No newline at end of file diff --git a/sources/Services/Controllers/ControlNode.cpp b/sources/Services/Controllers/ControlNode.cpp index edea4c58..7503d41e 100644 --- a/sources/Services/Controllers/ControlNode.cpp +++ b/sources/Services/Controllers/ControlNode.cpp @@ -1,7 +1,7 @@ #include "Services/Controllers/ControllerService.h" #include "ControlNode.h" -#include #include "System/Console/Trace.h" +#include using namespace std; diff --git a/sources/Services/Controllers/ControlNode.h b/sources/Services/Controllers/ControlNode.h index 6a0b60c3..4b22f281 100644 --- a/sources/Services/Controllers/ControlNode.h +++ b/sources/Services/Controllers/ControlNode.h @@ -3,8 +3,8 @@ #define _CONTROL_NODE_H_ #include "Foundation/T_SimpleList.h" -#include "Foundation/Observable.h" #include "Services/Controllers/Channel.h" +#include "Foundation/Observable.h" #include "Services/Controllers/ControllerService.h" enum ControlNodeType { diff --git a/sources/Services/Controllers/ControllerService.cpp b/sources/Services/Controllers/ControllerService.cpp index e529b1da..01636e25 100644 --- a/sources/Services/Controllers/ControllerService.cpp +++ b/sources/Services/Controllers/ControllerService.cpp @@ -1,8 +1,9 @@ +#include "System/Console/Trace.h" +//#include "Framework/Types/Types.h" #include "ControllerService.h" -#include #include #include -#include "System/Console/Trace.h" +#include using namespace std; diff --git a/sources/Services/Controllers/ControllerService.h b/sources/Services/Controllers/ControllerService.h index ae374989..53c39c8d 100644 --- a/sources/Services/Controllers/ControllerService.h +++ b/sources/Services/Controllers/ControllerService.h @@ -4,9 +4,10 @@ #include "Foundation/T_Singleton.h" #include "Foundation/T_SimpleList.h" -#include "Services/Time/TimeService.h" + #include "ControllerSource.h" #include "ControllableVariable.h" +#include "Services/Time/TimeService.h" class ControllerService: public T_Singleton,public T_SimpleList { public: diff --git a/sources/Services/Controllers/ControllerSource.cpp b/sources/Services/Controllers/ControllerSource.cpp index bf5eade0..d83e7694 100644 --- a/sources/Services/Controllers/ControllerSource.cpp +++ b/sources/Services/Controllers/ControllerSource.cpp @@ -1,6 +1,7 @@ #include "ControllerSource.h" #include "ControllerService.h" +//#include "System/Memory/Memory.h" #include ControllerSource::ControllerSource(const char *devclass,const char *name) { @@ -20,4 +21,4 @@ const char *ControllerSource::GetClass() { const char *ControllerSource::GetName() { return name_.c_str() ; -} ; +} ; \ No newline at end of file diff --git a/sources/Services/Controllers/ControllerSource.h b/sources/Services/Controllers/ControllerSource.h index 8e5b19cc..925ccc7e 100644 --- a/sources/Services/Controllers/ControllerSource.h +++ b/sources/Services/Controllers/ControllerSource.h @@ -1,9 +1,9 @@ #ifndef _CONTROLLER_SOURCE_H_ #define _CONTROLLER_SOURCE_H_ +#include "Channel.h" #include #include "Services/Time/TimeService.h" -#include "Channel.h" class ControllerSource { public: diff --git a/sources/Services/Controllers/HatControllerSource.cpp b/sources/Services/Controllers/HatControllerSource.cpp index b9c2c33d..c91a4603 100644 --- a/sources/Services/Controllers/HatControllerSource.cpp +++ b/sources/Services/Controllers/HatControllerSource.cpp @@ -1,6 +1,6 @@ #include "HatControllerSource.h" -#include #include "System/Console/Trace.h" +#include HatControllerSource::HatControllerSource(const char *name):ControllerSource("hat",name) { } ; diff --git a/sources/Services/Controllers/KeyboardControllerSource.cpp b/sources/Services/Controllers/KeyboardControllerSource.cpp index 0e63248e..d0622c15 100644 --- a/sources/Services/Controllers/KeyboardControllerSource.cpp +++ b/sources/Services/Controllers/KeyboardControllerSource.cpp @@ -1,8 +1,7 @@ #include "KeyboardControllerSource.h" -#include -#include "System/Console/Trace.h" #include "UIFramework/Interfaces/I_GUIWindowFactory.h" - +#include "System/Console/Trace.h" +#include KeyboardControllerSource::KeyboardControllerSource(const char *name):ControllerSource("key",name) { memset(channel_,0,MAX_KEY*sizeof(Channel *)) ; diff --git a/sources/Services/Midi/MidiEvent.cpp b/sources/Services/Midi/MidiEvent.cpp index 1ef12b93..065fbe08 100644 --- a/sources/Services/Midi/MidiEvent.cpp +++ b/sources/Services/Midi/MidiEvent.cpp @@ -1,7 +1,7 @@ #include "MidiEvent.h" -#include #include "System/System/System.h" +#include MidiEvent::MidiEvent(unsigned char status,unsigned char data1,unsigned char data2) { diff --git a/sources/Services/Midi/MidiInDevice.cpp b/sources/Services/Midi/MidiInDevice.cpp index 87669eee..3ba59658 100644 --- a/sources/Services/Midi/MidiInDevice.cpp +++ b/sources/Services/Midi/MidiInDevice.cpp @@ -1,7 +1,7 @@ #include "MidiInDevice.h" -#include "Application/Model/Config.h" -#include "System/Console/Trace.h" #include "System/System/System.h" +#include "System/Console/Trace.h" +#include "Application/Model/Config.h" using namespace std; diff --git a/sources/Services/Midi/MidiInMerger.h b/sources/Services/Midi/MidiInMerger.h index 6694285f..3396ad05 100644 --- a/sources/Services/Midi/MidiInMerger.h +++ b/sources/Services/Midi/MidiInMerger.h @@ -3,9 +3,9 @@ #include "MidiChannel.h" #include "MidiInDevice.h" -#include -#include +#include +#include typedef std::map tChannelMap ; @@ -20,4 +20,4 @@ class MidiInMerger: public Observable, public ControllerSource,public T_SimpleLi tChannelMap channels_ ; } ; -#endif +#endif \ No newline at end of file diff --git a/sources/Services/Midi/MidiMessage.h b/sources/Services/Midi/MidiMessage.h index fd423829..154788a3 100644 --- a/sources/Services/Midi/MidiMessage.h +++ b/sources/Services/Midi/MidiMessage.h @@ -1,7 +1,7 @@ #pragma once -#include "Foundation/Observable.h" #include "Foundation/Types/Types.h" +#include "Foundation/Observable.h" #include "MidiMessage.h" struct MidiMessage:public I_ObservableData @@ -43,4 +43,4 @@ struct MidiMessage:public I_ObservableData unsigned char status_ ; unsigned char data1_ ; unsigned char data2_ ; -}; +}; \ No newline at end of file diff --git a/sources/Services/Midi/MidiService.cpp b/sources/Services/Midi/MidiService.cpp index 4f16732e..d456804a 100644 --- a/sources/Services/Midi/MidiService.cpp +++ b/sources/Services/Midi/MidiService.cpp @@ -1,9 +1,10 @@ #include "MidiService.h" -#include "Application/Model/Config.h" #include "Application/Player/SyncMaster.h" -#include "Services/Audio/AudioDriver.h" #include "System/Console/Trace.h" #include "System/Timer/Timer.h" +#include "Application/Model/Config.h" +#include "Services/Audio/AudioDriver.h" +#include "System/Console/Trace.h" #ifdef SendMessage #undef SendMessage diff --git a/sources/System/Console/Trace.cpp b/sources/System/Console/Trace.cpp index 7fb75b86..d18a7ba8 100644 --- a/sources/System/Console/Trace.cpp +++ b/sources/System/Console/Trace.cpp @@ -1,8 +1,9 @@ +#include "System/System/System.h" #include "Trace.h" -#include #include +#include #include -#include "System/System/System.h" + Trace::Trace() :logger_(0) diff --git a/sources/System/Console/n_assert.cpp b/sources/System/Console/n_assert.cpp index 3a1c0582..ef503323 100644 --- a/sources/System/Console/n_assert.cpp +++ b/sources/System/Console/n_assert.cpp @@ -1,7 +1,7 @@ #include "System/Console/Trace.h" -#include #include +#include void __NAssert(const char *exp, const char *file, unsigned line) { const char *filestr=file ; diff --git a/sources/System/FileSystem/FileSystem.cpp b/sources/System/FileSystem/FileSystem.cpp index a7c61b4e..168c793f 100644 --- a/sources/System/FileSystem/FileSystem.cpp +++ b/sources/System/FileSystem/FileSystem.cpp @@ -1,7 +1,7 @@ #include "FileSystem.h" -#include #include "Application/Utils/wildcard.h" #include "System/Console/Trace.h" +#include T_SimpleList Path::aliases_(true) ; @@ -215,4 +215,4 @@ int FileSystemService::Copy(const Path &src,const Path &dst) isrc->Close(); idst->Close(); return nbwrite; -} +} \ No newline at end of file diff --git a/sources/System/FileSystem/FileSystem.h b/sources/System/FileSystem/FileSystem.h index 5a66038b..a915ffc8 100644 --- a/sources/System/FileSystem/FileSystem.h +++ b/sources/System/FileSystem/FileSystem.h @@ -1,14 +1,14 @@ #ifndef _FILESYSTEM_H_ #define _FILESYSTEM_H_ -#include -#include -#include +#include "System/System/System.h" #include "Foundation/T_Factory.h" #include "Foundation/T_SimpleList.h" #include "Foundation/Types/Types.h" #include "System/Errors/Result.h" -#include "System/System/System.h" +#include +#include +#include #define MAX_FILENAME_SIZE 256 diff --git a/sources/System/Process/Process.cpp b/sources/System/Process/Process.cpp index 172dc281..c3a772ff 100644 --- a/sources/System/Process/Process.cpp +++ b/sources/System/Process/Process.cpp @@ -1,7 +1,7 @@ #include "Process.h" -#include "System/Console/n_assert.h" #include "System/Console/Trace.h" +#include "System/Console/n_assert.h" bool SysThread::Start() { return SysProcessFactory::GetInstance()->BeginThread(*this) ; diff --git a/sources/System/Timer/Timer.h b/sources/System/Timer/Timer.h index 4bf57375..2936dcd6 100644 --- a/sources/System/Timer/Timer.h +++ b/sources/System/Timer/Timer.h @@ -1,8 +1,8 @@ #ifndef _TIMER_H_ #define _TIMER_H_ -#include "Foundation/Observable.h" #include "Foundation/T_Factory.h" +#include "Foundation/Observable.h" typedef void (*timerCallback)() ; diff --git a/sources/System/_Midi/Midi.cpp b/sources/System/_Midi/Midi.cpp index 5575fb94..1e86572f 100644 --- a/sources/System/_Midi/Midi.cpp +++ b/sources/System/_Midi/Midi.cpp @@ -1,6 +1,6 @@ #include "Midi.h" -#include "Application/Player/SyncMaster.h" #include "System/io/Trace.h" +#include "Application/Player/SyncMaster.h" Midi::Midi() { for (int i=0;i #include +#include //#include void Status::Set(char *fmt, ...) { diff --git a/sources/UIFramework/BasicDatas/GUIBitmap.cpp b/sources/UIFramework/BasicDatas/GUIBitmap.cpp index fe7c282e..ca0cbb51 100644 --- a/sources/UIFramework/BasicDatas/GUIBitmap.cpp +++ b/sources/UIFramework/BasicDatas/GUIBitmap.cpp @@ -1,9 +1,9 @@ #include "GUIBitmap.h" -#include #include "UIFramework/Interfaces/I_GUIWindowFactory.h" //#include "Engine/ENGBitmap.h" #define ENGBitmap int +#include // This constructor. We wrap the class around an Implementation class // That way, we can change the imps we use without changing the core code diff --git a/sources/UIFramework/BasicDatas/GUIBitmap.h b/sources/UIFramework/BasicDatas/GUIBitmap.h index 89c8f953..b9486349 100644 --- a/sources/UIFramework/BasicDatas/GUIBitmap.h +++ b/sources/UIFramework/BasicDatas/GUIBitmap.h @@ -1,8 +1,8 @@ #ifndef _GUIBITMAP_H_ #define _GUIBITMAP_H_ -#include "UIFramework/BasicDatas/GUIResourceID.h" #include "UIFramework/Interfaces/I_GUIBitmapImp.h" +#include "UIFramework/BasicDatas/GUIResourceID.h" // Class for Bitmap description in GUI. The bitmap is drawable so // it implements I_GUIGraphics diff --git a/sources/UIFramework/Framework/GUIParentGraphics.cpp b/sources/UIFramework/Framework/GUIParentGraphics.cpp index f4f1d5b6..b6b09536 100644 --- a/sources/UIFramework/Framework/GUIParentGraphics.cpp +++ b/sources/UIFramework/Framework/GUIParentGraphics.cpp @@ -1,7 +1,7 @@ #include "GUIParentGraphics.h" -#include "Application/utils/assert.h" #include "UIFramework/BasicDatas/GUIBitmap.h" +#include "Application/utils/assert.h" GUIParentGraphics::GUIParentGraphics() { diff --git a/sources/UIFramework/Framework/GUIParentGraphics.h b/sources/UIFramework/Framework/GUIParentGraphics.h index 5eceff0e..96fbd98b 100644 --- a/sources/UIFramework/Framework/GUIParentGraphics.h +++ b/sources/UIFramework/Framework/GUIParentGraphics.h @@ -3,9 +3,10 @@ #define _GUIPARENTGRAPHICS_H_ #include "UIFramework/Interfaces/I_GUIGraphics.h" -#include #include "UIFramework/Interfaces/I_GUIControl.h" +#include + class GUIParentGraphics: public I_GUIGraphics { public: diff --git a/sources/UIFramework/Interfaces/I_GUIGraphics.h b/sources/UIFramework/Interfaces/I_GUIGraphics.h index 9b725e1f..91abc43f 100644 --- a/sources/UIFramework/Interfaces/I_GUIGraphics.h +++ b/sources/UIFramework/Interfaces/I_GUIGraphics.h @@ -1,8 +1,8 @@ #ifndef _I_GUIGRAPHICS_H_ #define _I_GUIGRAPHICS_H_ -#include "UIFramework/BasicDatas/GUIRect.h" #include "UIFramework/Framework/GUIColor.h" +#include "UIFramework/BasicDatas/GUIRect.h" #include "UIFramework/Framework/GUITextProperties.h" //#include "Engine/ENGBitmap.h" diff --git a/sources/UIFramework/Interfaces/I_GUIWindowFactory.h b/sources/UIFramework/Interfaces/I_GUIWindowFactory.h index 8ff9e9f4..2cf7dc2f 100644 --- a/sources/UIFramework/Interfaces/I_GUIWindowFactory.h +++ b/sources/UIFramework/Interfaces/I_GUIWindowFactory.h @@ -3,8 +3,9 @@ #define _I_GUIWINDOWFACTORY_H_ #include "I_GUIWindowImp.h" -#include "UIFramework/BasicDatas/GUICreateWindowParams.h" #include "UIFramework/SimpleBaseClasses/EventManager.h" + +#include "UIFramework/BasicDatas/GUICreateWindowParams.h" #include "Foundation/T_Factory.h" // The GUI factory. This object is responsible for the creation of all diff --git a/sources/UIFramework/Interfaces/I_GUIWindowImp.h b/sources/UIFramework/Interfaces/I_GUIWindowImp.h index bf343995..93189ee8 100644 --- a/sources/UIFramework/Interfaces/I_GUIWindowImp.h +++ b/sources/UIFramework/Interfaces/I_GUIWindowImp.h @@ -1,9 +1,9 @@ #ifndef _I_GUIWINDOWIMP_H_ #define _I_GUIWINDOWIMP_H_ -#include "UIFramework/BasicDatas/GUIEvent.h" #include "UIFramework/BasicDatas/GUICreateWindowParams.h" #include "I_GUIGraphics.h" +#include "UIFramework/BasicDatas/GUIEvent.h" class I_GUIWindowFactory ; // forward declaration class GUIWindow ; diff --git a/sources/UIFramework/SimpleBaseClasses/EventManager.cpp b/sources/UIFramework/SimpleBaseClasses/EventManager.cpp index 5aa24cd7..fe55efb0 100644 --- a/sources/UIFramework/SimpleBaseClasses/EventManager.cpp +++ b/sources/UIFramework/SimpleBaseClasses/EventManager.cpp @@ -8,9 +8,9 @@ */ #include "EventManager.h" -#include "Application/Commands/NodeList.h" -#include "Application/Controllers/ControlRoom.h" #include "Application/Model/Config.h" +#include "Application/Controllers/ControlRoom.h" +#include "Application/Commands/NodeList.h" bool EventManager::Init() { return true ; @@ -68,4 +68,4 @@ void EventManager::InstallMappings() { cr->Attach(URL_VOLUME_INCREASE,mapping_[APP_BUTTON_VOLINC].c_str()) ; cr->Attach(URL_VOLUME_DECREASE,mapping_[APP_BUTTON_VOLDEC].c_str()) ; -} +} \ No newline at end of file diff --git a/sources/UIFramework/SimpleBaseClasses/GUIWindow.cpp b/sources/UIFramework/SimpleBaseClasses/GUIWindow.cpp index ff6f8062..e8361d2a 100644 --- a/sources/UIFramework/SimpleBaseClasses/GUIWindow.cpp +++ b/sources/UIFramework/SimpleBaseClasses/GUIWindow.cpp @@ -1,7 +1,7 @@ #include "GUIWindow.h" -#include "UIFramework/Interfaces/I_GUIWindowFactory.h" #include "UIFramework/Interfaces/I_GUIWindowImp.h" +#include "UIFramework/Interfaces/I_GUIWindowFactory.h" // Constructor: We wrap the window around an implementation that // will be used to provide system functionalities @@ -91,4 +91,4 @@ bool GUIWindow::DispatchEvent(GUIEvent &event) void GUIWindow::PushEvent(GUIEvent &event) { _imp->PushEvent(event) ; -} ; +} ; \ No newline at end of file From 7e1729544b1579d15abe3ce2f61689a278bd8834 Mon Sep 17 00:00:00 2001 From: Simon Lees Date: Tue, 6 Aug 2024 11:39:10 +0930 Subject: [PATCH 22/66] Restore DEB target to SDL1 32bit Also make some other makefiles more consistent. --- projects/Makefile | 26 ++++++++++++++++++++++---- projects/Makefile.DEB | 31 +++++++++++++++++++++++-------- projects/Makefile.X64 | 8 ++++++-- projects/Makefile.X86 | 21 ++++++++++++++++----- 4 files changed, 67 insertions(+), 19 deletions(-) diff --git a/projects/Makefile b/projects/Makefile index 193b5871..dab5ae33 100644 --- a/projects/Makefile +++ b/projects/Makefile @@ -4,7 +4,7 @@ .SUFFIXES: #--------------------------------------------------------------------------------- -PLATFORM := RASPI +PLATFORM := X64 FONT := original.bmp include $(PWD)/Makefile.$(PLATFORM) @@ -65,6 +65,13 @@ LINUXDIRS := \ ../sources/Adapters/Unix/FileSystem \ ../sources/Adapters/Unix/Process \ ../sources/System/Process + +DBDIRS := \ + ../sources/Adapters/DEB/Main \ + ../sources/Adapters/DEB/System \ + ../sources/Adapters/Unix/FileSystem \ + ../sources/Adapters/Unix/Process \ + ../sources/System/Process DUMMYMIDIDIRS := \ ../sources/Adapters/Dummy/Midi @@ -96,8 +103,8 @@ SDLAUDIODIRS := \ SDL2AUDIODIRS := \ ../sources/Adapters/SDL2/Audio -BEAGLEBOARDDIRS := $(LINUXDIRS) $(RTAUDIODIRS) $(SDLDIRS) -DEBDIRS := $(LINUXDIRS) $(JACKDIRS) $(RTAUDIODIRS) $(RTMIDIDIRS) $(SDLDIRS) +BEAGLEBOARDDIRS := $(LINUXDIRS) $(DUMMYMIDIDIRS) $(RTAUDIODIRS) $(SDLDIRS) +DEBDIRS := $(DBDIRS) $(JACKDIRS) $(RTAUDIODIRS) $(RTMIDIDIRS) $(SDLDIRS) RASPIDIRS := $(LINUXDIRS) $(JACKDIRS) $(RTAUDIODIRS) $(RTMIDIDIRS) $(SDLDIRS) STEAMDIRS := $(LINUXDIRS) $(JACKDIRS) $(RTAUDIODIRS) $(RTMIDIDIRS) $(SDLDIRS) #X64DIRS := $(LINUXDIRS) $(RTMIDIDIRS) $(SDL2DIRS) $(SDL2AUDIODIRS) @@ -268,6 +275,17 @@ LINUXFILES := \ Process.o \ UnixProcess.o \ SDLTimer.o + +DBFILES := \ + UnixFileSystem.o \ + DEBmain.o \ + DEBSystem.o \ + GUIFactory.o \ + SDLGUIWindowImp.o \ + SDLEventManager.o \ + Process.o \ + UnixProcess.o \ + SDLTimer.o DUMMYMIDIFILES := \ DummyMidi.o @@ -292,7 +310,7 @@ SDLAUDIOFILES := \ SDLAudioDriver.o \ SDLAudio.o -DEBFILES := $(LINUXFILES) $(RTAUDIOFILES) $(RTMIDIFILES) $(JACKFILES) +DEBFILES := $(DBFILES) $(RTAUDIOFILES) $(RTMIDIFILES) $(JACKFILES) BEAGLEBOARDFILES := $(LINUXFILES) $(DUMMYMIDIFILES) RASPIFILES := $(LINUXFILES) $(RTAUDIOFILES) $(RTMIDIFILES) $(JACKFILES) STEAMFILES := $(LINUXFILES) $(RTAUDIOFILES) $(RTMIDIFILES) $(JACKFILES) diff --git a/projects/Makefile.DEB b/projects/Makefile.DEB index 246f44f9..00f8c6d5 100644 --- a/projects/Makefile.DEB +++ b/projects/Makefile.DEB @@ -1,15 +1,30 @@ -include $(PWD)/rules_base -LDFLAGS := -m32 -%.deb-exe: $(OFILES) - $(CXX) $(LDFLAGS) $@ $(OFILES) $(LIBS) +# config +DEFINES := \ + -DCPP_MEMORY \ + -D_DEBUG \ + -D__LINUX_ALSA__ \ + -D__LINUX_ALSASEQ__ -CFLAGS := -m32 -O3 -DCPP_MEMORY -Wall -I/usr/local/include -I$(PWD)/../sources -D__LINUX_ALSA__ -D__LINUX_ALSASEQ__ -D_DEBUG -LIBS := -O3 -L/local/lib -Wl,-rpath,/usr/local/lib -lasound -lSDL -ljack -lpthread +ALSA_CFLAGS := $(shell pkg-config alsa --cflags) +ALSA_LIBS := $(shell pkg-config alsa --libs) +JACK_CFLAGS := $(shell pkg-config jack --cflags) +JACK_LIBS := $(shell pkg-config jack --libs) +SDL_CFLAGS := $(shell pkg-config sdl --cflags) +SDL_LIBS := $(shell pkg-config sdl --libs) +# optimization +OPT_FLAGS := -O3 -m32 #For debugging -#LIBS := -g -L/local/lib -Wl,-rpath,/usr/local/lib -lasound -lSDL -ljack -lpthread -#CFLAGS := -g -m32 -DCPP_MEMORY -Wall -I/usr/local/include -I$(PWD)/../sources -D__LINUX_ALSA__ -D__LINUX_ALSASEQ__ - +# OPT_FLAGS := -g -m32 +INCLUDES := -I/usr/local/include $(ALSA_CFLAGS) $(JACK_CFLAGS) $(SDL_CFLAGS) -I$(PWD)/../sources +CFLAGS := $(OPT_FLAGS) $(DEFINES) $(INCLUDES) -Wall CXXFLAGS:= $(CFLAGS) +LIBS := -O3 -L/local/lib -Wl,-rpath,/usr/local/lib $(ALSA_LIBS) $(JACK_LIBS) $(SDL_LIBS) +LDFLAGS := -m32 + EXTENSION:= deb-exe + +%.deb-exe: $(OFILES) + $(CXX) $(LDFLAGS) $@ $(OFILES) $(LIBS) diff --git a/projects/Makefile.X64 b/projects/Makefile.X64 index 02f16314..7fadf8c5 100644 --- a/projects/Makefile.X64 +++ b/projects/Makefile.X64 @@ -2,10 +2,10 @@ # config DEFINES := \ + -D_64BIT \ -DCPP_MEMORY \ -D__LINUX_ALSA__ \ -D__LINUX_ALSASEQ__ \ - -D_64BIT \ -DSDL2 \ -DSDLAUDIO \ -DDUMMYMIDI @@ -18,7 +18,11 @@ SDL_CFLAGS := $(shell pkg-config sdl2 --cflags) SDL_LIBS := $(shell pkg-config sdl2 --libs) # optimization -CFLAGS := $(DEFINES) -g -O3 -Wall $(ALSA_CFLAGS) $(JACK_CFLAGS) $(SDL_CFLAGS) -I$(PWD)/../sources +OPT_FLAGS := -O3 +#For debugging +OPT_FLAGS := -g +INCLUDES := $(ALSA_CFLAGS) $(JACK_CFLAGS) $(SDL_CFLAGS) -I$(PWD)/../sources +CFLAGS := $(OPT_FLAGS) $(DEFINES) $(INCLUDES) -Wall CXXFLAGS := $(CFLAGS) -std=gnu++03 LIBS := $(ALSA_LIBS) $(JACK_LIBS) $(SDL_LIBS) OUTPUT := ../lgpt diff --git a/projects/Makefile.X86 b/projects/Makefile.X86 index 60d6f4de..14c670df 100644 --- a/projects/Makefile.X86 +++ b/projects/Makefile.X86 @@ -5,14 +5,25 @@ DEFINES := \ -DCPP_MEMORY \ -D__LINUX_ALSA__ \ -D__LINUX_ALSASEQ__ \ - -DJACKAUDIO \ - -DRTAUDIO \ - -DRTMIDI + -DSDL2 \ + -DSDLAUDIO \ + -DDUMMYMIDI + +ALSA_CFLAGS := $(shell pkg-config alsa --cflags) +ALSA_LIBS := $(shell pkg-config alsa --libs) +JACK_CFLAGS := $(shell pkg-config jack --cflags) +JACK_LIBS := $(shell pkg-config jack --libs) +SDL_CFLAGS := $(shell pkg-config sdl2 --cflags) +SDL_LIBS := $(shell pkg-config sdl2 --libs) # optimization -CFLAGS := -m32 -O3 -Wall -I/usr/local/include -I$(PWD)/../sources +OPT_FLAGS := -O3 -m32 +#For debugging +#OPT_FLAGS := -g -m32 +INCLUDES := $(ALSA_CFLAGS) $(JACK_CFLAGS) $(SDL_CFLAGS) -I$(PWD)/../sources +CFLAGS := $(OPT_FLAGS) $(DEFINES) $(INCLUDES) -Wall CXXFLAGS := $(CFLAGS) -LIBS := -L/local/lib -Wl,-rpath,/usr/local/lib -lasound -lSDL -ljack -lpthread +LIBS := $(ALSA_LIBS) $(JACK_LIBS) $(SDL_LIBS) LDFLAGS := -m32 OUTPUT = ../lgpt EXTENSION := x86 From 649c1cfd4a1585936576476c6d8326fea73c3cb5 Mon Sep 17 00:00:00 2001 From: Simon Lees Date: Fri, 9 Aug 2024 18:04:15 +0930 Subject: [PATCH 23/66] Trigger workflows on this test branch --- .github/workflows/build.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2fb008f5..011bd28f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,6 +1,10 @@ name: Multi platform build on: + push: + branches: + - "workflow-test" + workflow_dispatch: jobs: From 161a619f61eae248406f689bda9126dd2b9341c3 Mon Sep 17 00:00:00 2001 From: Simon Lees Date: Fri, 9 Aug 2024 20:43:42 +0930 Subject: [PATCH 24/66] Console Makefile cleanup/fix * Fix a regression with midi/audio files being included in some makefiles * Remove PLUSH we already have RG35XX * Partially add RG35XXS for running on the Stock ROM with SDL2 Support --- projects/Makefile | 24 +++++++++++++++++------- projects/Makefile.PLUSH | 33 --------------------------------- 2 files changed, 17 insertions(+), 40 deletions(-) delete mode 100644 projects/Makefile.PLUSH diff --git a/projects/Makefile b/projects/Makefile index dab5ae33..9f8a0b3b 100644 --- a/projects/Makefile +++ b/projects/Makefile @@ -4,7 +4,7 @@ .SUFFIXES: #--------------------------------------------------------------------------------- -PLATFORM := X64 +PLATFORM := RASPI FONT := original.bmp include $(PWD)/Makefile.$(PLATFORM) @@ -106,6 +106,7 @@ SDL2AUDIODIRS := \ BEAGLEBOARDDIRS := $(LINUXDIRS) $(DUMMYMIDIDIRS) $(RTAUDIODIRS) $(SDLDIRS) DEBDIRS := $(DBDIRS) $(JACKDIRS) $(RTAUDIODIRS) $(RTMIDIDIRS) $(SDLDIRS) RASPIDIRS := $(LINUXDIRS) $(JACKDIRS) $(RTAUDIODIRS) $(RTMIDIDIRS) $(SDLDIRS) +RG35XXSDIRS := $(LINUXDIRS) $(DUMMYMIDIDIRS) $(SDL2DIRS) $(SDL2AUDIODIRS) STEAMDIRS := $(LINUXDIRS) $(JACKDIRS) $(RTAUDIODIRS) $(RTMIDIDIRS) $(SDLDIRS) #X64DIRS := $(LINUXDIRS) $(RTMIDIDIRS) $(SDL2DIRS) $(SDL2AUDIODIRS) X64DIRS := $(LINUXDIRS) $(DUMMYMIDIDIRS) $(SDL2DIRS) $(SDL2AUDIODIRS) @@ -127,7 +128,7 @@ CAANOODIRS := \ ../sources/Adapters/SDL/GUI \ ../sources/Adapters/SDL/Timer -DINGOODIRS := \ +DINGUXDIRS := \ . \ ../sources/Adapters/DINGOO/Main \ ../sources/Adapters/Unix/FileSystem \ @@ -140,11 +141,19 @@ DINGOODIRS := \ ../sources/Adapters/SDL/Process \ ../sources/Adapters/SDL/GUI \ ../sources/Adapters/SDL/Timer + +DINGUXAUDIODIRS := \ + ../sources/Adapters/DINGOO/Midi \ + ../sources/Adapters/DINGOO/Audio + +DUMMYMIDIDIRS := \ + ../sources/Adapters/Dummy/Midi -RS97DIRS := $(DINGOODIRS) -BITTBOYDIRS := $(DINGOODIRS) -MIYOODIRS := $(DINGOODIRS) -PLUSHDIRS := $(MIYOODIRS) +BITTBOYDIRS := $(DINGUXDIRS) $(DINGUXAUDIODIRS) +DINGOODIRS := $(DINGUXDIRS) $(DINGUXAUDIODIRS) $(DUMMYMIDIDIRS) +MIYOODIRS := $(DINGUXDIRS) $(DUMMYMIDIDIRS) +RG35XXGDIRS := $(MIYOODIRS) +RS97DIRS := $(DINGUXDIRS) $(DINGUXAUDIODIRS) GP2XDIRS := \ . \ @@ -313,6 +322,7 @@ SDLAUDIOFILES := \ DEBFILES := $(DBFILES) $(RTAUDIOFILES) $(RTMIDIFILES) $(JACKFILES) BEAGLEBOARDFILES := $(LINUXFILES) $(DUMMYMIDIFILES) RASPIFILES := $(LINUXFILES) $(RTAUDIOFILES) $(RTMIDIFILES) $(JACKFILES) +RG35XXSFILES := $(LINUXFILES) $(SDLAUDIOFILES) $(DUMMYMIDIFILES) STEAMFILES := $(LINUXFILES) $(RTAUDIOFILES) $(RTMIDIFILES) $(JACKFILES) #X64FILES := $(LINUXFILES) $(RTMIDIFILES) $(SDLAUDIOFILES) X64FILES := $(LINUXFILES) $(SDLAUDIOFILES) $(DUMMYMIDIFILES) @@ -400,7 +410,7 @@ MIYOOFILES := \ MIYOOSystem.o \ SDLAudio.o -PLUSHFILES = $(MIYOOFILES) +RG35XXGDIRS = $(MIYOOFILES) NDSFILES := \ NDSmain.o \ diff --git a/projects/Makefile.PLUSH b/projects/Makefile.PLUSH deleted file mode 100644 index 68547f05..00000000 --- a/projects/Makefile.PLUSH +++ /dev/null @@ -1,33 +0,0 @@ --include $(PWD)/rules_base -STRIP = $(CROSS_COMPILE)strip - -%.arm7hf: $(OFILES) - $(CXX) $(LDFLAGS) -o $@ $(OFILES) $(LIBS) - @$(STRIP) $@ - -DEVKIT = /opt/arm-buildroot-linux-gnueabihf_sdk-buildroot/ -CROSS_COMPILE = $(DEVKIT)bin/arm-buildroot-linux-gnueabihf- - -CC = $(CROSS_COMPILE)gcc -CXX = $(CROSS_COMPILE)g++ -SYSROOT := $(shell $(CROSS_COMPILE)gcc --print-sysroot) -SDL_CFLAGS := -I/opt/arm-buildroot-linux-gnueabihf_sdk-buildroot/arm-buildroot-linux-gnueabihf/sysroot/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -SDL_LIBS := -L/opt/arm-buildroot-linux-gnueabihf_sdk-buildroot/arm-buildroot-linux-gnueabihf/sysroot/usr/lib -lSDL - -DEFINES = -DHAVE_STDINT_H -D_NDEBUG -D_NO_JACK_ -I$(PWD)/../sources -DCPP_MEMORY $(SDL_CFLAGS) $(SDL_LIBS) -DBUFFERED -INCLUDES = -Iinclude $(SDL_CFLAGS) -OPT_FLAGS = -O3 -Ofast -fdata-sections -fdata-sections -fno-common -fno-PIC -flto -marm -mtune=cortex-a53 - -OUTPUT = ../lgpt-rg35xxplush24 - -TOOLPATH = $(DEVKIT)/usr/bin -PREFIX := arm-linux-gnueabihf- - -CFLAGS := $(DEFINES) $(INCLUDES) $(OPT_FLAGS) -Wall -CXXFLAGS := $(CFLAGS) -std=gnu++03 - -EXTENSION := arm7hf - -LIBS := -lSDL -lSDL_mixer -lpthread -LIBDIRS := $(DEKVIT)/usr/lib -LIBDIRS += $(DEKVIT)/usr/include From 46f8358534dd308ae492120d51c35b186b9a0e73 Mon Sep 17 00:00:00 2001 From: Simon Lees Date: Fri, 9 Aug 2024 21:23:30 +0930 Subject: [PATCH 25/66] Workflows: deb target needs pkgconf Now that we are using pkg-config to set the lib and include files for the deb target we need to make sure its installed on the CI --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 011bd28f..81bbefa2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -82,7 +82,7 @@ jobs: pip install Pillow sudo dpkg --add-architecture i386 sudo apt update - sudo apt install -y make gcc-multilib g++-multilib libsdl1.2-dev:i386 libasound2-plugins:i386 libjack-dev:i386 + sudo apt install -y make pkgconf gcc-multilib g++-multilib libsdl1.2-dev:i386 libasound2-plugins:i386 libjack-dev:i386 - name: Build DEB working-directory: projects From 3e53d45296073c07de63e95559220ddd38ee5d5a Mon Sep 17 00:00:00 2001 From: Simon Lees Date: Fri, 9 Aug 2024 22:21:46 +0930 Subject: [PATCH 26/66] Workflows: deb specify the PKG_CONFIG_PATH This is needed for cross compiling to 32 bit in ubuntu, if you were to compile on a 32bit machine this should do nothing. --- projects/Makefile.DEB | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/projects/Makefile.DEB b/projects/Makefile.DEB index 00f8c6d5..b00ec20e 100644 --- a/projects/Makefile.DEB +++ b/projects/Makefile.DEB @@ -7,12 +7,15 @@ DEFINES := \ -D__LINUX_ALSA__ \ -D__LINUX_ALSASEQ__ -ALSA_CFLAGS := $(shell pkg-config alsa --cflags) -ALSA_LIBS := $(shell pkg-config alsa --libs) -JACK_CFLAGS := $(shell pkg-config jack --cflags) -JACK_LIBS := $(shell pkg-config jack --libs) -SDL_CFLAGS := $(shell pkg-config sdl --cflags) -SDL_LIBS := $(shell pkg-config sdl --libs) +# When cross compiling on the CI we need to specify the correct path. +PKG_CONFIG_PATH := /usr/lib/i386-linux-gnu/pkgconfig + +ALSA_CFLAGS := $(shell PKG_CONFIG_PATH='$(PKG_CONFIG_PATH)' pkg-config alsa --cflags) +ALSA_LIBS := $(shell PKG_CONFIG_PATH='$(PKG_CONFIG_PATH)' pkg-config alsa --libs) +JACK_CFLAGS := $(shell PKG_CONFIG_PATH='$(PKG_CONFIG_PATH)' pkg-config jack --cflags) +JACK_LIBS := $(shell PKG_CONFIG_PATH='$(PKG_CONFIG_PATH)' pkg-config jack --libs) +SDL_CFLAGS := $(shell PKG_CONFIG_PATH='$(PKG_CONFIG_PATH)' pkg-config sdl --cflags) +SDL_LIBS := $(shell PKG_CONFIG_PATH='$(PKG_CONFIG_PATH)' pkg-config sdl --libs) # optimization OPT_FLAGS := -O3 -m32 From 8834f3b0d90fa017b2ae4c74eb6c5f9e79124d95 Mon Sep 17 00:00:00 2001 From: Simon Lees Date: Fri, 9 Aug 2024 23:07:50 +0930 Subject: [PATCH 27/66] DEBUG: Workspace --- .github/workflows/build.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 81bbefa2..c1b340d2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -276,3 +276,17 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} tag_name: ${{ steps.extract_tag.outputs.tag_name }} files: ./workspace/LittleGPTracker/projects/*.zip + +build-rg35xxS: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Clone and build LGPT + run: | + apt-add-repository --list + sudo chmod -R 777 ./workspace/LittleGPTracker/projects + sudo chown -R root:root ./workspace/LittleGPTracker/projects + From 4b441ec9cd64fb24651c2ae7f0550df5f086dfc4 Mon Sep 17 00:00:00 2001 From: Simon Lees Date: Sun, 11 Aug 2024 20:31:10 +0930 Subject: [PATCH 28/66] rg35xx: Makefile cleanup Now its more consistent with the other newer makefiles --- projects/Makefile.RG35XX | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/projects/Makefile.RG35XX b/projects/Makefile.RG35XX index 9a3ca9a2..f29b5d9e 100644 --- a/projects/Makefile.RG35XX +++ b/projects/Makefile.RG35XX @@ -1,34 +1,37 @@ -include $(PWD)/rules_base STRIP = $(CROSS_COMPILE)strip -%.elf: $(OFILES) - $(CXX) $(LDFLAGS) -o $@ $(OFILES) $(LIBS) - @$(STRIP) $@ +DEFINES := \ + -DBUFFERED \ + -DCPP_MEMORY \ + -D_NDEBUG \ + -DHAVE_STDINT_H \ + -D_NO_JACK_ -DEVKIT = /opt/miyoo/ -CROSS_COMPILE=$(DEVKIT)bin/arm-miyoo-linux-uclibcgnueabi- PLATFORM := RG35XX +DEVKIT = /opt/miyoo/ +CROSS_COMPILE=$(DEVKIT)bin/arm-miyoo-linux-uclibcgnueabi- CC = $(CROSS_COMPILE)gcc CXX = $(CROSS_COMPILE)g++ +TOOLPATH=$(DEVKIT)/usr/bin SYSROOT := $(shell $(CROSS_COMPILE)gcc --print-sysroot) + SDL_CFLAGS := $(shell $(SYSROOT)/usr/bin/sdl-config --cflags) SDL_LIBS := $(shell $(SYSROOT)/usr/bin/sdl-config --libs) -DEFINES = -DHAVE_STDINT_H -D_NDEBUG -D_NO_JACK_ -I$(PWD)/../sources -DCPP_MEMORY $(SDL_CFLAGS) $(SDL_LIBS) -DBUFFERED -INCLUDES = -Iinclude $(SDL_CFLAGS) +# optimization OPT_FLAGS = -O3 -Ofast -fdata-sections -fdata-sections -fno-common -fno-PIC -flto -marm -mtune=cortex-a53 -mfpu=neon-vfpv4 -mfloat-abi=hard - -OUTPUT = ../lgpt-rg35xx - -TOOLPATH=$(DEVKIT)/usr/bin -PREFIX := arm-linux-gnueabihf- - +PREFIX := arm-linux-gnueabihf- +INCLUDES:= -Iinclude $(SDL_CFLAGS) -I$(PWD)/../sources CFLAGS := $(DEFINES) $(INCLUDES) $(OPT_FLAGS) -Wall CXXFLAGS:= $(CFLAGS) -std=gnu++03 - -EXTENSION:= elf - -LIBS := -lSDL -lSDL_mixer -lpthread +LIBS := $(SDL_LIBS) -lpthread LIBDIRS := $(DEKVIT)/usr/lib LIBDIRS += $(DEKVIT)/usr/include +OUTPUT := ../lgpt-rg35xx +EXTENSION:= elf + +%.elf: $(OFILES) + $(CXX) $(LDFLAGS) -o $@ $(OFILES) $(LIBS) + @$(STRIP) $@ From 2db057d5720c4436899d0a81e087be491052bc6a Mon Sep 17 00:00:00 2001 From: Simon Lees Date: Sun, 11 Aug 2024 20:45:57 +0930 Subject: [PATCH 29/66] build.yaml, this shouldn't be here yet --- .github/workflows/build.yml | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c1b340d2..33976647 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -276,17 +276,4 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} tag_name: ${{ steps.extract_tag.outputs.tag_name }} files: ./workspace/LittleGPTracker/projects/*.zip - -build-rg35xxS: - runs-on: ubuntu-latest - - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - - name: Clone and build LGPT - run: | - apt-add-repository --list - sudo chmod -R 777 ./workspace/LittleGPTracker/projects - sudo chown -R root:root ./workspace/LittleGPTracker/projects From f20dcc699c48aa60560497dc10f0ef6efaefa06c Mon Sep 17 00:00:00 2001 From: Simon Lees Date: Sun, 11 Aug 2024 20:51:12 +0930 Subject: [PATCH 30/66] Rename Current rg35xx to rg35xxG The aim is to have a seperate build for GarlicOS (G) and the Stock OS (S) --- .github/workflows/build.yml | 5 +++-- projects/{Makefile.RG35XX => Makefile.RG35XXG} | 0 2 files changed, 3 insertions(+), 2 deletions(-) rename projects/{Makefile.RG35XX => Makefile.RG35XXG} (100%) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 33976647..5a3e2f15 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -236,7 +236,7 @@ jobs: tag_name: ${{ steps.extract_tag.outputs.tag_name }} files: ./projects/*.zip - build-rg35xx: + build-rg35xxg: runs-on: ubuntu-latest steps: @@ -250,7 +250,7 @@ jobs: apt update && apt install -y python3 python3-pillow git clone https://github.com/djdiskmachine/LittleGPTracker.git cd LittleGPTracker/projects - make PLATFORM=RG35XX + make PLATFORM=RG35XXG " sudo chmod -R 777 ./workspace/LittleGPTracker/projects sudo chown -R root:root ./workspace/LittleGPTracker/projects @@ -276,4 +276,5 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} tag_name: ${{ steps.extract_tag.outputs.tag_name }} files: ./workspace/LittleGPTracker/projects/*.zip + diff --git a/projects/Makefile.RG35XX b/projects/Makefile.RG35XXG similarity index 100% rename from projects/Makefile.RG35XX rename to projects/Makefile.RG35XXG From badbe4d2842885d7f31995843ccbc2e5bf14c77b Mon Sep 17 00:00:00 2001 From: Ivan Gavrilov Date: Mon, 12 Aug 2024 20:16:33 +0300 Subject: [PATCH 31/66] RG35XXH -> RG35XXPLUS --- projects/Makefile | 6 ++-- .../{Makefile.RG35XXH => Makefile.RG35XXPLUS} | 14 ++++----- projects/README.md | 9 +++++- projects/resources/RG35XXH/config.xml | 29 ------------------ projects/resources/RG35XXH/launch.sh | 6 ---- .../resources/RG35XXPLUS/INSTALL_HOWTO.txt | 22 +++++++++++++ projects/resources/RG35XXPLUS/README.md | 20 ++++++++++++ .../{RG35XXH => RG35XXPLUS}/config.json | 0 projects/resources/RG35XXPLUS/config.xml | 17 ++++++++++ .../RG35XXPLUS/garlicos/LittleGPTracker.sh | 6 ++++ .../{RG35XXH => RG35XXPLUS}/lgpt.png | Bin .../{RG35XXH => RG35XXPLUS}/mapping.xml | 0 .../RG35XXPLUS/muos/LittleGPTracker.sh | 15 +++++++++ 13 files changed, 98 insertions(+), 46 deletions(-) rename projects/{Makefile.RG35XXH => Makefile.RG35XXPLUS} (74%) delete mode 100644 projects/resources/RG35XXH/config.xml delete mode 100755 projects/resources/RG35XXH/launch.sh create mode 100644 projects/resources/RG35XXPLUS/INSTALL_HOWTO.txt create mode 100644 projects/resources/RG35XXPLUS/README.md rename projects/resources/{RG35XXH => RG35XXPLUS}/config.json (100%) create mode 100644 projects/resources/RG35XXPLUS/config.xml create mode 100755 projects/resources/RG35XXPLUS/garlicos/LittleGPTracker.sh rename projects/resources/{RG35XXH => RG35XXPLUS}/lgpt.png (100%) rename projects/resources/{RG35XXH => RG35XXPLUS}/mapping.xml (100%) create mode 100644 projects/resources/RG35XXPLUS/muos/LittleGPTracker.sh diff --git a/projects/Makefile b/projects/Makefile index 9725a366..6145d749 100644 --- a/projects/Makefile +++ b/projects/Makefile @@ -182,7 +182,7 @@ RG35XXDIRS := . \ # ../sources/Adapters/RTMidi \ # Disabled for now # ../sources/Externals/RtMidi -RG35XXHDIRS := . \ +RG35XXPLUSDIRS := . \ ../sources/Adapters/DINGOO/Main \ ../sources/Adapters/Unix/FileSystem \ ../sources/System/Process \ @@ -341,12 +341,12 @@ RG35XXFILES := GPSDLMain.o \ SDLEventManager.o \ DummyMidi.o \ SDLGUIWindowImp.o -# RtMidi.o \ #Disabled for now +# RtMidi.o \ #Disabled for now # RTMidiService.o \ # RTMidiOutDevice.o \ # RTMidiInDevice.o \ -RG35XXHFILES := GPSDLMain.o \ +RG35XXPLUSFILES := GPSDLMain.o \ UnixFileSystem.o \ SDLAudio.o \ Process.o \ diff --git a/projects/Makefile.RG35XXH b/projects/Makefile.RG35XXPLUS similarity index 74% rename from projects/Makefile.RG35XXH rename to projects/Makefile.RG35XXPLUS index 3e953bd7..e31fbad7 100644 --- a/projects/Makefile.RG35XXH +++ b/projects/Makefile.RG35XXPLUS @@ -5,10 +5,10 @@ STRIP = $(CROSS_COMPILE)strip $(CXX) $(LDFLAGS) -o $@ $(OFILES) $(LIBS) @$(STRIP) $@ -# compiled using the https://github.com/shauninman/union-rg35xx-toolchain +# compiled using the https://github.com/shauninman/union-rg35xxplus-toolchain # Docker image -DEVKIT = /opt/rg35xx-toolchain/usr/ +DEVKIT = /opt/rg35xxplus-toolchain/usr/ CROSS_COMPILE=$(DEVKIT)bin/arm-buildroot-linux-gnueabihf- CC = $(CROSS_COMPILE)gcc @@ -21,16 +21,16 @@ DEFINES = -DHAVE_STDINT_H -D_NDEBUG -D_NO_JACK_ -I$(PWD)/../sources -DCPP_MEMORY INCLUDES = -Iinclude $(SDL_CFLAGS) OPT_FLAGS = -O3 -Ofast -fdata-sections -fdata-sections -fno-common -fno-PIC -flto -marm -mtune=cortex-a53 -mfpu=neon-vfpv4 -mfloat-abi=hard -march=armv8-a -OUTPUT = ../lgpt-rg35xxh +OUTPUT = ../lgpt-rg35xxplus TOOLPATH=$(DEVKIT)/usr/bin PREFIX := arm-linux-gnueabihf- -CFLAGS := $(DEFINES) $(INCLUDES) $(OPT_FLAGS) -Wall -CXXFLAGS:= $(CFLAGS) -std=gnu++03 +CFLAGS := $(DEFINES) $(INCLUDES) $(OPT_FLAGS) -Wall +CXXFLAGS:= $(CFLAGS) -std=gnu++03 EXTENSION:= elf -LIBS := -lSDL -lpthread +LIBS := -lSDL -lpthread LIBDIRS := $(DEKVIT)/usr/lib -LIBDIRS += $(DEKVIT)/usr/include +LIBDIRS += $(DEKVIT)/usr/include diff --git a/projects/README.md b/projects/README.md index fc97122e..665ea83e 100644 --- a/projects/README.md +++ b/projects/README.md @@ -12,7 +12,7 @@ using nano ~/.bashrc, add export PSPDEV=~/pspdev export PATH=$PATH:$PSPDEV/bin - at the end, then + at the end, then source ~/.bashrc Build with: make PLATFORM=PSP @@ -70,3 +70,10 @@ apt install -y python3 python3-pillow make PLATFORM=RG35XX +##### RG35XXPLUS: Compile in shauninman toolchain docker + clone: + https://github.com/shauninman/union-rg35xxplus-toolchain + enter docker: + make shell + Build with: + make PLATFORM=RG35XXPLUS diff --git a/projects/resources/RG35XXH/config.xml b/projects/resources/RG35XXH/config.xml deleted file mode 100644 index e3905c70..00000000 --- a/projects/resources/RG35XXH/config.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/projects/resources/RG35XXH/launch.sh b/projects/resources/RG35XXH/launch.sh deleted file mode 100755 index 230851f5..00000000 --- a/projects/resources/RG35XXH/launch.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh -progdir=$(dirname "$0")/lgpt -cd $progdir -HOME=$progdir -LD_LIBRARY_PATH=$PROGDIR:$LD_LIBRARY_PATH ./lgpt-rg35xxh.elf > ./lgpt.log -#sync diff --git a/projects/resources/RG35XXPLUS/INSTALL_HOWTO.txt b/projects/resources/RG35XXPLUS/INSTALL_HOWTO.txt new file mode 100644 index 00000000..60ca4047 --- /dev/null +++ b/projects/resources/RG35XXPLUS/INSTALL_HOWTO.txt @@ -0,0 +1,22 @@ +# Garlic OS + +## Installation + +1. Copy lgpt-rg35xxplus.elf, config.xml, samplelib, lgpt_BETA to /SdCard/Roms/APPS/lgpt/ +2. Copy LittleGPTracker.png to /SdCard/Roms/Imgs/ +3. Copy garlicos/LittleGPTracker.sh to /SdCard/Roms/ + +## Usage + +Open "Consoles -> Apps -> LittleGPTracker". + +# muOS + +## Installation + +1. Copy lgpt-rg35xxplus.elf, config.xml, samplelib, lgpt_BETA to /mnt/mmc/MUOS/application/.lgpt/ +3. Copy muos/LittleGPTracker.sh to /mnt/mmc/MUOS/application/ + +## Usage + +Open "Applications -> LittleGPTracker". diff --git a/projects/resources/RG35XXPLUS/README.md b/projects/resources/RG35XXPLUS/README.md new file mode 100644 index 00000000..70af2f72 --- /dev/null +++ b/projects/resources/RG35XXPLUS/README.md @@ -0,0 +1,20 @@ +# Garlic OS + +## Installation + +1. Copy lgpt-rg35xxplus.elf, config.xml, samplelib, lgpt_BETA to /SdCard/Roms/APPS/lgpt/ +2. Copy LittleGPTracker.png to /SdCard/Roms/Imgs/ +3. Copy garlicos/LittleGPTracker.sh to /SdCard/Roms/ + +## Usage + +Open "Consoles -> Apps -> LittleGPTracker". + +# muOS + +1. Copy lgpt-rg35xxplus.elf, config.xml, samplelib, lgpt_BETA to /mnt/mmc/MUOS/application/.lgpt/ +3. Copy muos/LittleGPTracker.sh to /mnt/mmc/MUOS/application/ + +## Usage + +Open "Applications -> LittleGPTracker". diff --git a/projects/resources/RG35XXH/config.json b/projects/resources/RG35XXPLUS/config.json similarity index 100% rename from projects/resources/RG35XXH/config.json rename to projects/resources/RG35XXPLUS/config.json diff --git a/projects/resources/RG35XXPLUS/config.xml b/projects/resources/RG35XXPLUS/config.xml new file mode 100644 index 00000000..21d43983 --- /dev/null +++ b/projects/resources/RG35XXPLUS/config.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/projects/resources/RG35XXPLUS/garlicos/LittleGPTracker.sh b/projects/resources/RG35XXPLUS/garlicos/LittleGPTracker.sh new file mode 100755 index 00000000..f82c0450 --- /dev/null +++ b/projects/resources/RG35XXPLUS/garlicos/LittleGPTracker.sh @@ -0,0 +1,6 @@ +#!/bin/sh +progdir=$(dirname "$0")/lgpt +cd $progdir +HOME=$progdir +LD_LIBRARY_PATH=$PROGDIR:$LD_LIBRARY_PATH ./lgpt-rg35xxplus.elf > ./lgpt.log +sync diff --git a/projects/resources/RG35XXH/lgpt.png b/projects/resources/RG35XXPLUS/lgpt.png similarity index 100% rename from projects/resources/RG35XXH/lgpt.png rename to projects/resources/RG35XXPLUS/lgpt.png diff --git a/projects/resources/RG35XXH/mapping.xml b/projects/resources/RG35XXPLUS/mapping.xml similarity index 100% rename from projects/resources/RG35XXH/mapping.xml rename to projects/resources/RG35XXPLUS/mapping.xml diff --git a/projects/resources/RG35XXPLUS/muos/LittleGPTracker.sh b/projects/resources/RG35XXPLUS/muos/LittleGPTracker.sh new file mode 100644 index 00000000..85588804 --- /dev/null +++ b/projects/resources/RG35XXPLUS/muos/LittleGPTracker.sh @@ -0,0 +1,15 @@ +#!/bin/sh +echo app >/tmp/act_go + +. /opt/muos/script/var/device/storage.sh + +export LD_LIBRARY_PATH=/usr/lib32 + +PROGDIR="$DC_STO_ROM_MOUNT/MUOS/application/.lgpt" +cd $PROGDIR +HOME=$PROGDIR + +echo "lgpt" >/tmp/fg_proc + +LD_LIBRARY_PATH=$PROGDIR:$LD_LIBRARY_PATH ./lgpt-rg35xxplus.elf &> lgpt.log +sync From 19e1a218844978efade5cae44b3e6ad6c3fc7197 Mon Sep 17 00:00:00 2001 From: Ivan Gavrilov Date: Mon, 12 Aug 2024 20:33:57 +0300 Subject: [PATCH 32/66] rm INSTALL_HOWTO.txt --- .../resources/RG35XXPLUS/INSTALL_HOWTO.txt | 22 ------------------- 1 file changed, 22 deletions(-) delete mode 100644 projects/resources/RG35XXPLUS/INSTALL_HOWTO.txt diff --git a/projects/resources/RG35XXPLUS/INSTALL_HOWTO.txt b/projects/resources/RG35XXPLUS/INSTALL_HOWTO.txt deleted file mode 100644 index 60ca4047..00000000 --- a/projects/resources/RG35XXPLUS/INSTALL_HOWTO.txt +++ /dev/null @@ -1,22 +0,0 @@ -# Garlic OS - -## Installation - -1. Copy lgpt-rg35xxplus.elf, config.xml, samplelib, lgpt_BETA to /SdCard/Roms/APPS/lgpt/ -2. Copy LittleGPTracker.png to /SdCard/Roms/Imgs/ -3. Copy garlicos/LittleGPTracker.sh to /SdCard/Roms/ - -## Usage - -Open "Consoles -> Apps -> LittleGPTracker". - -# muOS - -## Installation - -1. Copy lgpt-rg35xxplus.elf, config.xml, samplelib, lgpt_BETA to /mnt/mmc/MUOS/application/.lgpt/ -3. Copy muos/LittleGPTracker.sh to /mnt/mmc/MUOS/application/ - -## Usage - -Open "Applications -> LittleGPTracker". From 2767e1c6c53cd613cf9cb85146234de1ffbffafd Mon Sep 17 00:00:00 2001 From: Ivan Gavrilov Date: Mon, 12 Aug 2024 20:41:05 +0300 Subject: [PATCH 33/66] README.md update --- projects/resources/RG35XXPLUS/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/projects/resources/RG35XXPLUS/README.md b/projects/resources/RG35XXPLUS/README.md index 70af2f72..60ca4047 100644 --- a/projects/resources/RG35XXPLUS/README.md +++ b/projects/resources/RG35XXPLUS/README.md @@ -12,6 +12,8 @@ Open "Consoles -> Apps -> LittleGPTracker". # muOS +## Installation + 1. Copy lgpt-rg35xxplus.elf, config.xml, samplelib, lgpt_BETA to /mnt/mmc/MUOS/application/.lgpt/ 3. Copy muos/LittleGPTracker.sh to /mnt/mmc/MUOS/application/ From 5904ea5a81f9b7228cbe90595044bbc35dbafb02 Mon Sep 17 00:00:00 2001 From: Simon Lees Date: Sat, 17 Aug 2024 22:34:31 +0930 Subject: [PATCH 34/66] Add support for rg35xx stock 64bit To separate the GarlicOS version it now has the G postfix and the stock has the S prefix. --- .github/workflows/build.yml | 41 +++++++++++++++++++- projects/Makefile.RG35XXG | 2 +- projects/Makefile.RG35XXS | 34 ++++++++++++++++ projects/resources/packaging/lgpt_package.sh | 5 ++- 4 files changed, 77 insertions(+), 5 deletions(-) create mode 100644 projects/Makefile.RG35XXS diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5a3e2f15..dfd9a95c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -236,7 +236,7 @@ jobs: tag_name: ${{ steps.extract_tag.outputs.tag_name }} files: ./projects/*.zip - build-rg35xxg: + build-rg35xxG: runs-on: ubuntu-latest steps: @@ -277,4 +277,41 @@ jobs: tag_name: ${{ steps.extract_tag.outputs.tag_name }} files: ./workspace/LittleGPTracker/projects/*.zip - +build-rg35xxS: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Install rg35xx Stock Toolchain + run: | + + wget -O /tmp/rg35xx-plus-aarch64-SDL2-SDK-0.1.0.tar.xz https://github.com/simotek/rg35xx-plus-aarch64-SDL2-SDK/releases/download/0.1.0/rg35xx-plus-aarch64-SDL2-SDK-0.1.0.tar.xz + mkdir /opt/rg35xx-plus-aarch64-SDL2-SDK-0.1.0 + tar -xvf /tmp/rg35xx-plus-aarch64-SDL2-SDK-0.1.0.tar.xz -C /opt/rg35xx-plus-aarch64-SDL2-SDK-0.1.0 --strip-components=1 + + - name: Build rg35xx Stock + working-directory: projects + run: make PLATFORM=rg35xxS + + - name: Package build + working-directory: projects + run: | + curl -L -o lgpt-resources.zip https://github.com/djdiskmachine/lgpt-resources/archive/refs/tags/1.0.zip + unzip lgpt-resources.zip + mv lgpt-resources-1.0/*/ ./resources/packaging + rm -rf lgpt-resources* + ./resources/packaging/lgpt_package.sh + + - name: Extract Git tag name + id: extract_tag + run: echo "::set-output name=tag_name::${GITHUB_REF#refs/tags/}" + env: + GITHUB_REF: ${{ github.ref }} + + - name: Upload build release + uses: softprops/action-gh-release@v2 + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + tag_name: ${{ steps.extract_tag.outputs.tag_name }} + files: ./projects/*.zip diff --git a/projects/Makefile.RG35XXG b/projects/Makefile.RG35XXG index f29b5d9e..7076c18e 100644 --- a/projects/Makefile.RG35XXG +++ b/projects/Makefile.RG35XXG @@ -29,7 +29,7 @@ CXXFLAGS:= $(CFLAGS) -std=gnu++03 LIBS := $(SDL_LIBS) -lpthread LIBDIRS := $(DEKVIT)/usr/lib LIBDIRS += $(DEKVIT)/usr/include -OUTPUT := ../lgpt-rg35xx +OUTPUT := ../lgpt-rg35xxG EXTENSION:= elf %.elf: $(OFILES) diff --git a/projects/Makefile.RG35XXS b/projects/Makefile.RG35XXS new file mode 100644 index 00000000..2fff06f3 --- /dev/null +++ b/projects/Makefile.RG35XXS @@ -0,0 +1,34 @@ +-include $(PWD)/rules_base + +# config +DEFINES := \ + -D_64BIT \ + -DBUFFERED \ + -DCPP_MEMORY \ + -DHAVE_STDINT_H \ + -D_NDEBUG \ + -D_NO_JACK_ \ + -DSDL2 \ + -DSDLAUDIO \ + -DDUMMYMIDI + +DEVKIT := /opt/rg35xx-plus-aarch64-SDL2-SDK-0.1.0/ +CROSS_COMPILE:=$(DEVKIT)bin/aarch64-none-linux-gnu- +TRIPLET:=aarch64-linux-gnu +CC = $(CROSS_COMPILE)gcc +CXX = $(CROSS_COMPILE)g++ +TOOLPATH=$(DEVKIT)/usr/bin + +SDL_CFLAGS := -I/$(SYSROOT)/include -D_REENTRANT +SDL_LIBS := -lSDL2 + +OPT_FLAGS = -O3 -mlittle-endian -mabi=lp64 -march=armv8-a+crypto+crc -fasynchronous-unwind-tables -fstack-protector-strong -Wformat -Wformat-security -fstack-clash-protection -dumpbase +INCLUDES = -Iinclude $(SDL_CFLAGS) -I$(DEVKIT)/$(TRIPLET)/include -I$(DEVKIT)/$(TRIPLET)/include/c++/11/ -I$(PWD)/../sources +CFLAGS := $(DEFINES) $(INCLUDES) $(OPT_FLAGS) -Wall +CXXFLAGS:= $(CFLAGS) -std=gnu++03 +LIBS := -Wl,-rpath-link,$(DEVKIT)/$(TRIPLET)/lib -Wl,-rpath-link,$(DEVKIT)/$(TRIPLET)/lib/pulseaudio $(SDL_LIBS) -lpthread +OUTPUT = ../lgpt-rg35xxS +EXTENSION:= elf + +%.elf: $(OFILES) + $(CXX) $(LDFLAGS) -o $@ $(OFILES) $(LIBS) diff --git a/projects/resources/packaging/lgpt_package.sh b/projects/resources/packaging/lgpt_package.sh index 45cd390f..ac1542bd 100755 --- a/projects/resources/packaging/lgpt_package.sh +++ b/projects/resources/packaging/lgpt_package.sh @@ -38,6 +38,7 @@ collect_resources W32 lgpt-W32.exe collect_resources RASPI lgpt.rpi-exe collect_resources CHIP lgpt.chip-exe collect_resources BITTBOY lgpt-bittboy.elf -collect_resources RG35XX lgpt-rg35xx.elf +collect_resources RG35XXG lgpt-rg35xxG.elf +collect_resources RG35XXS lgpt-rg35xxS.elf # collect_resources RS97 lgpt.dge -# collect_resources STEAM lgpt.steam-exe \ No newline at end of file +# collect_resources STEAM lgpt.steam-exe From d67c413310ea010176518082985c15ec3bb389ba Mon Sep 17 00:00:00 2001 From: Simon Lees Date: Sat, 17 Aug 2024 23:09:28 +0930 Subject: [PATCH 35/66] Add x64 and x86 to workflows --- .github/workflows/build.yml | 79 ++++++++++++++++++++ projects/resources/packaging/lgpt_package.sh | 4 +- 2 files changed, 82 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index dfd9a95c..e9777d9d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -110,6 +110,85 @@ jobs: tag_name: ${{ steps.extract_tag.outputs.tag_name }} files: ./projects/*.zip + build-x86: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Install required libraries + run: | + python -m pip install --upgrade pip + pip install Pillow + sudo dpkg --add-architecture i386 + sudo apt update + sudo apt install -y make pkgconf gcc-multilib g++-multilib libsdl1.2-dev:i386 libasound2-plugins:i386 libjack-dev:i386 + + - name: Build X86 + working-directory: projects + run: make PLATFORM=X86 + + - name: Package build + working-directory: projects + run: | + curl -L -o lgpt-resources.zip https://github.com/djdiskmachine/lgpt-resources/archive/refs/tags/1.0.zip + unzip lgpt-resources.zip + mv lgpt-resources-1.0/*/ ./resources/packaging + rm -rf lgpt-resources* + ./resources/packaging/lgpt_package.sh + + - name: Extract Git tag name + id: extract_tag + run: echo "::set-output name=tag_name::${GITHUB_REF#refs/tags/}" + env: + GITHUB_REF: ${{ github.ref }} + + - name: Upload build release + uses: softprops/action-gh-release@v2 + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + tag_name: ${{ steps.extract_tag.outputs.tag_name }} + files: ./projects/*.zip + + build-x64: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Install required libraries + run: | + python -m pip install --upgrade pip + pip install Pillow + sudo apt update + sudo apt install -y make pkgconf libsdl2-dev libasound2-plugins libjack-dev + + - name: Build X64 + working-directory: projects + run: make PLATFORM=X64 + + - name: Package build + working-directory: projects + run: | + curl -L -o lgpt-resources.zip https://github.com/djdiskmachine/lgpt-resources/archive/refs/tags/1.0.zip + unzip lgpt-resources.zip + mv lgpt-resources-1.0/*/ ./resources/packaging + rm -rf lgpt-resources* + ./resources/packaging/lgpt_package.sh + + - name: Extract Git tag name + id: extract_tag + run: echo "::set-output name=tag_name::${GITHUB_REF#refs/tags/}" + env: + GITHUB_REF: ${{ github.ref }} + + - name: Upload build release + uses: softprops/action-gh-release@v2 + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + tag_name: ${{ steps.extract_tag.outputs.tag_name }} + files: ./projects/*.zip + build-psp: runs-on: ubuntu-latest env: diff --git a/projects/resources/packaging/lgpt_package.sh b/projects/resources/packaging/lgpt_package.sh index ac1542bd..9b3d470a 100755 --- a/projects/resources/packaging/lgpt_package.sh +++ b/projects/resources/packaging/lgpt_package.sh @@ -16,7 +16,7 @@ collect_resources() { #1PLATFORM #2lgpt.*-exe echo "-=-=Packaging $PACKAGE=-=-" CONTENTS="./resources/$1/*" CONTENTS+=" $(find -iname $2)" - if [ "$1" == "PSP" ] || [ "$1" == "RG35XX" ]; then # All files go in the root folder + if [ "$1" == "PSP" ] || [ "$1" == "RG35XXG" ] || [ "$1" == "RG35XXS" ]; then # All files go in the root folder zip -9 $PACKAGE -j $CONTENTS else # all the others go in the bin mkdir bin ; cp $CONTENTS bin @@ -33,6 +33,8 @@ collect_resources() { #1PLATFORM #2lgpt.*-exe collect_resources PSP EBOOT.PBP collect_resources DEB lgpt.deb-exe +collect_resources X64 lgpt.x64 +collect_resources X86 lgpt.x86 collect_resources MIYOO lgpt-miyoo.elf collect_resources W32 lgpt-W32.exe collect_resources RASPI lgpt.rpi-exe From 8413491a496371ee31416999c660cde464f4d134 Mon Sep 17 00:00:00 2001 From: Simon Lees Date: Sat, 17 Aug 2024 23:16:58 +0930 Subject: [PATCH 36/66] Fix spacing on rg35xx --- .github/workflows/build.yml | 79 +++++++++++++++++++------------------ 1 file changed, 40 insertions(+), 39 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e9777d9d..db8ca3a7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -355,42 +355,43 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} tag_name: ${{ steps.extract_tag.outputs.tag_name }} files: ./workspace/LittleGPTracker/projects/*.zip - -build-rg35xxS: - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - - name: Install rg35xx Stock Toolchain - run: | - - wget -O /tmp/rg35xx-plus-aarch64-SDL2-SDK-0.1.0.tar.xz https://github.com/simotek/rg35xx-plus-aarch64-SDL2-SDK/releases/download/0.1.0/rg35xx-plus-aarch64-SDL2-SDK-0.1.0.tar.xz - mkdir /opt/rg35xx-plus-aarch64-SDL2-SDK-0.1.0 - tar -xvf /tmp/rg35xx-plus-aarch64-SDL2-SDK-0.1.0.tar.xz -C /opt/rg35xx-plus-aarch64-SDL2-SDK-0.1.0 --strip-components=1 - - - name: Build rg35xx Stock - working-directory: projects - run: make PLATFORM=rg35xxS - - - name: Package build - working-directory: projects - run: | - curl -L -o lgpt-resources.zip https://github.com/djdiskmachine/lgpt-resources/archive/refs/tags/1.0.zip - unzip lgpt-resources.zip - mv lgpt-resources-1.0/*/ ./resources/packaging - rm -rf lgpt-resources* - ./resources/packaging/lgpt_package.sh - - - name: Extract Git tag name - id: extract_tag - run: echo "::set-output name=tag_name::${GITHUB_REF#refs/tags/}" - env: - GITHUB_REF: ${{ github.ref }} - - - name: Upload build release - uses: softprops/action-gh-release@v2 - with: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - tag_name: ${{ steps.extract_tag.outputs.tag_name }} - files: ./projects/*.zip + + build-rg35xxS: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Install rg35xx Stock Toolchain + run: | + + wget -O /tmp/rg35xx-plus-aarch64-SDL2-SDK-0.1.0.tar.xz https://github.com/simotek/rg35xx-plus-aarch64-SDL2-SDK/releases/download/0.1.0/rg35xx-plus-aarch64-SDL2-SDK-0.1.0.tar.xz + mkdir /opt/rg35xx-plus-aarch64-SDL2-SDK-0.1.0 + tar -xvf /tmp/rg35xx-plus-aarch64-SDL2-SDK-0.1.0.tar.xz -C /opt/rg35xx-plus-aarch64-SDL2-SDK-0.1.0 --strip-components=1 + + - name: Build rg35xx Stock + working-directory: projects + run: make PLATFORM=rg35xxS + + - name: Package build + working-directory: ./workspace/LittleGPTracker/projects + run: | + curl -L -o lgpt-resources.zip https://github.com/djdiskmachine/lgpt-resources/archive/refs/tags/1.0.zip + unzip lgpt-resources.zip + mv lgpt-resources-1.0/*/ ./resources/packaging + rm -rf lgpt-resources* + ./resources/packaging/lgpt_package.sh + + - name: Extract Git tag name + id: extract_tag + run: echo "::set-output name=tag_name::${GITHUB_REF#refs/tags/}" + env: + GITHUB_REF: ${{ github.ref }} + + - name: Upload build release + uses: softprops/action-gh-release@v2 + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + tag_name: ${{ steps.extract_tag.outputs.tag_name }} + files: ./workspace/LittleGPTracker/projects/*.zip From d07c52897841b7ef838e5692a6a0e9b43457e923 Mon Sep 17 00:00:00 2001 From: Simon Lees Date: Sat, 17 Aug 2024 23:26:54 +0930 Subject: [PATCH 37/66] Fixes for workflow --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index db8ca3a7..c086291e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -372,7 +372,7 @@ jobs: - name: Build rg35xx Stock working-directory: projects - run: make PLATFORM=rg35xxS + run: make PLATFORM=RG35XXS - name: Package build working-directory: ./workspace/LittleGPTracker/projects From 5544226f50a436ab24a085ef62ae9bfc51055b0c Mon Sep 17 00:00:00 2001 From: Simon Lees Date: Sat, 17 Aug 2024 23:33:45 +0930 Subject: [PATCH 38/66] RG35XXS probably needs pip if this works --- .github/workflows/build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c086291e..cddf4280 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -365,7 +365,8 @@ jobs: - name: Install rg35xx Stock Toolchain run: | - + python -m pip install --upgrade pip + pip install Pillow wget -O /tmp/rg35xx-plus-aarch64-SDL2-SDK-0.1.0.tar.xz https://github.com/simotek/rg35xx-plus-aarch64-SDL2-SDK/releases/download/0.1.0/rg35xx-plus-aarch64-SDL2-SDK-0.1.0.tar.xz mkdir /opt/rg35xx-plus-aarch64-SDL2-SDK-0.1.0 tar -xvf /tmp/rg35xx-plus-aarch64-SDL2-SDK-0.1.0.tar.xz -C /opt/rg35xx-plus-aarch64-SDL2-SDK-0.1.0 --strip-components=1 From 7852b435672ec33b11870a06cf38b42ada42fd4b Mon Sep 17 00:00:00 2001 From: Simon Lees Date: Sun, 18 Aug 2024 18:49:32 +0930 Subject: [PATCH 39/66] do 32bit pkg-config correctly --- projects/Makefile.DEB | 15 ++++++--------- projects/Makefile.X86 | 12 ++++++------ 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/projects/Makefile.DEB b/projects/Makefile.DEB index b00ec20e..66cda35c 100644 --- a/projects/Makefile.DEB +++ b/projects/Makefile.DEB @@ -7,15 +7,12 @@ DEFINES := \ -D__LINUX_ALSA__ \ -D__LINUX_ALSASEQ__ -# When cross compiling on the CI we need to specify the correct path. -PKG_CONFIG_PATH := /usr/lib/i386-linux-gnu/pkgconfig - -ALSA_CFLAGS := $(shell PKG_CONFIG_PATH='$(PKG_CONFIG_PATH)' pkg-config alsa --cflags) -ALSA_LIBS := $(shell PKG_CONFIG_PATH='$(PKG_CONFIG_PATH)' pkg-config alsa --libs) -JACK_CFLAGS := $(shell PKG_CONFIG_PATH='$(PKG_CONFIG_PATH)' pkg-config jack --cflags) -JACK_LIBS := $(shell PKG_CONFIG_PATH='$(PKG_CONFIG_PATH)' pkg-config jack --libs) -SDL_CFLAGS := $(shell PKG_CONFIG_PATH='$(PKG_CONFIG_PATH)' pkg-config sdl --cflags) -SDL_LIBS := $(shell PKG_CONFIG_PATH='$(PKG_CONFIG_PATH)' pkg-config sdl --libs) +ALSA_CFLAGS := $(shell i686-linux-gnu-pkg-config alsa --cflags) +ALSA_LIBS := $(shell i686-linux-gnu-pkg-config alsa --libs) +JACK_CFLAGS := $(shell i686-linux-gnu-pkg-config jack --cflags) +JACK_LIBS := $(shell i686-linux-gnu-pkg-config jack --libs) +SDL_CFLAGS := $(shell i686-linux-gnu-pkg-config sdl --cflags) +SDL_LIBS := $(shell i686-linux-gnu-pkg-config sdl --libs) # optimization OPT_FLAGS := -O3 -m32 diff --git a/projects/Makefile.X86 b/projects/Makefile.X86 index 14c670df..669d616b 100644 --- a/projects/Makefile.X86 +++ b/projects/Makefile.X86 @@ -9,12 +9,12 @@ DEFINES := \ -DSDLAUDIO \ -DDUMMYMIDI -ALSA_CFLAGS := $(shell pkg-config alsa --cflags) -ALSA_LIBS := $(shell pkg-config alsa --libs) -JACK_CFLAGS := $(shell pkg-config jack --cflags) -JACK_LIBS := $(shell pkg-config jack --libs) -SDL_CFLAGS := $(shell pkg-config sdl2 --cflags) -SDL_LIBS := $(shell pkg-config sdl2 --libs) +ALSA_CFLAGS := $(shell i686-linux-gnu-pkg-config alsa --cflags) +ALSA_LIBS := $(shell i686-linux-gnu-pkg-config alsa --libs) +JACK_CFLAGS := $(shell i686-linux-gnu-pkg-config jack --cflags) +JACK_LIBS := $(shell i686-linux-gnu-pkg-config jack --libs) +SDL_CFLAGS := $(shell i686-linux-gnu-pkg-config sdl2 --cflags) +SDL_LIBS := $(shell i686-linux-gnu-pkg-config sdl2 --libs) # optimization OPT_FLAGS := -O3 -m32 From dde57fb3df5ad6413fe1fc1edb98816c2d2d4f4d Mon Sep 17 00:00:00 2001 From: Simon Lees Date: Sun, 18 Aug 2024 18:50:22 +0930 Subject: [PATCH 40/66] Debug rg35xxG workflow --- .github/workflows/build.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cddf4280..63feda43 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -327,6 +327,11 @@ jobs: docker run -d --name rg35xx-container -v "$(pwd)/workspace:/root/workspace" aveferrum/rg35xx-toolchain sleep infinity docker exec rg35xx-container bash -c " apt update && apt install -y python3 python3-pillow + echo "$PWD" + echo "ls" + ls + echo "ls /root/workspace" + ls /root/workspace git clone https://github.com/djdiskmachine/LittleGPTracker.git cd LittleGPTracker/projects make PLATFORM=RG35XXG From 3baca7aec57b4ef73bd098f70b5b7ac2d96fd13c Mon Sep 17 00:00:00 2001 From: Simon Lees Date: Sun, 18 Aug 2024 18:54:17 +0930 Subject: [PATCH 41/66] Workflow: x86 needs SDL2 --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 63feda43..9523056b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -122,7 +122,7 @@ jobs: pip install Pillow sudo dpkg --add-architecture i386 sudo apt update - sudo apt install -y make pkgconf gcc-multilib g++-multilib libsdl1.2-dev:i386 libasound2-plugins:i386 libjack-dev:i386 + sudo apt install -y make pkgconf gcc-multilib g++-multilib libsdl2-dev:i386 libasound2-plugins:i386 libjack-dev:i386 - name: Build X86 working-directory: projects From cda0cee72ef3d0679962053c1025ef80293c2646 Mon Sep 17 00:00:00 2001 From: Simon Lees Date: Sun, 18 Aug 2024 18:58:27 +0930 Subject: [PATCH 42/66] Workflow: more rg35xxG --- .github/workflows/build.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9523056b..4b079bfe 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -328,12 +328,13 @@ jobs: docker exec rg35xx-container bash -c " apt update && apt install -y python3 python3-pillow echo "$PWD" + cd /root/workspace echo "ls" ls echo "ls /root/workspace" ls /root/workspace - git clone https://github.com/djdiskmachine/LittleGPTracker.git - cd LittleGPTracker/projects + #git clone https://github.com/djdiskmachine/LittleGPTracker.git + #cd LittleGPTracker/projects make PLATFORM=RG35XXG " sudo chmod -R 777 ./workspace/LittleGPTracker/projects From 6140356d9157d96158d660afda29a63206574395 Mon Sep 17 00:00:00 2001 From: Simon Lees Date: Sun, 18 Aug 2024 19:07:20 +0930 Subject: [PATCH 43/66] Workflow: add x64 to check Its simple and significantly different to the other check builds but will be similar to all the SDL2 builds. --- .github/workflows/check.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 63224ceb..a2ab45b8 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -58,3 +58,22 @@ jobs: working-directory: projects run: | make PLATFORM=MIYOO + + x64: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Install required libraries + run: | + python -m pip install --upgrade pip + pip install Pillow + sudo apt update + sudo apt install -y make pkgconf libsdl2-dev libasound2-plugins libjack-dev + + - name: Build X64 + working-directory: projects + run: | + make PLATFORM=X64 From f9a73488a2f0d4fd04b513b53389f33f680d7a68 Mon Sep 17 00:00:00 2001 From: Simon Lees Date: Sun, 18 Aug 2024 19:10:04 +0930 Subject: [PATCH 44/66] Keep debugging rg35xxG --- .github/workflows/build.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4b079bfe..1a16a5a7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -324,10 +324,12 @@ jobs: - name: Clone and build LGPT run: | + echo "Working DIR: $PWD" + ls docker run -d --name rg35xx-container -v "$(pwd)/workspace:/root/workspace" aveferrum/rg35xx-toolchain sleep infinity docker exec rg35xx-container bash -c " apt update && apt install -y python3 python3-pillow - echo "$PWD" + echo "DOCKER Working DIR:$PWD" cd /root/workspace echo "ls" ls From 89131d5b2143ad9f0c1fe4533d989d4b474cc995 Mon Sep 17 00:00:00 2001 From: Simon Lees Date: Sun, 18 Aug 2024 20:33:35 +0930 Subject: [PATCH 45/66] Workflow: More rg35xxG testing --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1a16a5a7..84c9a9d6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -326,7 +326,7 @@ jobs: run: | echo "Working DIR: $PWD" ls - docker run -d --name rg35xx-container -v "$(pwd)/workspace:/root/workspace" aveferrum/rg35xx-toolchain sleep infinity + docker run -d --name rg35xx-container -v "$(pwd):/root/workspace" aveferrum/rg35xx-toolchain sleep infinity docker exec rg35xx-container bash -c " apt update && apt install -y python3 python3-pillow echo "DOCKER Working DIR:$PWD" @@ -336,7 +336,7 @@ jobs: echo "ls /root/workspace" ls /root/workspace #git clone https://github.com/djdiskmachine/LittleGPTracker.git - #cd LittleGPTracker/projects + cd projects make PLATFORM=RG35XXG " sudo chmod -R 777 ./workspace/LittleGPTracker/projects From 89da54477fb359413f2166aa04194c215d157e77 Mon Sep 17 00:00:00 2001 From: Simon Lees Date: Sun, 18 Aug 2024 20:51:52 +0930 Subject: [PATCH 46/66] Still trying to get docker right --- .github/workflows/build.yml | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 84c9a9d6..543aaab8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -324,26 +324,24 @@ jobs: - name: Clone and build LGPT run: | - echo "Working DIR: $PWD" - ls - docker run -d --name rg35xx-container -v "$(pwd):/root/workspace" aveferrum/rg35xx-toolchain sleep infinity + ln -s /home/runner/work/LittleGPTracker/LittleGPTracker workspace + docker run -d --name rg35xx-container -v "$(pwd)/workspace:/root/workspace" aveferrum/rg35xx-toolchain sleep infinity docker exec rg35xx-container bash -c " apt update && apt install -y python3 python3-pillow - echo "DOCKER Working DIR:$PWD" - cd /root/workspace + echo "$PWD" echo "ls" ls - echo "ls /root/workspace" - ls /root/workspace - #git clone https://github.com/djdiskmachine/LittleGPTracker.git + echo "ls ~/workspace" cd projects + #git clone https://github.com/djdiskmachine/LittleGPTracker.git + #cd LittleGPTracker/projects make PLATFORM=RG35XXG " - sudo chmod -R 777 ./workspace/LittleGPTracker/projects - sudo chown -R root:root ./workspace/LittleGPTracker/projects + sudo chmod -R 777 ./workspace/projects + sudo chown -R root:root ./workspace/projects - name: Package build - working-directory: ./workspace/LittleGPTracker/projects + working-directory: ./workspace/projects run: | curl -L -o lgpt-resources.zip https://github.com/djdiskmachine/lgpt-resources/archive/refs/tags/1.0.zip unzip lgpt-resources.zip From f66cdc68f3cd2f0821ab7de4bb0404f30d7fccc1 Mon Sep 17 00:00:00 2001 From: Simon Lees Date: Sun, 18 Aug 2024 21:00:58 +0930 Subject: [PATCH 47/66] Debug some more --- .github/workflows/build.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 543aaab8..0423c459 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -324,19 +324,24 @@ jobs: - name: Clone and build LGPT run: | + echo "## a ##" ln -s /home/runner/work/LittleGPTracker/LittleGPTracker workspace docker run -d --name rg35xx-container -v "$(pwd)/workspace:/root/workspace" aveferrum/rg35xx-toolchain sleep infinity docker exec rg35xx-container bash -c " + echo "## b ##" apt update && apt install -y python3 python3-pillow + echo "## c ##" echo "$PWD" echo "ls" ls echo "ls ~/workspace" cd projects + echo "## d ##" #git clone https://github.com/djdiskmachine/LittleGPTracker.git #cd LittleGPTracker/projects make PLATFORM=RG35XXG " + echo "## e ##" sudo chmod -R 777 ./workspace/projects sudo chown -R root:root ./workspace/projects From 2af5d361d3010a0723f698b011378ac2774c2e47 Mon Sep 17 00:00:00 2001 From: Simon Lees Date: Sun, 18 Aug 2024 21:16:25 +0930 Subject: [PATCH 48/66] Need to escape quotes --- .github/workflows/build.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0423c459..9fbabb99 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -328,15 +328,14 @@ jobs: ln -s /home/runner/work/LittleGPTracker/LittleGPTracker workspace docker run -d --name rg35xx-container -v "$(pwd)/workspace:/root/workspace" aveferrum/rg35xx-toolchain sleep infinity docker exec rg35xx-container bash -c " - echo "## b ##" apt update && apt install -y python3 python3-pillow - echo "## c ##" - echo "$PWD" - echo "ls" + echo \"## c ##\" + echo \"$PWD\" + echo \"ls\" ls - echo "ls ~/workspace" + echo \"ls ~/workspace\" cd projects - echo "## d ##" + echo \"## d ##\" #git clone https://github.com/djdiskmachine/LittleGPTracker.git #cd LittleGPTracker/projects make PLATFORM=RG35XXG From 6569faa8158526acfe6750c1a218d95a630b35d8 Mon Sep 17 00:00:00 2001 From: Simon Lees Date: Sun, 18 Aug 2024 21:45:57 +0930 Subject: [PATCH 49/66] For now define platform right, not sure we need it --- projects/Makefile.RG35XXG | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/Makefile.RG35XXG b/projects/Makefile.RG35XXG index 7076c18e..2f058b25 100644 --- a/projects/Makefile.RG35XXG +++ b/projects/Makefile.RG35XXG @@ -8,7 +8,7 @@ DEFINES := \ -DHAVE_STDINT_H \ -D_NO_JACK_ -PLATFORM := RG35XX +PLATFORM := RG35XXG DEVKIT = /opt/miyoo/ CROSS_COMPILE=$(DEVKIT)bin/arm-miyoo-linux-uclibcgnueabi- From e3d0d8ac3d8582e3ca5cd202bf25865098487fbf Mon Sep 17 00:00:00 2001 From: Simon Lees Date: Sun, 18 Aug 2024 21:49:11 +0930 Subject: [PATCH 50/66] Clean up rg35xxG workflow --- .github/workflows/build.yml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9fbabb99..ac5d1e29 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -324,23 +324,13 @@ jobs: - name: Clone and build LGPT run: | - echo "## a ##" ln -s /home/runner/work/LittleGPTracker/LittleGPTracker workspace docker run -d --name rg35xx-container -v "$(pwd)/workspace:/root/workspace" aveferrum/rg35xx-toolchain sleep infinity docker exec rg35xx-container bash -c " apt update && apt install -y python3 python3-pillow - echo \"## c ##\" - echo \"$PWD\" - echo \"ls\" - ls - echo \"ls ~/workspace\" cd projects - echo \"## d ##\" - #git clone https://github.com/djdiskmachine/LittleGPTracker.git - #cd LittleGPTracker/projects make PLATFORM=RG35XXG " - echo "## e ##" sudo chmod -R 777 ./workspace/projects sudo chown -R root:root ./workspace/projects From 6eecf8221a099a6f231dcd9ae650df455608130e Mon Sep 17 00:00:00 2001 From: Simon Lees Date: Sun, 18 Aug 2024 22:17:44 +0930 Subject: [PATCH 51/66] Fix typo for rg35xxG --- projects/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/Makefile b/projects/Makefile index 9f8a0b3b..7d0d85bf 100644 --- a/projects/Makefile +++ b/projects/Makefile @@ -410,7 +410,7 @@ MIYOOFILES := \ MIYOOSystem.o \ SDLAudio.o -RG35XXGDIRS = $(MIYOOFILES) +RG35XXGFILES = $(MIYOOFILES) NDSFILES := \ NDSmain.o \ From 41facf72ba06a9e6336e337e83b79f63af2b8aeb Mon Sep 17 00:00:00 2001 From: Simon Lees Date: Sun, 18 Aug 2024 22:26:16 +0930 Subject: [PATCH 52/66] x86 should be building against SDL2 --- projects/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/Makefile b/projects/Makefile index 7d0d85bf..61581890 100644 --- a/projects/Makefile +++ b/projects/Makefile @@ -110,7 +110,7 @@ RG35XXSDIRS := $(LINUXDIRS) $(DUMMYMIDIDIRS) $(SDL2DIRS) $(SDL2AUDIODIRS) STEAMDIRS := $(LINUXDIRS) $(JACKDIRS) $(RTAUDIODIRS) $(RTMIDIDIRS) $(SDLDIRS) #X64DIRS := $(LINUXDIRS) $(RTMIDIDIRS) $(SDL2DIRS) $(SDL2AUDIODIRS) X64DIRS := $(LINUXDIRS) $(DUMMYMIDIDIRS) $(SDL2DIRS) $(SDL2AUDIODIRS) -X86DIRS := $(LINUXDIRS) $(JACKDIRS) $(RTAUDIODIRS) $(RTMIDIDIRS) $(SDLDIRS) +X86DIRS := $(LINUXDIRS) $(JACKDIRS) $(RTAUDIODIRS) $(RTMIDIDIRS) $(SDL2DIRS) #--------------------------------------------------------------------------------- # Consoles/Embedded From 6408f1d1ef15cfafe0d638c8ac01338db527c910 Mon Sep 17 00:00:00 2001 From: Simon Lees Date: Sun, 18 Aug 2024 22:28:57 +0930 Subject: [PATCH 53/66] Makefile.RG35XXG doesn't need to define PROJECT --- projects/Makefile.RG35XXG | 2 -- 1 file changed, 2 deletions(-) diff --git a/projects/Makefile.RG35XXG b/projects/Makefile.RG35XXG index 2f058b25..2b02db07 100644 --- a/projects/Makefile.RG35XXG +++ b/projects/Makefile.RG35XXG @@ -8,8 +8,6 @@ DEFINES := \ -DHAVE_STDINT_H \ -D_NO_JACK_ -PLATFORM := RG35XXG - DEVKIT = /opt/miyoo/ CROSS_COMPILE=$(DEVKIT)bin/arm-miyoo-linux-uclibcgnueabi- CC = $(CROSS_COMPILE)gcc From c58767195f0d88f9d53ea4f2266ba16ae7d1e93a Mon Sep 17 00:00:00 2001 From: Simon Lees Date: Sun, 18 Aug 2024 22:36:02 +0930 Subject: [PATCH 54/66] x86 build needs to be a clone of x64 --- projects/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/Makefile b/projects/Makefile index 61581890..543b18ec 100644 --- a/projects/Makefile +++ b/projects/Makefile @@ -110,7 +110,7 @@ RG35XXSDIRS := $(LINUXDIRS) $(DUMMYMIDIDIRS) $(SDL2DIRS) $(SDL2AUDIODIRS) STEAMDIRS := $(LINUXDIRS) $(JACKDIRS) $(RTAUDIODIRS) $(RTMIDIDIRS) $(SDLDIRS) #X64DIRS := $(LINUXDIRS) $(RTMIDIDIRS) $(SDL2DIRS) $(SDL2AUDIODIRS) X64DIRS := $(LINUXDIRS) $(DUMMYMIDIDIRS) $(SDL2DIRS) $(SDL2AUDIODIRS) -X86DIRS := $(LINUXDIRS) $(JACKDIRS) $(RTAUDIODIRS) $(RTMIDIDIRS) $(SDL2DIRS) +X86DIRS := $(LINUXDIRS) $(DUMMYMIDIDIRS) $(SDL2DIRS) $(SDL2AUDIODIRS) #--------------------------------------------------------------------------------- # Consoles/Embedded From 9bf2c6aac17f6870699a1aa923b91390d00c42da Mon Sep 17 00:00:00 2001 From: Simon Lees Date: Sun, 18 Aug 2024 22:39:49 +0930 Subject: [PATCH 55/66] objects need to match sources --- projects/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/Makefile b/projects/Makefile index 543b18ec..dfc4702b 100644 --- a/projects/Makefile +++ b/projects/Makefile @@ -326,7 +326,7 @@ RG35XXSFILES := $(LINUXFILES) $(SDLAUDIOFILES) $(DUMMYMIDIFILES) STEAMFILES := $(LINUXFILES) $(RTAUDIOFILES) $(RTMIDIFILES) $(JACKFILES) #X64FILES := $(LINUXFILES) $(RTMIDIFILES) $(SDLAUDIOFILES) X64FILES := $(LINUXFILES) $(SDLAUDIOFILES) $(DUMMYMIDIFILES) -X86FILES := $(LINUXFILES) $(RTAUDIOFILES) $(RTMIDIFILES) $(JACKFILES) +X86FILES := $(LINUXFILES) $(SDLAUDIOFILES) $(DUMMYMIDIFILES) #--------------------------------------------------------------------------------- # Consoles/Embedded From e731948efed698fa9d49af8e929ce05c3c28a343 Mon Sep 17 00:00:00 2001 From: Simon Lees Date: Mon, 19 Aug 2024 10:50:43 +0930 Subject: [PATCH 56/66] Remove test from workflow build --- .github/workflows/build.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ac5d1e29..510fd4c3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,10 +1,6 @@ name: Multi platform build on: - push: - branches: - - "workflow-test" - workflow_dispatch: jobs: From 822994d02985f422878c3f1e316501dc80c6999c Mon Sep 17 00:00:00 2001 From: Simon Lees Date: Thu, 22 Aug 2024 11:36:41 +0930 Subject: [PATCH 57/66] Rename RG35XXPLUS to GARLICPLUS --- projects/Makefile | 2 ++ .../{Makefile.RG35XXPLUS => Makefile.GARLICPLUS} | 0 projects/README.md | 4 ++-- .../resources/{RG35XXPLUS => GARLICPLUS}/README.md | 0 .../{RG35XXPLUS => GARLICPLUS}/config.json | 0 .../resources/{RG35XXPLUS => GARLICPLUS}/config.xml | 0 .../garlicos/LittleGPTracker.sh | 0 .../resources/{RG35XXPLUS => GARLICPLUS}/lgpt.png | Bin .../{RG35XXPLUS => GARLICPLUS}/mapping.xml | 0 .../muos/LittleGPTracker.sh | 0 10 files changed, 4 insertions(+), 2 deletions(-) rename projects/{Makefile.RG35XXPLUS => Makefile.GARLICPLUS} (100%) rename projects/resources/{RG35XXPLUS => GARLICPLUS}/README.md (100%) rename projects/resources/{RG35XXPLUS => GARLICPLUS}/config.json (100%) rename projects/resources/{RG35XXPLUS => GARLICPLUS}/config.xml (100%) rename projects/resources/{RG35XXPLUS => GARLICPLUS}/garlicos/LittleGPTracker.sh (100%) rename projects/resources/{RG35XXPLUS => GARLICPLUS}/lgpt.png (100%) rename projects/resources/{RG35XXPLUS => GARLICPLUS}/mapping.xml (100%) rename projects/resources/{RG35XXPLUS => GARLICPLUS}/muos/LittleGPTracker.sh (100%) diff --git a/projects/Makefile b/projects/Makefile index 12122044..98028b1f 100644 --- a/projects/Makefile +++ b/projects/Makefile @@ -153,6 +153,7 @@ BITTBOYDIRS := $(DINGUXDIRS) $(DINGUXAUDIODIRS) DINGOODIRS := $(DINGUXDIRS) $(DINGUXAUDIODIRS) $(DUMMYMIDIDIRS) MIYOODIRS := $(DINGUXDIRS) $(DUMMYMIDIDIRS) RG35XXGDIRS := $(MIYOODIRS) +GARLICPLUSDIRS := $(MIYOODIRS) RS97DIRS := $(DINGUXDIRS) $(DINGUXAUDIODIRS) GP2XDIRS := \ @@ -414,6 +415,7 @@ MIYOOFILES := \ SDLAudio.o RG35XXGFILES = $(MIYOOFILES) +GARLICPLUSFILES = $(MIYOOFILES) NDSFILES := \ NDSmain.o \ diff --git a/projects/Makefile.RG35XXPLUS b/projects/Makefile.GARLICPLUS similarity index 100% rename from projects/Makefile.RG35XXPLUS rename to projects/Makefile.GARLICPLUS diff --git a/projects/README.md b/projects/README.md index 665ea83e..b5e2c9e3 100644 --- a/projects/README.md +++ b/projects/README.md @@ -70,10 +70,10 @@ apt install -y python3 python3-pillow make PLATFORM=RG35XX -##### RG35XXPLUS: Compile in shauninman toolchain docker +##### GARLICPLUS: Compile in shauninman toolchain docker clone: https://github.com/shauninman/union-rg35xxplus-toolchain enter docker: make shell Build with: - make PLATFORM=RG35XXPLUS + make PLATFORM=GARLICPLUS diff --git a/projects/resources/RG35XXPLUS/README.md b/projects/resources/GARLICPLUS/README.md similarity index 100% rename from projects/resources/RG35XXPLUS/README.md rename to projects/resources/GARLICPLUS/README.md diff --git a/projects/resources/RG35XXPLUS/config.json b/projects/resources/GARLICPLUS/config.json similarity index 100% rename from projects/resources/RG35XXPLUS/config.json rename to projects/resources/GARLICPLUS/config.json diff --git a/projects/resources/RG35XXPLUS/config.xml b/projects/resources/GARLICPLUS/config.xml similarity index 100% rename from projects/resources/RG35XXPLUS/config.xml rename to projects/resources/GARLICPLUS/config.xml diff --git a/projects/resources/RG35XXPLUS/garlicos/LittleGPTracker.sh b/projects/resources/GARLICPLUS/garlicos/LittleGPTracker.sh similarity index 100% rename from projects/resources/RG35XXPLUS/garlicos/LittleGPTracker.sh rename to projects/resources/GARLICPLUS/garlicos/LittleGPTracker.sh diff --git a/projects/resources/RG35XXPLUS/lgpt.png b/projects/resources/GARLICPLUS/lgpt.png similarity index 100% rename from projects/resources/RG35XXPLUS/lgpt.png rename to projects/resources/GARLICPLUS/lgpt.png diff --git a/projects/resources/RG35XXPLUS/mapping.xml b/projects/resources/GARLICPLUS/mapping.xml similarity index 100% rename from projects/resources/RG35XXPLUS/mapping.xml rename to projects/resources/GARLICPLUS/mapping.xml diff --git a/projects/resources/RG35XXPLUS/muos/LittleGPTracker.sh b/projects/resources/GARLICPLUS/muos/LittleGPTracker.sh similarity index 100% rename from projects/resources/RG35XXPLUS/muos/LittleGPTracker.sh rename to projects/resources/GARLICPLUS/muos/LittleGPTracker.sh From 63b72db9dab7e30e2911a6ad4a2e141c6db3241f Mon Sep 17 00:00:00 2001 From: Simon Lees Date: Thu, 22 Aug 2024 12:13:28 +0930 Subject: [PATCH 58/66] Rename RG35XXG to GARLIC --- .github/workflows/build.yml | 4 ++-- projects/Makefile | 8 ++++---- projects/{Makefile.RG35XXG => Makefile.GARLIC} | 2 +- projects/README.md | 4 ++-- .../resources/{RG35XX => GARLIC}/INSTALL_HOW_TO.txt | 0 .../{RG35XX => GARLIC}/LittleGPTracker.png | Bin .../resources/{RG35XX => GARLIC}/LittleGPTracker.sh | 0 projects/resources/{RG35XX => GARLIC}/config.xml | 0 projects/resources/{RG35XX => GARLIC}/j2k.so | Bin projects/resources/packaging/lgpt_package.sh | 4 ++-- 10 files changed, 11 insertions(+), 11 deletions(-) rename projects/{Makefile.RG35XXG => Makefile.GARLIC} (97%) rename projects/resources/{RG35XX => GARLIC}/INSTALL_HOW_TO.txt (100%) rename projects/resources/{RG35XX => GARLIC}/LittleGPTracker.png (100%) rename projects/resources/{RG35XX => GARLIC}/LittleGPTracker.sh (100%) rename projects/resources/{RG35XX => GARLIC}/config.xml (100%) rename projects/resources/{RG35XX => GARLIC}/j2k.so (100%) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 510fd4c3..505c4d14 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -311,7 +311,7 @@ jobs: tag_name: ${{ steps.extract_tag.outputs.tag_name }} files: ./projects/*.zip - build-rg35xxG: + build-garlic: runs-on: ubuntu-latest steps: @@ -325,7 +325,7 @@ jobs: docker exec rg35xx-container bash -c " apt update && apt install -y python3 python3-pillow cd projects - make PLATFORM=RG35XXG + make PLATFORM=GARLIC " sudo chmod -R 777 ./workspace/projects sudo chown -R root:root ./workspace/projects diff --git a/projects/Makefile b/projects/Makefile index 98028b1f..ad0c37c2 100644 --- a/projects/Makefile +++ b/projects/Makefile @@ -152,8 +152,8 @@ DUMMYMIDIDIRS := \ BITTBOYDIRS := $(DINGUXDIRS) $(DINGUXAUDIODIRS) DINGOODIRS := $(DINGUXDIRS) $(DINGUXAUDIODIRS) $(DUMMYMIDIDIRS) MIYOODIRS := $(DINGUXDIRS) $(DUMMYMIDIDIRS) -RG35XXGDIRS := $(MIYOODIRS) -GARLICPLUSDIRS := $(MIYOODIRS) +GARLICDIRS := $(MIYOODIRS) +GARLICPLUSDIRS := $(GARLICDIRS) RS97DIRS := $(DINGUXDIRS) $(DINGUXAUDIODIRS) GP2XDIRS := \ @@ -414,8 +414,8 @@ MIYOOFILES := \ MIYOOSystem.o \ SDLAudio.o -RG35XXGFILES = $(MIYOOFILES) -GARLICPLUSFILES = $(MIYOOFILES) +GARLICFILES = $(MIYOOFILES) +GARLICPLUSFILES = $(GARLICFILES) NDSFILES := \ NDSmain.o \ diff --git a/projects/Makefile.RG35XXG b/projects/Makefile.GARLIC similarity index 97% rename from projects/Makefile.RG35XXG rename to projects/Makefile.GARLIC index 2b02db07..cc658479 100644 --- a/projects/Makefile.RG35XXG +++ b/projects/Makefile.GARLIC @@ -27,7 +27,7 @@ CXXFLAGS:= $(CFLAGS) -std=gnu++03 LIBS := $(SDL_LIBS) -lpthread LIBDIRS := $(DEKVIT)/usr/lib LIBDIRS += $(DEKVIT)/usr/include -OUTPUT := ../lgpt-rg35xxG +OUTPUT := ../lgpt-garlic EXTENSION:= elf %.elf: $(OFILES) diff --git a/projects/README.md b/projects/README.md index b5e2c9e3..e1287753 100644 --- a/projects/README.md +++ b/projects/README.md @@ -61,14 +61,14 @@ Build with: make PLATFORM=RS97 -##### RG35XX: Compile in edemirkans toolchain docker +##### GARLIC: Compile in edemirkans toolchain docker clone: https://github.com/edemirkan/rg35xx-toolchain enter docker: make shell Build with: apt install -y python3 python3-pillow - make PLATFORM=RG35XX + make PLATFORM=GARLIC ##### GARLICPLUS: Compile in shauninman toolchain docker clone: diff --git a/projects/resources/RG35XX/INSTALL_HOW_TO.txt b/projects/resources/GARLIC/INSTALL_HOW_TO.txt similarity index 100% rename from projects/resources/RG35XX/INSTALL_HOW_TO.txt rename to projects/resources/GARLIC/INSTALL_HOW_TO.txt diff --git a/projects/resources/RG35XX/LittleGPTracker.png b/projects/resources/GARLIC/LittleGPTracker.png similarity index 100% rename from projects/resources/RG35XX/LittleGPTracker.png rename to projects/resources/GARLIC/LittleGPTracker.png diff --git a/projects/resources/RG35XX/LittleGPTracker.sh b/projects/resources/GARLIC/LittleGPTracker.sh similarity index 100% rename from projects/resources/RG35XX/LittleGPTracker.sh rename to projects/resources/GARLIC/LittleGPTracker.sh diff --git a/projects/resources/RG35XX/config.xml b/projects/resources/GARLIC/config.xml similarity index 100% rename from projects/resources/RG35XX/config.xml rename to projects/resources/GARLIC/config.xml diff --git a/projects/resources/RG35XX/j2k.so b/projects/resources/GARLIC/j2k.so similarity index 100% rename from projects/resources/RG35XX/j2k.so rename to projects/resources/GARLIC/j2k.so diff --git a/projects/resources/packaging/lgpt_package.sh b/projects/resources/packaging/lgpt_package.sh index 9b3d470a..6598dbd7 100755 --- a/projects/resources/packaging/lgpt_package.sh +++ b/projects/resources/packaging/lgpt_package.sh @@ -16,7 +16,7 @@ collect_resources() { #1PLATFORM #2lgpt.*-exe echo "-=-=Packaging $PACKAGE=-=-" CONTENTS="./resources/$1/*" CONTENTS+=" $(find -iname $2)" - if [ "$1" == "PSP" ] || [ "$1" == "RG35XXG" ] || [ "$1" == "RG35XXS" ]; then # All files go in the root folder + if [ "$1" == "PSP" ] || [ "$1" == "GARLIC" ] || [ "$1" == "RG35XXS" ]; then # All files go in the root folder zip -9 $PACKAGE -j $CONTENTS else # all the others go in the bin mkdir bin ; cp $CONTENTS bin @@ -40,7 +40,7 @@ collect_resources W32 lgpt-W32.exe collect_resources RASPI lgpt.rpi-exe collect_resources CHIP lgpt.chip-exe collect_resources BITTBOY lgpt-bittboy.elf -collect_resources RG35XXG lgpt-rg35xxG.elf +collect_resources GARLIC lgpt-garlic.elf collect_resources RG35XXS lgpt-rg35xxS.elf # collect_resources RS97 lgpt.dge # collect_resources STEAM lgpt.steam-exe From 03dfc41833150e5809d03ecdbbb8890b9eb8654a Mon Sep 17 00:00:00 2001 From: Simon Lees Date: Thu, 22 Aug 2024 12:33:21 +0930 Subject: [PATCH 59/66] RG35XXS to RG35XXPLUS --- .github/workflows/build.yml | 4 ++-- projects/Makefile | 4 ++-- projects/{Makefile.RG35XXS => Makefile.RG35XXPLUS} | 2 +- projects/resources/packaging/lgpt_package.sh | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) rename projects/{Makefile.RG35XXS => Makefile.RG35XXPLUS} (97%) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 505c4d14..cfb2f937 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -352,7 +352,7 @@ jobs: tag_name: ${{ steps.extract_tag.outputs.tag_name }} files: ./workspace/LittleGPTracker/projects/*.zip - build-rg35xxS: + build-rg35xxplus: runs-on: ubuntu-latest steps: @@ -369,7 +369,7 @@ jobs: - name: Build rg35xx Stock working-directory: projects - run: make PLATFORM=RG35XXS + run: make PLATFORM=RG35XXPLUS - name: Package build working-directory: ./workspace/LittleGPTracker/projects diff --git a/projects/Makefile b/projects/Makefile index ad0c37c2..2cb29bbf 100644 --- a/projects/Makefile +++ b/projects/Makefile @@ -106,7 +106,7 @@ SDL2AUDIODIRS := \ BEAGLEBOARDDIRS := $(LINUXDIRS) $(DUMMYMIDIDIRS) $(RTAUDIODIRS) $(SDLDIRS) DEBDIRS := $(DBDIRS) $(JACKDIRS) $(RTAUDIODIRS) $(RTMIDIDIRS) $(SDLDIRS) RASPIDIRS := $(LINUXDIRS) $(JACKDIRS) $(RTAUDIODIRS) $(RTMIDIDIRS) $(SDLDIRS) -RG35XXSDIRS := $(LINUXDIRS) $(DUMMYMIDIDIRS) $(SDL2DIRS) $(SDL2AUDIODIRS) +RG35XXPLUSDIRS := $(LINUXDIRS) $(DUMMYMIDIDIRS) $(SDL2DIRS) $(SDL2AUDIODIRS) STEAMDIRS := $(LINUXDIRS) $(JACKDIRS) $(RTAUDIODIRS) $(RTMIDIDIRS) $(SDLDIRS) #X64DIRS := $(LINUXDIRS) $(RTMIDIDIRS) $(SDL2DIRS) $(SDL2AUDIODIRS) X64DIRS := $(LINUXDIRS) $(DUMMYMIDIDIRS) $(SDL2DIRS) $(SDL2AUDIODIRS) @@ -326,7 +326,7 @@ SDLAUDIOFILES := \ DEBFILES := $(DBFILES) $(RTAUDIOFILES) $(RTMIDIFILES) $(JACKFILES) BEAGLEBOARDFILES := $(LINUXFILES) $(DUMMYMIDIFILES) RASPIFILES := $(LINUXFILES) $(RTAUDIOFILES) $(RTMIDIFILES) $(JACKFILES) -RG35XXSFILES := $(LINUXFILES) $(SDLAUDIOFILES) $(DUMMYMIDIFILES) +RG35XXPLUSFILES := $(LINUXFILES) $(SDLAUDIOFILES) $(DUMMYMIDIFILES) STEAMFILES := $(LINUXFILES) $(RTAUDIOFILES) $(RTMIDIFILES) $(JACKFILES) #X64FILES := $(LINUXFILES) $(RTMIDIFILES) $(SDLAUDIOFILES) X64FILES := $(LINUXFILES) $(SDLAUDIOFILES) $(DUMMYMIDIFILES) diff --git a/projects/Makefile.RG35XXS b/projects/Makefile.RG35XXPLUS similarity index 97% rename from projects/Makefile.RG35XXS rename to projects/Makefile.RG35XXPLUS index 2fff06f3..97d10508 100644 --- a/projects/Makefile.RG35XXS +++ b/projects/Makefile.RG35XXPLUS @@ -27,7 +27,7 @@ INCLUDES = -Iinclude $(SDL_CFLAGS) -I$(DEVKIT)/$(TRIPLET)/include -I$(DEVKIT)/$( CFLAGS := $(DEFINES) $(INCLUDES) $(OPT_FLAGS) -Wall CXXFLAGS:= $(CFLAGS) -std=gnu++03 LIBS := -Wl,-rpath-link,$(DEVKIT)/$(TRIPLET)/lib -Wl,-rpath-link,$(DEVKIT)/$(TRIPLET)/lib/pulseaudio $(SDL_LIBS) -lpthread -OUTPUT = ../lgpt-rg35xxS +OUTPUT = ../lgpt-rg35xxplus EXTENSION:= elf %.elf: $(OFILES) diff --git a/projects/resources/packaging/lgpt_package.sh b/projects/resources/packaging/lgpt_package.sh index 6598dbd7..45c1bde6 100755 --- a/projects/resources/packaging/lgpt_package.sh +++ b/projects/resources/packaging/lgpt_package.sh @@ -16,7 +16,7 @@ collect_resources() { #1PLATFORM #2lgpt.*-exe echo "-=-=Packaging $PACKAGE=-=-" CONTENTS="./resources/$1/*" CONTENTS+=" $(find -iname $2)" - if [ "$1" == "PSP" ] || [ "$1" == "GARLIC" ] || [ "$1" == "RG35XXS" ]; then # All files go in the root folder + if [ "$1" == "PSP" ] || [ "$1" == "GARLIC" ] || [ "$1" == "RG35XXPLUS" ]; then # All files go in the root folder zip -9 $PACKAGE -j $CONTENTS else # all the others go in the bin mkdir bin ; cp $CONTENTS bin @@ -41,6 +41,6 @@ collect_resources RASPI lgpt.rpi-exe collect_resources CHIP lgpt.chip-exe collect_resources BITTBOY lgpt-bittboy.elf collect_resources GARLIC lgpt-garlic.elf -collect_resources RG35XXS lgpt-rg35xxS.elf +collect_resources RG35XXPLUS lgpt-rg35xxplus.elf # collect_resources RS97 lgpt.dge # collect_resources STEAM lgpt.steam-exe From eae6fd20586474bf30fe2d75b1db84f9ef3b2ba9 Mon Sep 17 00:00:00 2001 From: Simon Lees Date: Thu, 22 Aug 2024 12:44:04 +0930 Subject: [PATCH 60/66] Add x64 x86 and rg35xxplus instructions to project README.md --- projects/README.md | 37 +++++++++++++++++++++++++++++++------ 1 file changed, 31 insertions(+), 6 deletions(-) diff --git a/projects/README.md b/projects/README.md index e1287753..d785a43e 100644 --- a/projects/README.md +++ b/projects/README.md @@ -27,6 +27,22 @@ Build with: make PLATFORM=DEB + +##### X64: Compile under Linux + Required libs: + sudo apt install -y git make libsdl2 libasound2-plugins libjack-dev python3 python3-pillow + + Build with: + make PLATFORM=X64 + +##### X86: Compile under Linux + This builds a 32bit version of the X64 SDL2 port + Required libs: + sudo dpkg --add-architecture i386 && sudo apt update + sudo apt install -y git make gcc-multilib g++-multilib libsdl2-dev:i386 libasound2-plugins:i386 libjack-dev:i386 python3 python3-pillow + + Build with: + make PLATFORM=X86 ##### RASPI: Compile under Linux Required libs: @@ -71,9 +87,18 @@ make PLATFORM=GARLIC ##### GARLICPLUS: Compile in shauninman toolchain docker - clone: - https://github.com/shauninman/union-rg35xxplus-toolchain - enter docker: - make shell - Build with: - make PLATFORM=GARLICPLUS + clone: + https://github.com/shauninman/union-rg35xxplus-toolchain + enter docker: + make shell + Build with: + make PLATFORM=GARLICPLUS + +##### RG35XXPLUS: Compile with simotek toolchain + download: + https://github.com/simotek/rg35xx-plus-aarch64-SDL2-SDK/releases/download/0.1.0/rg35xx-plus-aarch64-SDL2-SDK-0.1.0.tar.xz + extract: + cd /opt + tar -xf rg35xx-plus-aarch64-SDL2-SDK-0.1.0.tar.xz + Build with: + make PLATFORM=RG35XXPLUS From 3ba59748a155e24d06f098417283cb6693371aa4 Mon Sep 17 00:00:00 2001 From: Simon Lees Date: Thu, 22 Aug 2024 14:28:34 +0930 Subject: [PATCH 61/66] Add x64 and x86 Resources copied from DEB --- projects/resources/X64/config.xml | 29 ++++++++++++++ projects/resources/X64/mapping.xml | 61 ++++++++++++++++++++++++++++++ projects/resources/X86/config.xml | 29 ++++++++++++++ projects/resources/X86/mapping.xml | 61 ++++++++++++++++++++++++++++++ 4 files changed, 180 insertions(+) create mode 100644 projects/resources/X64/config.xml create mode 100644 projects/resources/X64/mapping.xml create mode 100644 projects/resources/X86/config.xml create mode 100644 projects/resources/X86/mapping.xml diff --git a/projects/resources/X64/config.xml b/projects/resources/X64/config.xml new file mode 100644 index 00000000..f47f24e5 --- /dev/null +++ b/projects/resources/X64/config.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + diff --git a/projects/resources/X64/mapping.xml b/projects/resources/X64/mapping.xml new file mode 100644 index 00000000..ab5d37e3 --- /dev/null +++ b/projects/resources/X64/mapping.xml @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/projects/resources/X86/config.xml b/projects/resources/X86/config.xml new file mode 100644 index 00000000..f47f24e5 --- /dev/null +++ b/projects/resources/X86/config.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + diff --git a/projects/resources/X86/mapping.xml b/projects/resources/X86/mapping.xml new file mode 100644 index 00000000..ab5d37e3 --- /dev/null +++ b/projects/resources/X86/mapping.xml @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From b2c02f3cca8ed2631e8134c69353b6de2c59732d Mon Sep 17 00:00:00 2001 From: Simon Lees Date: Thu, 22 Aug 2024 14:43:00 +0930 Subject: [PATCH 62/66] Add RG35XXPLUS Resources --- .../resources/RG35XXPLUS/INSTALL_HOW_TO.txt | 9 ++++++++ .../resources/RG35XXPLUS/LittleGPTracker.png | Bin 0 -> 1499 bytes .../resources/RG35XXPLUS/LittleGPTracker.sh | 6 +++++ projects/resources/RG35XXPLUS/config.xml | 15 +++++++++++++ projects/resources/RG35XXPLUS/mapping.xml | 21 ++++++++++++++++++ 5 files changed, 51 insertions(+) create mode 100644 projects/resources/RG35XXPLUS/INSTALL_HOW_TO.txt create mode 100644 projects/resources/RG35XXPLUS/LittleGPTracker.png create mode 100644 projects/resources/RG35XXPLUS/LittleGPTracker.sh create mode 100644 projects/resources/RG35XXPLUS/config.xml create mode 100644 projects/resources/RG35XXPLUS/mapping.xml diff --git a/projects/resources/RG35XXPLUS/INSTALL_HOW_TO.txt b/projects/resources/RG35XXPLUS/INSTALL_HOW_TO.txt new file mode 100644 index 00000000..d6bca3c6 --- /dev/null +++ b/projects/resources/RG35XXPLUS/INSTALL_HOW_TO.txt @@ -0,0 +1,9 @@ +Installation: +1. Copy lgpt-rg35xxplus.elf, config.xml, samplelib, mapping.xml to /mmc/Roms/APPS/lgpt/ +2. Copy LittleGPTracker.png to /SdCard/Roms/APPS/Imgs/ +3. Copy LittleGPTracker.sh to /SdCard/Roms/APPS/ + +Usage: +In "Garlic OS" open "Consoles -> Apps -> LittleGPTracker". + + diff --git a/projects/resources/RG35XXPLUS/LittleGPTracker.png b/projects/resources/RG35XXPLUS/LittleGPTracker.png new file mode 100644 index 0000000000000000000000000000000000000000..3ee4d69ae65098a018b4cd486aa93280cdc5e49c GIT binary patch literal 1499 zcmV<11tj{3P)Ob~`^R^JK82rW6W2)!pDUa}r}P5>tuX+lDz zIe|IBSlb!IoM0Uy5+uUOxWasatGcUyY+(2qkg5~FHrTSCdh4xn8vq$HWXO>5@Z;&4 zKdzMeYFnqZetM)6^-EYeZv1!d4~&tT{f^O6H?$BnIU}olQvd+41NZ^}s2_wZA?nr| z#r0^n(*OXFgCfSvc4hg|yxBG{zu#ZXy1IrZA?m@0oTyucUalHZPE42qyeWL2;xf5J^g`6Ni6Zg#>2Ya^4J2q=Az_XUrC$dCfH@QT`40=d5Opo0 z3`uAl^JBiWwQuXRow^#g%TxMnZN=pMXLU=6x)xF6yvcIq>xZjNj2f<2r;K{*fw-|m zLDmqgQMdGsHA{$+6Lo{`0SWdF(=|7fL*EWixTMxNPA5%NOsTGmh1n5SB4ztEQJLVf zS_@GRLsSoIh`$jce8IKCU71CnjD$ew!L0=*LN9T} z_?Wt^CBL^PgDhM($4KkI>MWvmhp7pc zb<}!}rNGp`{lt%ZmISaP0eKNnW9$dLFrkOOOX+5XDd7*ZH_6Kv0D#utBTI<7ME8Jh zT$W0mwG-Y2*dR$G)SukR^IrFJ6P77NqBDr7HNFnqeQ{U1##?EpYL*ZsC+a57oC@^D z+0JmD002ObXh*>x{ZXyyo zx(`CsCB*!gkz;E(XC}4p;Wy>RaT`hR-YCrWMQ9JA2jP9LLYv}uJ!b4y*fGK`MBR$0 z*id+z{Y`xY_JDM!7^)DO+ATq%r4#*DM8Evj)`q>$5c3qZZKmxp9W(n+h!Qcs)6g5U ziDct}LKofOoer&-QyJ%nnG>R)epY}WbfF)%iGy%tb)@k%5PpBPY=pgQeuEHo3B!5P z*jaJh_Pndc#Jrx6@alk?f=uMJqkFK8rGA%S`c2-MAU{mYvc8UjCq(_UMkzF$y!W%g zD@#|g7{}W=l2^j7ZwLZbk@EVh`>v^c03( zq|!%mUhujOtM)8cfpzFA;p(n~zz|z3@pBR;m=R4=!foeko`^8?Y6-nN74x;*85prv zvVXTJzrdt3JCzYdd__jrZbP@i=$W0j(jL=na(Hr@5Or&f8Zbc_nJcNTs>0u%cE%T2dPhG>w=U18O zSm-#_t6it{;r_W0C5H3P#GD47DmZ>sXQlo?@LB9kG0%^N>S$SLLe9OdwqoH%a~__4 zzlfOsxR{gS+$SAro-gyCh3S|DGv%ev%3U{qXVVs6>Fdhv8t|K>nM)aeSiFlQA?j8d zMK?bGl_X77w7fVi%_B+JqZ$puzW97eI>_mAwJ|DpXbVH;P$v*y=3(qCY$Ju1QPb7Jp_fQYY}Ds zi-oRKWE;EAeG;Kb%lJ$S&VCsWA}O3E#B#_oH}$71^&6pHV(L#0i?e9dy_YcGHmnNR ze@x*&0qu+hu_Pj log.txt +sync diff --git a/projects/resources/RG35XXPLUS/config.xml b/projects/resources/RG35XXPLUS/config.xml new file mode 100644 index 00000000..cea9fe0a --- /dev/null +++ b/projects/resources/RG35XXPLUS/config.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/projects/resources/RG35XXPLUS/mapping.xml b/projects/resources/RG35XXPLUS/mapping.xml new file mode 100644 index 00000000..bb6436b3 --- /dev/null +++ b/projects/resources/RG35XXPLUS/mapping.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + From 0da403058d4a20006af6f9976379168a674fb40a Mon Sep 17 00:00:00 2001 From: Simon Lees Date: Fri, 23 Aug 2024 20:49:05 +0930 Subject: [PATCH 63/66] Explain difference between various rg35xx options --- projects/README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/projects/README.md b/projects/README.md index d785a43e..955f7e65 100644 --- a/projects/README.md +++ b/projects/README.md @@ -78,6 +78,7 @@ make PLATFORM=RS97 ##### GARLIC: Compile in edemirkans toolchain docker + For older Anbernic RG35XX Devices running GarlicOS clone: https://github.com/edemirkan/rg35xx-toolchain enter docker: @@ -87,6 +88,8 @@ make PLATFORM=GARLIC ##### GARLICPLUS: Compile in shauninman toolchain docker + For newer Anbernic RG35XX Platform devices (SP, Plus, H, 2024) + running either Garlic or muOS clone: https://github.com/shauninman/union-rg35xxplus-toolchain enter docker: @@ -95,6 +98,8 @@ make PLATFORM=GARLICPLUS ##### RG35XXPLUS: Compile with simotek toolchain + For newer Anbernic RG35XX Platform devices (SP, Plus, H, 2024) + running the latest 64bit stock or stock modified firmware. download: https://github.com/simotek/rg35xx-plus-aarch64-SDL2-SDK/releases/download/0.1.0/rg35xx-plus-aarch64-SDL2-SDK-0.1.0.tar.xz extract: From 294baa4ecd697aef39dcda4779e2edfa64c7ae54 Mon Sep 17 00:00:00 2001 From: Simon Lees Date: Sat, 31 Aug 2024 11:22:45 +0930 Subject: [PATCH 64/66] Fix remaining workflow issues --- .github/workflows/build.yml | 47 ++++++++++++++++++-- projects/Makefile.GARLICPLUS | 45 ++++++++++--------- projects/resources/packaging/lgpt_package.sh | 1 + 3 files changed, 69 insertions(+), 24 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cfb2f937..73001e48 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -350,7 +350,48 @@ jobs: with: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} tag_name: ${{ steps.extract_tag.outputs.tag_name }} - files: ./workspace/LittleGPTracker/projects/*.zip + files: ./workspace/projects/*.zip + + build-garlicplus: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Install Garlic Plus toolchain + run: | + python -m pip install --upgrade pip + pip install Pillow + wget -O /tmp/rg35xxplus-toolchain.tar.xz https://github.com/simotek/union-rg35xxplus-toolchain/releases/download/20240830/rg35xxplus-toolchain.tar.xz + mkdir /opt/rg35xxplus-toolchain + tar -xvf /tmp/rg35xxplus-toolchain.tar.xz -C /opt/rg35xxplus-toolchain --strip-components=1 + + - name: Build Garlic Plus + working-directory: projects + run: make PLATFORM=GARLICPLUS + + - name: Package build + working-directory: projects + run: | + curl -L -o lgpt-resources.zip https://github.com/djdiskmachine/lgpt-resources/archive/refs/tags/1.0.zip + unzip lgpt-resources.zip + mv lgpt-resources-1.0/*/ ./resources/packaging + rm -rf lgpt-resources* + ./resources/packaging/lgpt_package.sh + + - name: Extract Git tag name + id: extract_tag + run: echo "::set-output name=tag_name::${GITHUB_REF#refs/tags/}" + env: + GITHUB_REF: ${{ github.ref }} + + - name: Upload build release + uses: softprops/action-gh-release@v2 + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + tag_name: ${{ steps.extract_tag.outputs.tag_name }} + files: ./projects/*.zip build-rg35xxplus: runs-on: ubuntu-latest @@ -372,7 +413,7 @@ jobs: run: make PLATFORM=RG35XXPLUS - name: Package build - working-directory: ./workspace/LittleGPTracker/projects + working-directory: projects run: | curl -L -o lgpt-resources.zip https://github.com/djdiskmachine/lgpt-resources/archive/refs/tags/1.0.zip unzip lgpt-resources.zip @@ -391,4 +432,4 @@ jobs: with: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} tag_name: ${{ steps.extract_tag.outputs.tag_name }} - files: ./workspace/LittleGPTracker/projects/*.zip + files: ./projects/*.zip diff --git a/projects/Makefile.GARLICPLUS b/projects/Makefile.GARLICPLUS index e31fbad7..f6f68156 100644 --- a/projects/Makefile.GARLICPLUS +++ b/projects/Makefile.GARLICPLUS @@ -1,36 +1,39 @@ -include $(PWD)/rules_base STRIP = $(CROSS_COMPILE)strip -%.elf: $(OFILES) - $(CXX) $(LDFLAGS) -o $@ $(OFILES) $(LIBS) - @$(STRIP) $@ +export LD_LIBRARY_PATH = $LD_LIBRARY_PATH:/usr/lib/x86_64-linux-gnu:/opt/rg35xxplus-toolchain/usr/lib -# compiled using the https://github.com/shauninman/union-rg35xxplus-toolchain -# Docker image +DEFINES := \ + -DBUFFERED \ + -DCPP_MEMORY \ + -D_NDEBUG \ + -DHAVE_STDINT_H \ + -D_NO_JACK_ -DEVKIT = /opt/rg35xxplus-toolchain/usr/ -CROSS_COMPILE=$(DEVKIT)bin/arm-buildroot-linux-gnueabihf- +# compiled using the https://github.com/shauninman/union-rg35xxplus-toolchain +DEVKIT = /opt/rg35xxplus-toolchain/ +CROSS_COMPILE=$(DEVKIT)/usr/bin/arm-buildroot-linux-gnueabihf- CC = $(CROSS_COMPILE)gcc CXX = $(CROSS_COMPILE)g++ +TOOLPATH=$(DEVKIT)/usr/bin SYSROOT := $(shell $(CROSS_COMPILE)gcc --print-sysroot) + SDL_CFLAGS := $(shell $(SYSROOT)/usr/bin/sdl-config --cflags) SDL_LIBS := $(shell $(SYSROOT)/usr/bin/sdl-config --libs) -DEFINES = -DHAVE_STDINT_H -D_NDEBUG -D_NO_JACK_ -I$(PWD)/../sources -DCPP_MEMORY $(SDL_CFLAGS) $(SDL_LIBS) -DBUFFERED -INCLUDES = -Iinclude $(SDL_CFLAGS) -OPT_FLAGS = -O3 -Ofast -fdata-sections -fdata-sections -fno-common -fno-PIC -flto -marm -mtune=cortex-a53 -mfpu=neon-vfpv4 -mfloat-abi=hard -march=armv8-a - -OUTPUT = ../lgpt-rg35xxplus - -TOOLPATH=$(DEVKIT)/usr/bin -PREFIX := arm-linux-gnueabihf- - -CFLAGS := $(DEFINES) $(INCLUDES) $(OPT_FLAGS) -Wall -CXXFLAGS:= $(CFLAGS) -std=gnu++03 - -EXTENSION:= elf - +# optimization +OPT_FLAGS = -O3 -Ofast -fdata-sections -fdata-sections -fno-common -fno-PIC -flto -marm -mtune=cortex-a53 -mfpu=neon-vfpv4 -mfloat-abi=hard +PREFIX := arm-linux-gnueabihf- +INCLUDES = -Iinclude $(SDL_CFLAGS) -I$(PWD)/../sources +CFLAGS := $(DEFINES) $(INCLUDES) $(OPT_FLAGS) -Wall +CXXFLAGS:= $(CFLAGS) -std=gnu++03 LIBS := -lSDL -lpthread LIBDIRS := $(DEKVIT)/usr/lib LIBDIRS += $(DEKVIT)/usr/include +OUTPUT = ../lgpt-garlicplus +EXTENSION:= elf + +%.elf: $(OFILES) + $(CXX) $(LDFLAGS) -o $@ $(OFILES) $(LIBS) + @$(STRIP) $@ diff --git a/projects/resources/packaging/lgpt_package.sh b/projects/resources/packaging/lgpt_package.sh index 45c1bde6..801a0ed2 100755 --- a/projects/resources/packaging/lgpt_package.sh +++ b/projects/resources/packaging/lgpt_package.sh @@ -41,6 +41,7 @@ collect_resources RASPI lgpt.rpi-exe collect_resources CHIP lgpt.chip-exe collect_resources BITTBOY lgpt-bittboy.elf collect_resources GARLIC lgpt-garlic.elf +collect_resources GARLICPLUS lgpt-garlicplus.elf collect_resources RG35XXPLUS lgpt-rg35xxplus.elf # collect_resources RS97 lgpt.dge # collect_resources STEAM lgpt.steam-exe From d569ca40c8efbb65c368daaacb818bfa6983f332 Mon Sep 17 00:00:00 2001 From: Simon Lees Date: Sat, 31 Aug 2024 20:49:36 +0930 Subject: [PATCH 65/66] Make the lastest songview changes work with SDL2 --- sources/Application/Views/SongView.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sources/Application/Views/SongView.h b/sources/Application/Views/SongView.h index 2724294a..1791c7a1 100644 --- a/sources/Application/Views/SongView.h +++ b/sources/Application/Views/SongView.h @@ -3,7 +3,11 @@ #define _SONG_VIEW_H_ #include "BaseClasses/View.h" +#ifdef SDL2 +#include +#else #include +#endif class SongView ; From 95d4665c49b836eb7d83121527a8c62fbc1dc1b7 Mon Sep 17 00:00:00 2001 From: Simon Lees Date: Sun, 1 Sep 2024 19:23:49 +0930 Subject: [PATCH 66/66] Add a proper readme for RG35XX+ --- projects/resources/RG35XXPLUS/INSTALL_HOW_TO.txt | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/projects/resources/RG35XXPLUS/INSTALL_HOW_TO.txt b/projects/resources/RG35XXPLUS/INSTALL_HOW_TO.txt index d6bca3c6..9f40be6b 100644 --- a/projects/resources/RG35XXPLUS/INSTALL_HOW_TO.txt +++ b/projects/resources/RG35XXPLUS/INSTALL_HOW_TO.txt @@ -1,9 +1,13 @@ Installation: -1. Copy lgpt-rg35xxplus.elf, config.xml, samplelib, mapping.xml to /mmc/Roms/APPS/lgpt/ -2. Copy LittleGPTracker.png to /SdCard/Roms/APPS/Imgs/ -3. Copy LittleGPTracker.sh to /SdCard/Roms/APPS/ +1. Ensure you have the latest rg35xx Stock firmware from below or the latest "Stock Modified firmware", this build requires the 64bit OS + * https://win.anbernic.com/download/318.html (RG35XXPLUS-EN-240712 or later) +2. Copy the following files, note `/mnt/mmc/Roms/` is the path when the SD-Card is mounted in the device. When viewing from your computer it will just be a partition with a `Roms` Directory + a. lgpt-rg35xxplus.elf, config.xml, samplelib, mapping.xml to `/mnt/mmc/Roms/APPS/lgpt/` + b. Copy LittleGPTracker.png to /mnt/mmc/Roms/APPS/lgpt/Imgs/ + c. Copy LittleGPTracker.sh to /mnt/mmc/Roms/APPS/lgpt/ + Usage: -In "Garlic OS" open "Consoles -> Apps -> LittleGPTracker". +on the "Stock OS" open "App Center -> APPS -> LittleGPTracker".