summaryrefslogtreecommitdiffstats
path: root/utils/themeeditor/models/parsetreenode.cpp
diff options
context:
space:
mode:
authorRobert Bieber <robby@bieberphoto.com>2010-07-12 06:07:50 +0000
committerRobert Bieber <robby@bieberphoto.com>2010-07-12 06:07:50 +0000
commit64af2b3a16c1fc9968b50223b79321ca04cc53e4 (patch)
treea34a9330f320846e07479791c7a664e3f8d979e9 /utils/themeeditor/models/parsetreenode.cpp
parentbae183633705b087f80afe11a36772f553a5cb26 (diff)
downloadrockbox-64af2b3a16c1fc9968b50223b79321ca04cc53e4.tar.gz
rockbox-64af2b3a16c1fc9968b50223b79321ca04cc53e4.tar.bz2
rockbox-64af2b3a16c1fc9968b50223b79321ca04cc53e4.zip
Theme Editor: Made %pv tag display bar and select from conditional branches correctly
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27398 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'utils/themeeditor/models/parsetreenode.cpp')
-rw-r--r--utils/themeeditor/models/parsetreenode.cpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/utils/themeeditor/models/parsetreenode.cpp b/utils/themeeditor/models/parsetreenode.cpp
index 973ceb598b..1b894b7c33 100644
--- a/utils/themeeditor/models/parsetreenode.cpp
+++ b/utils/themeeditor/models/parsetreenode.cpp
@@ -660,6 +660,17 @@ bool ParseTreeNode::execTag(const RBRenderInfo& info, RBViewport* viewport)
new RBProgressBar(viewport, info, element->params_count,
element->params);
return true;
+
+ case 'v':
+ /* %pv */
+ if(element->params_count > 0)
+ {
+ new RBProgressBar(viewport, info, element->params_count,
+ element->params, true);
+ return true;
+ }
+ else
+ return false;
}
return false;
@@ -928,6 +939,26 @@ QVariant ParseTreeNode::evalTag(const RBRenderInfo& info, bool conditional,
child = ((branches - 1) * child / 100) + 1;
}
}
+ else if(QString(element->tag->name) == "pv")
+ {
+ /* ?pv gets scaled to the number of available children, sandwiched
+ * in between mute and 0/>0dB. I assume a floor of -50dB for the
+ * time being
+ */
+ int dB = val.toInt();
+
+ if(dB < -50)
+ child = 0;
+ else if(dB == 0)
+ child = branches - 2;
+ else if(dB > 0)
+ child = branches - 1;
+ else
+ {
+ int options = branches - 3;
+ child = (options * (dB + 50)) / 50;
+ }
+ }
else if(QString(element->tag->name) == "px")
{
child = val.toInt();