forked from len0rd/rockbox
Theme Editor: Began working on special cases for device option panel. Implemented path info for current and next file
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27346 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
eb93e3b3d2
commit
6358d41f31
4 changed files with 67 additions and 21 deletions
|
@ -198,6 +198,36 @@ DeviceState::~DeviceState()
|
||||||
QVariant DeviceState::data(QString tag, int paramCount,
|
QVariant DeviceState::data(QString tag, int paramCount,
|
||||||
skin_tag_parameter *params)
|
skin_tag_parameter *params)
|
||||||
{
|
{
|
||||||
|
/* Handling special cases */
|
||||||
|
if(tag.toLower() == "fm")
|
||||||
|
{
|
||||||
|
QString path = tag[0].isLower()
|
||||||
|
? data("file").toString() : data("nextfile").toString();
|
||||||
|
return fileName(path, true);
|
||||||
|
}
|
||||||
|
else if(tag.toLower() == "fn")
|
||||||
|
{
|
||||||
|
QString path = tag[0].isLower()
|
||||||
|
? data("file").toString() : data("nextfile").toString();
|
||||||
|
return fileName(path, false);
|
||||||
|
}
|
||||||
|
else if(tag.toLower() == "fp")
|
||||||
|
{
|
||||||
|
if(tag[0].isLower())
|
||||||
|
return data("file").toString();
|
||||||
|
else
|
||||||
|
return data("nextfile").toString();
|
||||||
|
}
|
||||||
|
else if(tag.toLower() == "d")
|
||||||
|
{
|
||||||
|
QString path = tag[0].isLower()
|
||||||
|
? data("file").toString() : data("nextfile").toString();
|
||||||
|
if(paramCount > 0)
|
||||||
|
return directory(path, params[0].data.numeric);
|
||||||
|
else
|
||||||
|
return QVariant();
|
||||||
|
}
|
||||||
|
|
||||||
QPair<InputType, QWidget*> found =
|
QPair<InputType, QWidget*> found =
|
||||||
inputs.value(tag, QPair<InputType, QWidget*>(Slide, 0));
|
inputs.value(tag, QPair<InputType, QWidget*>(Slide, 0));
|
||||||
|
|
||||||
|
@ -279,3 +309,29 @@ void DeviceState::input()
|
||||||
{
|
{
|
||||||
emit settingsChanged();
|
emit settingsChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString DeviceState::fileName(QString path, bool extension)
|
||||||
|
{
|
||||||
|
path = path.split("/").last();
|
||||||
|
if(!extension)
|
||||||
|
{
|
||||||
|
QString sum;
|
||||||
|
QStringList name = path.split(".");
|
||||||
|
for(int i = 0; i < name.count() - 1; i++)
|
||||||
|
sum.append(name[i]);
|
||||||
|
return sum;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return path;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
QString DeviceState::directory(QString path, int level)
|
||||||
|
{
|
||||||
|
QStringList dirs = path.split("/");
|
||||||
|
int index = dirs.count() - 1 - level;
|
||||||
|
if(index < 0)
|
||||||
|
index = 0;
|
||||||
|
return dirs[index];
|
||||||
|
}
|
||||||
|
|
|
@ -59,6 +59,9 @@ private slots:
|
||||||
void input();
|
void input();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
static QString fileName(QString path, bool extension);
|
||||||
|
static QString directory(QString path, int level);
|
||||||
|
|
||||||
QMap<QString, QPair<InputType, QWidget*> > inputs;
|
QMap<QString, QPair<InputType, QWidget*> > inputs;
|
||||||
QTabWidget tabs;
|
QTabWidget tabs;
|
||||||
};
|
};
|
||||||
|
|
|
@ -873,7 +873,8 @@ QVariant ParseTreeNode::evalTag(const RBRenderInfo& info, bool conditional,
|
||||||
{
|
{
|
||||||
if(!conditional)
|
if(!conditional)
|
||||||
{
|
{
|
||||||
return info.device()->data(QString(element->tag->name));
|
return info.device()->data(QString(element->tag->name),
|
||||||
|
element->params_count, element->params);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -886,7 +887,8 @@ QVariant ParseTreeNode::evalTag(const RBRenderInfo& info, bool conditional,
|
||||||
int child;
|
int child;
|
||||||
QVariant val = info.device()->data("?" + QString(element->tag->name));
|
QVariant val = info.device()->data("?" + QString(element->tag->name));
|
||||||
if(val.isNull())
|
if(val.isNull())
|
||||||
val = info.device()->data(QString(element->tag->name));
|
val = info.device()->data(QString(element->tag->name),
|
||||||
|
element->params_count, element->params);
|
||||||
|
|
||||||
if(val.isNull())
|
if(val.isNull())
|
||||||
{
|
{
|
||||||
|
|
|
@ -74,41 +74,26 @@ fb ; Bitrate (kbps) ; spin(1,2048) ; 256
|
||||||
fc ; Codec ; combo(MP1, MP2, MP3, AIFF, WAV, OGG, FLAC, MPC, AC3, WV, ALAC, AAC, SHN, SID, ADX, NSF, Speex, SPC, APE, WMA) ; OGG
|
fc ; Codec ; combo(MP1, MP2, MP3, AIFF, WAV, OGG, FLAC, MPC, AC3, WV, ALAC, AAC, SHN, SID, ADX, NSF, Speex, SPC, APE, WMA) ; OGG
|
||||||
ff ; Frequency (Hz) ; spin(1,100000) ; 42000
|
ff ; Frequency (Hz) ; spin(1,100000) ; 42000
|
||||||
fk ; Frequency (KHz) ; fspin(1, 100) ; 42
|
fk ; Frequency (KHz) ; fspin(1, 100) ; 42
|
||||||
fm ; Name ; text ; Current File Name.a
|
file ; File Path ; text ; /.rockbox/music/artist/album/01 - file.ogg
|
||||||
fn ; Name (w/o extension) ; text ; Current File Name
|
|
||||||
fp ; Path ; text ; /current/file/path/
|
|
||||||
fs ; Size (KB) ; spin(1,100000) ; 3000
|
fs ; Size (KB) ; spin(1,100000) ; 3000
|
||||||
fv ; Variable Bit Rate ; check ; true
|
fv ; Variable Bit Rate ; check ; true
|
||||||
d1 ; cd up ; text ; /current/file/
|
|
||||||
d2 ; cd up x2 ; text ; /current/
|
|
||||||
d3 ; cd up x3 ; text ; /
|
|
||||||
|
|
||||||
[Next File Info]
|
[Next File Info]
|
||||||
Fb ; Next File Bitrate (kbps) ; spin(1,2048) ; 256
|
Fb ; Next File Bitrate (kbps) ; spin(1,2048) ; 256
|
||||||
Fc ; Next File Codec ; combo(MP1, MP2, MP3, AIFF, WAV, OGG, FLAC, MPC, AC3, WV, ALAC, AAC, SHN, SID, ADX, NSF, Speex, SPC, APE, WMA) ; OGG
|
Fc ; Next File Codec ; combo(MP1, MP2, MP3, AIFF, WAV, OGG, FLAC, MPC, AC3, WV, ALAC, AAC, SHN, SID, ADX, NSF, Speex, SPC, APE, WMA) ; OGG
|
||||||
Ff ; Next File Frequency (Hz) ; spin(1,100000) ; 42000
|
Ff ; Next File Frequency (Hz) ; spin(1,100000) ; 42000
|
||||||
Fk ; Next File Frequency (KHz) ; fspin(1, 100) ; 42
|
Fk ; Next File Frequency (KHz) ; fspin(1, 100) ; 42
|
||||||
Fm ; Next File Name ; text ; Next File Name.a
|
nextfile ; Next File Path ; text ; /.rockbox/music/artist/album/02 - nextfile.ogg
|
||||||
Fn ; Next File Name (w/o extension) ; text ; Next File Name
|
|
||||||
Fp ; Next File Path ; text ; /next/file/path/
|
|
||||||
Fs ; Next File Size (KB) ; spin(1,100000) ; 3000
|
Fs ; Next File Size (KB) ; spin(1,100000) ; 3000
|
||||||
Fv ; Next File Variable Bit Rate ; check ; true
|
Fv ; Next File Variable Bit Rate ; check ; true
|
||||||
D1 ; Next File cd up ; text ; /next/file/
|
|
||||||
D2 ; Next File cd up x2 ; text ; /next/
|
|
||||||
D3 ; Next File cd up x3 ; text ; /
|
|
||||||
|
|
||||||
[Playlist/Song Info]
|
[Playlist/Song Info]
|
||||||
px ; Percent Played ; spin(0,100) ; 50
|
?pc ; Time In Song (Seconds) ; fspin(0,5000) ; 60
|
||||||
pc ; Current Time In Song ; text ; 1:00
|
|
||||||
?pc ; Time In Song (Conditional) ; fspin(0,5000) ; 60
|
|
||||||
pe ; Playlist Entries ; spin(0,1000) ; 20
|
pe ; Playlist Entries ; spin(0,1000) ; 20
|
||||||
pn ; Playlist Name ; text ; Current Playlist
|
pn ; Playlist Name ; text ; Current Playlist
|
||||||
pp ; Playlist Position ; spin(0,1000) ; 10
|
pp ; Playlist Position ; spin(0,1000) ; 10
|
||||||
pr ; Time Remaining ; text ; 2:00
|
|
||||||
ps ; Shuffle ; check ; true
|
ps ; Shuffle ; check ; true
|
||||||
pt ; Total Track Time ; text ; 3:00
|
pt ; Total Track Time ; spin(0,1000) ; 180
|
||||||
pS ; Track Starting ; check ; true
|
|
||||||
pE ; Track Ending ; check ; false
|
|
||||||
Sp ; Playback Pitch ; fspin(50,200) ; 100
|
Sp ; Playback Pitch ; fspin(50,200) ; 100
|
||||||
rp ; Song Playcount ; spin(0,10000) ; 20
|
rp ; Song Playcount ; spin(0,10000) ; 20
|
||||||
rr ; Song Rating ; spin(0,10) ; 5
|
rr ; Song Rating ; spin(0,10) ; 5
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue