mirror of
https://github.com/RaySollium99/picodrive.git
synced 2025-09-06 15:48:05 -04:00
initial import
git-svn-id: file:///home/notaz/opt/svn/PicoDrive@2 be3aeb3a-fb24-0410-a615-afba39da0efa
This commit is contained in:
parent
2cadbd5e56
commit
cc68a136aa
341 changed files with 180839 additions and 0 deletions
418
platform/uiq2/audio/motorola/AUDIO_MOTOROLA.ARMI
Normal file
418
platform/uiq2/audio/motorola/AUDIO_MOTOROLA.ARMI
Normal file
|
@ -0,0 +1,418 @@
|
|||
|
||||
# CWD \DEV\UIQ21\_SRC\PICODRIVEN\AUDIO\MOTOROLA\
|
||||
# MMPFile \DEV\UIQ21\_SRC\PICODRIVEN\AUDIO\MOTOROLA\AUDIO_MOTOROLA.MMP
|
||||
# Target AUDIO_MOTOROLA.DLL
|
||||
# TargetType DLL
|
||||
# BasicTargetType DLL
|
||||
# MakefileType GNU
|
||||
|
||||
ERASE = @erase 2>>nul
|
||||
|
||||
# EPOC DEFINITIONS
|
||||
|
||||
EPOCBLD = ..\..\..\..\..\A925SDK\EPOC32\BUILD\DEV\UIQ21\_SRC\PICODRIVEN\AUDIO\MOTOROLA\AUDIO_MOTOROLA\ARMI
|
||||
EPOCTRG = ..\..\..\..\..\A925SDK\EPOC32\RELEASE\ARMI
|
||||
EPOCLIB = ..\..\..\..\..\A925SDK\EPOC32\RELEASE\ARMI
|
||||
EPOCLINK = ..\..\..\..\..\A925SDK\EPOC32\RELEASE\ARMI
|
||||
EPOCSTATLINK = ..\..\..\..\..\A925SDK\EPOC32\RELEASE\ARMI
|
||||
EPOCASSPLINK = ..\..\..\..\..\A925SDK\EPOC32\RELEASE\MARM
|
||||
EPOCDATA = \DEV\A925SDK\EPOC32\DATA
|
||||
EPOCINC = \DEV\A925SDK\EPOC32\INCLUDE
|
||||
TRGDIR =
|
||||
DATADIR = Z\SYSTEM\DATA
|
||||
|
||||
EPOCBLDUREL = $(EPOCBLD)\UREL
|
||||
EPOCTRGUREL = $(EPOCTRG)\UREL
|
||||
EPOCLIBUREL = $(EPOCLIB)\UREL
|
||||
EPOCLINKUREL = $(EPOCLINK)\UREL
|
||||
EPOCSTATLINKUREL = $(EPOCSTATLINK)\UREL
|
||||
EPOCASSPLINKUREL = $(EPOCASSPLINK)\UREL
|
||||
|
||||
EPOCBLDUDEB = $(EPOCBLD)\UDEB
|
||||
EPOCTRGUDEB = $(EPOCTRG)\UDEB
|
||||
EPOCLIBUDEB = $(EPOCLIB)\UREL
|
||||
EPOCLINKUDEB = $(EPOCLINK)\UREL
|
||||
EPOCSTATLINKUDEB = $(EPOCSTATLINK)\UDEB
|
||||
EPOCASSPLINKUDEB = $(EPOCASSPLINK)\UREL
|
||||
|
||||
# EPOC PSEUDOTARGETS
|
||||
|
||||
UREL : MAKEWORKUREL RESOURCEUREL
|
||||
|
||||
UDEB : MAKEWORKUDEB RESOURCEUDEB
|
||||
|
||||
ALL : UREL UDEB
|
||||
|
||||
CLEAN CLEANALL : CLEANBUILD CLEANRELEASE CLEANLIBRARY
|
||||
|
||||
|
||||
|
||||
WHAT WHATALL : WHATUREL WHATUDEB
|
||||
|
||||
RESOURCE RESOURCEALL : RESOURCEUREL RESOURCEUDEB
|
||||
|
||||
CLEANBUILD CLEANBUILDALL : CLEANBUILDUREL CLEANBUILDUDEB
|
||||
|
||||
CLEANRELEASE CLEANRELEASEALL : CLEANRELEASEUREL CLEANRELEASEUDEB
|
||||
|
||||
MAKEWORK MAKEWORKALL : MAKEWORKUREL MAKEWORKUDEB
|
||||
|
||||
LISTING LISTINGALL : LISTINGUREL LISTINGUDEB
|
||||
|
||||
MAKEWORK : MAKEWORKLIBRARY
|
||||
|
||||
RESOURCEUREL RESOURCEUDEB : GENERIC_RESOURCE
|
||||
|
||||
|
||||
# must set both PATH and Path to make it work correctly
|
||||
Path:=X:\DEV\A925SDK\EPOC32\gcc\bin;$(Path)
|
||||
PATH:=$(Path)
|
||||
|
||||
INCDIR = -I "." -I "..\.." -I "..\..\..\..\..\A925SDK\EPOC32\INCLUDE"
|
||||
|
||||
GCCFLAGS=-march=armv4t -mthumb-interwork \
|
||||
-pipe -c -nostdinc -Wall -Wno-ctor-dtor-privacy -Wno-unknown-pragmas
|
||||
|
||||
GCCDEFS = -D__SYMBIAN32__ -D__GCC32__ -D__EPOC32__ -D__MARM__ -D__MARM_ARMI__ -D__DLL__ $(USERDEFS)
|
||||
|
||||
GCCUREL = gcc -s -fomit-frame-pointer -O $(GCCFLAGS) -DNDEBUG -D_UNICODE $(GCCDEFS)
|
||||
GCCUDEB = gcc -g -O $(GCCFLAGS) -D_DEBUG -D_UNICODE $(GCCDEFS)
|
||||
|
||||
|
||||
UREL : \
|
||||
$(EPOCTRGUREL)\AUDIO_MOTOROLA.DLL \
|
||||
LIBRARY
|
||||
|
||||
|
||||
UDEB : \
|
||||
$(EPOCTRGUDEB)\AUDIO_MOTOROLA.DLL \
|
||||
LIBRARY
|
||||
|
||||
|
||||
|
||||
RESOURCEUREL : MAKEWORKUREL
|
||||
RESOURCEUDEB : MAKEWORKUDEB
|
||||
|
||||
LIBRARY : MAKEWORKLIBRARY $(EPOCLIB)\UREL\AUDIO_MOTOROLA.LIB \DEV\A925SDK\EPOC32\RELEASE\ARM4\UREL\AUDIO_MOTOROLA.LIB \DEV\A925SDK\EPOC32\RELEASE\THUMB\UREL\AUDIO_MOTOROLA.LIB
|
||||
|
||||
|
||||
# REAL TARGET - LIBRARY
|
||||
|
||||
$(EPOCLIB)\UREL\AUDIO_MOTOROLA.LIB : \DEV\UIQ21\_SRC\PICODRIVEN\AUDIO\MOTOROLA\AUDIO_MOTOROLA.DEF
|
||||
@echo AUDIO_MOTOROLA.LIB: dlltool
|
||||
@dlltool -m arm_interwork --output-lib "$(EPOCLIB)\UREL\AUDIO_MOTOROLA.LIB" \
|
||||
--def ".\AUDIO_MOTOROLA.DEF" \
|
||||
--dllname "AUDIO_MOTOROLA[1000c197].DLL"
|
||||
|
||||
\DEV\A925SDK\EPOC32\RELEASE\ARM4\UREL\AUDIO_MOTOROLA.LIB : \DEV\UIQ21\_SRC\PICODRIVEN\AUDIO\MOTOROLA\AUDIO_MOTOROLA.DEF
|
||||
@echo AUDIO_MOTOROLA.LIB: dlltool
|
||||
@dlltool -m arm --output-lib "..\..\..\..\..\A925SDK\EPOC32\RELEASE\ARM4\UREL\AUDIO_MOTOROLA.LIB" \
|
||||
--def ".\AUDIO_MOTOROLA.DEF" \
|
||||
--dllname "AUDIO_MOTOROLA[1000c197].DLL"
|
||||
|
||||
\DEV\A925SDK\EPOC32\RELEASE\THUMB\UREL\AUDIO_MOTOROLA.LIB : \DEV\UIQ21\_SRC\PICODRIVEN\AUDIO\MOTOROLA\AUDIO_MOTOROLA.DEF
|
||||
@echo AUDIO_MOTOROLA.LIB: dlltool
|
||||
@dlltool -m thumb --output-lib "..\..\..\..\..\A925SDK\EPOC32\RELEASE\THUMB\UREL\AUDIO_MOTOROLA.LIB" \
|
||||
--def ".\AUDIO_MOTOROLA.DEF" \
|
||||
--dllname "AUDIO_MOTOROLA[1000c197].DLL"
|
||||
|
||||
|
||||
FREEZE :
|
||||
perl -S efreeze.pl "\DEV\UIQ21\_SRC\PICODRIVEN\AUDIO\MOTOROLA\AUDIO_MOTOROLA.DEF" "$(EPOCBLD)\AUDIO_MOTOROLA.def"
|
||||
|
||||
CLEANLIBRARY :
|
||||
-$(ERASE) "$(EPOCLIB)\UREL\AUDIO_MOTOROLA.LIB"
|
||||
-$(ERASE) "\DEV\A925SDK\EPOC32\RELEASE\ARM4\UREL\AUDIO_MOTOROLA.LIB"
|
||||
-$(ERASE) "\DEV\A925SDK\EPOC32\RELEASE\THUMB\UREL\AUDIO_MOTOROLA.LIB"
|
||||
|
||||
|
||||
GENERIC_RESOURCE : GENERIC_MAKEWORK
|
||||
|
||||
# REAL TARGET - BUILD VARIANT UREL
|
||||
|
||||
WHATUREL : WHATGENERIC
|
||||
|
||||
CLEANUREL : CLEANBUILDUREL CLEANRELEASEUREL
|
||||
|
||||
CLEANBUILDUREL :
|
||||
@perl -S ermdir.pl "$(EPOCBLDUREL)"
|
||||
|
||||
CLEANRELEASEUREL : CLEANGENERIC
|
||||
|
||||
|
||||
UREL_RELEASEABLES1= \
|
||||
\DEV\A925SDK\EPOC32\RELEASE\ARM4\UREL\AUDIO_MOTOROLA.LIB \
|
||||
\DEV\A925SDK\EPOC32\RELEASE\ARMI\UREL\AUDIO_MOTOROLA.DLL \
|
||||
\DEV\A925SDK\EPOC32\RELEASE\ARMI\UREL\AUDIO_MOTOROLA.DLL.MAP \
|
||||
\DEV\A925SDK\EPOC32\RELEASE\ARMI\UREL\AUDIO_MOTOROLA.LIB \
|
||||
\DEV\A925SDK\EPOC32\RELEASE\THUMB\UREL\AUDIO_MOTOROLA.LIB
|
||||
|
||||
WHATUREL:
|
||||
@echo $(UREL_RELEASEABLES1)
|
||||
|
||||
CLEANRELEASEUREL:
|
||||
-$(ERASE) $(UREL_RELEASEABLES1)
|
||||
|
||||
LISTINGUREL : MAKEWORKUREL \
|
||||
LISTINGURELAUDIO_MOTOROLA \
|
||||
LISTINGURELPOLLEDAS
|
||||
|
||||
LIBSUREL= \
|
||||
$(EPOCSTATLINKUREL)\EDLLSTUB.LIB \
|
||||
$(EPOCSTATLINKUREL)\EGCC.LIB \
|
||||
$(EPOCLINKUREL)\EUSER.LIB \
|
||||
$(EPOCLINKUREL)\MAUDIOFB.LIB \
|
||||
$(EPOCLINKUREL)\MAUDIOAC.LIB
|
||||
|
||||
$(EPOCTRGUREL)\AUDIO_MOTOROLA.DLL : $(EPOCBLDUREL)\AUDIO_MOTOROLA.in \DEV\UIQ21\_SRC\PICODRIVEN\AUDIO\MOTOROLA\AUDIO_MOTOROLA.DEF $(EPOCSTATLINKUREL)\EDLL.LIB $(LIBSUREL)
|
||||
@echo AUDIO_MOTOROLA.DLL: dlltool
|
||||
@dlltool -m arm_interwork --output-def "$(EPOCBLDUREL)\AUDIO_MOTOROLA.inf" "$(EPOCBLDUREL)\AUDIO_MOTOROLA.in"
|
||||
@echo AUDIO_MOTOROLA.DLL: perl -S makedef.pl
|
||||
@perl -S makedef.pl -Deffile "$(EPOCBLDUREL)\AUDIO_MOTOROLA.inf" -Frzfile "\DEV\UIQ21\_SRC\PICODRIVEN\AUDIO\MOTOROLA\AUDIO_MOTOROLA.DEF" "$(EPOCBLD)\AUDIO_MOTOROLA.def"
|
||||
-$(ERASE) "$(EPOCBLDUREL)\AUDIO_MOTOROLA.inf"
|
||||
@echo AUDIO_MOTOROLA.DLL: dlltool
|
||||
@dlltool -m arm_interwork --def "$(EPOCBLD)\AUDIO_MOTOROLA.def" \
|
||||
--output-exp "$(EPOCBLDUREL)\AUDIO_MOTOROLA.exp" \
|
||||
--dllname "AUDIO_MOTOROLA[1000c197].DLL"
|
||||
@echo AUDIO_MOTOROLA.DLL: ld
|
||||
@ld -s -e _E32Dll -u _E32Dll "$(EPOCBLDUREL)\AUDIO_MOTOROLA.exp" --dll \
|
||||
--base-file "$(EPOCBLDUREL)\AUDIO_MOTOROLA.bas" -o "$(EPOCBLDUREL)\AUDIO_MOTOROLA.DLL" \
|
||||
"$(EPOCSTATLINKUREL)\EDLL.LIB" --whole-archive "$(EPOCBLDUREL)\AUDIO_MOTOROLA.in" \
|
||||
--no-whole-archive $(LIBSUREL) $(USERLDFLAGS)
|
||||
-$(ERASE) "$(EPOCBLDUREL)\AUDIO_MOTOROLA.exp"
|
||||
-$(ERASE) "$(EPOCBLDUREL)\AUDIO_MOTOROLA.DLL"
|
||||
@echo AUDIO_MOTOROLA.DLL: dlltool
|
||||
@dlltool -m arm_interwork \
|
||||
--def "$(EPOCBLD)\AUDIO_MOTOROLA.def" \
|
||||
--dllname "AUDIO_MOTOROLA[1000c197].DLL" \
|
||||
--base-file "$(EPOCBLDUREL)\AUDIO_MOTOROLA.bas" \
|
||||
--output-exp "$(EPOCBLDUREL)\AUDIO_MOTOROLA.exp"
|
||||
-$(ERASE) "$(EPOCBLDUREL)\AUDIO_MOTOROLA.bas"
|
||||
@echo AUDIO_MOTOROLA.DLL: ld
|
||||
@ld -s -e _E32Dll -u _E32Dll --dll \
|
||||
"$(EPOCBLDUREL)\AUDIO_MOTOROLA.exp" \
|
||||
-Map "$(EPOCTRGUREL)\AUDIO_MOTOROLA.DLL.map" -o "$(EPOCBLDUREL)\AUDIO_MOTOROLA.DLL" \
|
||||
"$(EPOCSTATLINKUREL)\EDLL.LIB" --whole-archive "$(EPOCBLDUREL)\AUDIO_MOTOROLA.in" \
|
||||
--no-whole-archive $(LIBSUREL) $(USERLDFLAGS)
|
||||
-$(ERASE) "$(EPOCBLDUREL)\AUDIO_MOTOROLA.exp"
|
||||
@echo AUDIO_MOTOROLA.DLL: petran
|
||||
@petran "$(EPOCBLDUREL)\AUDIO_MOTOROLA.DLL" "$@" \
|
||||
-nocall -uid1 0x10000079 -uid2 0x100039ce -uid3 0x1000c197
|
||||
-$(ERASE) "$(EPOCBLDUREL)\AUDIO_MOTOROLA.DLL"
|
||||
|
||||
OBJECTSUREL= \
|
||||
$(EPOCBLDUREL)\AUDIO_MOTOROLA.o \
|
||||
$(EPOCBLDUREL)\POLLEDAS.o
|
||||
|
||||
$(EPOCBLDUREL)\AUDIO_MOTOROLA.in : $(OBJECTSUREL)
|
||||
@echo AUDIO_MOTOROLA.in: if exist (del?)
|
||||
@if exist "$@" del "$@"
|
||||
@echo AUDIO_MOTOROLA.in: ar
|
||||
@ar cr $@ $^
|
||||
|
||||
|
||||
# REAL TARGET - BUILD VARIANT UDEB
|
||||
|
||||
WHATUDEB : WHATGENERIC
|
||||
|
||||
CLEANUDEB : CLEANBUILDUDEB CLEANRELEASEUDEB
|
||||
|
||||
CLEANBUILDUDEB :
|
||||
@perl -S ermdir.pl "$(EPOCBLDUDEB)"
|
||||
|
||||
CLEANRELEASEUDEB : CLEANGENERIC
|
||||
|
||||
|
||||
UDEB_RELEASEABLES1= \
|
||||
\DEV\A925SDK\EPOC32\RELEASE\ARM4\UREL\AUDIO_MOTOROLA.LIB \
|
||||
\DEV\A925SDK\EPOC32\RELEASE\ARMI\UDEB\AUDIO_MOTOROLA.DLL \
|
||||
\DEV\A925SDK\EPOC32\RELEASE\ARMI\UDEB\AUDIO_MOTOROLA.DLL.MAP \
|
||||
\DEV\A925SDK\EPOC32\RELEASE\ARMI\UREL\AUDIO_MOTOROLA.LIB \
|
||||
\DEV\A925SDK\EPOC32\RELEASE\THUMB\UREL\AUDIO_MOTOROLA.LIB
|
||||
|
||||
WHATUDEB:
|
||||
@echo $(UDEB_RELEASEABLES1)
|
||||
|
||||
CLEANRELEASEUDEB:
|
||||
-$(ERASE) $(UDEB_RELEASEABLES1)
|
||||
|
||||
LISTINGUDEB : MAKEWORKUDEB \
|
||||
LISTINGUDEBAUDIO_MOTOROLA \
|
||||
LISTINGUDEBPOLLEDAS
|
||||
|
||||
LIBSUDEB= \
|
||||
$(EPOCSTATLINKUDEB)\EDLLSTUB.LIB \
|
||||
$(EPOCSTATLINKUDEB)\EGCC.LIB \
|
||||
$(EPOCLINKUDEB)\EUSER.LIB \
|
||||
$(EPOCLINKUDEB)\MAUDIOFB.LIB \
|
||||
$(EPOCLINKUDEB)\MAUDIOAC.LIB
|
||||
|
||||
$(EPOCTRGUDEB)\AUDIO_MOTOROLA.DLL : $(EPOCBLDUDEB)\AUDIO_MOTOROLA.in \DEV\UIQ21\_SRC\PICODRIVEN\AUDIO\MOTOROLA\AUDIO_MOTOROLA.DEF $(EPOCSTATLINKUDEB)\EDLL.LIB $(LIBSUDEB)
|
||||
@echo AUDIO_MOTOROLA.DLL: dlltool
|
||||
@dlltool -m arm_interwork --output-def "$(EPOCBLDUDEB)\AUDIO_MOTOROLA.inf" "$(EPOCBLDUDEB)\AUDIO_MOTOROLA.in"
|
||||
@echo AUDIO_MOTOROLA.DLL: perl -S makedef.pl
|
||||
@perl -S makedef.pl -Deffile "$(EPOCBLDUDEB)\AUDIO_MOTOROLA.inf" -Frzfile "\DEV\UIQ21\_SRC\PICODRIVEN\AUDIO\MOTOROLA\AUDIO_MOTOROLA.DEF" "$(EPOCBLD)\AUDIO_MOTOROLA.def"
|
||||
-$(ERASE) "$(EPOCBLDUDEB)\AUDIO_MOTOROLA.inf"
|
||||
@echo AUDIO_MOTOROLA.DLL: dlltool
|
||||
@dlltool -m arm_interwork --def "$(EPOCBLD)\AUDIO_MOTOROLA.def" \
|
||||
--output-exp "$(EPOCBLDUDEB)\AUDIO_MOTOROLA.exp" \
|
||||
--dllname "AUDIO_MOTOROLA[1000c197].DLL"
|
||||
@echo AUDIO_MOTOROLA.DLL: ld
|
||||
@ld -s -e _E32Dll -u _E32Dll "$(EPOCBLDUDEB)\AUDIO_MOTOROLA.exp" --dll \
|
||||
--base-file "$(EPOCBLDUDEB)\AUDIO_MOTOROLA.bas" -o "$(EPOCBLDUDEB)\AUDIO_MOTOROLA.DLL" \
|
||||
"$(EPOCSTATLINKUDEB)\EDLL.LIB" --whole-archive "$(EPOCBLDUDEB)\AUDIO_MOTOROLA.in" \
|
||||
--no-whole-archive $(LIBSUDEB) $(USERLDFLAGS)
|
||||
-$(ERASE) "$(EPOCBLDUDEB)\AUDIO_MOTOROLA.exp"
|
||||
-$(ERASE) "$(EPOCBLDUDEB)\AUDIO_MOTOROLA.DLL"
|
||||
@echo AUDIO_MOTOROLA.DLL: dlltool
|
||||
@dlltool -m arm_interwork \
|
||||
--def "$(EPOCBLD)\AUDIO_MOTOROLA.def" \
|
||||
--dllname "AUDIO_MOTOROLA[1000c197].DLL" \
|
||||
--base-file "$(EPOCBLDUDEB)\AUDIO_MOTOROLA.bas" \
|
||||
--output-exp "$(EPOCBLDUDEB)\AUDIO_MOTOROLA.exp"
|
||||
-$(ERASE) "$(EPOCBLDUDEB)\AUDIO_MOTOROLA.bas"
|
||||
@echo AUDIO_MOTOROLA.DLL: ld
|
||||
@ld -e _E32Dll -u _E32Dll --dll \
|
||||
"$(EPOCBLDUDEB)\AUDIO_MOTOROLA.exp" \
|
||||
-Map "$(EPOCTRGUDEB)\AUDIO_MOTOROLA.DLL.map" -o "$(EPOCBLDUDEB)\AUDIO_MOTOROLA.DLL" \
|
||||
"$(EPOCSTATLINKUDEB)\EDLL.LIB" --whole-archive "$(EPOCBLDUDEB)\AUDIO_MOTOROLA.in" \
|
||||
--no-whole-archive $(LIBSUDEB) $(USERLDFLAGS)
|
||||
-$(ERASE) "$(EPOCBLDUDEB)\AUDIO_MOTOROLA.exp"
|
||||
objcopy -X "$(EPOCBLDUDEB)\AUDIO_MOTOROLA.DLL" "$(EPOCTRGUDEB)\AUDIO_MOTOROLA.sym"
|
||||
@echo AUDIO_MOTOROLA.DLL: petran
|
||||
@petran "$(EPOCBLDUDEB)\AUDIO_MOTOROLA.DLL" "$@" \
|
||||
-nocall -uid1 0x10000079 -uid2 0x100039ce -uid3 0x1000c197
|
||||
-$(ERASE) "$(EPOCBLDUDEB)\AUDIO_MOTOROLA.DLL"
|
||||
|
||||
OBJECTSUDEB= \
|
||||
$(EPOCBLDUDEB)\AUDIO_MOTOROLA.o \
|
||||
$(EPOCBLDUDEB)\POLLEDAS.o
|
||||
|
||||
$(EPOCBLDUDEB)\AUDIO_MOTOROLA.in : $(OBJECTSUDEB)
|
||||
@echo AUDIO_MOTOROLA.in: if exist (del?)
|
||||
@if exist "$@" del "$@"
|
||||
@echo AUDIO_MOTOROLA.in: ar
|
||||
@ar cr $@ $^
|
||||
|
||||
|
||||
# SOURCES
|
||||
|
||||
# Source AUDIO_MOTOROLA.CPP
|
||||
|
||||
$(EPOCBLDUREL)\AUDIO_MOTOROLA.lis $(EPOCBLDUREL)\AUDIO_MOTOROLA.o \
|
||||
$(EPOCBLDUDEB)\AUDIO_MOTOROLA.lis $(EPOCBLDUDEB)\AUDIO_MOTOROLA.o \
|
||||
: \
|
||||
\DEV\A925SDK\EPOC32\INCLUDE\CMAUDIOAC.H \
|
||||
\DEV\A925SDK\EPOC32\INCLUDE\CMAUDIOFB.H \
|
||||
\DEV\A925SDK\EPOC32\INCLUDE\CMAUDIOFBFORMAT.H \
|
||||
\DEV\A925SDK\EPOC32\INCLUDE\E32BASE.H \
|
||||
\DEV\A925SDK\EPOC32\INCLUDE\E32BASE.INL \
|
||||
\DEV\A925SDK\EPOC32\INCLUDE\E32DEF.H \
|
||||
\DEV\A925SDK\EPOC32\INCLUDE\E32DES16.H \
|
||||
\DEV\A925SDK\EPOC32\INCLUDE\E32DES8.H \
|
||||
\DEV\A925SDK\EPOC32\INCLUDE\E32HAL.H \
|
||||
\DEV\A925SDK\EPOC32\INCLUDE\E32KEYS.H \
|
||||
\DEV\A925SDK\EPOC32\INCLUDE\E32PCCD.H \
|
||||
\DEV\A925SDK\EPOC32\INCLUDE\E32STD.H \
|
||||
\DEV\A925SDK\EPOC32\INCLUDE\E32STD.INL \
|
||||
\DEV\A925SDK\EPOC32\INCLUDE\E32SVR.H \
|
||||
\DEV\A925SDK\EPOC32\INCLUDE\F32FILE.H \
|
||||
\DEV\A925SDK\EPOC32\INCLUDE\F32FILE.INL \
|
||||
\DEV\A925SDK\EPOC32\INCLUDE\MAUDIOGLOBAL.H \
|
||||
\DEV\A925SDK\EPOC32\INCLUDE\RPFILE.H \
|
||||
\DEV\UIQ21\_SRC\PICODRIVEN\AUDIO.H \
|
||||
\DEV\UIQ21\_SRC\PICODRIVEN\AUDIO\MOTOROLA\AUDIO_MOTOROLA.H \
|
||||
\DEV\UIQ21\_SRC\PICODRIVEN\AUDIO\MOTOROLA\POLLEDAS.H
|
||||
|
||||
$(EPOCBLDUREL)\AUDIO_MOTOROLA.o : \DEV\UIQ21\_SRC\PICODRIVEN\AUDIO\MOTOROLA\Audio_motorola.cpp
|
||||
@echo AUDIO_MOTOROLA.o: gcc
|
||||
@$(GCCUREL) -I "." $(INCDIR) -o $@ ".\Audio_motorola.cpp"
|
||||
|
||||
LISTINGURELAUDIO_MOTOROLA : $(EPOCBLDUREL)\AUDIO_MOTOROLA.lis
|
||||
@echo ISTINGURELAUDIO_MOTOROLA: perl -S ecopyfile.pl
|
||||
@perl -S ecopyfile.pl $? \DEV\UIQ21\_SRC\PICODRIVEN\AUDIO\MOTOROLA\AUDIO_MOTOROLA.lst.ARMI
|
||||
|
||||
$(EPOCBLDUREL)\AUDIO_MOTOROLA.lis : \DEV\UIQ21\_SRC\PICODRIVEN\AUDIO\MOTOROLA\Audio_motorola.cpp
|
||||
$(GCCUREL) -Wa,-adln -I "." $(INCDIR) -o nul: ".\Audio_motorola.cpp" > $@
|
||||
|
||||
$(EPOCBLDUDEB)\AUDIO_MOTOROLA.o : \DEV\UIQ21\_SRC\PICODRIVEN\AUDIO\MOTOROLA\Audio_motorola.cpp
|
||||
$(GCCUDEB) -I "." $(INCDIR) -o $@ ".\Audio_motorola.cpp"
|
||||
|
||||
LISTINGUDEBAUDIO_MOTOROLA : $(EPOCBLDUDEB)\AUDIO_MOTOROLA.lis
|
||||
@echo ISTINGUDEBAUDIO_MOTOROLA: perl -S ecopyfile.pl
|
||||
@perl -S ecopyfile.pl $? \DEV\UIQ21\_SRC\PICODRIVEN\AUDIO\MOTOROLA\AUDIO_MOTOROLA.lst.ARMI
|
||||
|
||||
$(EPOCBLDUDEB)\AUDIO_MOTOROLA.lis : \DEV\UIQ21\_SRC\PICODRIVEN\AUDIO\MOTOROLA\Audio_motorola.cpp
|
||||
$(GCCUDEB) -Wa,-adln -I "." $(INCDIR) -o nul: ".\Audio_motorola.cpp" > $@
|
||||
|
||||
|
||||
|
||||
# Source POLLEDAS.CPP
|
||||
|
||||
$(EPOCBLDUREL)\POLLEDAS.lis $(EPOCBLDUREL)\POLLEDAS.o \
|
||||
$(EPOCBLDUDEB)\POLLEDAS.lis $(EPOCBLDUDEB)\POLLEDAS.o \
|
||||
: \
|
||||
\DEV\A925SDK\EPOC32\INCLUDE\E32DEF.H \
|
||||
\DEV\A925SDK\EPOC32\INCLUDE\E32DES16.H \
|
||||
\DEV\A925SDK\EPOC32\INCLUDE\E32DES8.H \
|
||||
\DEV\A925SDK\EPOC32\INCLUDE\E32STD.H \
|
||||
\DEV\A925SDK\EPOC32\INCLUDE\E32STD.INL \
|
||||
\DEV\UIQ21\_SRC\PICODRIVEN\AUDIO\MOTOROLA\POLLEDAS.H
|
||||
|
||||
$(EPOCBLDUREL)\POLLEDAS.o : \DEV\UIQ21\_SRC\PICODRIVEN\AUDIO\MOTOROLA\Polledas.cpp
|
||||
@echo POLLEDAS.o: gcc
|
||||
@$(GCCUREL) -I "." $(INCDIR) -o $@ ".\Polledas.cpp"
|
||||
|
||||
LISTINGURELPOLLEDAS : $(EPOCBLDUREL)\POLLEDAS.lis
|
||||
@echo ISTINGURELPOLLEDAS: perl -S ecopyfile.pl
|
||||
@perl -S ecopyfile.pl $? \DEV\UIQ21\_SRC\PICODRIVEN\AUDIO\MOTOROLA\POLLEDAS.lst.ARMI
|
||||
|
||||
$(EPOCBLDUREL)\POLLEDAS.lis : \DEV\UIQ21\_SRC\PICODRIVEN\AUDIO\MOTOROLA\Polledas.cpp
|
||||
$(GCCUREL) -Wa,-adln -I "." $(INCDIR) -o nul: ".\Polledas.cpp" > $@
|
||||
|
||||
$(EPOCBLDUDEB)\POLLEDAS.o : \DEV\UIQ21\_SRC\PICODRIVEN\AUDIO\MOTOROLA\Polledas.cpp
|
||||
$(GCCUDEB) -I "." $(INCDIR) -o $@ ".\Polledas.cpp"
|
||||
|
||||
LISTINGUDEBPOLLEDAS : $(EPOCBLDUDEB)\POLLEDAS.lis
|
||||
@echo ISTINGUDEBPOLLEDAS: perl -S ecopyfile.pl
|
||||
@perl -S ecopyfile.pl $? \DEV\UIQ21\_SRC\PICODRIVEN\AUDIO\MOTOROLA\POLLEDAS.lst.ARMI
|
||||
|
||||
$(EPOCBLDUDEB)\POLLEDAS.lis : \DEV\UIQ21\_SRC\PICODRIVEN\AUDIO\MOTOROLA\Polledas.cpp
|
||||
$(GCCUDEB) -Wa,-adln -I "." $(INCDIR) -o nul: ".\Polledas.cpp" > $@
|
||||
|
||||
|
||||
|
||||
ROMFILE:
|
||||
@echo file=\DEV\A925SDK\EPOC32\RELEASE\ARMI\##BUILD##\AUDIO_MOTOROLA.DLL System\Libs\AUDIO_MOTOROLA.DLL
|
||||
|
||||
|
||||
WHATGENERIC CLEANGENERIC :
|
||||
@rem none
|
||||
|
||||
# Rules to create all necessary directories
|
||||
|
||||
GENERIC_MAKEWORK : \
|
||||
\DEV\A925SDK\EPOC32\BUILD\DEV\UIQ21\_SRC\PICODRIVEN\AUDIO\MOTOROLA\AUDIO_MOTOROLA\ARMI
|
||||
MAKEWORKLIBRARY : \
|
||||
\DEV\A925SDK\EPOC32\RELEASE\ARM4\UREL \
|
||||
\DEV\A925SDK\EPOC32\RELEASE\ARMI\UREL \
|
||||
\DEV\A925SDK\EPOC32\RELEASE\THUMB\UREL
|
||||
MAKEWORKUDEB : \
|
||||
\DEV\A925SDK\EPOC32\BUILD\DEV\UIQ21\_SRC\PICODRIVEN\AUDIO\MOTOROLA\AUDIO_MOTOROLA\ARMI\UDEB \
|
||||
\DEV\A925SDK\EPOC32\RELEASE\ARMI\UDEB
|
||||
MAKEWORKUREL : \
|
||||
\DEV\A925SDK\EPOC32\BUILD\DEV\UIQ21\_SRC\PICODRIVEN\AUDIO\MOTOROLA\AUDIO_MOTOROLA\ARMI\UREL \
|
||||
\DEV\A925SDK\EPOC32\RELEASE\ARMI\UREL
|
||||
|
||||
\DEV\A925SDK\EPOC32\BUILD\DEV\UIQ21\_SRC\PICODRIVEN\AUDIO\MOTOROLA\AUDIO_MOTOROLA\ARMI \
|
||||
\DEV\A925SDK\EPOC32\BUILD\DEV\UIQ21\_SRC\PICODRIVEN\AUDIO\MOTOROLA\AUDIO_MOTOROLA\ARMI\UDEB \
|
||||
\DEV\A925SDK\EPOC32\BUILD\DEV\UIQ21\_SRC\PICODRIVEN\AUDIO\MOTOROLA\AUDIO_MOTOROLA\ARMI\UREL \
|
||||
\DEV\A925SDK\EPOC32\RELEASE\ARM4\UREL \
|
||||
\DEV\A925SDK\EPOC32\RELEASE\ARMI\UDEB \
|
||||
\DEV\A925SDK\EPOC32\RELEASE\ARMI\UREL \
|
||||
\DEV\A925SDK\EPOC32\RELEASE\THUMB\UREL \
|
||||
:
|
||||
@echo UREL: perl -S emkdir.pl
|
||||
@perl -S emkdir.pl $@
|
||||
|
||||
|
32
platform/uiq2/audio/motorola/PolledAS.h
Normal file
32
platform/uiq2/audio/motorola/PolledAS.h
Normal file
|
@ -0,0 +1,32 @@
|
|||
/*******************************************************************
|
||||
*
|
||||
* File: PolledAS.h
|
||||
*
|
||||
* Author: Peter van Sebille (peter@yipton.net)
|
||||
*
|
||||
* (c) Copyright 2001, Peter van Sebille
|
||||
* All Rights Reserved
|
||||
*
|
||||
*******************************************************************/
|
||||
|
||||
#ifndef __POLLED_AS_H
|
||||
#define __POLLED_AS_H
|
||||
|
||||
class CPrivatePolledActiveScheduler;
|
||||
|
||||
class CPolledActiveScheduler : public CBase
|
||||
{
|
||||
public:
|
||||
~CPolledActiveScheduler();
|
||||
static CPolledActiveScheduler* NewL();
|
||||
//static CPolledActiveScheduler* Instance();
|
||||
void Schedule();
|
||||
protected:
|
||||
CPolledActiveScheduler(){};
|
||||
void ConstructL();
|
||||
CPrivatePolledActiveScheduler* iPrivatePolledActiveScheduler;
|
||||
};
|
||||
|
||||
|
||||
#endif /* __POLLED_AS_H */
|
||||
|
363
platform/uiq2/audio/motorola/audio_motorola.cpp
Normal file
363
platform/uiq2/audio/motorola/audio_motorola.cpp
Normal file
|
@ -0,0 +1,363 @@
|
|||
/*******************************************************************
|
||||
*
|
||||
* File: Audio_motorola.cpp
|
||||
*
|
||||
* Author: Peter van Sebille (peter@yipton.net)
|
||||
*
|
||||
* Modified/adapted for picodriveN by notaz, 2006
|
||||
*
|
||||
* (c) Copyright 2006, notaz
|
||||
* (c) Copyright 2001, Peter van Sebille
|
||||
* All Rights Reserved
|
||||
*
|
||||
*******************************************************************/
|
||||
|
||||
// if only I had Motorola to test this on..
|
||||
|
||||
|
||||
#include "audio_motorola.h"
|
||||
|
||||
#ifdef __DEBUG_PRINT_SND
|
||||
#include <e32svr.h> // RDebug
|
||||
#define DEBUGPRINT(x...) RDebug::Print(x)
|
||||
#else
|
||||
#define DEBUGPRINT(x...)
|
||||
#endif
|
||||
|
||||
|
||||
GLDEF_C TInt E32Dll(TDllReason)
|
||||
{
|
||||
return KErrNone;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************
|
||||
*
|
||||
* CGameAudioMot
|
||||
*
|
||||
*******************************************/
|
||||
|
||||
CGameAudioMot::CGameAudioMot(TInt aRate, TBool aStereo, TInt aPcmFrames, TInt aBufferedFrames)
|
||||
: iRate(aRate), iStereo(aStereo), iBufferedFrames(aBufferedFrames), iPcmFrames(aPcmFrames)
|
||||
{
|
||||
DEBUGPRINT(_L("CGameAudioMot::CGameAudioMot"));
|
||||
}
|
||||
|
||||
|
||||
CGameAudioMot* CGameAudioMot::NewL(TInt aRate, TBool aStereo, TInt aPcmFrames, TInt aBufferedFrames)
|
||||
{
|
||||
DEBUGPRINT(_L("CGameAudioMot::NewL(%i, %i, %i, %i)"),aRate, aStereo, aPcmFrames, aBufferedFrames);
|
||||
CGameAudioMot* self = new(ELeave) CGameAudioMot(aRate, aStereo, aPcmFrames, aBufferedFrames);
|
||||
CleanupStack::PushL(self);
|
||||
self->ConstructL();
|
||||
CleanupStack::Pop(); // self
|
||||
return self;
|
||||
}
|
||||
|
||||
|
||||
CGameAudioMot::~CGameAudioMot()
|
||||
{
|
||||
DEBUGPRINT(_L("CGameAudioMot::~CGameAudioMot()"));
|
||||
if(iAudioOutputStream) {
|
||||
iScheduler->Schedule(); // let it finish it's stuff
|
||||
//iAudioOutputStream->Stop();
|
||||
delete iAudioOutputStream;
|
||||
}
|
||||
|
||||
if(iAudioControl) delete iAudioControl;
|
||||
|
||||
for (TInt i=0 ; i < KSoundBuffers+1; i++) {
|
||||
delete iSoundBufferPtrs[i];
|
||||
delete iSoundBuffers[i];
|
||||
}
|
||||
|
||||
// Polled AS
|
||||
if(iScheduler) delete iScheduler;
|
||||
}
|
||||
|
||||
|
||||
void CGameAudioMot::ConstructL()
|
||||
{
|
||||
iScheduler = CPolledActiveScheduler::NewL();
|
||||
|
||||
iSettings.iPCMSettings.iSamplingFreq = (TMSampleRate) iRate;
|
||||
iSettings.iPCMSettings.iStereo = iStereo;
|
||||
|
||||
TInt bytesPerFrame = iStereo ? iPcmFrames << 2 : iPcmFrames << 1;
|
||||
for (TInt i=0 ; i<KSoundBuffers ; i++)
|
||||
{
|
||||
iSoundBuffers[i] = HBufC8::NewL(bytesPerFrame * iBufferedFrames);
|
||||
iSoundBuffers[i]->Des().FillZ (bytesPerFrame * iBufferedFrames);
|
||||
iSoundBufferPtrs[i] = new TPtr8( iSoundBuffers[i]->Des() );
|
||||
}
|
||||
// because feeding 2 buffers after an underflow is a little too much, but feeding 1 may be not enough,
|
||||
// prepare this ~50ms empty buffer to additionaly feed after every underflow.
|
||||
iSoundBuffers[KSoundBuffers] = HBufC8::NewL(bytesPerFrame * (iBufferedFrames / 4));
|
||||
iSoundBuffers[KSoundBuffers]->Des().FillZ (bytesPerFrame * (iBufferedFrames / 4));
|
||||
iSoundBufferPtrs[KSoundBuffers] = new TPtr8( iSoundBuffers[KSoundBuffers]->Des() );
|
||||
|
||||
iCurrentBuffer = 0;
|
||||
iListener.iFatalError = iListener.iIsOpen = iListener.iIsCtrlOpen = EFalse;
|
||||
|
||||
// here we actually test if we can create and open CMdaAudioOutputStream at all, but really create and use it later.
|
||||
iAudioOutputStream = CMAudioFB::NewL(EMAudioFBRequestTypeDecode, EMAudioFBFormatPCM, iSettings, iListener);
|
||||
if(iAudioOutputStream) {
|
||||
delete iAudioOutputStream;
|
||||
iAudioOutputStream = 0;
|
||||
}
|
||||
|
||||
// ceate audio control object
|
||||
iAudioControl = CMAudioAC::NewL(iListener);
|
||||
}
|
||||
|
||||
|
||||
// returns a pointer to buffer for next frame,
|
||||
// to be used when iSoundBuffers are used directly
|
||||
TInt16 *CGameAudioMot::NextFrameL()
|
||||
{
|
||||
iCurrentPosition += iPcmFrames << (iStereo?1:0);
|
||||
|
||||
if (++iFrameCount == iBufferedFrames)
|
||||
{
|
||||
WriteBlockL();
|
||||
}
|
||||
|
||||
iScheduler->Schedule();
|
||||
|
||||
if(iListener.iFatalError || iListener.iUnderflowed > KMaxUnderflows) {
|
||||
if(iAudioOutputStream) delete iAudioOutputStream;
|
||||
iAudioOutputStream = 0;
|
||||
return 0;
|
||||
}
|
||||
else if(iListener.iUnderflowed) UnderflowedL();
|
||||
|
||||
return iCurrentPosition;
|
||||
}
|
||||
|
||||
TInt16 *CGameAudioMot::DupeFrameL(TInt &aUnderflowed)
|
||||
{
|
||||
TInt shorts = iStereo ? (iPcmFrames << 1) : iPcmFrames;
|
||||
if(iFrameCount)
|
||||
Mem::Copy(iCurrentPosition, iCurrentPosition-shorts, shorts<<1);
|
||||
else {
|
||||
TInt lastBuffer = iCurrentBuffer;
|
||||
if(--lastBuffer < 0) lastBuffer = KSoundBuffers - 1;
|
||||
Mem::Copy(iCurrentPosition, ((TInt16*) (iSoundBuffers[lastBuffer]->Ptr()))+shorts*(iBufferedFrames-1), shorts<<1);
|
||||
}
|
||||
iCurrentPosition += shorts;
|
||||
|
||||
if (++iFrameCount == iBufferedFrames)
|
||||
{
|
||||
WriteBlockL();
|
||||
}
|
||||
|
||||
iScheduler->Schedule();
|
||||
|
||||
if(iListener.iFatalError || iListener.iUnderflowed > KMaxUnderflows) {
|
||||
if(iAudioOutputStream) delete iAudioOutputStream;
|
||||
iAudioOutputStream = 0;
|
||||
return 0;
|
||||
}
|
||||
else if((aUnderflowed = iListener.iUnderflowed)) UnderflowedL(); // not again!
|
||||
|
||||
return iCurrentPosition;
|
||||
}
|
||||
|
||||
void CGameAudioMot::WriteBlockL()
|
||||
{
|
||||
iScheduler->Schedule();
|
||||
|
||||
// do not write until stream is open
|
||||
if(!iListener.iIsOpen) WaitForOpenToCompleteL();
|
||||
//if(!iListener.iHasCopied) WaitForCopyToCompleteL(); // almost never happens anyway and sometimes even deadlocks?
|
||||
//iListener.iHasCopied = EFalse;
|
||||
|
||||
|
||||
if(!iListener.iUnderflowed) {
|
||||
iAudioOutputStream->QueueBufferL(iSoundBufferPtrs[iCurrentBuffer]);
|
||||
// it is certain we already Queued at least 2 buffers (one just after underflow, another above)
|
||||
if(!iDecoding) {
|
||||
iAudioOutputStream->DecodeL();
|
||||
iDecoding = ETrue;
|
||||
}
|
||||
}
|
||||
|
||||
iFrameCount = 0;
|
||||
if (++iCurrentBuffer == KSoundBuffers)
|
||||
iCurrentBuffer = 0;
|
||||
iCurrentPosition = (TInt16*) iSoundBuffers[iCurrentBuffer]->Ptr();
|
||||
}
|
||||
|
||||
void CGameAudioMot::Pause()
|
||||
{
|
||||
if(!iAudioOutputStream) return;
|
||||
|
||||
iScheduler->Schedule();
|
||||
// iAudioOutputStream->Stop(); // may be this breaks everything in A925?
|
||||
delete iAudioOutputStream;
|
||||
iAudioOutputStream = 0;
|
||||
}
|
||||
|
||||
// call this before doing any playback!
|
||||
TInt16 *CGameAudioMot::ResumeL()
|
||||
{
|
||||
DEBUGPRINT(_L("CGameAudioMot::Resume()"));
|
||||
iScheduler->Schedule();
|
||||
|
||||
// we act a bit strange here: simulate buffer underflow, which actually starts audio
|
||||
iListener.iIsOpen = ETrue;
|
||||
iListener.iUnderflowed = 1;
|
||||
iListener.iFatalError = EFalse;
|
||||
iFrameCount = 0;
|
||||
iCurrentPosition = (TInt16*) iSoundBuffers[iCurrentBuffer]->Ptr();
|
||||
return iCurrentPosition;
|
||||
}
|
||||
|
||||
// handles underflow condition
|
||||
void CGameAudioMot::UnderflowedL()
|
||||
{
|
||||
// recreate the stream
|
||||
if(iAudioOutputStream) delete iAudioOutputStream;
|
||||
if(iListener.iUnderflowed > 4) {
|
||||
// HACK: A925 user said sound works for the first time, but fails after pause/resume, etc.
|
||||
// at the very beginning we create and delete CMAudioFB object, maybe we should do this every time?
|
||||
iAudioOutputStream = CMAudioFB::NewL(EMAudioFBRequestTypeDecode, EMAudioFBFormatPCM, iSettings, iListener);
|
||||
if(iAudioOutputStream) delete iAudioOutputStream;
|
||||
}
|
||||
|
||||
iAudioOutputStream = CMAudioFB::NewL(EMAudioFBRequestTypeDecode, EMAudioFBFormatPCM, iSettings, iListener);
|
||||
iListener.iIsOpen = EFalse; // wait for it to open
|
||||
iDecoding = EFalse;
|
||||
//iListener.iHasCopied = ETrue; // but don't wait for last copy to complete
|
||||
// let it open and feed some stuff to make it happy
|
||||
User::After(0);
|
||||
//TInt lastBuffer = iCurrentBuffer;
|
||||
//if(--lastBuffer < 0) lastBuffer = KSoundBuffers - 1;
|
||||
iScheduler->Schedule();
|
||||
if(!iListener.iIsOpen) WaitForOpenToCompleteL();
|
||||
if(iListener.iUnderflowed) {
|
||||
// something went wrong again. May be it needs time? Trying to fix something without ability to test is hell.
|
||||
if(iAudioOutputStream) delete iAudioOutputStream;
|
||||
iAudioOutputStream = 0;
|
||||
User::After(50*000);
|
||||
iScheduler->Schedule();
|
||||
return;
|
||||
}
|
||||
|
||||
iAudioOutputStream->QueueBufferL(iSoundBufferPtrs[KSoundBuffers]); // try a short buffer with hope to reduce lag
|
||||
}
|
||||
|
||||
|
||||
void CGameAudioMot::ChangeVolume(TInt aUp)
|
||||
{
|
||||
if(iAudioControl && iListener.iIsCtrlOpen)
|
||||
{
|
||||
TInt vol = iAudioControl->GetMasterVolume();
|
||||
TInt max = iAudioControl->GetMaxMasterVolume();
|
||||
|
||||
if(aUp) vol++; // adjust volume
|
||||
else vol--;
|
||||
|
||||
if(vol >= 0 && vol <= max)
|
||||
{
|
||||
iAudioControl->SetMasterVolume(vol);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void CGameAudioMot::WaitForOpenToCompleteL()
|
||||
{
|
||||
DEBUGPRINT(_L("CGameAudioMot::WaitForOpenToCompleteL"));
|
||||
TInt count = 20; // 2 seconds
|
||||
TInt waitPeriod = 100 * 1000;
|
||||
|
||||
if(!iListener.iIsOpen) {
|
||||
// it is often enough to do this
|
||||
User::After(0);
|
||||
iScheduler->Schedule();
|
||||
}
|
||||
while (!iListener.iIsOpen && --count)
|
||||
{
|
||||
User::After(waitPeriod);
|
||||
iScheduler->Schedule();
|
||||
}
|
||||
if (!iListener.iIsOpen)
|
||||
User::LeaveIfError(KErrNotSupported);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void TGameAudioEventListener::OnEvent(TMAudioFBCallbackState aState, TInt aError)
|
||||
{
|
||||
switch ( aState )
|
||||
{
|
||||
case EMAudioFBCallbackStateReady:
|
||||
iIsOpen = ETrue;
|
||||
iUnderflowed = 0;
|
||||
break;
|
||||
|
||||
case EMAudioFBCallbackStateDecodeCompleteStopped:
|
||||
break;
|
||||
|
||||
//case EMAudioFBCallbackStateDecodeFileSystemError:
|
||||
case EMAudioFBCallbackStateDecodeError:
|
||||
switch( aError )
|
||||
{
|
||||
case EMAudioFBCallbackErrorBufferFull:
|
||||
case EMAudioFBCallbackErrorForcedStop:
|
||||
case EMAudioFBCallbackErrorForcedClose:
|
||||
//case EMAudioFBCallbackErrorForcedPause:
|
||||
case EMAudioFBCallbackErrorPriorityRejection:
|
||||
case EMAudioFBCallbackErrorAlertModeRejection:
|
||||
case EMAudioFBCallbackErrorResourceRejection:
|
||||
case EMAudioFBCallbackErrorUnknown:
|
||||
iUnderflowed++;
|
||||
break;
|
||||
|
||||
// these look like really bad errors
|
||||
case EMAudioFBCallbackErrorInvalidParameter:
|
||||
case EMAudioFBCallbackErrorWrongState:
|
||||
case EMAudioFBCallbackErrorFormatNotSupported:
|
||||
case EMAudioFBCallbackErrorFunctionNotSupported:
|
||||
case EMAudioFBCallbackErrorNoBuffer:
|
||||
case EMAudioFBCallbackErrorSampleOrBitRateNotSupported:
|
||||
//case EMAudioFBCallbackErrorPriorityOrPreferenceNotSupported:
|
||||
//case EMAudioFBCallbackErrorFileSystemFull:
|
||||
//iFatalError = ETrue;
|
||||
// who cares, just keep retrying
|
||||
iUnderflowed++;
|
||||
break;
|
||||
|
||||
default:
|
||||
iUnderflowed++;
|
||||
break;
|
||||
}
|
||||
// in error condition we also set to open, so that the
|
||||
// framework would not leave, catch the error and retry
|
||||
iIsOpen = ETrue;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void TGameAudioEventListener::OnEvent(TMAudioFBCallbackState aState, TInt aError, TDes8* aBuffer)
|
||||
{
|
||||
switch( aState )
|
||||
{
|
||||
case EMAudioFBCallbackStateDecodeBufferDecoded:
|
||||
break;
|
||||
|
||||
default:
|
||||
OnEvent( aState, aError );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void TGameAudioEventListener::OnEvent(TMAudioACCallbackState aState, TInt aError)
|
||||
{
|
||||
if(aState == EMAudioACCallbackStateReady) iIsCtrlOpen = ETrue;
|
||||
}
|
||||
|
3
platform/uiq2/audio/motorola/audio_motorola.def
Normal file
3
platform/uiq2/audio/motorola/audio_motorola.def
Normal file
|
@ -0,0 +1,3 @@
|
|||
EXPORTS
|
||||
; NEW:
|
||||
NewL__13CGameAudioMotiiii @ 1 NONAME ; static CGameAudioMot* NewL(TInt aRate, TBool aStereo, TInt aPcmFrames, TInt aBufferedFrames);
|
91
platform/uiq2/audio/motorola/audio_motorola.h
Normal file
91
platform/uiq2/audio/motorola/audio_motorola.h
Normal file
|
@ -0,0 +1,91 @@
|
|||
/*******************************************************************
|
||||
*
|
||||
* File: Audio_motorola.h
|
||||
*
|
||||
* Author: Peter van Sebille (peter@yipton.net)
|
||||
*
|
||||
* Modified/adapted for picodriveN by notaz, 2006
|
||||
*
|
||||
* (c) Copyright 2006, notaz
|
||||
* (c) Copyright 2001, Peter van Sebille
|
||||
* All Rights Reserved
|
||||
*
|
||||
*******************************************************************/
|
||||
|
||||
#ifndef __AUDIO_MEDIASERVER_H
|
||||
#define __AUDIO_MEDIASERVER_H
|
||||
|
||||
#include <cmaudiofb.h>
|
||||
|
||||
#include "audio.h"
|
||||
#include "polledas.h"
|
||||
|
||||
const TInt KSoundBuffers = 8;
|
||||
const TInt KMaxUnderflows = 20; // max underflows/API errors we are going allow in a row (to prevent lockups)
|
||||
|
||||
|
||||
class TGameAudioEventListener : public MMAudioFBObserver, public MMAudioACObserver
|
||||
{
|
||||
public:
|
||||
// Implementation of MMAudioFBObserver
|
||||
void OnEvent(TMAudioFBCallbackState aState, TInt aError);
|
||||
void OnEvent(TMAudioFBCallbackState aState, TInt aError, TDes8* aBuffer);
|
||||
// Implementation of MMAudioACObserver
|
||||
void OnEvent(TMAudioACCallbackState aState, TInt aError);
|
||||
|
||||
TBool iIsOpen;
|
||||
TBool iIsCtrlOpen;
|
||||
// TBool iHasCopied;
|
||||
TInt iUnderflowed;
|
||||
TBool iFatalError;
|
||||
};
|
||||
|
||||
|
||||
class CGameAudioMot : public IGameAudio // IGameAudio MUST be specified first!
|
||||
{
|
||||
public: // implements IGameAudio
|
||||
TInt16 *NextFrameL();
|
||||
TInt16 *DupeFrameL(TInt &aUnderflowed);
|
||||
TInt16 *ResumeL();
|
||||
void Pause();
|
||||
void ChangeVolume(TInt aUp);
|
||||
|
||||
public:
|
||||
~CGameAudioMot();
|
||||
CGameAudioMot(TInt aRate, TBool aStereo, TInt aPcmFrames, TInt aBufferedFrames);
|
||||
void ConstructL();
|
||||
EXPORT_C static CGameAudioMot* NewL(TInt aRate, TBool aStereo, TInt aPcmFrames, TInt aBufferedFrames);
|
||||
|
||||
protected:
|
||||
void WriteBlockL();
|
||||
void UnderflowedL();
|
||||
|
||||
protected:
|
||||
void WaitForOpenToCompleteL();
|
||||
|
||||
TInt iRate;
|
||||
TBool iStereo;
|
||||
|
||||
CMAudioFB *iAudioOutputStream;
|
||||
CMAudioAC *iAudioControl;
|
||||
TMAudioFBBufSettings iSettings;
|
||||
|
||||
TGameAudioEventListener iListener;
|
||||
|
||||
CPolledActiveScheduler *iScheduler;
|
||||
|
||||
HBufC8* iSoundBuffers[KSoundBuffers+1];
|
||||
TPtr8* iSoundBufferPtrs[KSoundBuffers+1];
|
||||
|
||||
TInt iBufferedFrames;
|
||||
TInt16* iCurrentPosition;
|
||||
TInt iCurrentBuffer;
|
||||
TInt iFrameCount;
|
||||
TInt iPcmFrames;
|
||||
|
||||
TBool iDecoding;
|
||||
|
||||
//TInt64 iTime; // removed because can't test
|
||||
};
|
||||
|
||||
#endif /* __AUDIO_MEDIASERVER_H */
|
20
platform/uiq2/audio/motorola/audio_motorola.mmp
Normal file
20
platform/uiq2/audio/motorola/audio_motorola.mmp
Normal file
|
@ -0,0 +1,20 @@
|
|||
TARGET audio_motorola.dll
|
||||
TARGETTYPE dll
|
||||
UID 0x100039CE 0x1000C197
|
||||
|
||||
USERINCLUDE .
|
||||
USERINCLUDE ..\..\
|
||||
|
||||
SYSTEMINCLUDE \epoc32\include
|
||||
|
||||
SOURCEPATH .
|
||||
SOURCE audio_motorola.cpp
|
||||
SOURCE polledas.cpp
|
||||
|
||||
LIBRARY EUSER.LIB
|
||||
LIBRARY maudiofb.lib
|
||||
LIBRARY maudioac.lib
|
||||
|
||||
deffile .\audio_motorola.def
|
||||
|
||||
nostrictdef
|
209
platform/uiq2/audio/motorola/polledas.cpp
Normal file
209
platform/uiq2/audio/motorola/polledas.cpp
Normal file
|
@ -0,0 +1,209 @@
|
|||
/*******************************************************************
|
||||
*
|
||||
* File: PolledAS.cpp
|
||||
*
|
||||
* Author: Peter van Sebille (peter@yipton.net)
|
||||
*
|
||||
* (c) Copyright 2002, Peter van Sebille
|
||||
* All Rights Reserved
|
||||
*
|
||||
*******************************************************************/
|
||||
|
||||
/*
|
||||
* Oh Lord, forgive me for I have sinned.
|
||||
* In their infinite wisdom, Symbian Engineers have decided that
|
||||
* the Active Scheduler's queue of Active Objects is private
|
||||
* and no getters are provided... sigh.
|
||||
* This mere mortal will have to excercise the power of C pre-processor
|
||||
* once more to circumvent the will of the gods.
|
||||
*/
|
||||
|
||||
|
||||
#include <e32std.h>
|
||||
|
||||
// from e32base.h
|
||||
class CBase
|
||||
{
|
||||
public:
|
||||
IMPORT_C virtual ~CBase();
|
||||
inline TAny* operator new(TUint aSize,TAny *aBase) {Mem::FillZ(aBase,aSize);return(aBase);}
|
||||
IMPORT_C TAny* operator new(TUint aSize);
|
||||
inline TAny* operator new(TUint aSize, TLeave) {return newL(aSize);}
|
||||
IMPORT_C TAny* operator new(TUint aSize,TUint anExtraSize);
|
||||
protected:
|
||||
IMPORT_C CBase();
|
||||
private:
|
||||
CBase(const CBase&);
|
||||
CBase& operator=(const CBase&);
|
||||
IMPORT_C static TAny* newL(TUint aSize);
|
||||
};
|
||||
|
||||
class CActive : public CBase
|
||||
{
|
||||
public:
|
||||
enum TPriority
|
||||
{
|
||||
EPriorityIdle=-100,
|
||||
EPriorityLow=-20,
|
||||
EPriorityStandard=0,
|
||||
EPriorityUserInput=10,
|
||||
EPriorityHigh=20,
|
||||
};
|
||||
public:
|
||||
IMPORT_C ~CActive();
|
||||
IMPORT_C void Cancel();
|
||||
IMPORT_C void Deque();
|
||||
IMPORT_C void SetPriority(TInt aPriority);
|
||||
inline TBool IsActive() const {return(iActive);}
|
||||
inline TBool IsAdded() const {return(iLink.iNext!=NULL);}
|
||||
inline TInt Priority() const {return iLink.iPriority;}
|
||||
protected:
|
||||
IMPORT_C CActive(TInt aPriority);
|
||||
IMPORT_C void SetActive();
|
||||
// Pure virtual
|
||||
virtual void DoCancel() =0;
|
||||
virtual void RunL() =0;
|
||||
IMPORT_C virtual TInt RunError(TInt aError);
|
||||
public:
|
||||
TRequestStatus iStatus;
|
||||
private:
|
||||
TBool iActive;
|
||||
TPriQueLink iLink;
|
||||
friend class CActiveScheduler;
|
||||
// friend class CServer;
|
||||
friend class CPrivatePolledActiveScheduler; // added
|
||||
};
|
||||
|
||||
//
|
||||
class CActiveScheduler : public CBase
|
||||
{
|
||||
public:
|
||||
IMPORT_C CActiveScheduler();
|
||||
IMPORT_C ~CActiveScheduler();
|
||||
IMPORT_C static void Install(CActiveScheduler* aScheduler);
|
||||
IMPORT_C static CActiveScheduler* Current();
|
||||
IMPORT_C static void Add(CActive* anActive);
|
||||
IMPORT_C static void Start();
|
||||
IMPORT_C static void Stop();
|
||||
IMPORT_C static TBool RunIfReady(TInt& aError, TInt aMinimumPriority);
|
||||
IMPORT_C static CActiveScheduler* Replace(CActiveScheduler* aNewActiveScheduler);
|
||||
IMPORT_C virtual void WaitForAnyRequest();
|
||||
IMPORT_C virtual void Error(TInt anError) const;
|
||||
private:
|
||||
void DoStart();
|
||||
IMPORT_C virtual void OnStarting();
|
||||
IMPORT_C virtual void OnStopping();
|
||||
IMPORT_C virtual void Reserved_1();
|
||||
IMPORT_C virtual void Reserved_2();
|
||||
friend class CPrivatePolledActiveScheduler; // added
|
||||
protected:
|
||||
inline TInt Level() const;
|
||||
private:
|
||||
TInt iLevel;
|
||||
TPriQue<CActive> iActiveQ;
|
||||
};
|
||||
|
||||
class TCleanupItem;
|
||||
class CleanupStack
|
||||
{
|
||||
public:
|
||||
IMPORT_C static void PushL(TAny* aPtr);
|
||||
IMPORT_C static void PushL(CBase* aPtr);
|
||||
IMPORT_C static void PushL(TCleanupItem anItem);
|
||||
IMPORT_C static void Pop();
|
||||
IMPORT_C static void Pop(TInt aCount);
|
||||
IMPORT_C static void PopAndDestroy();
|
||||
IMPORT_C static void PopAndDestroy(TInt aCount);
|
||||
IMPORT_C static void Check(TAny* aExpectedItem);
|
||||
inline static void Pop(TAny* aExpectedItem);
|
||||
inline static void Pop(TInt aCount, TAny* aLastExpectedItem);
|
||||
inline static void PopAndDestroy(TAny* aExpectedItem);
|
||||
inline static void PopAndDestroy(TInt aCount, TAny* aLastExpectedItem);
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* This will declare CPrivatePolledActiveScheduler as a friend
|
||||
* of all classes that define a friend. CPrivatePolledActiveScheduler needs to
|
||||
* be a friend of CActive
|
||||
*/
|
||||
//#define friend friend class CPrivatePolledActiveScheduler; friend
|
||||
|
||||
|
||||
/*
|
||||
* This will change the:
|
||||
* void DoStart();
|
||||
* method in CActiveScheduler to:
|
||||
* void DoStart(); friend class CPrivatePolledActiveScheduler;
|
||||
* We need this to access the private datamembers in CActiveScheduler.
|
||||
*/
|
||||
//#define DoStart() DoStart(); friend class CPrivatePolledActiveScheduler;
|
||||
//#include <e32base.h>
|
||||
#include "PolledAS.h"
|
||||
|
||||
|
||||
class CPrivatePolledActiveScheduler : public CActiveScheduler
|
||||
{
|
||||
public:
|
||||
void Schedule();
|
||||
};
|
||||
|
||||
|
||||
|
||||
void CPrivatePolledActiveScheduler::Schedule()
|
||||
{
|
||||
TDblQueIter<CActive> q(iActiveQ);
|
||||
q.SetToFirst();
|
||||
FOREVER
|
||||
{
|
||||
CActive *pR=q++;
|
||||
if (pR)
|
||||
{
|
||||
if (pR->IsActive() && pR->iStatus!=KRequestPending)
|
||||
{
|
||||
pR->iActive=EFalse;
|
||||
TRAPD(r,pR->RunL());
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
CPolledActiveScheduler::~CPolledActiveScheduler()
|
||||
{
|
||||
delete iPrivatePolledActiveScheduler;
|
||||
}
|
||||
|
||||
//static CPolledActiveScheduler* sPolledActiveScheduler = NULL;
|
||||
CPolledActiveScheduler* CPolledActiveScheduler::NewL()
|
||||
{
|
||||
//sPolledActiveScheduler =
|
||||
CPolledActiveScheduler* self = new(ELeave)CPolledActiveScheduler;
|
||||
CleanupStack::PushL(self);
|
||||
self->ConstructL();
|
||||
CleanupStack::Pop();
|
||||
return self;
|
||||
}
|
||||
|
||||
void CPolledActiveScheduler::ConstructL()
|
||||
{
|
||||
iPrivatePolledActiveScheduler = new(ELeave) CPrivatePolledActiveScheduler;
|
||||
iPrivatePolledActiveScheduler->Install(iPrivatePolledActiveScheduler);
|
||||
}
|
||||
|
||||
|
||||
void CPolledActiveScheduler::Schedule()
|
||||
{
|
||||
iPrivatePolledActiveScheduler->Schedule();
|
||||
}
|
||||
|
||||
/*
|
||||
CPolledActiveScheduler* CPolledActiveScheduler::Instance()
|
||||
{
|
||||
// return (CPolledActiveScheduler*) CActiveScheduler::Current();
|
||||
return sPolledActiveScheduler;
|
||||
}
|
||||
*/
|
2
platform/uiq2/audio/motorola/retr.cmd
Normal file
2
platform/uiq2/audio/motorola/retr.cmd
Normal file
|
@ -0,0 +1,2 @@
|
|||
copy %EPOCROOT%\epoc32\release\armi\urel\audio_motorola.dll ..\
|
||||
..\..\..\qconsole-1.52\qtty\release\qtty --qc-addr P800 --qc-channel 5 --user qconsole --pass server --cmds "put d:\system\apps\picodriven\audio_motorola.dll ..\audio_motorola.dll" exit
|
1
platform/uiq2/audio/motorola/retr2.cmd
Normal file
1
platform/uiq2/audio/motorola/retr2.cmd
Normal file
|
@ -0,0 +1 @@
|
|||
copy %EPOCROOT%\epoc32\release\armi\urel\audio_motorola.dll ..\
|
Loading…
Add table
Add a link
Reference in a new issue