Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Added BuiltInSequence() Builtin #2270

Closed
wants to merge 1 commit into from

4 participants

@phil65
Collaborator

Handy function for bit more complex skinning stuff.
useful..

  • when using $INFO[Skin.String(...)] or $VAR[] for < onclick > in skins (could make use of it in Nox)
  • 2+ executes with one AlarmClock
  • Keymaps (?)

Usage
BuiltInSequence(Builtin1,BuiltIn2,...,BuiltInX)

@jmarshallnz
Owner

I can see the usefulness, but it seems a bit fugly. I can't really think of a better way to do it though without some sort of "end of function/expression" character (e.g. semicolon).

@phil65
Collaborator

even nicer would be if we could define some builtin sequences with xml.
so same structure like < variable > nodes except that every value gets evaluated, not only till the first hit.
that way we could even use conditions. implementing that is beyond my coding capabilities though, i still have much to learn..

@jmarshallnz
Owner

Well, I guess with multiple bar (do we support this?) you'd have it anyway, right? It's mainly for those cases where you want a single string to represent multiple actions. Semi-colon separated would be a bit nicer I think, but may be trickier to implement as you'd need to split things up first (taking into account quotes).

@phil65
Collaborator

what do you mean with multiple var?
atm we can call a var from inside another var var if you mean that (< value >$VAR[xyz]</ value > )
what i mean is (and would would be more powerful) is something like this

< action name="ExampleAction" >
< builtin condition="Control.HasFocus(xxx)" >SetProperty(bla,bla)< /builtin >
< builtin condition="Control.HasFocus(yyy)" >SetProperty(bla,bla2)< /builtin >
< builtin >ActivateWindow(....)< /builtin >
...
< /action >

with difference to vars that every builtin gets evaluated, even when the first one is true for example.

and then < onclick >Action(ExampleAction)< /onclick >

would have to be seperate from vars since multiple hits can only work for builtins, not for info labels.
as i said i think i won´t get that done in a way that you´d accept the pull request, just an idea i was havin :)

concerning the PR: if wanted I can try to adjust it to your wishes. busy with some other stuff atm so it will have to wait a bit then.
is there any advantage when using semicolon as a seperator?
we don´t use that anywhere else in skin xmls. escaping should work correctly i think when using commas since commas are only used inside brackets (parser respects that afaik)

@MartijnKaijser

@phil65
i'm closing this for now until you will have time to work on this PR.
Create a new one when time comes

@phil65 phil65 deleted the phil65:ActionSequence branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 20, 2013
  1. @phil65-2
This page is out of date. Refresh to see the latest.
Showing with 7 additions and 0 deletions.
  1. +7 −0 xbmc/interfaces/Builtins.cpp
View
7 xbmc/interfaces/Builtins.cpp
@@ -144,6 +144,7 @@ const BUILT_IN commands[] = {
{ "AlarmClock", true, "Prompt for a length of time and start an alarm clock" },
{ "CancelAlarm", true, "Cancels an alarm" },
{ "Action", true, "Executes an action for the active window (same as in keymap)" },
+ { "BuiltInSequence", true, "Executes a Sequence Of BuiltIns" },
{ "Notification", true, "Shows a notification on screen, specify header, then message, and optionally time in milliseconds and a icon." },
{ "PlayDVD", false, "Plays the inserted CD or DVD media from the DVD-ROM Drive!" },
{ "RipCD", false, "Rip the currently inserted audio CD"},
@@ -988,6 +989,12 @@ int CBuiltins::Execute(const CStdString& execString)
return false;
g_alarmClock.Start(params[0], seconds, params[1], silent, loop);
}
+ //Execute BuiltIn Sequence by looping through parameters, recursive
+ else if (execute.Equals("builtinsequence"))
+ {
+ for (unsigned int i = 0; i < params.size() ; i++)
+ CBuiltins::Execute(params[i]);
+ }
else if (execute.Equals("notification"))
{
if (params.size() < 2)
Something went wrong with that request. Please try again.