1
0
Fork 0
forked from len0rd/rockbox

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
This commit is contained in:
Dominik Wenger 2008-09-03 19:24:50 +00:00
parent ca0de82cec
commit 254fa65c7b
26 changed files with 360 additions and 186 deletions

View file

@ -7,15 +7,18 @@
Installation Installation
To make a release version, change value in CONFIG from "debug" to "release" in gui.pro and QPropertyEditor.pro.
Windows: Windows:
* be sure that you have properly installed mingw, QT > 4.3.* * be sure that you have properly installed mingw, QT > 4.3.* and bin directories are set properly
* if you want to debug wpseditor, you'll have to build Qt debug libraries * if you want to debug wpseditor, you'll have to build Qt debug libraries
* cd to rockbox/utils/wpseditor/ from Qt command promt and run qmake and then make * if you haven't qmake from PATH enviromet use Qts command line.
* >gui\bin\wpseditor.exe * run 'buildall.bat' in utils\wpseditor\
* the binary is then in utils\wpseditor\gui\bin\wpseditord.exe
Linux: Linux:
* Make sure you have libqt4-dev installed and you have a working Rockbox environment * Make sure you have libqt4-dev installed and you have a working Rockbox environment
* cd to utils/wpseditor/ and do 'qmake-qt4 && make' * cd to utils/wpseditor/ and run 'buildall.sh'
* cd to gui/bin/ and start WPS editor with './wpseditord' * cd to gui/bin/ and start WPS editor with './wpseditord'

View file

@ -1,7 +1,19 @@
* Enable ability in gui to load different targets on the fly * Make better logging system
* Replace checkwps functionality
* Include 'screenshot utility' functionality
* Options
* Enable animation(timers,sliding lines, etc) * Enable animation(timers,sliding lines, etc)
* Test on Mac OS * Test on Mac OS
* Redesign GUI for more usability * Redesign GUI for more usability
* Replace checkwps functionality
* Include 'screenshot utility' functionality
* Make editing via gui * Make editing via gui
* Use native rockbox fonts
* Replace shared libs as Qt Plugins
* Edit wiki :-)
Partially solved
* Enable ability in gui to load different targets on the fly [Not all targets are built yet]
* Syntax highlight [Comments are done; enable for logEdit; tag highlight]
THE BUGZ ARE COMING!
* While loading wps for the first time, gui doesn't show properties from editor properly
* Strange text horisontal position in cabbie(probably other themes)

View file

@ -0,0 +1,9 @@
@echo off
echo qmake...
qmake
echo Building gui...
mingw32-make 1>nul
echo Building libs...
cd libwps
call buildall.bat 2>nul
cd ..

4
utils/wpseditor/buildall.sh Executable file
View file

@ -0,0 +1,4 @@
#!/bin/sh
qmake && make
cd libwps
./buildall.sh 2> /dev/null

View file

@ -8,10 +8,7 @@ MOC_DIR = build
UI_DIR = build UI_DIR = build
QMAKE_LIBDIR += lib QMAKE_LIBDIR += lib
QT = gui core QT = gui core
CONFIG += qt warn_on console debug_and_release CONFIG += qt warn_on debug
libwps.commands += $(MAKE) -C ../libwps shared
QMAKE_EXTRA_TARGETS += libwps
PRE_TARGETDEPS += libwps
HEADERS += ../libwps/src/api.h \ HEADERS += ../libwps/src/api.h \
../libwps/src/defs.h \ ../libwps/src/defs.h \
src/slider.h \ src/slider.h \
@ -19,7 +16,8 @@ HEADERS += ../libwps/src/api.h \
src/qwpsstate.h \ src/qwpsstate.h \
src/qwpseditorwindow.h \ src/qwpseditorwindow.h \
src/utils.h \ src/utils.h \
src/qwpsdrawer.h src/qwpsdrawer.h \
src/qsyntaxer.h
FORMS += ui/mainwindow.ui ui/slider.ui FORMS += ui/mainwindow.ui ui/slider.ui
SOURCES += src/main.cpp \ SOURCES += src/main.cpp \
src/slider.cpp \ src/slider.cpp \
@ -28,11 +26,13 @@ SOURCES += src/main.cpp \
src/qwpseditorwindow.cpp \ src/qwpseditorwindow.cpp \
src/utils.cpp \ src/utils.cpp \
src/qwpsdrawer.cpp \ src/qwpsdrawer.cpp \
src/qwpsdrawer_static.cpp src/qwpsdrawer_static.cpp \
src/qsyntaxer.cpp
LIBS += -Lbin LIBS += -Lbin
CONFIG(debug, debug|release) { CONFIG(debug, debug|release) {
LIBS += -lQPropertyEditord LIBS += -lQPropertyEditord
TARGET = wpseditord TARGET = wpseditord
CONFIG += console
} }
CONFIG(release, debug|release) { CONFIG(release, debug|release) {
LIBS += -lQPropertyEditor LIBS += -lQPropertyEditor

View file

@ -1,5 +1,5 @@
TEMPLATE = lib TEMPLATE = lib
CONFIG += staticlib debug_and_release CONFIG += staticlib debug
SOURCES = ColorCombo.cpp \ SOURCES = ColorCombo.cpp \
Property.cpp \ Property.cpp \
QPropertyEditorWidget.cpp \ QPropertyEditorWidget.cpp \

View file

@ -0,0 +1,44 @@
#include <QTextCharFormat>
#include "qsyntaxer.h"
QSyntaxer::QSyntaxer(QTextDocument *parent)
: QSyntaxHighlighter(parent) {
HighlightingRule rule;
hrules["operator"].pattern = QRegExp("%[^\\| \n<\\?%]{1,2}");
hrules["operator"].format.setFontWeight(QFont::Bold);
hrules["operator"].format.setForeground(Qt::darkBlue);
hrules["question"].pattern = QRegExp("%[\\?]{1}[^<]{1,2}");
hrules["question"].format.setForeground(Qt::darkMagenta);
hrules["question2"].pattern = QRegExp("(<|>)");
hrules["question2"].format.setForeground(Qt::red);
hrules["limiter"].pattern = QRegExp("\\|");
hrules["limiter"].format.setForeground(Qt::darkRed);
hrules["comment"].pattern = QRegExp("#[^\n]*");
hrules["comment"].format.setForeground(Qt::darkGreen);
hrules["comment"].format.setFontItalic(true);
}
//
void QSyntaxer::highlightBlock(const QString &text) {
QTextCharFormat wholeText;
wholeText.setFont(QFont("arial",11,QFont::Normal));
setFormat(0,text.length(),wholeText);
foreach (HighlightingRule rule, hrules) {
QRegExp expression(rule.pattern);
int index = text.indexOf(expression);
while (index >= 0) {
int length = expression.matchedLength();
setFormat(index, length, rule.format);
index = text.indexOf(expression, index + length);
}
}
}

View file

@ -0,0 +1,21 @@
#ifndef QSYNTAXER_H
#define QSYNTAXER_H
//
#include <QSyntaxHighlighter>
class QTextCharFormat;
class QSyntaxer : public QSyntaxHighlighter {
Q_OBJECT
struct HighlightingRule {
QRegExp pattern;
QTextCharFormat format;
};
QMap<QString,HighlightingRule> hrules;
public:
QSyntaxer(QTextDocument *parent = 0);
protected:
void highlightBlock(const QString &text);
};
#endif

View file

@ -4,11 +4,9 @@
#include "wpsstate.h" #include "wpsstate.h"
#include <QObject> #include <QObject>
class QWpsState;
class QTrackState : public QObject { class QTrackState : public QObject {
Q_OBJECT Q_OBJECT
Q_CLASSINFO ( "QTrackState", "Mp3 State" ); Q_CLASSINFO ( "QTrackState", "Track State" );
Q_PROPERTY ( QString Title READ title WRITE setTitle DESIGNABLE true USER true ) Q_PROPERTY ( QString Title READ title WRITE setTitle DESIGNABLE true USER true )
Q_PROPERTY ( QString Artist READ artist WRITE setArtist DESIGNABLE true USER true ) Q_PROPERTY ( QString Artist READ artist WRITE setArtist DESIGNABLE true USER true )
Q_PROPERTY ( QString Album READ album WRITE setAlbum DESIGNABLE true USER true ) Q_PROPERTY ( QString Album READ album WRITE setAlbum DESIGNABLE true USER true )
@ -17,7 +15,6 @@ class QTrackState : public QObject {
Q_PROPERTY ( int Elapsed READ elapsed WRITE setElapsed DESIGNABLE true USER true ) Q_PROPERTY ( int Elapsed READ elapsed WRITE setElapsed DESIGNABLE true USER true )
Q_CLASSINFO("Elapsed", "minimum=0;maximum=100;value=50"); Q_CLASSINFO("Elapsed", "minimum=0;maximum=100;value=50");
trackstate state; trackstate state;
public: public:

View file

@ -1,11 +1,14 @@
#include <stdarg.h>
#include <QtGui>
#include <QLibrary>
#include "qwpsdrawer.h" #include "qwpsdrawer.h"
#include "slider.h" #include "slider.h"
#include "utils.h" #include "utils.h"
#include <QtGui> #include "qtrackstate.h"
#include <QLibrary> #include "qwpsstate.h"
#include <stdarg.h> #include "api.h"
//
QPointer<QWpsDrawer> drawer; QPointer<QWpsDrawer> drawer;
QPixmap *QWpsDrawer::pix = NULL; QPixmap *QWpsDrawer::pix = NULL;
@ -14,34 +17,38 @@ QImage QWpsDrawer::backdrop;
proxy_api QWpsDrawer::api; proxy_api QWpsDrawer::api;
QWpsDrawer::QWpsDrawer( QWpsState *ws,QTrackState *ms, QWidget *parent ) QWpsDrawer::QWpsDrawer( QWpsState *ws,QTrackState *ms, QWidget *parent )
: QWidget(parent),wpsState(ws),trackState(ms),showGrid(false),mTargetLibName("libwps") { : QWidget(parent),wpsState(ws),trackState(ms),showGrid(false),mCurTarget("h10_5gb") {
tryResolve(); tryResolve();
memset(&api,0,sizeof(struct proxy_api));
api.verbose = 2;
api.putsxy = &QWpsDrawer::putsxy;
api.transparent_bitmap_part = &QWpsDrawer::transparent_bitmap_part;
api.bitmap_part = &QWpsDrawer::bitmap_part;
api.drawpixel = &QWpsDrawer::drawpixel;
api.fillrect = &QWpsDrawer::fillrect;
api.hline = &QWpsDrawer::hline;
api.vline = &QWpsDrawer::vline;
api.clear_viewport = &QWpsDrawer::clear_viewport;
api.load_wps_backdrop = &QWpsDrawer::load_wps_backdrop;
api.read_bmp_file = &QWpsDrawer::read_bmp_file;
api.debugf = &qlogger;
newTempWps(); newTempWps();
} }
bool QWpsDrawer::tryResolve() { bool QWpsDrawer::tryResolve() {
QLibrary lib(qApp->applicationDirPath()+"/"+mTargetLibName); QLibrary lib(qApp->applicationDirPath()+"/libwps_"+mCurTarget);
wps_init = (pfwps_init)lib.resolve("wps_init"); lib_wps_init = (pfwps_init)lib.resolve("wps_init");
wps_display = (pfwps_display)lib.resolve("wps_display"); lib_wps_display = (pfwps_display)lib.resolve("wps_display");
wps_refresh = (pfwps_refresh)lib.resolve("wps_refresh"); lib_wps_refresh = (pfwps_refresh)lib.resolve("wps_refresh");
mResolved = wps_init && wps_display && wps_refresh; lib_get_model_name = (pfget_model_name)lib.resolve("get_model_name");
mResolved = lib_wps_init && lib_wps_display && lib_wps_refresh && lib_get_model_name;
if (!mResolved) if (!mResolved)
DEBUGF1(tr("ERR: Failed to resolve funcs!")); DEBUGF1(tr("ERR: Failed to resolve funcs!"));
else {
int v = api.verbose;
memset(&api,0,sizeof(struct proxy_api));
api.verbose = v;
api.putsxy = &QWpsDrawer::putsxy;
api.transparent_bitmap_part = &QWpsDrawer::transparent_bitmap_part;
api.bitmap_part = &QWpsDrawer::bitmap_part;
api.drawpixel = &QWpsDrawer::drawpixel;
api.fillrect = &QWpsDrawer::fillrect;
api.hline = &QWpsDrawer::hline;
api.vline = &QWpsDrawer::vline;
api.clear_viewport = &QWpsDrawer::clear_viewport;
api.load_wps_backdrop = &QWpsDrawer::load_wps_backdrop;
api.read_bmp_file = &QWpsDrawer::read_bmp_file;
api.debugf = &qlogger;
qDebug()<<(qApp->applicationDirPath()+"/libwps_"+mCurTarget+" resolved");
}
return mResolved; return mResolved;
} }
QWpsDrawer::~QWpsDrawer() { QWpsDrawer::~QWpsDrawer() {
@ -56,20 +63,20 @@ void QWpsDrawer::mouseReleaseEvent ( QMouseEvent * event ) {
DEBUGF1("x=%d,y=%d",x,y);*/ DEBUGF1("x=%d,y=%d",x,y);*/
} }
void QWpsDrawer::newTempWps() { void QWpsDrawer::newTempWps() {
QTemporaryFile tmpWps; QTemporaryFile tmpWps;
tmpWps.setAutoRemove(false); tmpWps.setAutoRemove(false);
tmpWps.setFileTemplate(QDir::tempPath()+"/XXXXXXXXXX.wps"); tmpWps.setFileTemplate(QDir::tempPath()+"/XXXXXXXXXX.wps");
if (tmpWps.open()) { if (tmpWps.open()) {
QString tmpDir = tmpWps.fileName().left(tmpWps.fileName().length()-4); QString tmpDir = tmpWps.fileName().left(tmpWps.fileName().length()-4);
if (QDir::temp().mkpath(tmpDir)) { if (QDir::temp().mkpath(tmpDir)) {
mTmpWpsString = tmpDir; mTmpWpsString = tmpDir;
DEBUGF1(mTmpWpsString); DEBUGF3(QString("Created :"+mTmpWpsString).toAscii());
} }
} }
} }
void QWpsDrawer::WpsInit(QString buffer, bool isFile) { void QWpsDrawer::WpsInit(QString buffer, bool isFile) {
DEBUGF3("QWpsDrawer::WpsInit");
if (!mResolved) if (!mResolved)
if (!tryResolve()) if (!tryResolve())
return; return;
@ -87,22 +94,24 @@ void QWpsDrawer::WpsInit(QString buffer, bool isFile) {
if (tfile.open(QIODevice::WriteOnly | QIODevice::Text)) if (tfile.open(QIODevice::WriteOnly | QIODevice::Text))
tfile.write(mWpsString.toAscii(),mWpsString.length()); tfile.write(mWpsString.toAscii(),mWpsString.length());
} }
backdrop.fill(Qt::black);
DEBUGF3("clear backdrop");
if (isFile) if (isFile)
wps_init(buffer.toAscii(), &api, isFile); lib_wps_init(buffer.toAscii(), &api, isFile);
else else
wps_init(QString(mTmpWpsString+".wps").toAscii(), &api, true); lib_wps_init(QString(mTmpWpsString+".wps").toAscii(), &api, true);
pix = new QPixmap(api.getwidth(),api.getheight()); pix = new QPixmap(api.getwidth(),api.getheight());
pix->fill(Qt::black);
drawBackdrop(); drawBackdrop();
setMinimumWidth(api.getwidth()); setMinimumWidth(api.getwidth());
setMinimumHeight(api.getheight()); setMinimumHeight(api.getheight());
update(); update();
} }
void QWpsDrawer::paintEvent(QPaintEvent * event) { void QWpsDrawer::paintEvent(QPaintEvent * event) {
DEBUGF3("QWpsDrawer::paintEvent()");
if (!mResolved) if (!mResolved)
return; return;
if (pix==NULL) if (pix==NULL)
@ -111,7 +120,7 @@ void QWpsDrawer::paintEvent(QPaintEvent * event) {
QRect rect = event->rect(); QRect rect = event->rect();
drawBackdrop(); drawBackdrop();
wps_refresh(); lib_wps_refresh();
if (showGrid) { if (showGrid) {
QPainter g(pix); QPainter g(pix);
@ -172,10 +181,13 @@ void QWpsDrawer::slotShowGrid(bool show) {
} }
void QWpsDrawer::drawBackdrop() { void QWpsDrawer::drawBackdrop() {
DEBUGF3("QWpsDrawer::drawBackdrop()");
if (backdrop.isNull())
return;
QPainter b(pix); QPainter b(pix);
QImage pink = backdrop.createMaskFromColor(qRgb(255,0,255),Qt::MaskOutColor); QImage pink = backdrop.createMaskFromColor(qRgb(255,0,255),Qt::MaskOutColor);
backdrop.setAlphaChannel(pink); backdrop.setAlphaChannel(pink);
b.drawImage(0,0,backdrop); b.drawImage(0,0,backdrop,0,0,pix->width(),pix->height());
} }
void QWpsDrawer::slotSetAudioStatus(int status) { void QWpsDrawer::slotSetAudioStatus(int status) {
@ -198,3 +210,35 @@ void QWpsDrawer::closeEvent(QCloseEvent *event) {
cleanTemp(); cleanTemp();
event->accept(); event->accept();
} }
QString QWpsDrawer::getModelName(QString libraryName) {
QLibrary lib(libraryName);
if ((pfget_model_name)lib.resolve("get_model_name"))
return ((pfget_model_name)lib.resolve("get_model_name"))();
DEBUGF1("ERR: failed to resolve <get_model_name>");
return "unknown";
}
QList<QString> QWpsDrawer::getTargets() {
QList<QString> list ;
QDir d = QDir(qApp->applicationDirPath());
QFileInfoList libs = d.entryInfoList(QStringList("libwps*"));
qDebug() << libs.size()<<"libs found";
for (int i = 0; i < libs.size(); i++) {
QString modelName = getModelName(libs[i].absoluteFilePath());
qDebug() << libs[i].fileName()<<modelName;
if (modelName == "unknown")
continue;
list.append(modelName);
}
return list;
}
bool QWpsDrawer::setTarget(QString target) {
QLibrary lib(qApp->applicationDirPath()+"/libwps_"+mCurTarget);
//lib.unload();
if (getModelName("libwps_"+target)!="unknown") {
mCurTarget = target;
return tryResolve();
}
return false;
}

View file

@ -1,25 +1,30 @@
#ifndef WPSDRAWER_H #ifndef WPSDRAWER_H
#define WPSDRAWER_H #define WPSDRAWER_H
//
#include <QWidget> #include <QWidget>
#include <QPixmap> #include <QPixmap>
#include <QPointer> #include <QPointer>
#include <QTemporaryFile> #include <QTemporaryFile>
#include "api.h"
#include "qtrackstate.h" #include "wpsstate.h"
#include "qwpsstate.h"
// struct proxy_api;
class QWpsState;
class QTrackState;
typedef int (*pfwps_init)(const char* buff,struct proxy_api *api, bool isfile); typedef int (*pfwps_init)(const char* buff,struct proxy_api *api, bool isfile);
typedef int (*pfwps_display)(); typedef int (*pfwps_display)();
typedef int (*pfwps_refresh)(); typedef int (*pfwps_refresh)();
typedef const char* (*pfget_model_name)();
class QWpsDrawer : public QWidget { class QWpsDrawer : public QWidget {
Q_OBJECT Q_OBJECT
pfwps_init wps_init; pfwps_init lib_wps_init;
pfwps_display wps_display; pfwps_display lib_wps_display;
pfwps_refresh wps_refresh; pfwps_refresh lib_wps_refresh;
pfget_model_name lib_get_model_name;
static QPixmap *pix; static QPixmap *pix;
static QImage backdrop; static QImage backdrop;
@ -30,7 +35,7 @@ class QWpsDrawer : public QWidget {
bool showGrid; bool showGrid;
bool mResolved; bool mResolved;
QString mWpsString; QString mWpsString;
QString mTargetLibName; QString mCurTarget;
static QString mTmpWpsString; static QString mTmpWpsString;
@ -42,6 +47,7 @@ protected:
void newTempWps(); void newTempWps();
void cleanTemp(bool fileToo=true); void cleanTemp(bool fileToo=true);
bool tryResolve(); bool tryResolve();
QString getModelName(QString libraryName);
public: public:
QWpsDrawer(QWpsState *ws,QTrackState *ms, QWidget *parent=0); QWpsDrawer(QWpsState *ws,QTrackState *ms, QWidget *parent=0);
~QWpsDrawer(); ~QWpsDrawer();
@ -53,6 +59,8 @@ public:
QString tempWps() const { QString tempWps() const {
return mTmpWpsString; return mTmpWpsString;
}; };
QList<QString> getTargets();
bool setTarget(QString target);
static proxy_api api; static proxy_api api;
@ -73,7 +81,6 @@ public:
public slots: public slots:
void slotSetVolume(); void slotSetVolume();
void slotSetProgress(); void slotSetProgress();
void slotShowGrid(bool); void slotShowGrid(bool);
void slotWpsStateChanged(wpsstate); void slotWpsStateChanged(wpsstate);
void slotTrackStateChanged(trackstate); void slotTrackStateChanged(trackstate);

View file

@ -3,14 +3,14 @@
#include <QFile> #include <QFile>
#include <QFileInfo> #include <QFileInfo>
#include "utils.h" #include "utils.h"
#include "api.h"
void QWpsDrawer::putsxy(int x, int y, const unsigned char *str) { void QWpsDrawer::putsxy(int x, int y, const unsigned char *str) {
DEBUGF3("putsxy(int x=%d, int y=%d, *str=%s)",x,y,str);
QPainter p(pix); QPainter p(pix);
viewport_api avp; viewport_api avp;
api.get_current_vp(&avp); api.get_current_vp(&avp);
p.setPen(Qt::gray); p.setPen(Qt::gray);
QFont font("times",avp.fontheight,QFont::Bold); QFont font("times",avp.fontheight,QFont::Bold);
p.setFont(font); p.setFont(font);
p.drawText(x+avp.x,y + avp.fontheight + avp.y,(char*)str); p.drawText(x+avp.x,y + avp.fontheight + avp.y,(char*)str);
@ -54,7 +54,7 @@ void QWpsDrawer::vline(int x, int y1, int y2) {
p.drawLine(x,y1,x,y2); p.drawLine(x,y1,x,y2);
} }
bool QWpsDrawer::load_wps_backdrop(char* filename) { bool QWpsDrawer::load_wps_backdrop(char* filename) {
DEBUGF2("load backdrop: %s", filename); DEBUGF3("load backdrop: %s", filename);
QFile file(filename); QFile file(filename);
QFileInfo info(file); QFileInfo info(file);
file.copy(mTmpWpsString+"/"+info.fileName()); file.copy(mTmpWpsString+"/"+info.fileName());
@ -70,7 +70,6 @@ int QWpsDrawer::read_bmp_file(const char* filename,int *width, int *height) {
file.copy(mTmpWpsString+"/"+info.fileName()); file.copy(mTmpWpsString+"/"+info.fileName());
img.load(filename); img.load(filename);
//qDebug()<<"QWpsDrawer::read_bmp_file"<<img.width()<<img.height();
*width = img.width(); *width = img.width();
*height = img.height(); *height = img.height();
return 1; return 1;

View file

@ -1,9 +1,11 @@
#include "qwpseditorwindow.h"
#include "qwpsdrawer.h"
#include "utils.h"
#include <QFileDialog> #include <QFileDialog>
#include <QDebug> #include <QDebug>
#include <QInputDialog> #include <QInputDialog>
#include "api.h"
#include "qwpseditorwindow.h"
#include "utils.h"
#include "qsyntaxer.h"
enum api_playmode playmodes[PLAYMODES_NUM] = { enum api_playmode playmodes[PLAYMODES_NUM] = {
API_STATUS_PLAY, API_STATUS_PLAY,
@ -27,45 +29,61 @@ QWpsEditorWindow::QWpsEditorWindow( QWidget * parent, Qt::WFlags f)
setupUi(this); setupUi(this);
drawer = new QWpsDrawer(&wpsState,&trackState, this); drawer = new QWpsDrawer(&wpsState,&trackState, this);
QWpsDrawer::api.verbose = 1; QWpsDrawer::api.verbose = 1;
//drawer->WpsInit("iCatcher.wps");
setCentralWidget(drawer); setCentralWidget(drawer);
connectActions(); connectActions();
m_propertyEditor->addObject(&trackState); m_propertyEditor->addObject(&trackState);
m_propertyEditor->addObject(&wpsState); m_propertyEditor->addObject(&wpsState);
new QSyntaxer(plainWpsEdit->document());
} }
void QWpsEditorWindow::connectActions() { void QWpsEditorWindow::connectActions() {
qDebug()<<"connect actions"; DEBUGF3("connect actions");
connect(actOpenWps, SIGNAL(triggered()), this, SLOT(slotOpenWps())); connect(actOpenWps, SIGNAL(triggered()), this, SLOT(slotOpenWps()));
connect(actSetVolume, SIGNAL(triggered()), drawer, SLOT(slotSetVolume())); connect(actSetVolume, SIGNAL(triggered()), drawer, SLOT(slotSetVolume()));
connect(actSetProgress, SIGNAL(triggered()), drawer, SLOT(slotSetProgress())); connect(actSetProgress, SIGNAL(triggered()), drawer, SLOT(slotSetProgress()));
connect(actShowGrid, SIGNAL(triggered(bool)), drawer, SLOT(slotShowGrid(bool))); connect(actShowGrid, SIGNAL(triggered(bool)), drawer, SLOT(slotShowGrid(bool)));
connect(actUpdatePlainWps, SIGNAL(triggered()), SLOT(slotUpdatePlainWps())); connect(actUpdatePlainWps, SIGNAL(triggered()), SLOT(slotUpdatePlainWps()));
connect(plainWpsEdit->document(), SIGNAL(modificationChanged(bool)), SLOT(slotPlainDocModChanged(bool))); connect(plainWpsEdit->document(),SIGNAL(modificationChanged(bool)),SLOT(slotPlainDocModChanged(bool)));
connect(&wpsState, SIGNAL(stateChanged(wpsstate)), drawer, SLOT(slotWpsStateChanged(wpsstate))); connect(&wpsState, SIGNAL(stateChanged(wpsstate)), drawer, SLOT(slotWpsStateChanged(wpsstate)));
connect(&trackState, SIGNAL(stateChanged(trackstate)), drawer, SLOT(slotTrackStateChanged(trackstate))); connect(&trackState, SIGNAL(stateChanged(trackstate)), drawer, SLOT(slotTrackStateChanged(trackstate)));
connect(&wpsState, SIGNAL(stateChanged(wpsstate)), this, SLOT(slotWpsStateChanged(wpsstate))); connect(&wpsState, SIGNAL(stateChanged(wpsstate)), this, SLOT(slotWpsStateChanged(wpsstate)));
connect(&trackState, SIGNAL(stateChanged(trackstate)), this, SLOT(slotTrackStateChanged(trackstate))); connect(&trackState, SIGNAL(stateChanged(trackstate)), this, SLOT(slotTrackStateChanged(trackstate)));
connect(actClearLog, SIGNAL(triggered()), logEdit, SLOT(clear())); connect(actClearLog, SIGNAL(triggered()), logEdit, SLOT(clear()));
connect(actVerboseLevel, SIGNAL(triggered()), SLOT(slotVerboseLevel())); connect(actVerboseLevel, SIGNAL(triggered()), SLOT(slotVerboseLevel()));
actGroupAudios = new QActionGroup(this); actGroupAudios = new QActionGroup(this);
signalMapper = new QSignalMapper(this); audiosSignalMapper = new QSignalMapper(this);
for (int i=0;i<PLAYMODES_NUM;i++) { for (int i=0;i<PLAYMODES_NUM;i++) {
QAction *act = new QAction(playmodeNames[i],this); QAction *act = new QAction(playmodeNames[i],this);
act->setCheckable(true); act->setCheckable(true);
actGroupAudios->addAction(act); actGroupAudios->addAction(act);
connect(act,SIGNAL(triggered()),signalMapper,SLOT(map())); connect(act,SIGNAL(triggered()),audiosSignalMapper,SLOT(map()));
signalMapper->setMapping(act, i); audiosSignalMapper->setMapping(act, i);
menuPlay->addAction(act); menuPlay->addAction(act);
actAudios[playmodes[i]] = act; actAudios[playmodes[i]] = act;
} }
connect(signalMapper, SIGNAL(mapped(int)), SIGNAL(signalAudioStatusChanged(int))); connect(audiosSignalMapper, SIGNAL(mapped(int)), SIGNAL(signalAudioStatusChanged(int)));
connect(this, SIGNAL(signalAudioStatusChanged(int)), drawer, SLOT(slotSetAudioStatus(int))); connect(this, SIGNAL(signalAudioStatusChanged(int)), drawer, SLOT(slotSetAudioStatus(int)));
actGroupAudios->setEnabled(false); actGroupAudios->setEnabled(false);
QList<QString> targets = drawer->getTargets();
actGroupTargets = new QActionGroup(this);
targetsSignalMapper = new QSignalMapper(this);
for (int i=0;i<targets.size();i++) {
QAction *act = new QAction(targets[i],this);
act->setCheckable(true);
actGroupTargets->addAction(act);
connect(act,SIGNAL(triggered()),targetsSignalMapper,SLOT(map()));
targetsSignalMapper->setMapping(act, targets[i]);
menuTarget->addAction(act);
actTargets[targets[i]] = act;
}
connect(targetsSignalMapper, SIGNAL(mapped(const QString &)),this, SIGNAL(signalSetTarget(const QString &)));
connect(this, SIGNAL(signalSetTarget(const QString &)),this, SLOT(slotSetTarget(const QString &)));
} }
void QWpsEditorWindow::slotWpsStateChanged(wpsstate) { void QWpsEditorWindow::slotWpsStateChanged(wpsstate) {
@ -89,8 +107,9 @@ void QWpsEditorWindow::slotOpenWps() {
drawer->WpsInit(wpsfile); drawer->WpsInit(wpsfile);
plainWpsEdit->clear(); plainWpsEdit->clear();
plainWpsEdit->append(drawer->wpsString()); plainWpsEdit->append(drawer->wpsString());
trackState.setAlbum(trackState.album()); trackState.setAlbum(trackState.album()); ////updating property editor
actGroupAudios->setEnabled(true); actGroupAudios->setEnabled(true);
} }
void QWpsEditorWindow::logMsg(QString s) { void QWpsEditorWindow::logMsg(QString s) {
@ -108,7 +127,9 @@ void QWpsEditorWindow::slotUpdatePlainWps() {
DEBUGF1(tr("Updating WPS")); DEBUGF1(tr("Updating WPS"));
plainWpsEdit->document()->setModified(false); plainWpsEdit->document()->setModified(false);
drawer->WpsInit(plainWpsEdit->toPlainText(),false); drawer->WpsInit(plainWpsEdit->toPlainText(),false);
m_propertyEditor->setEnabled(true);
actGroupAudios->setEnabled(true);
trackState.setAlbum(trackState.album()); //updating property editor
} }
void QWpsEditorWindow::slotPlainDocModChanged(bool changed) { void QWpsEditorWindow::slotPlainDocModChanged(bool changed) {
@ -117,4 +138,15 @@ void QWpsEditorWindow::slotPlainDocModChanged(bool changed) {
else else
dockPlainWps->setWindowTitle(tr("PlainWps")); dockPlainWps->setWindowTitle(tr("PlainWps"));
} }
void QWpsEditorWindow::slotSetTarget(const QString & target) {
if (drawer->setTarget(target)) {
DEBUGF1(tr("New target <%1> switched").arg(target));
actTargets[target]->setChecked(true);
} else
DEBUGF1(tr("ERR: Target <%1> failed!").arg(target));
update();
slotUpdatePlainWps();
}

View file

@ -4,21 +4,28 @@
#include <QMainWindow> #include <QMainWindow>
#include <QActionGroup> #include <QActionGroup>
#include <QSignalMapper> #include <QSignalMapper>
#include "wpsstate.h"
#include "ui_mainwindow.h" #include "ui_mainwindow.h"
#include "wpsstate.h" #include "wpsstate.h"
#include "qwpsdrawer.h"
#include "qwpsstate.h" #include "qwpsstate.h"
#include "qtrackstate.h" #include "qtrackstate.h"
// #include "qwpsdrawer.h"
class QWpsEditorWindow : public QMainWindow, public Ui::MainWindow { class QWpsEditorWindow : public QMainWindow, public Ui::MainWindow {
Q_OBJECT Q_OBJECT
QWpsState wpsState; QWpsState wpsState;
QTrackState trackState; QTrackState trackState;
QPointer<QWpsDrawer> drawer; QPointer<QWpsDrawer> drawer;
QHash<int, QAction*> actAudios; QHash<int, QAction*> actAudios;
QActionGroup *actGroupAudios; QActionGroup *actGroupAudios;
QSignalMapper *signalMapper; QSignalMapper *audiosSignalMapper;
QHash<QString,QAction *> actTargets;
QActionGroup *actGroupTargets;
QSignalMapper *targetsSignalMapper;
protected: protected:
void connectActions(); void connectActions();
@ -33,9 +40,11 @@ private slots:
void slotUpdatePlainWps(); void slotUpdatePlainWps();
void slotPlainDocModChanged(bool m); void slotPlainDocModChanged(bool m);
void slotSetTarget(const QString &);
signals: signals:
void signalAudioStatusChanged(int); void signalAudioStatusChanged(int);
void signalSetTarget(const QString &);
}; };
#endif #endif
@ -43,3 +52,4 @@ signals:

View file

@ -1,11 +1,11 @@
#include "slider.h" #include "slider.h"
#include <QDebug> #include <QDebug>
// //
Slider::Slider(QWidget *parent, QString caption, int min, int max ):QDialog(parent) { Slider::Slider(QWidget *parent, QString caption, int min, int max ):QDialog(parent),mCaption(caption) {
setupUi ( this ); setupUi ( this );
connect(horslider, SIGNAL(valueChanged(int)), this, SIGNAL(valueChanged(int))); connect(horslider, SIGNAL(valueChanged(int)), this, SIGNAL(valueChanged(int)));
connect(this, SIGNAL(valueChanged(int)), this, SLOT(slotValueChanged(int))); connect(this, SIGNAL(valueChanged(int)), this, SLOT(slotValueChanged(int)));
setWindowTitle(caption); setWindowTitle(mCaption);
horslider->setMinimum(min); horslider->setMinimum(min);
horslider->setMaximum(max); horslider->setMaximum(max);
} }
@ -14,7 +14,8 @@ int Slider::value() {
return horslider->value(); return horslider->value();
} }
void Slider::slotValueChanged(int step) { void Slider::slotValueChanged(int step) {
setWindowTitle(tr("Value =%1 ").arg(step)); setWindowTitle(tr("%1 = %2 ").arg(mCaption).arg(step));
} }

View file

@ -7,6 +7,7 @@
// //
class Slider : public QDialog , Ui::slider { class Slider : public QDialog , Ui::slider {
Q_OBJECT Q_OBJECT
QString mCaption;
public slots: public slots:
void slotValueChanged(int step); void slotValueChanged(int step);
signals: signals:

View file

@ -19,7 +19,6 @@ int qlogger(const char* fmt,...) {
s = "<font color=red>"+s+"</font>"; s = "<font color=red>"+s+"</font>";
if (win!=0) if (win!=0)
win->logMsg(s); win->logMsg(s);
va_end(ap);
return s.length(); return s.length();
} }

View file

@ -5,6 +5,7 @@
#define DEBUGF1 qlogger #define DEBUGF1 qlogger
#define DEBUGF2(...) #define DEBUGF2(...)
#define DEBUGF3 qDebug
extern int qlogger(const char* fmt,...); extern int qlogger(const char* fmt,...);
extern int qlogger(const QString& s); extern int qlogger(const QString& s);

View file

@ -15,10 +15,10 @@
<widget class="QWidget" name="centralwidget" > <widget class="QWidget" name="centralwidget" >
<property name="geometry" > <property name="geometry" >
<rect> <rect>
<x>260</x> <x>262</x>
<y>21</y> <y>19</y>
<width>344</width> <width>340</width>
<height>345</height> <height>346</height>
</rect> </rect>
</property> </property>
</widget> </widget>
@ -28,7 +28,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>882</width> <width>882</width>
<height>21</height> <height>19</height>
</rect> </rect>
</property> </property>
<widget class="QMenu" name="menuFile" > <widget class="QMenu" name="menuFile" >
@ -48,8 +48,14 @@
<string>Play</string> <string>Play</string>
</property> </property>
</widget> </widget>
<widget class="QMenu" name="menuTarget" >
<property name="title" >
<string>Target</string>
</property>
</widget>
<addaction name="menuFile" /> <addaction name="menuFile" />
<addaction name="menuPlay" /> <addaction name="menuPlay" />
<addaction name="menuTarget" />
</widget> </widget>
<widget class="QStatusBar" name="statusbar" > <widget class="QStatusBar" name="statusbar" >
<property name="geometry" > <property name="geometry" >
@ -65,9 +71,9 @@
<property name="geometry" > <property name="geometry" >
<rect> <rect>
<x>0</x> <x>0</x>
<y>370</y> <y>371</y>
<width>882</width> <width>882</width>
<height>280</height> <height>279</height>
</rect> </rect>
</property> </property>
<property name="minimumSize" > <property name="minimumSize" >
@ -86,9 +92,9 @@
<property name="geometry" > <property name="geometry" >
<rect> <rect>
<x>0</x> <x>0</x>
<y>22</y> <y>20</y>
<width>882</width> <width>882</width>
<height>258</height> <height>259</height>
</rect> </rect>
</property> </property>
<layout class="QGridLayout" name="gridLayout_2" > <layout class="QGridLayout" name="gridLayout_2" >
@ -129,9 +135,9 @@
<property name="geometry" > <property name="geometry" >
<rect> <rect>
<x>0</x> <x>0</x>
<y>21</y> <y>19</y>
<width>256</width> <width>256</width>
<height>345</height> <height>346</height>
</rect> </rect>
</property> </property>
<property name="windowTitle" > <property name="windowTitle" >
@ -147,9 +153,9 @@
<property name="geometry" > <property name="geometry" >
<rect> <rect>
<x>0</x> <x>0</x>
<y>22</y> <y>20</y>
<width>256</width> <width>256</width>
<height>323</height> <height>326</height>
</rect> </rect>
</property> </property>
</widget> </widget>
@ -158,9 +164,9 @@
<property name="geometry" > <property name="geometry" >
<rect> <rect>
<x>608</x> <x>608</x>
<y>21</y> <y>19</y>
<width>274</width> <width>274</width>
<height>345</height> <height>346</height>
</rect> </rect>
</property> </property>
<property name="minimumSize" > <property name="minimumSize" >
@ -179,9 +185,9 @@
<property name="geometry" > <property name="geometry" >
<rect> <rect>
<x>0</x> <x>0</x>
<y>22</y> <y>20</y>
<width>274</width> <width>274</width>
<height>323</height> <height>326</height>
</rect> </rect>
</property> </property>
<layout class="QGridLayout" name="gridLayout" > <layout class="QGridLayout" name="gridLayout" >

View file

@ -13,39 +13,40 @@ CC = gcc
MKDIR = mkdir -p MKDIR = mkdir -p
ifeq ($(findstring MINGW,$(shell uname)),MINGW) ifeq ($(findstring MINGW,$(shell uname)),MINGW)
OS = w32 OS = w32
CC = mingw32-gcc CC = mingw32-gcc
COPY = copy COPY = copy
RM = rm RM = rm
endif endif
ifeq ($(findstring Linux,$(shell uname)),Linux) ifeq ($(findstring Linux,$(shell uname)),Linux)
OS = linux OS = linux
CC = gcc CC = gcc
COPY = cp COPY = cp
RM = rm -f RM = rm -f
endif endif
COMMON= \ SOURCES= \
src/dummies.c \
src/api.c \ src/api.c \
src/dummies.c \
src/lcd.c \ src/lcd.c \
src/proxy.c \
$(ROOT)/apps/gui/scrollbar.c \
$(ROOT)/apps/gui/gwps-common.c \
$(ROOT)/apps/gui/wps_parser.c \ $(ROOT)/apps/gui/wps_parser.c \
$(ROOT)/apps/gui/wps_debug.c \ $(ROOT)/apps/gui/wps_debug.c \
$(ROOT)/firmware/font.c \
$(ROOT)/apps/misc.c \
$(ROOT)/apps/gui/gwps-common.c \
$(ROOT)/apps/status.c \
$(ROOT)/apps/recorder/peakmeter.c \ $(ROOT)/apps/recorder/peakmeter.c \
$(ROOT)/apps/recorder/icons.c \ $(ROOT)/apps/recorder/icons.c \
$(ROOT)/apps/gui/scrollbar.c \ $(ROOT)/apps/misc.c \
$(ROOT)/apps/status.c \
$(ROOT)/firmware/common/ctype.c \
$(ROOT)/firmware/common/timefuncs.c \ $(ROOT)/firmware/common/timefuncs.c \
$(ROOT)/firmware/common/unicode.c \ $(ROOT)/firmware/common/unicode.c \
$(ROOT)/firmware/common/ctype.c \ $(ROOT)/firmware/font.c \
$(ROOT)/firmware/id3.c \
$(ROOT)/firmware/font_cache.c \ $(ROOT)/firmware/font_cache.c \
$(ROOT)/firmware/id3.c \
$(ROOT)/firmware/lru.c \ $(ROOT)/firmware/lru.c \
$(ROOT)/firmware/mp3data.c \ $(ROOT)/firmware/mp3data.c \
$(ROOT)/firmware/replaygain.c $(ROOT)/firmware/replaygain.c
@ -72,13 +73,13 @@ all:
build: build-$(OS) build: build-$(OS)
build-w32: src/proxy.c $(COMMON) build-w32: $(SOURCES)
@echo CC [$(TARGET)] @echo CC [$(TARGET)]
@$(CC) $(INCLUDE) $(CFLAGS) -D$(TARGET) -DTARGET_MODEL=\"$(MODEL)\" -DBUILD_DLL $(COMMON) -shared src/proxy.c -o libwps_$(MODEL).dll @$(CC) $(INCLUDE) $(CFLAGS) -D$(TARGET) -DTARGET_MODEL=\"$(MODEL)\" -DBUILD_DLL $(SOURCES) -shared -o libwps_$(MODEL).dll
build-linux: src/proxy.c $(COMMON) build-linux: $(SOURCES)
@echo CC [$(TARGET)] @echo CC [$(TARGET)]
@$(CC) $(INCLUDE) $(CFLAGS) -D$(TARGET) -DTARGET_MODEL=\"$(MODEL)\" -shared -Wl,-soname,libwps_$(MODEL).so,-olibwps_$(MODEL).so -fPIC $(COMMON) src/proxy.c @$(CC) $(INCLUDE) $(CFLAGS) -D$(TARGET) -DTARGET_MODEL=\"$(MODEL)\" -shared -Wl,-soname,libwps_$(MODEL).so,-olibwps_$(MODEL).so -fPIC $(SOURCES)
clean: clean-$(OS) clean: clean-$(OS)
@ -86,15 +87,15 @@ clean-w32:
$(RM) "libwps_$(MODEL).dll" $(RM) "libwps_$(MODEL).dll"
clean-linux: clean-linux:
$(RM) "libwps_$(MODEL).so.1" $(RM) "libwps_$(MODEL).so"
shared: shared-$(OS) shared: shared-$(OS)
shared-w32: src/proxy.c $(COMMON) shared-w32: $(SOURCES)
@echo CC [IRIVER_H10_5GB] @echo CC [IRIVER_H10_5GB]
@$(CC) $(INCLUDE) $(CFLAGS) -DIRIVER_H10_5GB -DTARGET_MODEL=\"h10_5gb\" -DBUILD_DLL $(COMMON) -shared src/proxy.c -o ../gui/bin/libwps.dll @$(CC) $(INCLUDE) $(CFLAGS) -DIRIVER_H10_5GB -DTARGET_MODEL=\"h10_5gb\" -DBUILD_DLL -shared $(SOURCES) -o ../gui/bin/libwps_h10_5gb.dll
shared-linux: src/proxy.c $(COMMON) shared-linux: $(SOURCES)
@echo CC [IRIVER_H10_5GB] @echo CC [IRIVER_H10_5GB]
@$(CC) $(INCLUDE) $(CFLAGS) -DIRIVER_H10_5GB -DTARGET_MODEL=\"h10_5gb\" -shared -Wl,-soname,libwps.so,-olibwps.so -fPIC $(COMMON) src/proxy.c @$(CC) $(INCLUDE) $(CFLAGS) -DIRIVER_H10_5GB -DTARGET_MODEL=\"h10_5gb\" -shared -Wl,-soname,libwps_h10_5gb.so,-olibwps_h10_5gb.so -fPIC $(SOURCES)
@$(COPY) libwps.so ../gui/bin/libwps.so @$(COPY) libwps_h10_5gb.so ../gui/bin/libwps_h10_5gb.so

View file

@ -0,0 +1,4 @@
@echo off
FOR /F "tokens=1,2* delims=, " %%i in (targets.txt) do @mingw32-make MODEL=%%j TARGET=%%i build 2>nul
echo Copying files...
xcopy /I /Y *.dll ..\gui\bin

2
utils/wpseditor/libwps/buildall.sh Normal file → Executable file
View file

@ -4,4 +4,6 @@ cat targets.txt | (
do do
make MODEL=$model TARGET=$target build make MODEL=$model TARGET=$target build
done done
cp *.dll ../gui/bin
cp *.so ../gui/bin
) )

View file

@ -32,8 +32,7 @@ bool load_remote_wps_backdrop(char* filename) {
} }
int read_bmp_file(const char* filename,struct bitmap *bm, int maxsize,int format) { int read_bmp_file(const char* filename,struct bitmap *bm, int maxsize,int format) {
if (!xapi->read_bmp_file) if (!xapi->read_bmp_file) {
{
DEBUGF1("can't read bmp file! NULL api!\n"); DEBUGF1("can't read bmp file! NULL api!\n");
return -1; return -1;
} }
@ -84,7 +83,7 @@ int getstringsize(const unsigned char *str, int *w, int *h) {
return 1; return 1;
} }
void set_wpsstate(struct wpsstate state){ void set_wpsstate(struct wpsstate state) {
sysfont.height = state.fontheight; sysfont.height = state.fontheight;
sysfont.maxwidth = state.fontwidth; sysfont.maxwidth = state.fontwidth;
global_settings.volume = state.volume; global_settings.volume = state.volume;
@ -92,7 +91,10 @@ void set_wpsstate(struct wpsstate state){
_audio_status = state.audio_status; _audio_status = state.audio_status;
} }
void set_trackstate(struct trackstate state){ void set_trackstate(struct trackstate state) {
if (!(gui_wps[0].state) ||
!(gui_wps[0].state->id3))
return;
gui_wps[0].state->id3->title = state.title; gui_wps[0].state->id3->title = state.title;
gui_wps[0].state->id3->artist = state.artist; gui_wps[0].state->id3->artist = state.artist;
gui_wps[0].state->id3->album = state.album; gui_wps[0].state->id3->album = state.album;
@ -100,8 +102,7 @@ void set_trackstate(struct trackstate state){
gui_wps[0].state->id3->length = state.length; gui_wps[0].state->id3->length = state.length;
} }
void set_next_trackstate(struct trackstate state) void set_next_trackstate(struct trackstate state) {
{
gui_wps[0].state->nid3->title = state.title; gui_wps[0].state->nid3->title = state.title;
gui_wps[0].state->nid3->artist = state.artist; gui_wps[0].state->nid3->artist = state.artist;
gui_wps[0].state->nid3->album = state.album; gui_wps[0].state->nid3->album = state.album;
@ -110,21 +111,21 @@ void set_next_trackstate(struct trackstate state)
} }
enum api_playmode playmodes[PLAYMODES_NUM] = { enum api_playmode playmodes[PLAYMODES_NUM] = {
API_STATUS_PLAY, API_STATUS_PLAY,
API_STATUS_STOP, API_STATUS_STOP,
API_STATUS_PAUSE, API_STATUS_PAUSE,
API_STATUS_FASTFORWARD, API_STATUS_FASTFORWARD,
API_STATUS_FASTBACKWARD API_STATUS_FASTBACKWARD
}; };
const char *playmodeNames[] = { const char *playmodeNames[] = {
"Play", "Stop", "Pause", "FastForward", "FastBackward" "Play", "Stop", "Pause", "FastForward", "FastBackward"
}; };
void set_audio_status(int status){ void set_audio_status(int status) {
DEBUGF1("%s",playmodeNames[status]); DEBUGF1("%s",playmodeNames[status]);
switch(status){ switch (status) {
case API_STATUS_PLAY: case API_STATUS_PLAY:
_audio_status = AUDIO_STATUS_PLAY; _audio_status = AUDIO_STATUS_PLAY;
status_set_ffmode(STATUS_PLAY); status_set_ffmode(STATUS_PLAY);
@ -203,8 +204,6 @@ int set_api(struct proxy_api* api) {
#else #else
screens[0].is_color=false; screens[0].is_color=false;
#endif #endif
if (api->getwidth)
screens[0].getwidth = api->getwidth;
if (api->stop_scroll) if (api->stop_scroll)
screens[0].stop_scroll=api->stop_scroll; screens[0].stop_scroll=api->stop_scroll;
screens[0].scroll_stop = lcd_scroll_stop; screens[0].scroll_stop = lcd_scroll_stop;
@ -266,3 +265,4 @@ int set_api(struct proxy_api* api) {

View file

@ -104,9 +104,8 @@ int wps_init(const char* filename,struct proxy_api *api, bool isfile){
if (!res) if (!res)
{ {
DEBUGF1("ERR: WPS parsing failure\n"); DEBUGF1("ERR: WPS parsing failure\n");
return 3; } else
} DEBUGF1("WPS parsed OK\n");
DEBUGF1("WPS parsed OK\n");
DEBUGF1("\n-------------------------------------------------\n"); DEBUGF1("\n-------------------------------------------------\n");
wps_state.paused = true; wps_state.paused = true;
gwps.data = &wpsdata; gwps.data = &wpsdata;
@ -115,7 +114,7 @@ int wps_init(const char* filename,struct proxy_api *api, bool isfile){
gwps.state->id3 = &id3; gwps.state->id3 = &id3;
gwps.state->nid3 = &nid3; gwps.state->nid3 = &nid3;
gui_wps[0] = gwps; gui_wps[0] = gwps;
return res; return (res?res:3);
} }
int wps_display(){ int wps_display(){

View file

@ -1,6 +1,8 @@
#ifndef PROXY_H #ifndef PROXY_H
#define PROXY_h #define PROXY_h
#include <stdio.h>
#include "screen_access.h" #include "screen_access.h"
#include "api.h" #include "api.h"
#include "defs.h" #include "defs.h"
@ -9,13 +11,13 @@
#define DEBUGF1 dbgf #define DEBUGF1 dbgf
#define DEBUGF2(...) #define DEBUGF2(...)
#define DEBUGF3(...) #define DEBUGF3(...)
#define DEBUGF4(...)
EXPORT int checkwps(const char *filename, int verbose); EXPORT int checkwps(const char *filename, int verbose);
EXPORT int wps_init(const char* filename,struct proxy_api *api,bool isfile); EXPORT int wps_init(const char* filename,struct proxy_api *api,bool isfile);
EXPORT int wps_display(); EXPORT int wps_display();
EXPORT int wps_refresh(); EXPORT int wps_refresh();
EXPORT const char* get_model_name();
const char* get_model_name();
extern struct screen screens[NB_SCREENS]; extern struct screen screens[NB_SCREENS];
extern bool debug_wps; extern bool debug_wps;

View file

@ -1,33 +1,9 @@
ARCHOS_RECORDER recorder
ARCHOS_FMRECORDER fmrecorder
ARCHOS_RECORDERV2 recorderv2
ARCHOS_ONDIOSP ondiosp
ARCHOS_ONDIOFM ondiofm
IRIVER_H120 h120
IRIVER_H300 h300
IRIVER_H100 h100
IRIVER_IFP7XX ifp7xx
IRIVER_H10 h10 IRIVER_H10 h10
IRIVER_H10_5GB h10_5gb IRIVER_H10_5GB h10_5gb
IPOD_COLOR ipodcolor IPOD_COLOR ipodcolor
IPOD_NANO ipodnano IPOD_NANO ipodnano
IPOD_VIDEO ipodvideo IPOD_VIDEO ipodvideo
IPOD_3G ipod3g
IPOD_4G ipod4g
IPOD_MINI ipodmini
IPOD_MINI2G ipodmini2g
IPOD_1G2G ipod1g2g
IAUDIO_X5 x5
IAUDIO_M5 m5
COWON_D2 cowond2
IAUDIO_M3 m3
GIGABEAT_F gigabeatf GIGABEAT_F gigabeatf
GIGABEAT_S gigabeats GIGABEAT_S gigabeats
MROBE_500 mrobe500
MROBE_100 mrobe100
LOGIK_DAX logikdax
CREATIVE_ZVM creativezvm
SANSA_E200 e200 SANSA_E200 e200
SANSA_E200 e200r
SANSA_C200 c200 SANSA_C200 c200
ELIO_TPJ1022 tpj1022