diff options
author | Dominik Wenger <domonoky@googlemail.com> | 2008-09-03 19:24:50 +0000 |
---|---|---|
committer | Dominik Wenger <domonoky@googlemail.com> | 2008-09-03 19:24:50 +0000 |
commit | 254fa65c7b75f61147186d9f9146b89ee11b2b26 (patch) | |
tree | bb5355f04275394ebfd2aa200abc44b188c08df9 /utils/wpseditor/libwps | |
parent | ca0de82cec434fcd4af827ff1a1d473667249338 (diff) | |
download | rockbox-254fa65c7b75f61147186d9f9146b89ee11b2b26.tar.gz rockbox-254fa65c7b75f61147186d9f9146b89ee11b2b26.zip |
WpsEditor: commit FS#9344 by Rostislav Chekan - multitarget support (only colour targets for now)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18399 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'utils/wpseditor/libwps')
-rw-r--r-- | utils/wpseditor/libwps/Makefile | 55 | ||||
-rw-r--r-- | utils/wpseditor/libwps/buildall.bat | 4 | ||||
-rwxr-xr-x[-rw-r--r--] | utils/wpseditor/libwps/buildall.sh | 2 | ||||
-rw-r--r-- | utils/wpseditor/libwps/src/api.c | 36 | ||||
-rw-r--r-- | utils/wpseditor/libwps/src/proxy.c | 9 | ||||
-rw-r--r-- | utils/wpseditor/libwps/src/proxy.h | 6 | ||||
-rw-r--r-- | utils/wpseditor/libwps/targets.txt | 24 |
7 files changed, 60 insertions, 76 deletions
diff --git a/utils/wpseditor/libwps/Makefile b/utils/wpseditor/libwps/Makefile index 3779a9ed30..c5d0a39de1 100644 --- a/utils/wpseditor/libwps/Makefile +++ b/utils/wpseditor/libwps/Makefile | |||
@@ -13,39 +13,40 @@ CC = gcc | |||
13 | MKDIR = mkdir -p | 13 | MKDIR = mkdir -p |
14 | 14 | ||
15 | ifeq ($(findstring MINGW,$(shell uname)),MINGW) | 15 | ifeq ($(findstring MINGW,$(shell uname)),MINGW) |
16 | OS = w32 | 16 | OS = w32 |
17 | CC = mingw32-gcc | 17 | CC = mingw32-gcc |
18 | COPY = copy | 18 | COPY = copy |
19 | RM = rm | 19 | RM = rm |
20 | endif | 20 | endif |
21 | 21 | ||
22 | ifeq ($(findstring Linux,$(shell uname)),Linux) | 22 | ifeq ($(findstring Linux,$(shell uname)),Linux) |
23 | OS = linux | 23 | OS = linux |
24 | CC = gcc | 24 | CC = gcc |
25 | COPY = cp | 25 | COPY = cp |
26 | RM = rm -f | 26 | RM = rm -f |
27 | endif | 27 | endif |
28 | 28 | ||
29 | 29 | ||
30 | 30 | ||
31 | COMMON= \ | 31 | SOURCES= \ |
32 | src/dummies.c \ | ||
33 | src/api.c \ | 32 | src/api.c \ |
33 | src/dummies.c \ | ||
34 | src/lcd.c \ | 34 | src/lcd.c \ |
35 | src/proxy.c \ | ||
36 | $(ROOT)/apps/gui/scrollbar.c \ | ||
37 | $(ROOT)/apps/gui/gwps-common.c \ | ||
35 | $(ROOT)/apps/gui/wps_parser.c \ | 38 | $(ROOT)/apps/gui/wps_parser.c \ |
36 | $(ROOT)/apps/gui/wps_debug.c \ | 39 | $(ROOT)/apps/gui/wps_debug.c \ |
37 | $(ROOT)/firmware/font.c \ | ||
38 | $(ROOT)/apps/misc.c \ | ||
39 | $(ROOT)/apps/gui/gwps-common.c \ | ||
40 | $(ROOT)/apps/status.c \ | ||
41 | $(ROOT)/apps/recorder/peakmeter.c \ | 40 | $(ROOT)/apps/recorder/peakmeter.c \ |
42 | $(ROOT)/apps/recorder/icons.c \ | 41 | $(ROOT)/apps/recorder/icons.c \ |
43 | $(ROOT)/apps/gui/scrollbar.c \ | 42 | $(ROOT)/apps/misc.c \ |
43 | $(ROOT)/apps/status.c \ | ||
44 | $(ROOT)/firmware/common/ctype.c \ | ||
44 | $(ROOT)/firmware/common/timefuncs.c \ | 45 | $(ROOT)/firmware/common/timefuncs.c \ |
45 | $(ROOT)/firmware/common/unicode.c \ | 46 | $(ROOT)/firmware/common/unicode.c \ |
46 | $(ROOT)/firmware/common/ctype.c \ | 47 | $(ROOT)/firmware/font.c \ |
47 | $(ROOT)/firmware/id3.c \ | ||
48 | $(ROOT)/firmware/font_cache.c \ | 48 | $(ROOT)/firmware/font_cache.c \ |
49 | $(ROOT)/firmware/id3.c \ | ||
49 | $(ROOT)/firmware/lru.c \ | 50 | $(ROOT)/firmware/lru.c \ |
50 | $(ROOT)/firmware/mp3data.c \ | 51 | $(ROOT)/firmware/mp3data.c \ |
51 | $(ROOT)/firmware/replaygain.c | 52 | $(ROOT)/firmware/replaygain.c |
@@ -72,13 +73,13 @@ all: | |||
72 | 73 | ||
73 | build: build-$(OS) | 74 | build: build-$(OS) |
74 | 75 | ||
75 | build-w32: src/proxy.c $(COMMON) | 76 | build-w32: $(SOURCES) |
76 | @echo CC [$(TARGET)] | 77 | @echo CC [$(TARGET)] |
77 | @$(CC) $(INCLUDE) $(CFLAGS) -D$(TARGET) -DTARGET_MODEL=\"$(MODEL)\" -DBUILD_DLL $(COMMON) -shared src/proxy.c -o libwps_$(MODEL).dll | 78 | @$(CC) $(INCLUDE) $(CFLAGS) -D$(TARGET) -DTARGET_MODEL=\"$(MODEL)\" -DBUILD_DLL $(SOURCES) -shared -o libwps_$(MODEL).dll |
78 | 79 | ||
79 | build-linux: src/proxy.c $(COMMON) | 80 | build-linux: $(SOURCES) |
80 | @echo CC [$(TARGET)] | 81 | @echo CC [$(TARGET)] |
81 | @$(CC) $(INCLUDE) $(CFLAGS) -D$(TARGET) -DTARGET_MODEL=\"$(MODEL)\" -shared -Wl,-soname,libwps_$(MODEL).so,-olibwps_$(MODEL).so -fPIC $(COMMON) src/proxy.c | 82 | @$(CC) $(INCLUDE) $(CFLAGS) -D$(TARGET) -DTARGET_MODEL=\"$(MODEL)\" -shared -Wl,-soname,libwps_$(MODEL).so,-olibwps_$(MODEL).so -fPIC $(SOURCES) |
82 | 83 | ||
83 | clean: clean-$(OS) | 84 | clean: clean-$(OS) |
84 | 85 | ||
@@ -86,15 +87,15 @@ clean-w32: | |||
86 | $(RM) "libwps_$(MODEL).dll" | 87 | $(RM) "libwps_$(MODEL).dll" |
87 | 88 | ||
88 | clean-linux: | 89 | clean-linux: |
89 | $(RM) "libwps_$(MODEL).so.1" | 90 | $(RM) "libwps_$(MODEL).so" |
90 | 91 | ||
91 | shared: shared-$(OS) | 92 | shared: shared-$(OS) |
92 | 93 | ||
93 | shared-w32: src/proxy.c $(COMMON) | 94 | shared-w32: $(SOURCES) |
94 | @echo CC [IRIVER_H10_5GB] | 95 | @echo CC [IRIVER_H10_5GB] |
95 | @$(CC) $(INCLUDE) $(CFLAGS) -DIRIVER_H10_5GB -DTARGET_MODEL=\"h10_5gb\" -DBUILD_DLL $(COMMON) -shared src/proxy.c -o ../gui/bin/libwps.dll | 96 | @$(CC) $(INCLUDE) $(CFLAGS) -DIRIVER_H10_5GB -DTARGET_MODEL=\"h10_5gb\" -DBUILD_DLL -shared $(SOURCES) -o ../gui/bin/libwps_h10_5gb.dll |
96 | 97 | ||
97 | shared-linux: src/proxy.c $(COMMON) | 98 | shared-linux: $(SOURCES) |
98 | @echo CC [IRIVER_H10_5GB] | 99 | @echo CC [IRIVER_H10_5GB] |
99 | @$(CC) $(INCLUDE) $(CFLAGS) -DIRIVER_H10_5GB -DTARGET_MODEL=\"h10_5gb\" -shared -Wl,-soname,libwps.so,-olibwps.so -fPIC $(COMMON) src/proxy.c | 100 | @$(CC) $(INCLUDE) $(CFLAGS) -DIRIVER_H10_5GB -DTARGET_MODEL=\"h10_5gb\" -shared -Wl,-soname,libwps_h10_5gb.so,-olibwps_h10_5gb.so -fPIC $(SOURCES) |
100 | @$(COPY) libwps.so ../gui/bin/libwps.so | 101 | @$(COPY) libwps_h10_5gb.so ../gui/bin/libwps_h10_5gb.so |
diff --git a/utils/wpseditor/libwps/buildall.bat b/utils/wpseditor/libwps/buildall.bat new file mode 100644 index 0000000000..c545453934 --- /dev/null +++ b/utils/wpseditor/libwps/buildall.bat | |||
@@ -0,0 +1,4 @@ | |||
1 | @echo off | ||
2 | FOR /F "tokens=1,2* delims=, " %%i in (targets.txt) do @mingw32-make MODEL=%%j TARGET=%%i build 2>nul | ||
3 | echo Copying files... | ||
4 | xcopy /I /Y *.dll ..\gui\bin | ||
diff --git a/utils/wpseditor/libwps/buildall.sh b/utils/wpseditor/libwps/buildall.sh index 60677d22b6..0f32bb9b9a 100644..100755 --- a/utils/wpseditor/libwps/buildall.sh +++ b/utils/wpseditor/libwps/buildall.sh | |||
@@ -4,4 +4,6 @@ cat targets.txt | ( | |||
4 | do | 4 | do |
5 | make MODEL=$model TARGET=$target build | 5 | make MODEL=$model TARGET=$target build |
6 | done | 6 | done |
7 | cp *.dll ../gui/bin | ||
8 | cp *.so ../gui/bin | ||
7 | ) | 9 | ) |
diff --git a/utils/wpseditor/libwps/src/api.c b/utils/wpseditor/libwps/src/api.c index 485efa8e00..89538423b4 100644 --- a/utils/wpseditor/libwps/src/api.c +++ b/utils/wpseditor/libwps/src/api.c | |||
@@ -32,8 +32,7 @@ bool load_remote_wps_backdrop(char* filename) { | |||
32 | } | 32 | } |
33 | 33 | ||
34 | int read_bmp_file(const char* filename,struct bitmap *bm, int maxsize,int format) { | 34 | int read_bmp_file(const char* filename,struct bitmap *bm, int maxsize,int format) { |
35 | if (!xapi->read_bmp_file) | 35 | if (!xapi->read_bmp_file) { |
36 | { | ||
37 | DEBUGF1("can't read bmp file! NULL api!\n"); | 36 | DEBUGF1("can't read bmp file! NULL api!\n"); |
38 | return -1; | 37 | return -1; |
39 | } | 38 | } |
@@ -84,7 +83,7 @@ int getstringsize(const unsigned char *str, int *w, int *h) { | |||
84 | return 1; | 83 | return 1; |
85 | } | 84 | } |
86 | 85 | ||
87 | void set_wpsstate(struct wpsstate state){ | 86 | void set_wpsstate(struct wpsstate state) { |
88 | sysfont.height = state.fontheight; | 87 | sysfont.height = state.fontheight; |
89 | sysfont.maxwidth = state.fontwidth; | 88 | sysfont.maxwidth = state.fontwidth; |
90 | global_settings.volume = state.volume; | 89 | global_settings.volume = state.volume; |
@@ -92,7 +91,10 @@ void set_wpsstate(struct wpsstate state){ | |||
92 | _audio_status = state.audio_status; | 91 | _audio_status = state.audio_status; |
93 | } | 92 | } |
94 | 93 | ||
95 | void set_trackstate(struct trackstate state){ | 94 | void set_trackstate(struct trackstate state) { |
95 | if (!(gui_wps[0].state) || | ||
96 | !(gui_wps[0].state->id3)) | ||
97 | return; | ||
96 | gui_wps[0].state->id3->title = state.title; | 98 | gui_wps[0].state->id3->title = state.title; |
97 | gui_wps[0].state->id3->artist = state.artist; | 99 | gui_wps[0].state->id3->artist = state.artist; |
98 | gui_wps[0].state->id3->album = state.album; | 100 | gui_wps[0].state->id3->album = state.album; |
@@ -100,8 +102,7 @@ void set_trackstate(struct trackstate state){ | |||
100 | gui_wps[0].state->id3->length = state.length; | 102 | gui_wps[0].state->id3->length = state.length; |
101 | } | 103 | } |
102 | 104 | ||
103 | void set_next_trackstate(struct trackstate state) | 105 | void set_next_trackstate(struct trackstate state) { |
104 | { | ||
105 | gui_wps[0].state->nid3->title = state.title; | 106 | gui_wps[0].state->nid3->title = state.title; |
106 | gui_wps[0].state->nid3->artist = state.artist; | 107 | gui_wps[0].state->nid3->artist = state.artist; |
107 | gui_wps[0].state->nid3->album = state.album; | 108 | gui_wps[0].state->nid3->album = state.album; |
@@ -110,21 +111,21 @@ void set_next_trackstate(struct trackstate state) | |||
110 | } | 111 | } |
111 | 112 | ||
112 | enum api_playmode playmodes[PLAYMODES_NUM] = { | 113 | enum api_playmode playmodes[PLAYMODES_NUM] = { |
113 | API_STATUS_PLAY, | 114 | API_STATUS_PLAY, |
114 | API_STATUS_STOP, | 115 | API_STATUS_STOP, |
115 | API_STATUS_PAUSE, | 116 | API_STATUS_PAUSE, |
116 | API_STATUS_FASTFORWARD, | 117 | API_STATUS_FASTFORWARD, |
117 | API_STATUS_FASTBACKWARD | 118 | API_STATUS_FASTBACKWARD |
118 | }; | 119 | }; |
119 | 120 | ||
120 | const char *playmodeNames[] = { | 121 | const char *playmodeNames[] = { |
121 | "Play", "Stop", "Pause", "FastForward", "FastBackward" | 122 | "Play", "Stop", "Pause", "FastForward", "FastBackward" |
122 | }; | 123 | }; |
123 | 124 | ||
124 | 125 | ||
125 | void set_audio_status(int status){ | 126 | void set_audio_status(int status) { |
126 | DEBUGF1("%s",playmodeNames[status]); | 127 | DEBUGF1("%s",playmodeNames[status]); |
127 | switch(status){ | 128 | switch (status) { |
128 | case API_STATUS_PLAY: | 129 | case API_STATUS_PLAY: |
129 | _audio_status = AUDIO_STATUS_PLAY; | 130 | _audio_status = AUDIO_STATUS_PLAY; |
130 | status_set_ffmode(STATUS_PLAY); | 131 | status_set_ffmode(STATUS_PLAY); |
@@ -203,8 +204,6 @@ int set_api(struct proxy_api* api) { | |||
203 | #else | 204 | #else |
204 | screens[0].is_color=false; | 205 | screens[0].is_color=false; |
205 | #endif | 206 | #endif |
206 | if (api->getwidth) | ||
207 | screens[0].getwidth = api->getwidth; | ||
208 | if (api->stop_scroll) | 207 | if (api->stop_scroll) |
209 | screens[0].stop_scroll=api->stop_scroll; | 208 | screens[0].stop_scroll=api->stop_scroll; |
210 | screens[0].scroll_stop = lcd_scroll_stop; | 209 | screens[0].scroll_stop = lcd_scroll_stop; |
@@ -266,3 +265,4 @@ int set_api(struct proxy_api* api) { | |||
266 | 265 | ||
267 | 266 | ||
268 | 267 | ||
268 | |||
diff --git a/utils/wpseditor/libwps/src/proxy.c b/utils/wpseditor/libwps/src/proxy.c index 3a3b8ce4d9..8f9218e3ff 100644 --- a/utils/wpseditor/libwps/src/proxy.c +++ b/utils/wpseditor/libwps/src/proxy.c | |||
@@ -69,7 +69,7 @@ void* plugin_get_buffer(size_t *buffer_size) | |||
69 | int checkwps(const char *filename, int verbose){ | 69 | int checkwps(const char *filename, int verbose){ |
70 | int res; | 70 | int res; |
71 | int fd; | 71 | int fd; |
72 | 72 | ||
73 | struct wps_data wps; | 73 | struct wps_data wps; |
74 | wps_verbose_level = verbose; | 74 | wps_verbose_level = verbose; |
75 | 75 | ||
@@ -104,9 +104,8 @@ int wps_init(const char* filename,struct proxy_api *api, bool isfile){ | |||
104 | if (!res) | 104 | if (!res) |
105 | { | 105 | { |
106 | DEBUGF1("ERR: WPS parsing failure\n"); | 106 | DEBUGF1("ERR: WPS parsing failure\n"); |
107 | return 3; | 107 | } else |
108 | } | 108 | DEBUGF1("WPS parsed OK\n"); |
109 | DEBUGF1("WPS parsed OK\n"); | ||
110 | DEBUGF1("\n-------------------------------------------------\n"); | 109 | DEBUGF1("\n-------------------------------------------------\n"); |
111 | wps_state.paused = true; | 110 | wps_state.paused = true; |
112 | gwps.data = &wpsdata; | 111 | gwps.data = &wpsdata; |
@@ -115,7 +114,7 @@ int wps_init(const char* filename,struct proxy_api *api, bool isfile){ | |||
115 | gwps.state->id3 = &id3; | 114 | gwps.state->id3 = &id3; |
116 | gwps.state->nid3 = &nid3; | 115 | gwps.state->nid3 = &nid3; |
117 | gui_wps[0] = gwps; | 116 | gui_wps[0] = gwps; |
118 | return res; | 117 | return (res?res:3); |
119 | } | 118 | } |
120 | 119 | ||
121 | int wps_display(){ | 120 | int wps_display(){ |
diff --git a/utils/wpseditor/libwps/src/proxy.h b/utils/wpseditor/libwps/src/proxy.h index 3836ecc6d0..df0abd3c3e 100644 --- a/utils/wpseditor/libwps/src/proxy.h +++ b/utils/wpseditor/libwps/src/proxy.h | |||
@@ -1,6 +1,8 @@ | |||
1 | #ifndef PROXY_H | 1 | #ifndef PROXY_H |
2 | #define PROXY_h | 2 | #define PROXY_h |
3 | 3 | ||
4 | #include <stdio.h> | ||
5 | |||
4 | #include "screen_access.h" | 6 | #include "screen_access.h" |
5 | #include "api.h" | 7 | #include "api.h" |
6 | #include "defs.h" | 8 | #include "defs.h" |
@@ -9,13 +11,13 @@ | |||
9 | #define DEBUGF1 dbgf | 11 | #define DEBUGF1 dbgf |
10 | #define DEBUGF2(...) | 12 | #define DEBUGF2(...) |
11 | #define DEBUGF3(...) | 13 | #define DEBUGF3(...) |
14 | #define DEBUGF4(...) | ||
12 | 15 | ||
13 | EXPORT int checkwps(const char *filename, int verbose); | 16 | EXPORT int checkwps(const char *filename, int verbose); |
14 | EXPORT int wps_init(const char* filename,struct proxy_api *api,bool isfile); | 17 | EXPORT int wps_init(const char* filename,struct proxy_api *api,bool isfile); |
15 | EXPORT int wps_display(); | 18 | EXPORT int wps_display(); |
16 | EXPORT int wps_refresh(); | 19 | EXPORT int wps_refresh(); |
17 | 20 | EXPORT const char* get_model_name(); | |
18 | const char* get_model_name(); | ||
19 | 21 | ||
20 | extern struct screen screens[NB_SCREENS]; | 22 | extern struct screen screens[NB_SCREENS]; |
21 | extern bool debug_wps; | 23 | extern bool debug_wps; |
diff --git a/utils/wpseditor/libwps/targets.txt b/utils/wpseditor/libwps/targets.txt index d2c54378d9..547a2ba42c 100644 --- a/utils/wpseditor/libwps/targets.txt +++ b/utils/wpseditor/libwps/targets.txt | |||
@@ -1,33 +1,9 @@ | |||
1 | ARCHOS_RECORDER recorder | ||
2 | ARCHOS_FMRECORDER fmrecorder | ||
3 | ARCHOS_RECORDERV2 recorderv2 | ||
4 | ARCHOS_ONDIOSP ondiosp | ||
5 | ARCHOS_ONDIOFM ondiofm | ||
6 | IRIVER_H120 h120 | ||
7 | IRIVER_H300 h300 | ||
8 | IRIVER_H100 h100 | ||
9 | IRIVER_IFP7XX ifp7xx | ||
10 | IRIVER_H10 h10 | 1 | IRIVER_H10 h10 |
11 | IRIVER_H10_5GB h10_5gb | 2 | IRIVER_H10_5GB h10_5gb |
12 | IPOD_COLOR ipodcolor | 3 | IPOD_COLOR ipodcolor |
13 | IPOD_NANO ipodnano | 4 | IPOD_NANO ipodnano |
14 | IPOD_VIDEO ipodvideo | 5 | IPOD_VIDEO ipodvideo |
15 | IPOD_3G ipod3g | ||
16 | IPOD_4G ipod4g | ||
17 | IPOD_MINI ipodmini | ||
18 | IPOD_MINI2G ipodmini2g | ||
19 | IPOD_1G2G ipod1g2g | ||
20 | IAUDIO_X5 x5 | ||
21 | IAUDIO_M5 m5 | ||
22 | COWON_D2 cowond2 | ||
23 | IAUDIO_M3 m3 | ||
24 | GIGABEAT_F gigabeatf | 6 | GIGABEAT_F gigabeatf |
25 | GIGABEAT_S gigabeats | 7 | GIGABEAT_S gigabeats |
26 | MROBE_500 mrobe500 | ||
27 | MROBE_100 mrobe100 | ||
28 | LOGIK_DAX logikdax | ||
29 | CREATIVE_ZVM creativezvm | ||
30 | SANSA_E200 e200 | 8 | SANSA_E200 e200 |
31 | SANSA_E200 e200r | ||
32 | SANSA_C200 c200 | 9 | SANSA_C200 c200 |
33 | ELIO_TPJ1022 tpj1022 | ||