Skip to content
Snippets Groups Projects
Commit 601b1ff2 authored by RANWEZ Pierre's avatar RANWEZ Pierre :anchor:
Browse files

:children_crossing: improve: code heritage

parent 83a767e8
Branches
No related tags found
1 merge request!1✨ feat: CSSLSD V2
......@@ -1430,7 +1430,8 @@ You can put "element" tab to bottom by right-clicking on it.
For deported devtool, click on more (top-right) and then click on separate devtool dock.</p>
<p><img src="file:///d:\Cours\M2S4\PFE\csslsd\doc\devtool.gif" alt="Devtool view"></p>
<h3 id="csslsd-code">CSSLSD Code</h3>
<p>You need to use a custom CSS template, like below to map your audio or MIDI events to some CSSLSD properties. All parameters are between <strong>square brackets</strong> you can extend parameter by heritage with a range like bellow (this is not mandatory). You can use multiple parameters in a line. You can also type pure CSS in code editor, this CSS wil be apply on code auto-save (each time your type something in editor).</p>
<p>You need to use a custom CSS template, like below to map your audio or MIDI events to some CSSLSD properties. All parameters are between <strong>square brackets</strong>. You can use multiple parameters in a line. You can also type pure CSS in code editor, this CSS wil be apply on code auto-save (each time your type something in editor).</p>
<p>You can extend parameter by heritage with template <code>[&lt;parameter&gt; &lt;type&gt; &lt;option&gt; &lt;audio or midi control&gt;]</code>. This is not mandatory to type all heritage, but you need to restect the direction. This is allowed : <code>[&lt;parameter&gt; &lt;type&gt; &lt;option&gt;]</code> or <code>[&lt;parameter&gt; &lt;type&gt;]</code>. This is <strong>not</strong> allowed : <code>[&lt;parameter&gt; &lt;audio or midi control&gt;]</code>.</p>
<p>Code example:</p>
<pre><code class="language-css"><div><span class="hljs-selector-tag">body</span> {
<span class="hljs-comment">/* Tip : You can use comments */</span>
......
......@@ -71,7 +71,9 @@ For deported devtool, click on more (top-right) and then click on separate devto
### CSSLSD Code
You need to use a custom CSS template, like below to map your audio or MIDI events to some CSSLSD properties. All parameters are between **square brackets** you can extend parameter by heritage with a range like bellow (this is not mandatory). You can use multiple parameters in a line. You can also type pure CSS in code editor, this CSS wil be apply on code auto-save (each time your type something in editor).
You need to use a custom CSS template, like below to map your audio or MIDI events to some CSSLSD properties. All parameters are between **square brackets**. You can use multiple parameters in a line. You can also type pure CSS in code editor, this CSS wil be apply on code auto-save (each time your type something in editor).
You can extend parameter by heritage with template `[<parameter> <type> <option> <audio or midi control>]`. This is not mandatory to type all heritage, but you need to restect the direction. This is allowed : `[<parameter> <type> <option>]` or `[<parameter> <type>]`. This is **not** allowed : `[<parameter> <audio or midi control>]`.
Code example:
......
......@@ -208,23 +208,23 @@ function analyseAll() {
type: '',
name: templateSplited[0],
templateFull: template,
eventType: '',
eventName: '',
options: '',
eventType: templateSplited.length > 3 ? (templateSplited[3].includes(':')?templateSplited[3].split(':')[0]:templateSplited[3]) : '',
eventName: templateSplited.length > 3 ? (templateSplited[3].includes(':')?templateSplited[3].split(':')[1]:'') : '',
options: templateSplited.length > 2 ? (templateSplited[2]) : '',
array: templateSplited.length > 1 ? (templateSplited[1].includes(';') ? templateSplited[1].split(';') : '') : '',
min: templateSplited.length > 1 ? (templateSplited[1].includes(':') ? templateSplited[1].split(':')[0] : '') : '',
max: templateSplited.length > 1 ? (templateSplited[1].includes(':') ? templateSplited[1].split(':')[1] : '') : '',
}
obj.type = 'midi';
if (midiE.includes(':')) {
obj.eventType = midiE.split(':')[0];
obj.eventName = midiE.split(':')[1];
obj.eventType = ((obj.eventType == '') ? midiE.split(':')[0] : obj.eventType);
obj.eventName = ((obj.eventName == '') ? midiE.split(':')[1] : obj.eventName);
}
else {
obj.eventType = midiE;
obj.eventName = '';
obj.eventType = ((obj.eventType == '') ? midiE : obj.eventType);
obj.eventName = ((obj.eventName == '') ? '' : obj.eventName);
}
obj.options = p[3];
obj.options = ((obj.options == '') ? (p[3]) : obj.options);
obj.array = ((obj.array == '') ? (p[2].includes(';') ? p[2].split(';') : '') : obj.array);
obj.min = ((obj.min == '') ? (p[2].includes(':') ? p[2].split(':')[0] : 0) : obj.min);
obj.max = ((obj.max == '') ? (p[2].includes(':') ? p[2].split(':')[1] : 1) : obj.max);
......@@ -237,23 +237,23 @@ function analyseAll() {
type: '',
name: templateSplited[0],
templateFull: template,
eventType: '',
eventName: '',
options: '',
eventType: templateSplited.length > 3 ? (templateSplited[3].includes(':')?templateSplited[3].split(':')[0]:templateSplited[3]) : '',
eventName: templateSplited.length > 3 ? (templateSplited[3].includes(':')?templateSplited[3].split(':')[1]:'') : '',
options: templateSplited.length > 2 ? (templateSplited[2]) : '',
array: templateSplited.length > 1 ? (templateSplited[1].includes(';') ? templateSplited[1].split(';') : '') : '',
min: templateSplited.length > 1 ? (templateSplited[1].includes(':') ? templateSplited[1].split(':')[0] : '') : '',
max: templateSplited.length > 1 ? (templateSplited[1].includes(':') ? templateSplited[1].split(':')[1] : '') : '',
}
obj.type = 'audio';
if (audioE.includes(':')) {
obj.eventType = audioE.split(':')[0];
obj.eventName = audioE.split(':')[1];
obj.eventType = ((obj.eventType == '') ? audioE.split(':')[0] : obj.eventType);
obj.eventName = ((obj.eventName == '') ? audioE.split(':')[1] : obj.eventName);
}
else {
obj.eventType = audioE;
obj.eventName = '';
obj.eventType = ((obj.eventType == '') ? audioE : obj.eventType);
obj.eventName = ((obj.eventName == '') ? '' : obj.eventName);
}
obj.options = p[3];
obj.options = ((obj.options == '') ? (p[3]) : obj.options);
obj.array = ((obj.array == '') ? (p[2].includes(';') ? p[2].split(';') : '') : obj.array);
obj.min = ((obj.min == '') ? (p[2].includes(':') ? p[2].split(':')[0] : 0) : obj.min);
obj.max = ((obj.max == '') ? (p[2].includes(':') ? p[2].split(':')[1] : 1) : obj.max);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment