diff options
Diffstat (limited to 'utils/wpseditor')
-rw-r--r-- | utils/wpseditor/buildall.bat | 9 | ||||
-rwxr-xr-x | utils/wpseditor/buildall.sh | 4 | ||||
-rw-r--r-- | utils/wpseditor/gui/src/qwpsdrawer.cpp | 27 | ||||
-rw-r--r-- | utils/wpseditor/gui/src/qwpsdrawer.h | 8 | ||||
-rw-r--r-- | utils/wpseditor/libwps/Makefile | 113 | ||||
-rw-r--r-- | utils/wpseditor/libwps/buildall.bat | 4 | ||||
-rwxr-xr-x | utils/wpseditor/libwps/buildall.sh | 9 | ||||
-rw-r--r-- | utils/wpseditor/libwps/cleanall.sh | 7 | ||||
-rw-r--r-- | utils/wpseditor/libwps/src/proxy.c | 4 | ||||
-rw-r--r-- | utils/wpseditor/libwps/targets.txt | 9 | ||||
-rw-r--r-- | utils/wpseditor/screenshot/Makefile | 28 | ||||
-rw-r--r-- | utils/wpseditor/wpseditor.pro | 4 |
12 files changed, 88 insertions, 138 deletions
diff --git a/utils/wpseditor/buildall.bat b/utils/wpseditor/buildall.bat deleted file mode 100644 index b813a38510..0000000000 --- a/utils/wpseditor/buildall.bat +++ /dev/null | |||
@@ -1,9 +0,0 @@ | |||
1 | @echo off | ||
2 | echo qmake... | ||
3 | qmake | ||
4 | echo Building gui... | ||
5 | mingw32-make 1>nul | ||
6 | echo Building libs... | ||
7 | cd libwps | ||
8 | call buildall.bat 2>nul | ||
9 | cd .. | ||
diff --git a/utils/wpseditor/buildall.sh b/utils/wpseditor/buildall.sh deleted file mode 100755 index c891900813..0000000000 --- a/utils/wpseditor/buildall.sh +++ /dev/null | |||
@@ -1,4 +0,0 @@ | |||
1 | #!/bin/sh | ||
2 | qmake && make | ||
3 | cd libwps | ||
4 | ./buildall.sh 2> /dev/null | ||
diff --git a/utils/wpseditor/gui/src/qwpsdrawer.cpp b/utils/wpseditor/gui/src/qwpsdrawer.cpp index a506d5c03b..096d835491 100644 --- a/utils/wpseditor/gui/src/qwpsdrawer.cpp +++ b/utils/wpseditor/gui/src/qwpsdrawer.cpp | |||
@@ -17,14 +17,14 @@ QImage QWpsDrawer::backdrop; | |||
17 | proxy_api QWpsDrawer::api; | 17 | proxy_api QWpsDrawer::api; |
18 | 18 | ||
19 | QWpsDrawer::QWpsDrawer( QWpsState *ws,QTrackState *ms, QWidget *parent ) | 19 | QWpsDrawer::QWpsDrawer( QWpsState *ws,QTrackState *ms, QWidget *parent ) |
20 | : QWidget(parent),wpsState(ws),trackState(ms),showGrid(false),mCurTarget("h10_5gb") { | 20 | : QWidget(parent),wpsState(ws),trackState(ms),showGrid(false),mCurTarget(qApp->applicationDirPath()+"/libwps_IRIVER_H10_5GB") { |
21 | 21 | ||
22 | tryResolve(); | 22 | tryResolve(); |
23 | newTempWps(); | 23 | newTempWps(); |
24 | } | 24 | } |
25 | 25 | ||
26 | bool QWpsDrawer::tryResolve() { | 26 | bool QWpsDrawer::tryResolve() { |
27 | QLibrary lib(qApp->applicationDirPath()+"/libwps_"+mCurTarget); | 27 | QLibrary lib(mCurTarget); |
28 | lib_wps_init = (pfwps_init)lib.resolve("wps_init"); | 28 | lib_wps_init = (pfwps_init)lib.resolve("wps_init"); |
29 | lib_wps_display = (pfwps_display)lib.resolve("wps_display"); | 29 | lib_wps_display = (pfwps_display)lib.resolve("wps_display"); |
30 | lib_wps_refresh = (pfwps_refresh)lib.resolve("wps_refresh"); | 30 | lib_wps_refresh = (pfwps_refresh)lib.resolve("wps_refresh"); |
@@ -47,7 +47,7 @@ bool QWpsDrawer::tryResolve() { | |||
47 | api.load_wps_backdrop = &QWpsDrawer::load_wps_backdrop; | 47 | api.load_wps_backdrop = &QWpsDrawer::load_wps_backdrop; |
48 | api.read_bmp_file = &QWpsDrawer::read_bmp_file; | 48 | api.read_bmp_file = &QWpsDrawer::read_bmp_file; |
49 | api.debugf = &qlogger; | 49 | api.debugf = &qlogger; |
50 | qDebug()<<(qApp->applicationDirPath()+"/libwps_"+mCurTarget+" resolved"); | 50 | qDebug()<<(mCurTarget+" resolved"); |
51 | } | 51 | } |
52 | return mResolved; | 52 | return mResolved; |
53 | } | 53 | } |
@@ -222,7 +222,7 @@ QString QWpsDrawer::getModelName(QString libraryName) { | |||
222 | QList<QString> QWpsDrawer::getTargets() { | 222 | QList<QString> QWpsDrawer::getTargets() { |
223 | QList<QString> list ; | 223 | QList<QString> list ; |
224 | QDir d = QDir(qApp->applicationDirPath()); | 224 | QDir d = QDir(qApp->applicationDirPath()); |
225 | QFileInfoList libs = d.entryInfoList(QStringList("libwps*")); | 225 | QFileInfoList libs = d.entryInfoList(QStringList("libwps_*")); |
226 | qDebug() << libs.size()<<"libs found"; | 226 | qDebug() << libs.size()<<"libs found"; |
227 | for (int i = 0; i < libs.size(); i++) { | 227 | for (int i = 0; i < libs.size(); i++) { |
228 | QString modelName = getModelName(libs[i].absoluteFilePath()); | 228 | QString modelName = getModelName(libs[i].absoluteFilePath()); |
@@ -230,15 +230,24 @@ QList<QString> QWpsDrawer::getTargets() { | |||
230 | if (modelName == "unknown") | 230 | if (modelName == "unknown") |
231 | continue; | 231 | continue; |
232 | list.append(modelName); | 232 | list.append(modelName); |
233 | libs_array[i].target_name = modelName; | ||
234 | libs_array[i].lib = libs[i].absoluteFilePath(); | ||
233 | } | 235 | } |
234 | return list; | 236 | return list; |
235 | } | 237 | } |
236 | bool QWpsDrawer::setTarget(QString target) { | 238 | bool QWpsDrawer::setTarget(QString target) { |
237 | QLibrary lib(qApp->applicationDirPath()+"/libwps_"+mCurTarget); | 239 | foreach(lib_t cur_lib, libs_array) |
238 | //lib.unload(); | 240 | { |
239 | if (getModelName("libwps_"+target)!="unknown") { | 241 | if(cur_lib.target_name == target) |
240 | mCurTarget = target; | 242 | { |
241 | return tryResolve(); | 243 | QLibrary lib(cur_lib.lib); |
244 | //lib.unload(); | ||
245 | if (getModelName(cur_lib.lib) != "unknown") | ||
246 | { | ||
247 | mCurTarget = cur_lib.lib; | ||
248 | return tryResolve(); | ||
249 | } | ||
250 | } | ||
242 | } | 251 | } |
243 | return false; | 252 | return false; |
244 | } | 253 | } |
diff --git a/utils/wpseditor/gui/src/qwpsdrawer.h b/utils/wpseditor/gui/src/qwpsdrawer.h index 65e98723f5..eec4300286 100644 --- a/utils/wpseditor/gui/src/qwpsdrawer.h +++ b/utils/wpseditor/gui/src/qwpsdrawer.h | |||
@@ -5,6 +5,7 @@ | |||
5 | #include <QPixmap> | 5 | #include <QPixmap> |
6 | #include <QPointer> | 6 | #include <QPointer> |
7 | #include <QTemporaryFile> | 7 | #include <QTemporaryFile> |
8 | #include <QMap> | ||
8 | 9 | ||
9 | #include "wpsstate.h" | 10 | #include "wpsstate.h" |
10 | 11 | ||
@@ -37,6 +38,13 @@ class QWpsDrawer : public QWidget { | |||
37 | QString mWpsString; | 38 | QString mWpsString; |
38 | QString mCurTarget; | 39 | QString mCurTarget; |
39 | static QString mTmpWpsString; | 40 | static QString mTmpWpsString; |
41 | |||
42 | struct lib_t | ||
43 | { | ||
44 | QString target_name; | ||
45 | QString lib; | ||
46 | }; | ||
47 | QMap<int, lib_t> libs_array; | ||
40 | 48 | ||
41 | 49 | ||
42 | protected: | 50 | protected: |
diff --git a/utils/wpseditor/libwps/Makefile b/utils/wpseditor/libwps/Makefile index c5d0a39de1..879cc8e4db 100644 --- a/utils/wpseditor/libwps/Makefile +++ b/utils/wpseditor/libwps/Makefile | |||
@@ -8,15 +8,13 @@ | |||
8 | # | 8 | # |
9 | ROOT=../../.. | 9 | ROOT=../../.. |
10 | 10 | ||
11 | OS = w32 | 11 | ifneq ($or($(findstring MINGW,$(shell uname)),$(findstring Windows_NT,$(OS))),) |
12 | CC = gcc | ||
13 | MKDIR = mkdir -p | ||
14 | |||
15 | ifeq ($(findstring MINGW,$(shell uname)),MINGW) | ||
16 | OS = w32 | 12 | OS = w32 |
17 | CC = mingw32-gcc | 13 | CC = mingw32-gcc |
18 | COPY = copy | 14 | COPY = copy |
19 | RM = rm | 15 | RM = del |
16 | EXT = .dll | ||
17 | LDFLAGS = -DBUILD_DLL | ||
20 | endif | 18 | endif |
21 | 19 | ||
22 | ifeq ($(findstring Linux,$(shell uname)),Linux) | 20 | ifeq ($(findstring Linux,$(shell uname)),Linux) |
@@ -24,39 +22,48 @@ ifeq ($(findstring Linux,$(shell uname)),Linux) | |||
24 | CC = gcc | 22 | CC = gcc |
25 | COPY = cp | 23 | COPY = cp |
26 | RM = rm -f | 24 | RM = rm -f |
25 | EXT = .so | ||
26 | LDFLAGS = -fPIC | ||
27 | endif | 27 | endif |
28 | 28 | ||
29 | 29 | TARGETS=IRIVER_H10 \ | |
30 | IRIVER_H10_5GB \ | ||
31 | IPOD_COLOR \ | ||
32 | IPOD_NANO \ | ||
33 | IPOD_VIDEO \ | ||
34 | GIGABEAT_F \ | ||
35 | GIGABEAT_S \ | ||
36 | SANSA_E200 \ | ||
37 | SANSA_C200 | ||
30 | 38 | ||
31 | SOURCES= \ | 39 | SOURCES= \ |
32 | src/api.c \ | 40 | src/api.c \ |
33 | src/dummies.c \ | 41 | src/dummies.c \ |
34 | src/lcd.c \ | 42 | src/lcd.c \ |
35 | src/proxy.c \ | 43 | src/proxy.c \ |
36 | $(ROOT)/apps/gui/scrollbar.c \ | 44 | $(ROOT)/apps/gui/scrollbar.c \ |
37 | $(ROOT)/apps/gui/gwps-common.c \ | 45 | $(ROOT)/apps/gui/gwps-common.c \ |
38 | $(ROOT)/apps/gui/wps_parser.c \ | 46 | $(ROOT)/apps/gui/wps_parser.c \ |
39 | $(ROOT)/apps/gui/wps_debug.c \ | 47 | $(ROOT)/apps/gui/wps_debug.c \ |
40 | $(ROOT)/apps/recorder/peakmeter.c \ | 48 | $(ROOT)/apps/recorder/peakmeter.c \ |
41 | $(ROOT)/apps/recorder/icons.c \ | 49 | $(ROOT)/apps/recorder/icons.c \ |
42 | $(ROOT)/apps/misc.c \ | 50 | $(ROOT)/apps/misc.c \ |
43 | $(ROOT)/apps/status.c \ | 51 | $(ROOT)/apps/status.c \ |
44 | $(ROOT)/firmware/common/ctype.c \ | 52 | $(ROOT)/firmware/common/ctype.c \ |
45 | $(ROOT)/firmware/common/timefuncs.c \ | 53 | $(ROOT)/firmware/common/timefuncs.c \ |
46 | $(ROOT)/firmware/common/unicode.c \ | 54 | $(ROOT)/firmware/common/unicode.c \ |
47 | $(ROOT)/firmware/font.c \ | 55 | $(ROOT)/firmware/font.c \ |
48 | $(ROOT)/firmware/font_cache.c \ | 56 | $(ROOT)/firmware/font_cache.c \ |
49 | $(ROOT)/firmware/id3.c \ | 57 | $(ROOT)/firmware/id3.c \ |
50 | $(ROOT)/firmware/lru.c \ | 58 | $(ROOT)/firmware/lru.c \ |
51 | $(ROOT)/firmware/mp3data.c \ | 59 | $(ROOT)/firmware/mp3data.c \ |
52 | $(ROOT)/firmware/replaygain.c | 60 | $(ROOT)/firmware/replaygain.c |
53 | 61 | # $(ROOT)/apps/recorder/bmp.c | |
54 | # $(ROOT)/apps/recorder/bmp.c | 62 | # $(ROOT)/apps/abrepeat.c \ |
55 | # $(ROOT)/apps/abrepeat.c \ | 63 | # $(ROOT)/apps/action.c \ |
56 | # $(ROOT)/apps/action.c \ | 64 | # $(ROOT)/apps/cuesheet.c \ |
57 | # $(ROOT)/apps/cuesheet.c \ | 65 | # $(ROOT)/apps/gui/statusbar.c \ |
58 | # $(ROOT)/apps/gui/statusbar.c \ | 66 | # $(ROOT)/apps/gui/gwps.c \ |
59 | # $(ROOT)/apps/gui/gwps.c \ | ||
60 | 67 | ||
61 | INCLUDE=-I src/include \ | 68 | INCLUDE=-I src/include \ |
62 | -I $(ROOT)/apps/gui \ | 69 | -I $(ROOT)/apps/gui \ |
@@ -68,34 +75,14 @@ INCLUDE=-I src/include \ | |||
68 | 75 | ||
69 | CFLAGS = -g -Wall -D__PCTOOL__ -DWPSEDITOR -DDEBUG -DROCKBOX_DIR_LEN=1 -DBUTTON_REMOTE | 76 | CFLAGS = -g -Wall -D__PCTOOL__ -DWPSEDITOR -DDEBUG -DROCKBOX_DIR_LEN=1 -DBUTTON_REMOTE |
70 | 77 | ||
71 | all: | 78 | RESULTS := $(patsubst %,libwps_%$(EXT),$(TARGETS)) |
72 | @echo To build, run the buildall.sh script | ||
73 | |||
74 | build: build-$(OS) | ||
75 | |||
76 | build-w32: $(SOURCES) | ||
77 | @echo CC [$(TARGET)] | ||
78 | @$(CC) $(INCLUDE) $(CFLAGS) -D$(TARGET) -DTARGET_MODEL=\"$(MODEL)\" -DBUILD_DLL $(SOURCES) -shared -o libwps_$(MODEL).dll | ||
79 | |||
80 | build-linux: $(SOURCES) | ||
81 | @echo CC [$(TARGET)] | ||
82 | @$(CC) $(INCLUDE) $(CFLAGS) -D$(TARGET) -DTARGET_MODEL=\"$(MODEL)\" -shared -Wl,-soname,libwps_$(MODEL).so,-olibwps_$(MODEL).so -fPIC $(SOURCES) | ||
83 | |||
84 | clean: clean-$(OS) | ||
85 | |||
86 | clean-w32: | ||
87 | $(RM) "libwps_$(MODEL).dll" | ||
88 | |||
89 | clean-linux: | ||
90 | $(RM) "libwps_$(MODEL).so" | ||
91 | 79 | ||
92 | shared: shared-$(OS) | 80 | all: $(RESULTS) |
81 | @$(COPY) $(RESULTS) ../gui/bin/ | ||
93 | 82 | ||
94 | shared-w32: $(SOURCES) | 83 | libwps_%$(EXT): $(SOURCES) |
95 | @echo CC [IRIVER_H10_5GB] | 84 | @echo CC [$(subst libwps_,,$(subst $(EXT),,$@))] |
96 | @$(CC) $(INCLUDE) $(CFLAGS) -DIRIVER_H10_5GB -DTARGET_MODEL=\"h10_5gb\" -DBUILD_DLL -shared $(SOURCES) -o ../gui/bin/libwps_h10_5gb.dll | 85 | @$(CC) $(INCLUDE) $(CFLAGS) -D$(subst libwps_,,$(subst $(EXT),,$@)) $(LDFLAGS) -shared -o $@ $+ |
97 | 86 | ||
98 | shared-linux: $(SOURCES) | 87 | clean: |
99 | @echo CC [IRIVER_H10_5GB] | 88 | $(RM) $(RESULTS) |
100 | @$(CC) $(INCLUDE) $(CFLAGS) -DIRIVER_H10_5GB -DTARGET_MODEL=\"h10_5gb\" -shared -Wl,-soname,libwps_h10_5gb.so,-olibwps_h10_5gb.so -fPIC $(SOURCES) | ||
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 deleted file mode 100644 index fb66b41904..0000000000 --- a/utils/wpseditor/libwps/buildall.bat +++ /dev/null | |||
@@ -1,4 +0,0 @@ | |||
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 deleted file mode 100755 index 0f32bb9b9a..0000000000 --- a/utils/wpseditor/libwps/buildall.sh +++ /dev/null | |||
@@ -1,9 +0,0 @@ | |||
1 | #!/bin/sh | ||
2 | cat targets.txt | ( | ||
3 | while read target model | ||
4 | do | ||
5 | make MODEL=$model TARGET=$target build | ||
6 | done | ||
7 | cp *.dll ../gui/bin | ||
8 | cp *.so ../gui/bin | ||
9 | ) | ||
diff --git a/utils/wpseditor/libwps/cleanall.sh b/utils/wpseditor/libwps/cleanall.sh deleted file mode 100644 index 15b733a6a7..0000000000 --- a/utils/wpseditor/libwps/cleanall.sh +++ /dev/null | |||
@@ -1,7 +0,0 @@ | |||
1 | #!/bin/sh | ||
2 | cat targets.txt | ( | ||
3 | while read target model | ||
4 | do | ||
5 | make MODEL=$model TARGET=$target clean | ||
6 | done | ||
7 | ) | ||
diff --git a/utils/wpseditor/libwps/src/proxy.c b/utils/wpseditor/libwps/src/proxy.c index 8f9218e3ff..1e4804cd11 100644 --- a/utils/wpseditor/libwps/src/proxy.c +++ b/utils/wpseditor/libwps/src/proxy.c | |||
@@ -23,8 +23,8 @@ pfdebugf dbgf = 0; | |||
23 | static char pluginbuf[PLUGIN_BUFFER_SIZE]; | 23 | static char pluginbuf[PLUGIN_BUFFER_SIZE]; |
24 | 24 | ||
25 | const char* get_model_name(){ | 25 | const char* get_model_name(){ |
26 | #ifdef TARGET_MODEL | 26 | #ifdef MODEL_NAME |
27 | return TARGET_MODEL; | 27 | return MODEL_NAME; |
28 | #else | 28 | #else |
29 | return "unknown"; | 29 | return "unknown"; |
30 | #endif | 30 | #endif |
diff --git a/utils/wpseditor/libwps/targets.txt b/utils/wpseditor/libwps/targets.txt deleted file mode 100644 index 547a2ba42c..0000000000 --- a/utils/wpseditor/libwps/targets.txt +++ /dev/null | |||
@@ -1,9 +0,0 @@ | |||
1 | IRIVER_H10 h10 | ||
2 | IRIVER_H10_5GB h10_5gb | ||
3 | IPOD_COLOR ipodcolor | ||
4 | IPOD_NANO ipodnano | ||
5 | IPOD_VIDEO ipodvideo | ||
6 | GIGABEAT_F gigabeatf | ||
7 | GIGABEAT_S gigabeats | ||
8 | SANSA_E200 e200 | ||
9 | SANSA_C200 c200 | ||
diff --git a/utils/wpseditor/screenshot/Makefile b/utils/wpseditor/screenshot/Makefile index 18a6de35a5..f9309f58a5 100644 --- a/utils/wpseditor/screenshot/Makefile +++ b/utils/wpseditor/screenshot/Makefile | |||
@@ -8,31 +8,17 @@ | |||
8 | # | 8 | # |
9 | ROOT=../../.. | 9 | ROOT=../../.. |
10 | 10 | ||
11 | OS = w32 | ||
12 | CC = gcc | ||
13 | |||
14 | ifeq ($(findstring MINGW,$(shell uname)),MINGW) | ||
15 | OS = w32 | ||
16 | CC = mingw32-gcc | ||
17 | RM = rm | ||
18 | endif | ||
19 | |||
20 | ifeq ($(findstring Linux,$(shell uname)),Linux) | ||
21 | OS = linux | ||
22 | CC = gcc | 11 | CC = gcc |
23 | RM = rm -f | 12 | RM = rm -f |
24 | endif | ||
25 | |||
26 | |||
27 | 13 | ||
28 | COMMON= main.c gd_bmp.c | 14 | COMMON = main.c gd_bmp.c |
29 | 15 | ||
30 | INCLUDE=-I ../libwps/src \ | 16 | INCLUDE = -I ../libwps/src \ |
31 | -I $(ROOT)/apps/gui \ | 17 | -I $(ROOT)/apps/gui \ |
32 | -I $(ROOT)/firmware/export \ | 18 | -I $(ROOT)/firmware/export \ |
33 | -I $(ROOT)/apps/recorder \ | 19 | -I $(ROOT)/apps/recorder \ |
34 | -I $(ROOT)/apps \ | 20 | -I $(ROOT)/apps \ |
35 | -I . | 21 | -I . |
36 | 22 | ||
37 | CFLAGS = -g -Wall | 23 | CFLAGS = -g -Wall |
38 | 24 | ||
diff --git a/utils/wpseditor/wpseditor.pro b/utils/wpseditor/wpseditor.pro index 0e9ecbbf51..df954ed68a 100644 --- a/utils/wpseditor/wpseditor.pro +++ b/utils/wpseditor/wpseditor.pro | |||
@@ -1,2 +1,4 @@ | |||
1 | SUBDIRS =gui/src/QPropertyEditor gui | ||
2 | TEMPLATE = subdirs | 1 | TEMPLATE = subdirs |
2 | SUBDIRS = gui/src/QPropertyEditor gui libwps | ||
3 | libwps.commands = @$(MAKE) -C libwps | ||
4 | QMAKE_EXTRA_TARGETS += libwps | ||