Mixxxml is still being defined and heavily refined. It may not work at the moment.
##Mixxxml Syntax
Mixxxml has a simple syntax that is intuitive for beginners and experts alike. Check out the features below:
###Tags
The core of Mixxxml are tags. They look like this:
tag: value
These directly translate into MIXXX XML tags to be parsed by the mixxx app. Tags can also be nested like such with two space indentation:
parent:
child: value
Here is an example of a vumeter.mixxxml file and below the XML it outputs:
####vumeter.mixxxml Template: VuMeter: MinimumSize: 100,20 MaximumSize: 200,20 PathVu: vumeter.svg Horizontal: true PeakHoldSize: 5 PeakHoldTime: 600 PeakFallTime: 100 PeakFallStep: 1 Connection ConfigKey: {{group}},VuMeter
####vumeter.xml 100,20 200,20 vumeter.svg true 5 600 100 1 ,VuMeter
In the above mixxxml code example, you may have noticed something interesting:
{{group}}
This is a mixxxml variable. It allows you to leverage the new variable features of mixxx 1.12 theming to make templating easier. To set a variable you can use the following syntax:
Set(something): value
This will generate the following XML:
<SetVariable name="something">value</SetVariable>
To access that variable in the future, you can use the brace syntax:
{{something}}
###Functions
In the last section we exposed you to your first function, Set()
. Functions have parens after their name.
Mixxxml functions wrap complex logic into a simple declarative syntax to keep your documents readable and clear.
Mixx functions are listed below:
The set function has two modes, single assignment and multiple assignment. They look like this:
Set(something): value
This is single assignment and it outputs the following:
<SetVariable name="something">value</SetVariable>
The multi-assignment use looks like this:
Set():
item1: val1
item2: val2
item3: val3
The output looks like this:
<SetVariable name="item1">val1</SetVariable>
<SetVariable name="item2">val2</SetVariable>
<SetVariable name="item3">val3</SetVariable>
This is useful when you need to set a lot variables for something like template overloading which is shown in the load()
example below.
####Load(template_name):
The load function allows you to load sub templates into your skin.
load(template.xml):
This outputs the following xml:
<Template src="skin:template.xml"/>
If you wanted to pass variables into this template you could do it like this:
load(template.xml):
Set():
item1: val1
item2: val2
item3: val3
This generates:
<Template src="skin:template.xml">
<SetVariable name="item1">val1</SetVariable>
<SetVariable name="item2">val2</SetVariable>
<SetVariable name="item3">val3</SetVariable>
</Template>
#Todo
- Build a whole theme with mixxxml to find edge cases.
- Define other necessary functions. (ConfigKey, Widget w/ triggers, others?)
- fix XML generator.