Start of internal audiofile module, WIP

Signed-off-by: falkTX <falktx@falktx.com>
This commit is contained in:
falkTX 2022-01-02 04:47:40 +00:00
parent 0ddd5afa43
commit 8452d0b8f6
8 changed files with 892 additions and 3 deletions

View file

@ -0,0 +1,172 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="116.84mm"
height="128.5mm"
viewBox="0 0 116.84 128.5"
version="1.1"
id="svg4620"
inkscape:version="0.92.5 (2060ec1f9f, 2020-04-08)"
sodipodi:docname="AudioFile.svg">
<defs
id="defs4614">
<style
id="style6"
type="text/css">
.str0 {stroke:#565656;stroke-width:0.0966867}
.str1 {stroke:#4F4F4F;stroke-width:0.193345}
.fil0 {fill:none}
.fil2 {fill:#2B2A29}
.fil1 {fill:#6B6B6B}
</style>
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath847">
<use
x="0"
y="0"
xlink:href="#g843"
id="use849"
width="100%"
height="100%" />
</clipPath>
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="0.98994949"
inkscape:cx="33.286897"
inkscape:cy="259.82545"
inkscape:document-units="mm"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:window-width="1920"
inkscape:window-height="1026"
inkscape:window-x="1920"
inkscape:window-y="0"
inkscape:window-maximized="1" />
<metadata
id="metadata4617">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-168.5)">
<g
id="g845"
clip-path="url(#clipPath847)"
transform="translate(35.668149)">
<g
inkscape:label="Clip"
id="g843">
<g
transform="matrix(6.342689,0,0,6.342689,5.4472535,175.6457)"
id="g5299"
style="fill-rule:evenodd">
<g
id="Layer_x0020_1"
transform="translate(-1.6191379e-5,-0.08553947)">
<metadata
id="CorelCorpID_0Corel-Layer" />
<circle
class="fil0 str0"
cx="0.525226"
cy="0.61075097"
r="0.15916"
id="circle10"
style="fill:none;stroke:#ffffff;stroke-width:0.0966867;stroke-opacity:1" />
<circle
class="fil0 str1"
cx="0.525226"
cy="0.61075097"
r="0.42853901"
id="circle12"
style="fill:none;stroke:#ffffff;stroke-width:0.193345;stroke-opacity:1" />
</g>
</g>
<g
transform="translate(-0.09449404,0.14174107)"
id="text5303"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:10.58333302px;line-height:1.25;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332"
aria-label="Cardinal">
<path
inkscape:connector-curvature="0"
id="path5305"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:6.3499999px;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#ffffff;fill-opacity:1;stroke-width:0.26458332"
d="m 17.923601,176.99103 v 0.66043 q -0.31626,-0.29456 -0.675928,-0.44028 -0.356567,-0.14573 -0.759643,-0.14573 -0.79375,0 -1.21543,0.48679 -0.42168,0.48369 -0.42168,1.40146 0,0.91468 0.42168,1.40147 0.42168,0.48369 1.21543,0.48369 0.403076,0 0.759643,-0.14573 0.359668,-0.14572 0.675928,-0.44028 v 0.65422 q -0.328662,0.22325 -0.697632,0.33487 -0.365869,0.11162 -0.775146,0.11162 -1.051099,0 -1.655713,-0.64182 -0.604615,-0.64492 -0.604615,-1.75804 0,-1.11621 0.604615,-1.75803 0.604614,-0.64492 1.655713,-0.64492 0.415478,0 0.781347,0.11162 0.36897,0.10852 0.691431,0.32866 z" />
<path
inkscape:connector-curvature="0"
id="path5307"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:6.3499999px;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#ffffff;fill-opacity:1;stroke-width:0.26458332"
d="m 20.444377,179.51801 q -0.69143,0 -0.958081,0.15813 -0.26665,0.15813 -0.26665,0.5395 0,0.30386 0.198437,0.48369 0.201538,0.17674 0.545703,0.17674 0.47439,0 0.759644,-0.33487 0.288355,-0.33796 0.288355,-0.89606 v -0.12713 z m 1.137915,-0.23564 v 1.98127 h -0.570507 v -0.5271 q -0.195337,0.31626 -0.486792,0.46819 -0.291456,0.14883 -0.713135,0.14883 -0.533301,0 -0.849561,-0.29766 -0.313159,-0.30075 -0.313159,-0.80305 0,-0.58601 0.390674,-0.88367 0.393774,-0.29765 1.172021,-0.29765 h 0.799952 v -0.0558 q 0,-0.39378 -0.26045,-0.60772 -0.257348,-0.21704 -0.725537,-0.21704 -0.297656,0 -0.579809,0.0713 -0.282154,0.0713 -0.542603,0.21394 v -0.52709 q 0.313159,-0.12093 0.607715,-0.17984 0.294556,-0.062 0.573608,-0.062 0.753443,0 1.125513,0.39067 0.37207,0.39068 0.37207,1.18443 z" />
<path
inkscape:connector-curvature="0"
id="path5309"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:6.3499999px;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#ffffff;fill-opacity:1;stroke-width:0.26458332"
d="m 24.769695,178.32429 q -0.09612,-0.0558 -0.21084,-0.0806 -0.111621,-0.0279 -0.248047,-0.0279 -0.483691,0 -0.744141,0.31626 -0.257348,0.31315 -0.257348,0.90227 v 1.82934 H 22.73571 v -3.47265 h 0.573609 v 0.5395 q 0.179834,-0.31626 0.468188,-0.46819 0.288355,-0.15503 0.700733,-0.15503 0.05891,0 0.130224,0.009 0.07131,0.006 0.15813,0.0217 z" />
<path
inkscape:connector-curvature="0"
id="path5311"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:6.3499999px;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#ffffff;fill-opacity:1;stroke-width:0.26458332"
d="m 27.541618,178.31808 v -1.87895 h 0.570508 v 4.82451 h -0.570508 v -0.5209 q -0.179834,0.31006 -0.455786,0.46199 -0.272851,0.14883 -0.657324,0.14883 -0.629419,0 -1.026294,-0.5023 -0.393774,-0.50229 -0.393774,-1.32085 0,-0.81855 0.393774,-1.32085 0.396875,-0.50229 1.026294,-0.50229 0.384473,0 0.657324,0.15193 0.275952,0.14883 0.455786,0.45888 z m -1.944067,1.21233 q 0,0.62942 0.257349,0.98909 0.260449,0.35657 0.713134,0.35657 0.452686,0 0.713135,-0.35657 0.260449,-0.35967 0.260449,-0.98909 0,-0.62942 -0.260449,-0.98598 -0.260449,-0.35967 -0.713135,-0.35967 -0.452685,0 -0.713134,0.35967 -0.257349,0.35656 -0.257349,0.98598 z" />
<path
inkscape:connector-curvature="0"
id="path5313"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:6.3499999px;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#ffffff;fill-opacity:1;stroke-width:0.26458332"
d="m 29.287248,177.79099 h 0.570508 v 3.47265 h -0.570508 z m 0,-1.35186 h 0.570508 v 0.72244 h -0.570508 z" />
<path
inkscape:connector-curvature="0"
id="path5315"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:6.3499999px;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#ffffff;fill-opacity:1;stroke-width:0.26458332"
d="m 33.938127,179.16765 v 2.09599 h -0.570508 v -2.07739 q 0,-0.49299 -0.192236,-0.73794 -0.192236,-0.24495 -0.576709,-0.24495 -0.461987,0 -0.728638,0.29456 -0.26665,0.29455 -0.26665,0.80305 v 1.96267 h -0.573608 v -3.47265 h 0.573608 v 0.5395 q 0.204639,-0.31316 0.480591,-0.46819 0.279053,-0.15503 0.641821,-0.15503 0.598413,0 0.905371,0.37207 0.306958,0.36897 0.306958,1.08831 z" />
<path
inkscape:connector-curvature="0"
id="path5317"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:6.3499999px;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#ffffff;fill-opacity:1;stroke-width:0.26458332"
d="m 36.654241,179.51801 q -0.691431,0 -0.958081,0.15813 -0.26665,0.15813 -0.26665,0.5395 0,0.30386 0.198437,0.48369 0.201538,0.17674 0.545703,0.17674 0.47439,0 0.759644,-0.33487 0.288354,-0.33796 0.288354,-0.89606 v -0.12713 z m 1.137915,-0.23564 v 1.98127 h -0.570508 v -0.5271 q -0.195337,0.31626 -0.486792,0.46819 -0.291455,0.14883 -0.713135,0.14883 -0.5333,0 -0.84956,-0.29766 -0.313159,-0.30075 -0.313159,-0.80305 0,-0.58601 0.390674,-0.88367 0.393774,-0.29765 1.172021,-0.29765 h 0.799951 v -0.0558 q 0,-0.39378 -0.260449,-0.60772 -0.257349,-0.21704 -0.725537,-0.21704 -0.297656,0 -0.57981,0.0713 -0.282153,0.0713 -0.542602,0.21394 v -0.52709 q 0.313159,-0.12093 0.607715,-0.17984 0.294555,-0.062 0.573608,-0.062 0.753442,0 1.125513,0.39067 0.37207,0.39068 0.37207,1.18443 z" />
<path
inkscape:connector-curvature="0"
id="path5319"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:6.3499999px;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#ffffff;fill-opacity:1;stroke-width:0.26458332"
d="m 38.967278,176.43913 h 0.570508 v 4.82451 h -0.570508 z" />
</g>
</g>
</g>
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:10.58333302px;line-height:1.25;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#808a8a;fill-opacity:1;stroke:none;stroke-width:0.26458332"
x="37.995232"
y="188.65312"
id="text845"><tspan
sodipodi:role="line"
id="tspan843"
x="37.995232"
y="188.65312"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.93888903px;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#808a8a;fill-opacity:1;stroke-width:0.26458332">Audio File Player</tspan></text>
</g>
</svg>

After

Width:  |  Height:  |  Size: 12 KiB

View file

@ -58,6 +58,15 @@
"Visual"
]
},
{
"slug": "AudioFile",
"disabled": false,
"name": "Audio File",
"description": "Audio file player as a module",
"tags": [
"Utility"
]
},
{
"slug": "Carla",
"disabled": false,

View file

@ -0,0 +1,226 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="116.84mm"
height="128.5mm"
viewBox="0 0 116.84 128.5"
version="1.1"
id="svg4620"
inkscape:version="0.92.5 (2060ec1f9f, 2020-04-08)"
sodipodi:docname="AudioFile.svg">
<defs
id="defs4614">
<style
id="style6"
type="text/css">
.str0 {stroke:#565656;stroke-width:0.0966867}
.str1 {stroke:#4F4F4F;stroke-width:0.193345}
.fil0 {fill:none}
.fil2 {fill:#2B2A29}
.fil1 {fill:#6B6B6B}
</style>
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath847">
<use
x="0"
y="0"
xlink:href="#g843"
id="use849"
width="100%"
height="100%" />
</clipPath>
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="0.98994949"
inkscape:cx="33.286897"
inkscape:cy="259.82545"
inkscape:document-units="mm"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:window-width="1920"
inkscape:window-height="1026"
inkscape:window-x="1920"
inkscape:window-y="0"
inkscape:window-maximized="1" />
<metadata
id="metadata4617">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-168.5)">
<g
id="g845"
clip-path="url(#clipPath847)"
transform="translate(35.668149)">
<g
inkscape:label="Clip"
id="g843">
<g
transform="matrix(6.342689,0,0,6.342689,5.4472535,175.6457)"
id="g5299"
style="fill-rule:evenodd">
<g
id="Layer_x0020_1"
transform="translate(-1.6191379e-5,-0.08553947)">
<metadata
id="CorelCorpID_0Corel-Layer" />
<circle
class="fil0 str0"
cx="0.525226"
cy="0.61075097"
r="0.15916"
id="circle10"
style="fill:none;stroke:#ffffff;stroke-width:0.0966867;stroke-opacity:1" />
<circle
class="fil0 str1"
cx="0.525226"
cy="0.61075097"
r="0.42853901"
id="circle12"
style="fill:none;stroke:#ffffff;stroke-width:0.193345;stroke-opacity:1" />
</g>
</g>
<g
transform="translate(-0.09449404,0.14174107)"
id="text5303"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:10.58333302px;line-height:1.25;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332"
aria-label="Cardinal">
<path
inkscape:connector-curvature="0"
id="path5305"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:6.3499999px;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#ffffff;fill-opacity:1;stroke-width:0.26458332"
d="m 17.923601,176.99103 v 0.66043 q -0.31626,-0.29456 -0.675928,-0.44028 -0.356567,-0.14573 -0.759643,-0.14573 -0.79375,0 -1.21543,0.48679 -0.42168,0.48369 -0.42168,1.40146 0,0.91468 0.42168,1.40147 0.42168,0.48369 1.21543,0.48369 0.403076,0 0.759643,-0.14573 0.359668,-0.14572 0.675928,-0.44028 v 0.65422 q -0.328662,0.22325 -0.697632,0.33487 -0.365869,0.11162 -0.775146,0.11162 -1.051099,0 -1.655713,-0.64182 -0.604615,-0.64492 -0.604615,-1.75804 0,-1.11621 0.604615,-1.75803 0.604614,-0.64492 1.655713,-0.64492 0.415478,0 0.781347,0.11162 0.36897,0.10852 0.691431,0.32866 z" />
<path
inkscape:connector-curvature="0"
id="path5307"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:6.3499999px;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#ffffff;fill-opacity:1;stroke-width:0.26458332"
d="m 20.444377,179.51801 q -0.69143,0 -0.958081,0.15813 -0.26665,0.15813 -0.26665,0.5395 0,0.30386 0.198437,0.48369 0.201538,0.17674 0.545703,0.17674 0.47439,0 0.759644,-0.33487 0.288355,-0.33796 0.288355,-0.89606 v -0.12713 z m 1.137915,-0.23564 v 1.98127 h -0.570507 v -0.5271 q -0.195337,0.31626 -0.486792,0.46819 -0.291456,0.14883 -0.713135,0.14883 -0.533301,0 -0.849561,-0.29766 -0.313159,-0.30075 -0.313159,-0.80305 0,-0.58601 0.390674,-0.88367 0.393774,-0.29765 1.172021,-0.29765 h 0.799952 v -0.0558 q 0,-0.39378 -0.26045,-0.60772 -0.257348,-0.21704 -0.725537,-0.21704 -0.297656,0 -0.579809,0.0713 -0.282154,0.0713 -0.542603,0.21394 v -0.52709 q 0.313159,-0.12093 0.607715,-0.17984 0.294556,-0.062 0.573608,-0.062 0.753443,0 1.125513,0.39067 0.37207,0.39068 0.37207,1.18443 z" />
<path
inkscape:connector-curvature="0"
id="path5309"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:6.3499999px;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#ffffff;fill-opacity:1;stroke-width:0.26458332"
d="m 24.769695,178.32429 q -0.09612,-0.0558 -0.21084,-0.0806 -0.111621,-0.0279 -0.248047,-0.0279 -0.483691,0 -0.744141,0.31626 -0.257348,0.31315 -0.257348,0.90227 v 1.82934 H 22.73571 v -3.47265 h 0.573609 v 0.5395 q 0.179834,-0.31626 0.468188,-0.46819 0.288355,-0.15503 0.700733,-0.15503 0.05891,0 0.130224,0.009 0.07131,0.006 0.15813,0.0217 z" />
<path
inkscape:connector-curvature="0"
id="path5311"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:6.3499999px;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#ffffff;fill-opacity:1;stroke-width:0.26458332"
d="m 27.541618,178.31808 v -1.87895 h 0.570508 v 4.82451 h -0.570508 v -0.5209 q -0.179834,0.31006 -0.455786,0.46199 -0.272851,0.14883 -0.657324,0.14883 -0.629419,0 -1.026294,-0.5023 -0.393774,-0.50229 -0.393774,-1.32085 0,-0.81855 0.393774,-1.32085 0.396875,-0.50229 1.026294,-0.50229 0.384473,0 0.657324,0.15193 0.275952,0.14883 0.455786,0.45888 z m -1.944067,1.21233 q 0,0.62942 0.257349,0.98909 0.260449,0.35657 0.713134,0.35657 0.452686,0 0.713135,-0.35657 0.260449,-0.35967 0.260449,-0.98909 0,-0.62942 -0.260449,-0.98598 -0.260449,-0.35967 -0.713135,-0.35967 -0.452685,0 -0.713134,0.35967 -0.257349,0.35656 -0.257349,0.98598 z" />
<path
inkscape:connector-curvature="0"
id="path5313"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:6.3499999px;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#ffffff;fill-opacity:1;stroke-width:0.26458332"
d="m 29.287248,177.79099 h 0.570508 v 3.47265 h -0.570508 z m 0,-1.35186 h 0.570508 v 0.72244 h -0.570508 z" />
<path
inkscape:connector-curvature="0"
id="path5315"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:6.3499999px;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#ffffff;fill-opacity:1;stroke-width:0.26458332"
d="m 33.938127,179.16765 v 2.09599 h -0.570508 v -2.07739 q 0,-0.49299 -0.192236,-0.73794 -0.192236,-0.24495 -0.576709,-0.24495 -0.461987,0 -0.728638,0.29456 -0.26665,0.29455 -0.26665,0.80305 v 1.96267 h -0.573608 v -3.47265 h 0.573608 v 0.5395 q 0.204639,-0.31316 0.480591,-0.46819 0.279053,-0.15503 0.641821,-0.15503 0.598413,0 0.905371,0.37207 0.306958,0.36897 0.306958,1.08831 z" />
<path
inkscape:connector-curvature="0"
id="path5317"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:6.3499999px;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#ffffff;fill-opacity:1;stroke-width:0.26458332"
d="m 36.654241,179.51801 q -0.691431,0 -0.958081,0.15813 -0.26665,0.15813 -0.26665,0.5395 0,0.30386 0.198437,0.48369 0.201538,0.17674 0.545703,0.17674 0.47439,0 0.759644,-0.33487 0.288354,-0.33796 0.288354,-0.89606 v -0.12713 z m 1.137915,-0.23564 v 1.98127 h -0.570508 v -0.5271 q -0.195337,0.31626 -0.486792,0.46819 -0.291455,0.14883 -0.713135,0.14883 -0.5333,0 -0.84956,-0.29766 -0.313159,-0.30075 -0.313159,-0.80305 0,-0.58601 0.390674,-0.88367 0.393774,-0.29765 1.172021,-0.29765 h 0.799951 v -0.0558 q 0,-0.39378 -0.260449,-0.60772 -0.257349,-0.21704 -0.725537,-0.21704 -0.297656,0 -0.57981,0.0713 -0.282153,0.0713 -0.542602,0.21394 v -0.52709 q 0.313159,-0.12093 0.607715,-0.17984 0.294555,-0.062 0.573608,-0.062 0.753442,0 1.125513,0.39067 0.37207,0.39068 0.37207,1.18443 z" />
<path
inkscape:connector-curvature="0"
id="path5319"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:6.3499999px;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#ffffff;fill-opacity:1;stroke-width:0.26458332"
d="m 38.967278,176.43913 h 0.570508 v 4.82451 h -0.570508 z" />
</g>
</g>
</g>
<g
aria-label="Audio File Player"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:10.58333302px;line-height:1.25;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#808a8a;fill-opacity:1;stroke:none;stroke-width:0.26458332"
id="text845">
<path
d="m 39.683328,185.53255 -0.660769,1.7918 h 1.32395 z m -0.274918,-0.4799 h 0.552249 l 1.372181,3.60047 h -0.506429 l -0.327973,-0.92363 h -1.622984 l -0.327974,0.92363 h -0.513663 z"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.93888903px;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#808a8a;fill-opacity:1;stroke-width:0.26458332"
id="path833" />
<path
d="m 41.793449,187.58721 v -1.63504 h 0.443729 v 1.61816 q 0,0.38344 0.149517,0.57636 0.149517,0.19052 0.448551,0.19052 0.359324,0 0.566719,-0.2291 0.209806,-0.2291 0.209806,-0.6246 v -1.53134 h 0.443728 v 2.70095 h -0.443728 v -0.41479 q -0.161575,0.24598 -0.376205,0.36656 -0.212217,0.11817 -0.494371,0.11817 -0.465432,0 -0.706589,-0.28939 -0.241157,-0.28939 -0.241157,-0.84646 z m 1.116556,-1.70016 z"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.93888903px;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#808a8a;fill-opacity:1;stroke-width:0.26458332"
id="path835" />
<path
d="m 46.746807,186.36213 v -1.46141 h 0.443729 v 3.7524 h -0.443729 v -0.40514 q -0.13987,0.24116 -0.3545,0.35932 -0.212218,0.11576 -0.511252,0.11576 -0.489548,0 -0.798229,-0.39068 -0.306269,-0.39067 -0.306269,-1.02732 0,-0.63666 0.306269,-1.02733 0.308681,-0.39068 0.798229,-0.39068 0.299034,0 0.511252,0.11817 0.21463,0.11576 0.3545,0.35691 z m -1.512052,0.94293 q 0,0.48954 0.20016,0.76929 0.202572,0.27733 0.55466,0.27733 0.352089,0 0.554661,-0.27733 0.202571,-0.27975 0.202571,-0.76929 0,-0.48955 -0.202571,-0.76688 -0.202572,-0.27974 -0.554661,-0.27974 -0.352088,0 -0.55466,0.27974 -0.20016,0.27733 -0.20016,0.76688 z"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.93888903px;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#808a8a;fill-opacity:1;stroke-width:0.26458332"
id="path837" />
<path
d="m 48.10452,185.95217 h 0.443728 v 2.70095 H 48.10452 Z m 0,-1.05145 h 0.443728 v 0.5619 H 48.10452 Z"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.93888903px;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#808a8a;fill-opacity:1;stroke-width:0.26458332"
id="path839" />
<path
d="m 50.523321,186.26326 q -0.356912,0 -0.564307,0.27974 -0.207394,0.27733 -0.207394,0.76206 0,0.48472 0.204983,0.76446 0.207395,0.27733 0.566718,0.27733 0.3545,0 0.561895,-0.27974 0.207395,-0.27974 0.207395,-0.76205 0,-0.47991 -0.207395,-0.75965 -0.207395,-0.28215 -0.561895,-0.28215 z m 0,-0.37621 q 0.578776,0 0.909161,0.37621 0.330384,0.3762 0.330384,1.0418 0,0.66318 -0.330384,1.04179 -0.330385,0.37621 -0.909161,0.37621 -0.581188,0 -0.911572,-0.37621 -0.327973,-0.37861 -0.327973,-1.04179 0,-0.6656 0.327973,-1.0418 0.330384,-0.37621 0.911572,-0.37621 z"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.93888903px;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#808a8a;fill-opacity:1;stroke-width:0.26458332"
id="path841" />
<path
d="m 54.087617,185.05265 h 2.069124 v 0.40997 h -1.581988 v 1.06109 h 1.427648 v 0.40996 h -1.427648 v 1.71945 h -0.487136 z"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.93888903px;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#808a8a;fill-opacity:1;stroke-width:0.26458332"
id="path843" />
<path
d="m 56.549827,185.95217 h 0.443728 v 2.70095 h -0.443728 z m 0,-1.05145 h 0.443728 v 0.5619 h -0.443728 z"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.93888903px;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#808a8a;fill-opacity:1;stroke-width:0.26458332"
id="path845" />
<path
d="m 57.922008,184.90072 h 0.443728 v 3.7524 h -0.443728 z"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.93888903px;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#808a8a;fill-opacity:1;stroke-width:0.26458332"
id="path847" />
<path
d="m 61.604472,187.19171 v 0.21704 h -2.040186 q 0.02894,0.4582 0.274919,0.69936 0.248391,0.23874 0.689708,0.23874 0.255626,0 0.494371,-0.0627 0.241157,-0.0627 0.47749,-0.1881 v 0.41961 q -0.238745,0.10129 -0.489548,0.15434 -0.250803,0.0531 -0.50884,0.0531 -0.6463,0 -1.024916,-0.37621 -0.376205,-0.3762 -0.376205,-1.01768 0,-0.66318 0.356912,-1.05144 0.359324,-0.39068 0.967039,-0.39068 0.545014,0 0.860929,0.35209 0.318327,0.34968 0.318327,0.95257 z m -0.443729,-0.13022 q -0.0048,-0.36415 -0.204983,-0.58119 -0.197748,-0.21704 -0.525721,-0.21704 -0.371382,0 -0.595657,0.20981 -0.221865,0.2098 -0.255626,0.59083 z"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.93888903px;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#808a8a;fill-opacity:1;stroke-width:0.26458332"
id="path849" />
<path
d="m 64.409123,185.45297 v 1.35289 h 0.612538 q 0.340031,0 0.525722,-0.17604 0.18569,-0.17605 0.18569,-0.50161 0,-0.32315 -0.18569,-0.49919 -0.185691,-0.17605 -0.525722,-0.17605 z m -0.487136,-0.40032 h 1.099674 q 0.605303,0 0.913984,0.27492 0.311092,0.27251 0.311092,0.80064 0,0.53296 -0.311092,0.80546 -0.308681,0.27251 -0.913984,0.27251 h -0.612538 v 1.44694 h -0.487136 z"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.93888903px;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#808a8a;fill-opacity:1;stroke-width:0.26458332"
id="path851" />
<path
d="m 66.880979,184.90072 h 0.443728 v 3.7524 h -0.443728 z"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.93888903px;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#808a8a;fill-opacity:1;stroke-width:0.26458332"
id="path853" />
<path
d="m 69.480649,187.29541 q -0.537779,0 -0.745174,0.12299 -0.207395,0.12299 -0.207395,0.41961 0,0.23634 0.154341,0.37621 0.156751,0.13746 0.424435,0.13746 0.36897,0 0.590834,-0.26045 0.224276,-0.26286 0.224276,-0.69695 v -0.0989 z m 0.885045,-0.18328 v 1.54099 h -0.443728 v -0.40996 q -0.151929,0.24598 -0.378616,0.36414 -0.226687,0.11576 -0.55466,0.11576 -0.41479,0 -0.66077,-0.23151 -0.243568,-0.23393 -0.243568,-0.6246 0,-0.45579 0.303857,-0.6873 0.306269,-0.23151 0.911573,-0.23151 h 0.622184 v -0.0434 q 0,-0.30627 -0.202572,-0.47267 -0.20016,-0.16881 -0.564306,-0.16881 -0.231511,0 -0.450963,0.0555 -0.219453,0.0555 -0.422025,0.16639 v -0.40996 q 0.243569,-0.0941 0.472668,-0.13987 0.229098,-0.0482 0.446139,-0.0482 0.586011,0 0.875399,0.30386 0.289388,0.30386 0.289388,0.92122 z"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.93888903px;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#808a8a;fill-opacity:1;stroke-width:0.26458332"
id="path855" />
<path
d="m 72.403466,188.90392 q -0.188102,0.48232 -0.366558,0.62942 -0.178456,0.14711 -0.477491,0.14711 h -0.3545 v -0.37138 h 0.260449 q 0.183279,0 0.284565,-0.0868 0.101286,-0.0868 0.224276,-0.40996 l 0.07958,-0.20258 -1.09244,-2.65754 h 0.470255 l 0.844049,2.11253 0.844048,-2.11253 h 0.470256 z"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.93888903px;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#808a8a;fill-opacity:1;stroke-width:0.26458332"
id="path857" />
<path
d="m 76.512778,187.19171 v 0.21704 h -2.040186 q 0.02894,0.4582 0.274919,0.69936 0.248391,0.23874 0.689708,0.23874 0.255626,0 0.494371,-0.0627 0.241157,-0.0627 0.47749,-0.1881 v 0.41961 q -0.238745,0.10129 -0.489548,0.15434 -0.250803,0.0531 -0.50884,0.0531 -0.6463,0 -1.024916,-0.37621 -0.376205,-0.3762 -0.376205,-1.01768 0,-0.66318 0.356912,-1.05144 0.359324,-0.39068 0.967039,-0.39068 0.545014,0 0.860929,0.35209 0.318327,0.34968 0.318327,0.95257 z m -0.443728,-0.13022 q -0.0048,-0.36415 -0.204984,-0.58119 -0.197748,-0.21704 -0.525721,-0.21704 -0.371382,0 -0.595657,0.20981 -0.221864,0.2098 -0.255626,0.59083 z"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.93888903px;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#808a8a;fill-opacity:1;stroke-width:0.26458332"
id="path859" />
<path
d="m 78.806178,186.36696 q -0.07476,-0.0434 -0.163987,-0.0627 -0.08682,-0.0217 -0.192925,-0.0217 -0.376204,0 -0.578776,0.24598 -0.20016,0.24357 -0.20016,0.70177 v 1.42282 h -0.44614 v -2.70095 h 0.44614 v 0.41961 q 0.139871,-0.24598 0.364147,-0.36415 0.224275,-0.12058 0.545014,-0.12058 0.04582,0 0.101285,0.007 0.05547,0.005 0.12299,0.0169 z"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.93888903px;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#808a8a;fill-opacity:1;stroke-width:0.26458332"
id="path861" />
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 24 KiB

View file

@ -0,0 +1,479 @@
/*
* DISTRHO Cardinal Plugin
* Copyright (C) 2021 Filipe Coelho <falktx@falktx.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 3 of
* the License, or any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* For a full copy of the GNU General Public License see the LICENSE file.
*/
#include "plugincontext.hpp"
#include "extra/Thread.hpp"
#include "dgl/src/nanovg/nanovg.h"
#include "CarlaNativePlugin.h"
#define BUFFER_SIZE 128
// generates a warning if this is defined as anything else
#define CARLA_API
// --------------------------------------------------------------------------------------------------------------------
std::size_t carla_getNativePluginCount() noexcept;
const NativePluginDescriptor* carla_getNativePluginDescriptor(const std::size_t index) noexcept;
// --------------------------------------------------------------------------------------------------------------------
using namespace CarlaBackend;
static uint32_t host_get_buffer_size(NativeHostHandle);
static double host_get_sample_rate(NativeHostHandle);
static bool host_is_offline(NativeHostHandle);
static const NativeTimeInfo* host_get_time_info(NativeHostHandle handle);
static bool host_write_midi_event(NativeHostHandle handle, const NativeMidiEvent* event);
static void host_ui_midi_program_changed(NativeHostHandle handle, uint8_t channel, uint32_t bank, uint32_t program);
static void host_ui_custom_data_changed(NativeHostHandle handle, const char* key, const char* value);
static intptr_t host_dispatcher(NativeHostHandle handle, NativeHostDispatcherOpcode opcode, int32_t index, intptr_t value, void* ptr, float opt);
static void host_ui_parameter_changed(NativeHostHandle, uint32_t, float) {}
static void host_ui_midi_program_changed(NativeHostHandle, uint8_t, uint32_t, uint32_t) {}
static void host_ui_custom_data_changed(NativeHostHandle, const char*, const char*) {}
static const char* host_ui_open_file(NativeHostHandle, bool, const char*, const char*) { return nullptr; }
static const char* host_ui_save_file(NativeHostHandle, bool, const char*, const char*) { return nullptr; }
static void host_ui_closed(NativeHostHandle) {}
// --------------------------------------------------------------------------------------------------------------------
struct CarlaInternalPluginModule : Module, Thread {
enum ParamIds {
NUM_PARAMS
};
enum InputIds {
NUM_INPUTS
};
enum OutputIds {
AUDIO_OUTPUT1,
AUDIO_OUTPUT2,
NUM_OUTPUTS
};
enum LightIds {
NUM_LIGHTS
};
CardinalPluginContext* const pcontext;
const NativePluginDescriptor* fCarlaPluginDescriptor = nullptr;
NativePluginHandle fCarlaPluginHandle = nullptr;
NativeHostDescriptor fCarlaHostDescriptor = {};
NativeTimeInfo fCarlaTimeInfo;
float dataOut[NUM_OUTPUTS][BUFFER_SIZE];
float* dataOutPtr[NUM_OUTPUTS];
unsigned audioDataFill = 0;
int64_t lastBlockFrame = -1;
struct {
float preview[108];
uint channels; // 4
uint bitDepth; // 6
uint sampleRate; // 7
uint length; // 8
float position; // 9
} audioInfo;
CarlaInternalPluginModule()
: pcontext(static_cast<CardinalPluginContext*>(APP))
{
config(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS);
configOutput(0, "Audio Left");
configOutput(1, "Audio Right");
dataOutPtr[0] = dataOut[0];
dataOutPtr[1] = dataOut[1];
std::memset(dataOut, 0, sizeof(dataOut));
std::memset(&audioInfo, 0, sizeof(audioInfo));
for (std::size_t i=0, count=carla_getNativePluginCount(); i<count; ++i)
{
const NativePluginDescriptor* const desc = carla_getNativePluginDescriptor(i);
if (std::strcmp(desc->label, "audiofile") != 0)
continue;
fCarlaPluginDescriptor = desc;
break;
}
DISTRHO_SAFE_ASSERT_RETURN(fCarlaPluginDescriptor != nullptr,);
memset(&fCarlaHostDescriptor, 0, sizeof(fCarlaHostDescriptor));
memset(&fCarlaTimeInfo, 0, sizeof(fCarlaTimeInfo));
fCarlaHostDescriptor.handle = this;
fCarlaHostDescriptor.resourceDir = "";
fCarlaHostDescriptor.uiName = "Cardinal";
fCarlaHostDescriptor.get_buffer_size = host_get_buffer_size;
fCarlaHostDescriptor.get_sample_rate = host_get_sample_rate;
fCarlaHostDescriptor.is_offline = host_is_offline;
fCarlaHostDescriptor.get_time_info = host_get_time_info;
fCarlaHostDescriptor.write_midi_event = host_write_midi_event;
fCarlaHostDescriptor.ui_parameter_changed = host_ui_parameter_changed;
fCarlaHostDescriptor.ui_midi_program_changed = host_ui_midi_program_changed;
fCarlaHostDescriptor.ui_custom_data_changed = host_ui_custom_data_changed;
fCarlaHostDescriptor.ui_closed = host_ui_closed;
fCarlaHostDescriptor.ui_open_file = host_ui_open_file;
fCarlaHostDescriptor.ui_save_file = host_ui_save_file;
fCarlaHostDescriptor.dispatcher = host_dispatcher;
fCarlaPluginHandle = fCarlaPluginDescriptor->instantiate(&fCarlaHostDescriptor);
DISTRHO_SAFE_ASSERT_RETURN(fCarlaPluginHandle != nullptr,);
fCarlaPluginDescriptor->activate(fCarlaPluginHandle);
// host-sync disabled by default
fCarlaPluginDescriptor->set_parameter_value(fCarlaPluginHandle, 1, 0.0f);
startThread();
}
~CarlaInternalPluginModule() override
{
if (fCarlaPluginHandle == nullptr)
return;
stopThread(-1);
fCarlaPluginDescriptor->deactivate(fCarlaPluginHandle);
fCarlaPluginDescriptor->cleanup(fCarlaPluginHandle);
}
void run() override
{
while (!shouldThreadExit())
{
d_msleep(500);
fCarlaPluginDescriptor->dispatcher(fCarlaPluginHandle, NATIVE_PLUGIN_OPCODE_IDLE, 0, 0, nullptr, 0.0f);
}
}
const NativeTimeInfo* hostGetTimeInfo() const noexcept
{
return &fCarlaTimeInfo;
}
intptr_t hostDispatcher(const NativeHostDispatcherOpcode opcode,
const int32_t index, const intptr_t value, void* const ptr, const float opt)
{
switch (opcode)
{
// cannnot be supported
case NATIVE_HOST_OPCODE_HOST_IDLE:
break;
// other stuff
case NATIVE_HOST_OPCODE_NULL:
case NATIVE_HOST_OPCODE_UPDATE_PARAMETER:
case NATIVE_HOST_OPCODE_UPDATE_MIDI_PROGRAM:
case NATIVE_HOST_OPCODE_RELOAD_PARAMETERS:
case NATIVE_HOST_OPCODE_RELOAD_MIDI_PROGRAMS:
case NATIVE_HOST_OPCODE_RELOAD_ALL:
case NATIVE_HOST_OPCODE_UI_UNAVAILABLE:
case NATIVE_HOST_OPCODE_INTERNAL_PLUGIN:
case NATIVE_HOST_OPCODE_QUEUE_INLINE_DISPLAY:
case NATIVE_HOST_OPCODE_UI_TOUCH_PARAMETER:
case NATIVE_HOST_OPCODE_UI_RESIZE:
break;
case NATIVE_HOST_OPCODE_PREVIEW_BUFFER_DATA:
std::memcpy(audioInfo.preview, ptr, sizeof(audioInfo.preview));
break;
case NATIVE_HOST_OPCODE_GET_FILE_PATH:
case NATIVE_HOST_OPCODE_REQUEST_IDLE:
break;
}
return 0;
}
// json_t* dataToJson() override
// {
// if (fCarlaPluginHandle == nullptr)
// return nullptr;
//
// char* const state = fCarlaPluginDescriptor->get_state(fCarlaPluginHandle);
// return json_string(state);
// }
//
// void dataFromJson(json_t* const rootJ) override
// {
// if (fCarlaPluginHandle == nullptr)
// return;
//
// const char* const state = json_string_value(rootJ);
// DISTRHO_SAFE_ASSERT_RETURN(state != nullptr,);
//
// fCarlaPluginDescriptor->set_state(fCarlaPluginHandle, state);
// }
void process(const ProcessArgs&) override
{
if (fCarlaPluginHandle == nullptr)
return;
const unsigned k = audioDataFill++;
outputs[0].setVoltage(dataOut[0][k] * 10.0f);
outputs[1].setVoltage(dataOut[1][k] * 10.0f);
if (audioDataFill == BUFFER_SIZE)
{
const int64_t blockFrame = pcontext->engine->getBlockFrame();
// Update time position if running a new audio block
if (lastBlockFrame != blockFrame)
{
lastBlockFrame = blockFrame;
fCarlaTimeInfo.playing = pcontext->playing;
fCarlaTimeInfo.frame = pcontext->frame;
}
// or advance time by BUFFER_SIZE frames if still under the same audio block
else if (fCarlaTimeInfo.playing)
{
fCarlaTimeInfo.frame += BUFFER_SIZE;
}
audioDataFill = 0;
fCarlaPluginDescriptor->process(fCarlaPluginHandle, nullptr, dataOutPtr, BUFFER_SIZE, nullptr, 0);
audioInfo.channels = fCarlaPluginDescriptor->get_parameter_value(fCarlaPluginHandle, 4);
audioInfo.bitDepth = fCarlaPluginDescriptor->get_parameter_value(fCarlaPluginHandle, 6);
audioInfo.sampleRate = fCarlaPluginDescriptor->get_parameter_value(fCarlaPluginHandle, 7);
audioInfo.length = fCarlaPluginDescriptor->get_parameter_value(fCarlaPluginHandle, 8);
audioInfo.position = fCarlaPluginDescriptor->get_parameter_value(fCarlaPluginHandle, 9);
}
}
void onSampleRateChange(const SampleRateChangeEvent& e) override
{
if (fCarlaPluginHandle == nullptr)
return;
fCarlaPluginDescriptor->deactivate(fCarlaPluginHandle);
fCarlaPluginDescriptor->dispatcher(fCarlaPluginHandle, NATIVE_PLUGIN_OPCODE_SAMPLE_RATE_CHANGED,
0, 0, nullptr, e.sampleRate);
fCarlaPluginDescriptor->activate(fCarlaPluginHandle);
}
DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(CarlaInternalPluginModule)
};
// -----------------------------------------------------------------------------------------------------------
static uint32_t host_get_buffer_size(NativeHostHandle)
{
return BUFFER_SIZE;
}
static double host_get_sample_rate(const NativeHostHandle handle)
{
CardinalPluginContext* const pcontext = static_cast<CarlaInternalPluginModule*>(handle)->pcontext;
DISTRHO_SAFE_ASSERT_RETURN(pcontext != nullptr, 48000.0);
return pcontext->sampleRate;
}
static bool host_is_offline(NativeHostHandle)
{
return false;
}
static const NativeTimeInfo* host_get_time_info(const NativeHostHandle handle)
{
return static_cast<CarlaInternalPluginModule*>(handle)->hostGetTimeInfo();
}
static bool host_write_midi_event(NativeHostHandle, const NativeMidiEvent*)
{
return false;
}
static intptr_t host_dispatcher(const NativeHostHandle handle, const NativeHostDispatcherOpcode opcode,
const int32_t index, const intptr_t value, void* const ptr, const float opt)
{
return static_cast<CarlaInternalPluginModule*>(handle)->hostDispatcher(opcode, index, value, ptr, opt);
}
// --------------------------------------------------------------------------------------------------------------------
#ifndef HEADLESS
struct AudioFileWidget : ModuleWidget {
static constexpr const float startX_In = 14.0f;
static constexpr const float startX_Out = 96.0f;
static constexpr const float padding = 29.0f;
CarlaInternalPluginModule* const module;
bool idleCallbackActive = false;
bool visible = false;
float lastPosition = 0.0f;
AudioFileWidget(CarlaInternalPluginModule* const m)
: ModuleWidget(),
module(m)
{
setModule(module);
setPanel(APP->window->loadSvg(asset::plugin(pluginInstance, "res/AudioFile.svg")));
addChild(createWidget<ScrewBlack>(Vec(RACK_GRID_WIDTH, 0)));
addChild(createWidget<ScrewBlack>(Vec(box.size.x - 2 * RACK_GRID_WIDTH, 0)));
addChild(createWidget<ScrewBlack>(Vec(RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH)));
addChild(createWidget<ScrewBlack>(Vec(box.size.x - 2 * RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH)));
addOutput(createOutput<PJ301MPort>(Vec(box.size.x - RACK_GRID_WIDTH * 5/2,
RACK_GRID_HEIGHT - RACK_GRID_WIDTH - padding * 1),
module, 0));
addOutput(createOutput<PJ301MPort>(Vec(box.size.x - RACK_GRID_WIDTH * 5/2,
RACK_GRID_HEIGHT - RACK_GRID_WIDTH - padding * 2),
module, 1));
}
void draw(const DrawArgs& args) override
{
nvgBeginPath(args.vg);
nvgRect(args.vg, 0, 0, box.size.x, box.size.y);
nvgFillPaint(args.vg, nvgLinearGradient(args.vg, 0, 0, 0, box.size.y,
nvgRGB(0x18, 0x19, 0x19),
nvgRGB(0x21, 0x22, 0x22)));
nvgFill(args.vg);
const Rect audioPreviewPos = Rect(8, box.size.y - 80 - 80, box.size.x - 16, 80);
nvgBeginPath(args.vg);
nvgRoundedRect(args.vg,
audioPreviewPos.pos.x, audioPreviewPos.pos.y,
audioPreviewPos.size.x, audioPreviewPos.size.y, 4.0f);
nvgFillColor(args.vg, nvgRGB(0x75, 0x17, 0x00));
nvgFill(args.vg);
nvgStrokeWidth(args.vg, 2.0f);
nvgStrokeColor(args.vg, nvgRGB(0xd6, 0x75, 0x16));
nvgStroke(args.vg);
char textInfo[0xff];
if (module != nullptr && module->audioInfo.channels != 0)
{
const float audioPreviewBarHeight = audioPreviewPos.size.y - 20;
const size_t position = (module->audioInfo.position * 0.01f) * ARRAY_SIZE(module->audioInfo.preview);
nvgFillColor(args.vg, nvgRGB(0xd6, 0x75, 0x16));
for (size_t i=0; i<ARRAY_SIZE(module->audioInfo.preview); ++i)
{
const float value = module->audioInfo.preview[i];
const float height = std::max(0.01f, value * audioPreviewBarHeight);
const float y = audioPreviewPos.pos.y + audioPreviewBarHeight - height;
if (position == i)
nvgFillColor(args.vg, color::WHITE);
nvgBeginPath(args.vg);
nvgRect(args.vg,
audioPreviewPos.pos.x + 3 + 3 * i, y + 2, 2, height);
nvgFill(args.vg);
}
std::snprintf(textInfo, sizeof(textInfo), "%s %d-Bit, %.1fkHz, %dm%02ds",
module->audioInfo.channels == 1 ? "Mono" : module->audioInfo.channels == 2 ? "Stereo" : "Other",
module->audioInfo.bitDepth,
static_cast<float>(module->audioInfo.sampleRate)/1000.0f,
module->audioInfo.length / 60,
module->audioInfo.length % 60);
}
else
{
std::strcpy(textInfo, "No file loaded");
}
nvgFillColor(args.vg, color::WHITE);
nvgFontFaceId(args.vg, 0);
nvgFontSize(args.vg, 13);
nvgTextAlign(args.vg, NVG_ALIGN_LEFT);
nvgText(args.vg, audioPreviewPos.pos.x + 4, audioPreviewPos.pos.y + audioPreviewPos.size.y - 6,
textInfo, nullptr);
nvgFontSize(args.vg, 11);
nvgTextAlign(args.vg, NVG_ALIGN_CENTER);
// nvgTextBounds(vg, 0, 0, text, nullptr, nullptr);
nvgBeginPath(args.vg);
nvgRoundedRect(args.vg, startX_Out - 4.0f, RACK_GRID_HEIGHT - padding * CarlaInternalPluginModule::NUM_INPUTS - 2.0f,
padding, padding * CarlaInternalPluginModule::NUM_INPUTS, 4);
nvgFillColor(args.vg, nvgRGB(0xd0, 0xd0, 0xd0));
nvgFill(args.vg);
ModuleWidget::draw(args);
}
// void step() override
// {
// if (d_isNotEqual(module->audioInfo.position, lastPosition))
// {
// lastPosition = module->audioInfo.position;
// // setDirty(true);
// }
//
// ModuleWidget::step();
// }
void appendContextMenu(ui::Menu* const menu) override
{
menu->addChild(new ui::MenuSeparator);
struct LoadAudioFileItem : MenuItem {
CarlaInternalPluginModule* const module;
LoadAudioFileItem(CarlaInternalPluginModule* const m)
: module(m)
{
text = "Load audio file...";
}
void onAction(const event::Action&) override
{
CarlaInternalPluginModule* const module = this->module;
async_dialog_filebrowser(false, nullptr, text.c_str(), [module](char* path)
{
if (path == nullptr)
return;
module->fCarlaPluginDescriptor->set_custom_data(module->fCarlaPluginHandle, "file", path);
std::free(path);
});
}
};
menu->addChild(new LoadAudioFileItem(module));
}
DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(AudioFileWidget)
};
#else
typedef ModuleWidget AudioFileWidget;
#endif
// --------------------------------------------------------------------------------------------------------------------
Model* modelAudioFile = createModel<CarlaInternalPluginModule, AudioFileWidget>("AudioFile");
// --------------------------------------------------------------------------------------------------------------------

View file

@ -27,6 +27,7 @@ using namespace rack;
extern Plugin* pluginInstance;
extern Model* modelAudioFile;
extern Model* modelCarla;
extern Model* modelCardinalBlank;
extern Model* modelGlBars;

View file

@ -184,6 +184,7 @@ PLUGIN_FILES = plugins.cpp
# --------------------------------------------------------------
# Cardinal (built-in)
PLUGIN_FILES += Cardinal/src/AudioFile.cpp
PLUGIN_FILES += Cardinal/src/Blank.cpp
PLUGIN_FILES += Cardinal/src/Carla.cpp
PLUGIN_FILES += Cardinal/src/glBars.cpp

View file

@ -668,6 +668,7 @@ static void initStatic__Cardinal()
const StaticPluginLoader spl(p, "Cardinal");
if (spl.ok())
{
p->addModel(modelAudioFile);
p->addModel(modelCarla);
p->addModel(modelCardinalBlank);
p->addModel(modelGlBars);

View file

@ -898,17 +898,17 @@ protected:
{
if (timePos.frame == 0)
{
singleTimeMidiEvent.data[0] = 0xFA;
singleTimeMidiEvent.data[0] = 0xFA; // start
sendSingleSimpleMidiMessage(singleTimeMidiEvent);
}
singleTimeMidiEvent.data[0] = 0xFB;
singleTimeMidiEvent.data[0] = 0xFB; // continue
sendSingleSimpleMidiMessage(singleTimeMidiEvent);
}
}
else if (context->playing)
{
singleTimeMidiEvent.data[0] = 0xFC;
singleTimeMidiEvent.data[0] = 0xFC; // stop
sendSingleSimpleMidiMessage(singleTimeMidiEvent);
}