I am trying to write a TAP to switch subtiles.
This is what I have written:
Code: Alles auswählen
/*******************************************************************************
TAP to switch subtitles (On or Off in OZ) when the Subtitle key is pressed.
Removed TAP Commander & OSD stuff.
From Subtitle Switch for PVR5000t by ToppyTools
*******************************************************************************/
#include "tap.h"
#include "key.h"
#include "libFireBird.h"
#define ID_TMSSUBS 0x82470001
#define TAP_NAME "TMS_Subtitle Switching v0.2"
TAP_ID( ID_TMSSUBS );
TAP_PROGRAM_NAME("TMS_Subtitle Switching v0.2");
TAP_AUTHOR_NAME("dRdoS7");
TAP_DESCRIPTION("One press subtitle Switching");
TAP_ETCINFO(__DATE__);
static bool subStatus;
//------------------------------------ TAP EventHandler ----------------------------------------
dword TAP_EventHandler( word event, dword param1, dword param2 )
{
UNUSED(param2);
dword mainState, subState;
TAP_GetState( &mainState, &subState );
if( event == EVT_KEY )
{
if( mainState == STATE_Normal && param1 == RKEY_Subt) //Subtitle key pressed and not showing any menu
{
subStatus = SubtitleGetStatus(); //Get Subtitle Status
if( subStatus == TRUE )
{
SubtitleSetStatus(FALSE); //Disable Subtitles
}
else
{
SubtitleSetStatus(TRUE); //Enable Subtitles
}
}
}
return param1;
}
//-------------------------------------- TAP MAIN ------------------------------------------------
int TAP_Main(void)
{
//TAP_Delay (1000); // pause startup for 10 seconds
return 1; //Starting in TSR mode
}
Code: Alles auswählen
build_TMS.bat
C:\TAP-Dev\TAPs\Eigene\TMSsubtitle02>set PATH=C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files (x86)\AMD APP\bin\x86_64;C:\Program Files (x86)\AMD APP\bin\x86;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files (x86)\ffmpeg\bin;C:\TAP-Dev\cygwin\bin;C:\TAP-Dev\api\tms\include;D:\Downloads\Topfield\MKVtoolnix;C:\Program Files (x86)\GPAC;C:\TAP-Dev\cygwin\opt\crosstool\bin
C:\TAP-Dev\TAPs\Eigene\TMSsubtitle02>del /Q bin obj
C:\TAP-Dev\TAPs\Eigene\TMSsubtitle02>bash -i -c make
bash: cannot set terminal process group (-1): Inappropriate ioctl for device
bash: no job control in this shell
[Compile... /taps/Eigene/TMSsubtitle02/TMSsubtitle02.c]
mipsel-linux-uclibc-gcc -D_TMS_ -DLINUX -MD -W -Wall -O2 -mips32 -fPIC -I/tapapi/TMS/include -c /taps/Eigene/TMSsubtitle02/TMSsubtitle02.c -o /taps/Eigene/TMSsubtitle02/obj/TMSsubtitle02.o
/taps/Eigene/TMSsubtitle02/TMSsubtitle02.c: In function `TAP_EventHandler':
/taps/Eigene/TMSsubtitle02/TMSsubtitle02.c:42: warning: implicit declaration of function `SubtitleGetStatus'
/taps/Eigene/TMSsubtitle02/TMSsubtitle02.c:45: warning: implicit declaration of function `SubtitleSetStatus'
[Linking... /taps/Eigene/TMSsubtitle02/bin/TMSsubtitle02.tap]
mipsel-linux-uclibc-ld -shared --no-undefined --allow-shlib-undefined -o /taps/Eigene/TMSsubtitle02/bin/TMSsubtitle02.tap /taps/Eigene/TMSsubtitle02/obj/TMSsubtitle02.o /tapapi/TMS/tapinit.o /tapapi/TMS/libtap.so -lFireBird -ldl -lc -Map /taps/Eigene/TMSsubtitle02/obj/TMSsubtitle02.map
/taps/Eigene/TMSsubtitle02/obj/TMSsubtitle02.o: In function `TAP_EventHandler':
TMSsubtitle02.c :( .text+0x78): undefined reference to `SubtitleGetStatus'
TMSsubtitle02.c :( .text+0x94): undefined reference to `SubtitleSetStatus'
Makefile:53: recipe for target `/taps/Eigene/TMSsubtitle02/bin/TMSsubtitle02.tap' failed
make: *** [/taps/Eigene/TMSsubtitle02/bin/TMSsubtitle02.tap] Error 1
C:\TAP-Dev\TAPs\Eigene\TMSsubtitle02>rem pause
>Exit code: 0 Time: 0.720
Code: Alles auswählen
APP = TMSsubtitle02
OBJS = TMSsubtitle02.o
BASE = $(shell cd /tapapi/TMS; pwd)
CUR_DIR = $(shell pwd)
# include default settings
include ${BASE}/include/tool.mk
# output object directory
OBJ_DIR = ${CUR_DIR}/obj
BIN_DIR = ${CUR_DIR}/bin
SRC_DIR = ${CUR_DIR}
#if you want to use other source path..
#vpath %.cpp $(VPATH)
#vpath %.c $(VPATH)
TAP_FLAGS += -fPIC
ifeq (${DEBUG},y)
TAP_FLAGS += -g -DDEBUG
endif
#compile options
CFLAGS += -DLINUX -MD -W -Wall -O2 -mips32
CPPFLAGS += -DLINUX -MD -W -Wall -O2 -mips32
#include directories.
INCLUDE_DIRS = ${BASE}/include
TAP_INCLUDE_DIRS = $(addprefix -I, $(INCLUDE_DIRS))
TAP_FLAGS += $(TAP_INCLUDE_DIRS)
TAP_OBJS = $(addprefix $(OBJ_DIR)/, ${OBJS})
TAP_LIBS = ${BASE}/tapinit.o ${BASE}/libtap.so -lFireBird -ldl -lc
TAP_APP = $(BIN_DIR)/$(APP).tap
TAP_MAP = $(OBJ_DIR)/$(APP).map
all: $(OBJ_DIR) $(BIN_DIR) $(TAP_APP)
$(OBJ_DIR) $(BIN_DIR):
@echo "[Making direcotry... $@]"
${Q_}$(MKDIR) "$@"
$(TAP_APP): ${TAP_OBJS}
@echo "[Linking... $@]"
$(Q_)$(LD) -shared --no-undefined --allow-shlib-undefined -o $@ ${TAP_OBJS} $(TAP_LIBS) -Map ${TAP_MAP}
$(Q_)$(JB) $(TAP_APP)
clean:
@echo "[Clean all objs...]"
$(Q_)-${RM} $(TAP_APP) $(OBJ_DIR)/*.d $(OBJ_DIR)/*.o $(OBJ_DIR)/*.map
# Implicit rule for building local apps
%.o : %.c
@echo [Compile... $<]
${Q_}$(CC) $(CFLAGS) $(TAP_FLAGS) -c $< -o $@
%.o : %.cpp
@echo "[Compile... $<]"
${Q_}$(CXX) $(CPPFLAGS) $(TAP_FLAGS) -c $< -o $@
$(OBJ_DIR)/%.o : $(SRC_DIR)/%.c
@echo [Compile... $<]
${Q_}$(CC) $(CFLAGS) $(TAP_FLAGS) -c $< -o $@
$(OBJ_DIR)/%.o : $(SRC_DIR)/%.cpp
@echo "[Compile... $<]"
${Q_}$(CXX) $(CPPFLAGS) $(TAP_FLAGS) -c $< -o $@
# Dependency file checking (created with gcc -M command)
-include $(OBJ_DIR)/*.d
I appreciate any help.
dRdoS7