[{"data":1,"prerenderedAt":39},["ShallowReactive",2],{"project-omx-panel-compare":3},{"page":4,"others":17},{"slug":5,"src":6,"title":7,"source":8,"toc":9,"html":16},"compare","docs\u002Fcompare.md","Compare A\u002FB\u002FC\u002FD and undo","https:\u002F\u002Fgithub.com\u002FFreeMixer\u002Fomx-panel\u002Fblob\u002Fedaf4f48de7e57496ead1b949f754b7e111867e3\u002Fdocs\u002Fcompare.md",[10,13],{"id":11,"title":12},"the-document","The document",{"id":14,"title":15},"the-operations","The operations","\u003Ch1 id=\"compare-a-b-c-d-and-undo\">Compare A\u002FB\u002FC\u002FD and undo\u003C\u002Fh1>\n\u003Cp>\u003Ccode>tools\u002Fcompare.mjs\u003C\u002Fcode> holds four unnamed sets of a processor's control values, and an undo ring, as pure functions: a\ndocument and the running values in, a new document and the parameter moves out. A host reads its values, calls the\nfunction, applies the moves through its own parameter door, and stores the document with its session. It works for any plugin:\nit only ever moves parameters. Presets are not touched.\u003C\u002Fp>\n\u003Cp>JavaScript imports \u003Ccode>@openmixer\u002Fomx-panel\u002Fcompare\u003C\u002Fcode>. Any other host runs the command, one JSON object in, one out:\u003C\u002Fp>\n\u003Cpre>\u003Ccode>omx-panel compare switch --to B     { &quot;doc&quot;: ..., &quot;values&quot;: { ... } }\nomx-panel compare copy --to C       { &quot;doc&quot;: ..., &quot;values&quot;: { ... } }\nomx-panel compare undo              { &quot;ring&quot;: ..., &quot;captures&quot;: [ { ... } ], &quot;values&quot;: { ... } }\nomx-panel compare redo              { &quot;ring&quot;: ..., &quot;values&quot;: { ... } }\n                                 -&gt; { &quot;doc&quot;: ..., &quot;ring&quot;: ..., &quot;moves&quot;: [ { &quot;symbol&quot;: &quot;ratio&quot;, &quot;value&quot;: 3 } ], &quot;unknown&quot;: [ ] }\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Cp>Leave out \u003Ccode>doc\u003C\u002Fcode> or \u003Ccode>ring\u003C\u002Fcode> for a new one. \u003Ccode>captures\u003C\u002Fcode> is a queue of value sets to take before the step, in order, so a\nhost starts no process while a knob turns. A refusal exits 1 and names its code on stderr; a usage error exits 2.\u003C\u002Fp>\n\u003Ch2 id=\"the-document\">The document\u003C\u002Fh2>\n\u003Cpre>\u003Ccode class=\"language-json\">{ &quot;format&quot;: &quot;org.openmixer.compare\u002F1&quot;, &quot;active&quot;: &quot;A&quot;,\n  &quot;slots&quot;: { &quot;A&quot;: { &quot;threshold&quot;: -18, &quot;ratio&quot;: 3 }, &quot;C&quot;: { &quot;threshold&quot;: -30, &quot;ratio&quot;: 8 } } }\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Cp>\u003Ccode>slots\u003C\u002Fcode> holds the slots used. Values are finite numbers, under whatever key the host names a control by.\u003C\u002Fp>\n\u003Ch2 id=\"the-operations\">The operations\u003C\u002Fh2>\n\u003Ctable>\n\u003Cthead>\n\u003Ctr>\n\u003Cth>Function\u003C\u002Fth>\n\u003Cth>Does\u003C\u002Fth>\n\u003Cth>Moves\u003C\u002Fth>\n\u003C\u002Ftr>\n\u003C\u002Fthead>\n\u003Ctbody>\n\u003Ctr>\n\u003Ctd>\u003Ccode>switchTo(doc, values, to)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd>stores the running values in the slot left and makes \u003Ccode>to\u003C\u002Fcode> the running one\u003C\u002Ftd>\n\u003Ctd>one per control that differs from \u003Ccode>to\u003C\u002Fcode>, sorted by symbol; none when \u003Ccode>to\u003C\u002Fcode> is empty, which takes a copy\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>copyTo(doc, values, to)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd>puts the running values in \u003Ccode>to\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd>none\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>capture(ring, values)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd>keeps the values as a step; the same values twice are one step, and a new step ends what could be redone; at most 64\u003C\u002Ftd>\n\u003Ctd>none\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>undo(ring, values)\u003C\u002Fcode>, \u003Ccode>redo(ring, values)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd>steps back or forward, keeping the running values on the other side\u003C\u002Ftd>\n\u003Ctd>to the step's values; none at either end\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003C\u002Ftbody>\n\u003C\u002Ftable>\n\u003Cp>A control a slot holds that the running plugin does not is named in \u003Ccode>unknown\u003C\u002Fcode>, not moved, and kept in the slot. A control the\nslot lacks keeps its value.\u003C\u002Fp>\n\u003Ctable>\n\u003Cthead>\n\u003Ctr>\n\u003Cth>Refusal\u003C\u002Fth>\n\u003Cth>When\u003C\u002Fth>\n\u003C\u002Ftr>\n\u003C\u002Fthead>\n\u003Ctbody>\n\u003Ctr>\n\u003Ctd>\u003Ccode>COMPARE_NO_SLOT\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd>a slot that is not \u003Ccode>A\u003C\u002Fcode>, \u003Ccode>B\u003C\u002Fcode>, \u003Ccode>C\u003C\u002Fcode> or \u003Ccode>D\u003C\u002Fcode>\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>COMPARE_FORMAT\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd>a document of another format\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>COMPARE_VALUE\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd>a value that is no finite number\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>COMPARE_COPY_TO_RUNNING\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd>a copy onto the slot running\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003C\u002Ftbody>\n\u003C\u002Ftable>\n\u003Cp>Only parameters move: a plugin's non-parameter state stays where it is, so a plugin whose sound lives in its state compares\nonly what its parameters reach.\u003C\u002Fp>\n",[18,21,24,27,30,33,36],{"slug":19,"title":20},"","omx-panel",{"slug":22,"title":23},"group-inference","Port-group inference for LV2 plugins",{"slug":25,"title":26},"lv2-complement","The LV2 complement: a replacing bundle with the inferred port groups",{"slug":28,"title":29},"modgui","The MOD GUI generator",{"slug":31,"title":32},"panel-layout","Panel layout from a descriptor",{"slug":34,"title":35},"skin-package","The skin package",{"slug":37,"title":38},"worked-example","Worked example: a third-party LV2 and CLAP plugin to a generated panel, adapted to Zynthian",1793954996025]