diff --git a/.gitmodules b/.gitmodules index 7fd9a3017ea..418515f43fb 100644 --- a/.gitmodules +++ b/.gitmodules @@ -8,3 +8,6 @@ [submodule "libs/midifile"] path = libs/midifile url = https://github.com/craigsapp/midifile.git +[submodule "libs/nanosvg"] + path = libs/nanosvg + url = https://github.com/memononen/nanosvg.git diff --git a/assets/original-vector/SVG/exported/bmp00102.svg b/assets/original-vector/SVG/exported/bmp00102.svg new file mode 100644 index 00000000000..dd2ad338f04 --- /dev/null +++ b/assets/original-vector/SVG/exported/bmp00102.svg @@ -0,0 +1,285 @@ + + + + bmp00102 + Created with Sketch. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/assets/original-vector/SVG/exported/bmp00105.svg b/assets/original-vector/SVG/exported/bmp00105.svg new file mode 100644 index 00000000000..9f652dd0785 --- /dev/null +++ b/assets/original-vector/SVG/exported/bmp00105.svg @@ -0,0 +1,127 @@ + + + + bmp00105 + Created with Sketch. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/assets/original-vector/SVG/exported/bmp00108.svg b/assets/original-vector/SVG/exported/bmp00108.svg new file mode 100644 index 00000000000..539b5951cf0 --- /dev/null +++ b/assets/original-vector/SVG/exported/bmp00108.svg @@ -0,0 +1,200 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/assets/original-vector/SVG/exported/bmp00112.svg b/assets/original-vector/SVG/exported/bmp00112.svg new file mode 100644 index 00000000000..074a0b53e2f --- /dev/null +++ b/assets/original-vector/SVG/exported/bmp00112.svg @@ -0,0 +1,416 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/assets/original-vector/SVG/exported/bmp00113.svg b/assets/original-vector/SVG/exported/bmp00113.svg new file mode 100644 index 00000000000..0c099510a6f --- /dev/null +++ b/assets/original-vector/SVG/exported/bmp00113.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/assets/original-vector/SVG/exported/bmp00114.svg b/assets/original-vector/SVG/exported/bmp00114.svg new file mode 100644 index 00000000000..6cd2d5fbd14 --- /dev/null +++ b/assets/original-vector/SVG/exported/bmp00114.svg @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/assets/original-vector/SVG/exported/bmp00118.svg b/assets/original-vector/SVG/exported/bmp00118.svg new file mode 100644 index 00000000000..6013d9d19cc --- /dev/null +++ b/assets/original-vector/SVG/exported/bmp00118.svg @@ -0,0 +1,82 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/assets/original-vector/SVG/exported/bmp00119.svg b/assets/original-vector/SVG/exported/bmp00119.svg new file mode 100644 index 00000000000..ace6ad9273f --- /dev/null +++ b/assets/original-vector/SVG/exported/bmp00119.svg @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/assets/original-vector/SVG/exported/bmp00120.svg b/assets/original-vector/SVG/exported/bmp00120.svg new file mode 100644 index 00000000000..9b9f61d7e31 --- /dev/null +++ b/assets/original-vector/SVG/exported/bmp00120.svg @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/assets/original-vector/SVG/exported/bmp00121.svg b/assets/original-vector/SVG/exported/bmp00121.svg new file mode 100644 index 00000000000..2eae571a0e1 --- /dev/null +++ b/assets/original-vector/SVG/exported/bmp00121.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/assets/original-vector/SVG/exported/bmp00122.svg b/assets/original-vector/SVG/exported/bmp00122.svg new file mode 100644 index 00000000000..0c273aafa96 --- /dev/null +++ b/assets/original-vector/SVG/exported/bmp00122.svg @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/assets/original-vector/SVG/exported/bmp00123.svg b/assets/original-vector/SVG/exported/bmp00123.svg new file mode 100644 index 00000000000..01687be6ab5 --- /dev/null +++ b/assets/original-vector/SVG/exported/bmp00123.svg @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/assets/original-vector/SVG/exported/bmp00124.svg b/assets/original-vector/SVG/exported/bmp00124.svg new file mode 100644 index 00000000000..f85ab4cf8d5 --- /dev/null +++ b/assets/original-vector/SVG/exported/bmp00124.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/assets/original-vector/SVG/exported/bmp00125.svg b/assets/original-vector/SVG/exported/bmp00125.svg new file mode 100644 index 00000000000..a1c9eea4a87 --- /dev/null +++ b/assets/original-vector/SVG/exported/bmp00125.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/assets/original-vector/SVG/exported/bmp00126.svg b/assets/original-vector/SVG/exported/bmp00126.svg new file mode 100644 index 00000000000..127a68d69bc --- /dev/null +++ b/assets/original-vector/SVG/exported/bmp00126.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/assets/original-vector/SVG/exported/bmp00132.svg b/assets/original-vector/SVG/exported/bmp00132.svg new file mode 100644 index 00000000000..5a57ed7fb8f --- /dev/null +++ b/assets/original-vector/SVG/exported/bmp00132.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/assets/original-vector/SVG/exported/bmp00134.svg b/assets/original-vector/SVG/exported/bmp00134.svg new file mode 100644 index 00000000000..2db9bf2eb89 --- /dev/null +++ b/assets/original-vector/SVG/exported/bmp00134.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/assets/original-vector/SVG/exported/bmp00136.svg b/assets/original-vector/SVG/exported/bmp00136.svg new file mode 100644 index 00000000000..713cab26db2 --- /dev/null +++ b/assets/original-vector/SVG/exported/bmp00136.svg @@ -0,0 +1,221 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/assets/original-vector/SVG/exported/bmp00137.svg b/assets/original-vector/SVG/exported/bmp00137.svg new file mode 100644 index 00000000000..e5ae1c219f9 --- /dev/null +++ b/assets/original-vector/SVG/exported/bmp00137.svg @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/assets/original-vector/SVG/exported/bmp00140.svg b/assets/original-vector/SVG/exported/bmp00140.svg new file mode 100644 index 00000000000..ffae76dfebd --- /dev/null +++ b/assets/original-vector/SVG/exported/bmp00140.svg @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/assets/original-vector/SVG/exported/bmp00143.svg b/assets/original-vector/SVG/exported/bmp00143.svg new file mode 100644 index 00000000000..1cca548bae5 --- /dev/null +++ b/assets/original-vector/SVG/exported/bmp00143.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/assets/original-vector/SVG/exported/bmp00144.svg b/assets/original-vector/SVG/exported/bmp00144.svg new file mode 100644 index 00000000000..5cce63c5b1d --- /dev/null +++ b/assets/original-vector/SVG/exported/bmp00144.svg @@ -0,0 +1,46 @@ + + + + bmp00144 + Created with Sketch. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/assets/original-vector/SVG/exported/bmp00145.svg b/assets/original-vector/SVG/exported/bmp00145.svg new file mode 100644 index 00000000000..87f4422c18a --- /dev/null +++ b/assets/original-vector/SVG/exported/bmp00145.svg @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/assets/original-vector/SVG/exported/bmp00146.svg b/assets/original-vector/SVG/exported/bmp00146.svg new file mode 100644 index 00000000000..a366e1a9d3b --- /dev/null +++ b/assets/original-vector/SVG/exported/bmp00146.svg @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/assets/original-vector/SVG/exported/bmp00148.svg b/assets/original-vector/SVG/exported/bmp00148.svg new file mode 100644 index 00000000000..c06e630531d --- /dev/null +++ b/assets/original-vector/SVG/exported/bmp00148.svg @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/assets/original-vector/SVG/exported/bmp00149.svg b/assets/original-vector/SVG/exported/bmp00149.svg new file mode 100644 index 00000000000..d5ab99a4a3c --- /dev/null +++ b/assets/original-vector/SVG/exported/bmp00149.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/assets/original-vector/SVG/exported/bmp00151.svg b/assets/original-vector/SVG/exported/bmp00151.svg new file mode 100644 index 00000000000..a16ed4a686e --- /dev/null +++ b/assets/original-vector/SVG/exported/bmp00151.svg @@ -0,0 +1,185 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/assets/original-vector/SVG/exported/bmp00152.svg b/assets/original-vector/SVG/exported/bmp00152.svg new file mode 100644 index 00000000000..99a6ab879e4 --- /dev/null +++ b/assets/original-vector/SVG/exported/bmp00152.svg @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/assets/original-vector/SVG/exported/bmp00153.svg b/assets/original-vector/SVG/exported/bmp00153.svg new file mode 100644 index 00000000000..b59583f47f9 --- /dev/null +++ b/assets/original-vector/SVG/exported/bmp00153.svg @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/assets/original-vector/SVG/exported/bmp00154.svg b/assets/original-vector/SVG/exported/bmp00154.svg new file mode 100644 index 00000000000..7aa15d402c2 --- /dev/null +++ b/assets/original-vector/SVG/exported/bmp00154.svg @@ -0,0 +1,222 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/assets/original-vector/SVG/exported/bmp00157.svg b/assets/original-vector/SVG/exported/bmp00157.svg new file mode 100644 index 00000000000..7572557113e --- /dev/null +++ b/assets/original-vector/SVG/exported/bmp00157.svg @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/assets/original-vector/SVG/exported/bmp00158.svg b/assets/original-vector/SVG/exported/bmp00158.svg new file mode 100644 index 00000000000..324f1811740 --- /dev/null +++ b/assets/original-vector/SVG/exported/bmp00158.svg @@ -0,0 +1,26 @@ + + + + bmp00158 + Created with Sketch. + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/assets/original-vector/SVG/exported/bmp00159.svg b/assets/original-vector/SVG/exported/bmp00159.svg new file mode 100644 index 00000000000..cc8d679f60b --- /dev/null +++ b/assets/original-vector/SVG/exported/bmp00159.svg @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/assets/original-vector/SVG/exported/bmp00160.svg b/assets/original-vector/SVG/exported/bmp00160.svg new file mode 100644 index 00000000000..59f773ffe47 --- /dev/null +++ b/assets/original-vector/SVG/exported/bmp00160.svg @@ -0,0 +1,50 @@ + + + + bmp00160 + Created with Sketch. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/assets/original-vector/SVG/exported/bmp00161.svg b/assets/original-vector/SVG/exported/bmp00161.svg new file mode 100644 index 00000000000..e0163c9d1c7 --- /dev/null +++ b/assets/original-vector/SVG/exported/bmp00161.svg @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/assets/original-vector/SVG/exported/bmp00162.svg b/assets/original-vector/SVG/exported/bmp00162.svg new file mode 100644 index 00000000000..431f1a0b501 --- /dev/null +++ b/assets/original-vector/SVG/exported/bmp00162.svg @@ -0,0 +1,24 @@ + + + + bmp00162 + Created with Sketch. + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/assets/original-vector/SVG/exported/bmp00163.svg b/assets/original-vector/SVG/exported/bmp00163.svg new file mode 100644 index 00000000000..de10cb275eb --- /dev/null +++ b/assets/original-vector/SVG/exported/bmp00163.svg @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/assets/original-vector/SVG/exported/bmp00164.svg b/assets/original-vector/SVG/exported/bmp00164.svg new file mode 100644 index 00000000000..6f143ecc334 --- /dev/null +++ b/assets/original-vector/SVG/exported/bmp00164.svg @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/assets/original-vector/SVG/exported/test/bmp00102.svg b/assets/original-vector/SVG/exported/test/bmp00102.svg new file mode 100644 index 00000000000..3ef43dbf419 --- /dev/null +++ b/assets/original-vector/SVG/exported/test/bmp00102.svg @@ -0,0 +1,466 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + bmp00102 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/original-vector/SVG/exported/test/bmp00108.svg b/assets/original-vector/SVG/exported/test/bmp00108.svg new file mode 100644 index 00000000000..ef03c74b012 --- /dev/null +++ b/assets/original-vector/SVG/exported/test/bmp00108.svg @@ -0,0 +1,398 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + bmp00108 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/original-vector/SVG/exported/test/bmp00112.svg b/assets/original-vector/SVG/exported/test/bmp00112.svg new file mode 100644 index 00000000000..08637a76983 --- /dev/null +++ b/assets/original-vector/SVG/exported/test/bmp00112.svg @@ -0,0 +1,617 @@ + + + + + bmp00112 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/original-vector/SVG/exported/test/bmp00114.svg b/assets/original-vector/SVG/exported/test/bmp00114.svg new file mode 100644 index 00000000000..9005bb8b3fb --- /dev/null +++ b/assets/original-vector/SVG/exported/test/bmp00114.svg @@ -0,0 +1,78 @@ + + + + + bmp00114 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/original-vector/SVG/exported/test/bmp00118.svg b/assets/original-vector/SVG/exported/test/bmp00118.svg new file mode 100644 index 00000000000..d27f2460722 --- /dev/null +++ b/assets/original-vector/SVG/exported/test/bmp00118.svg @@ -0,0 +1,169 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + bmp00118 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/original-vector/SVG/exported/test/bmp00119.svg b/assets/original-vector/SVG/exported/test/bmp00119.svg new file mode 100644 index 00000000000..6174e90b64f --- /dev/null +++ b/assets/original-vector/SVG/exported/test/bmp00119.svg @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + bmp00119 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/original-vector/SVG/exported/test/bmp00120.svg b/assets/original-vector/SVG/exported/test/bmp00120.svg new file mode 100644 index 00000000000..03bc2c6f137 --- /dev/null +++ b/assets/original-vector/SVG/exported/test/bmp00120.svg @@ -0,0 +1,134 @@ + + + + + bmp00120 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/original-vector/SVG/exported/test/bmp00121.svg b/assets/original-vector/SVG/exported/test/bmp00121.svg new file mode 100644 index 00000000000..bf06f19faa7 --- /dev/null +++ b/assets/original-vector/SVG/exported/test/bmp00121.svg @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + + + + + + bmp00121 + + + + + + + + + + + + + + + + + + + + diff --git a/assets/original-vector/SVG/exported/test/bmp00122.svg b/assets/original-vector/SVG/exported/test/bmp00122.svg new file mode 100644 index 00000000000..3f1a3b749e1 --- /dev/null +++ b/assets/original-vector/SVG/exported/test/bmp00122.svg @@ -0,0 +1,47 @@ + + + + + bmp00122 + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/original-vector/SVG/exported/test/bmp00123.svg b/assets/original-vector/SVG/exported/test/bmp00123.svg new file mode 100644 index 00000000000..7981a07920c --- /dev/null +++ b/assets/original-vector/SVG/exported/test/bmp00123.svg @@ -0,0 +1,116 @@ + + + + + bmp00123 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/original-vector/SVG/exported/test/bmp00132.svg b/assets/original-vector/SVG/exported/test/bmp00132.svg new file mode 100644 index 00000000000..9c39ff100ce --- /dev/null +++ b/assets/original-vector/SVG/exported/test/bmp00132.svg @@ -0,0 +1,64 @@ + + + + + bmp00132 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/original-vector/SVG/exported/test/bmp00140.svg b/assets/original-vector/SVG/exported/test/bmp00140.svg new file mode 100644 index 00000000000..9d08db86a1a --- /dev/null +++ b/assets/original-vector/SVG/exported/test/bmp00140.svg @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + bmp00140 + + + + + + + + + + + + + + + + + + diff --git a/assets/original-vector/SVG/exported/test/bmp00151.svg b/assets/original-vector/SVG/exported/test/bmp00151.svg new file mode 100644 index 00000000000..8589dfe87d0 --- /dev/null +++ b/assets/original-vector/SVG/exported/test/bmp00151.svg @@ -0,0 +1,256 @@ + + + + + bmp00151 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/original-vector/SVG/exported/test/bmp00158.svg b/assets/original-vector/SVG/exported/test/bmp00158.svg new file mode 100644 index 00000000000..6b435293d10 --- /dev/null +++ b/assets/original-vector/SVG/exported/test/bmp00158.svg @@ -0,0 +1,34 @@ + + + + + bmp00158 + + + + + + + + + + + + + + + + + diff --git a/assets/original-vector/SVG/exported/test/bmp00160.svg b/assets/original-vector/SVG/exported/test/bmp00160.svg new file mode 100644 index 00000000000..aacc4d6b02a --- /dev/null +++ b/assets/original-vector/SVG/exported/test/bmp00160.svg @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + bmp00160 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/original-vector/SVG/exported/test/bmp00162.svg b/assets/original-vector/SVG/exported/test/bmp00162.svg new file mode 100644 index 00000000000..3edd3ce03bc --- /dev/null +++ b/assets/original-vector/SVG/exported/test/bmp00162.svg @@ -0,0 +1,36 @@ + + + + + bmp00162 + + + + + + + + + + + + + + + + + + + diff --git a/assets/original-vector/SVG/master/Surge_OG.sketch b/assets/original-vector/SVG/master/Surge_OG.sketch new file mode 100644 index 00000000000..544d288dda0 Binary files /dev/null and b/assets/original-vector/SVG/master/Surge_OG.sketch differ diff --git a/libs/nanosvg b/libs/nanosvg new file mode 160000 index 00000000000..c1f6e209c16 --- /dev/null +++ b/libs/nanosvg @@ -0,0 +1 @@ +Subproject commit c1f6e209c16b18b46aa9f45d7e619acf42c29726 diff --git a/premake5.lua b/premake5.lua index 4dffacc212c..b6ddad1d22b 100644 --- a/premake5.lua +++ b/premake5.lua @@ -154,6 +154,7 @@ end includedirs { "libs/xml", + "libs/nanosvg/src", "src/common/vt_dsp", "src/common/thread", "vst3sdk/vstgui4", @@ -375,6 +376,7 @@ function plugincommon() "src/windows/scalableui.rc", "resources/bitmaps/*.png", "assets/original-vector/exported/*.png", + "assets/original-vector/SVG/exported/*.svg", VSTGUI .. "vstgui_win32.cpp", VSTGUI .. "vstgui_uidescription_win32.cpp", } diff --git a/scripts/linux/emit-vector-piggy.py b/scripts/linux/emit-vector-piggy.py index 5a5e1c620b1..a1a152c5a98 100644 --- a/scripts/linux/emit-vector-piggy.py +++ b/scripts/linux/emit-vector-piggy.py @@ -13,7 +13,7 @@ import re import sys -assets_path = "assets/original-vector/exported" +assets_path = "assets/original-vector/SVG/exported" source_file = open(sys.argv[1] + "/src/linux/ScalablePiggy.S", "w") source_file.write("""# THIS IS AN AUTOMATICALLY GENERATED FILE. DO NOT EDIT IT. @@ -23,8 +23,8 @@ .section ".rodata", "a" -memoryBitmapListStart: - .globl memoryBitmapListStart +memorySVGListStart: + .globl memorySVGListStart """) @@ -36,28 +36,28 @@ ** in scripts/linux/emit-vector-piggy.py */ -struct MemoryBitmap { +struct MemorySVG { const char *name; unsigned long size; unsigned long offset; }; -extern unsigned char memoryBitmapListStart[]; +extern unsigned char memorySVGListStart[]; -static const struct MemoryBitmap memoryBitmapList[] = { +static const struct MemorySVG memorySVGList[] = { """) offset = 0 for name in os.listdir(sys.argv[1] + "/" + assets_path): - if not re.match('bmp00(\\d+)(.*).png', name): + if not re.match('bmp00(\\d+)(.*).svg', name): continue path = os.path.join(assets_path, name) size = os.stat(sys.argv[1] + "/" + path).st_size; source_file.write(' .incbin "../../' + path + '"' + os.linesep) - header_file.write(' {"scalable/' + name + '", ' + str(size) + ', ' + + header_file.write(' {"svg/' + name + '", ' + str(size) + ', ' + str(offset) + '},' + os.linesep) offset += size diff --git a/scripts/macOS/package-au.sh b/scripts/macOS/package-au.sh index 20affeb4f70..2ee825aebac 100755 --- a/scripts/macOS/package-au.sh +++ b/scripts/macOS/package-au.sh @@ -8,9 +8,10 @@ fi # input config RES_SRC_LOCATION="resources" PACKAGE_SRC_LOCATION="$RES_SRC_LOCATION/osx-au" -BITMAP_SRC_LOCATION="$RES_SRC_LOCATION/bitmaps" + FONT_SRC_LOCATION="$RES_SRC_LOCATION/fonts" -VECTOR_BITMAP_SRC_LOCATION="assets/${SURGE_USE_VECTOR_SKIN}/exported" +SVG_SRC_LOCATION="assets/${SURGE_USE_VECTOR_SKIN}/SVG/exported" + BUNDLE_RES_SRC_LOCATION="$RES_SRC_LOCATION/osx-resources" EXEC_LOCATION="target/au/Release/Surge.dylib" #EXEC_LOCATION="target/au/Debug/Surge-Debug.dylib" @@ -40,15 +41,8 @@ cp $PACKAGE_SRC_LOCATION/* "$BUNDLE_DIR/Contents/" # copy bundle resources cp -R "$BUNDLE_RES_SRC_LOCATION" "$BUNDLE_DIR/Contents/Resources" -if [[ -z "$SURGE_USE_VECTOR_SKIN" ]]; then - cp $BITMAP_SRC_LOCATION/* "$BUNDLE_DIR/Contents/Resources/" -else - rm "$BUNDLE_DIR/Contents/Resources/bmp*.png" - cp $VECTOR_BITMAP_SRC_LOCATION/bmp?????.png "$BUNDLE_DIR/Contents/Resources/" - mkdir "$BUNDLE_DIR/Contents/Resources/scalable" - cp $VECTOR_BITMAP_SRC_LOCATION/*png "$BUNDLE_DIR/Contents/Resources/scalable" -fi - +mkdir "$BUNDLE_DIR/Contents/Resources/svg" +cp $SVG_SRC_LOCATION/*svg "$BUNDLE_DIR/Contents/Resources/svg" mkdir "$BUNDLE_DIR/Contents/Resources/fonts"; cp $FONT_SRC_LOCATION/* "$BUNDLE_DIR/Contents/Resources/fonts"; diff --git a/scripts/macOS/package-vst.sh b/scripts/macOS/package-vst.sh index 4494f2d0176..d40c0e130b8 100755 --- a/scripts/macOS/package-vst.sh +++ b/scripts/macOS/package-vst.sh @@ -8,9 +8,10 @@ fi # input config RES_SRC_LOCATION="resources" PACKAGE_SRC_LOCATION="$RES_SRC_LOCATION/osx-vst2" -BITMAP_SRC_LOCATION="$RES_SRC_LOCATION/bitmaps" -VECTOR_BITMAP_SRC_LOCATION="assets/${SURGE_USE_VECTOR_SKIN}/exported" + +SVG_SRC_LOCATION="assets/${SURGE_USE_VECTOR_SKIN}/SVG/exported" FONT_SRC_LOCATION="$RES_SRC_LOCATION/fonts" + BUNDLE_RES_SRC_LOCATION="$RES_SRC_LOCATION/osx-resources" EXEC_LOCATION="target/vst2/Release/Surge.dylib" #EXEC_LOCATION="target/vst2/Debug/Surge-Debug.dylib" @@ -40,14 +41,8 @@ cp $PACKAGE_SRC_LOCATION/* "$BUNDLE_DIR/Contents/" # copy bundle resources cp -R "$BUNDLE_RES_SRC_LOCATION" "$BUNDLE_DIR/Contents/Resources" -if [[ -z "$SURGE_USE_VECTOR_SKIN" ]]; then - cp $BITMAP_SRC_LOCATION/* "$BUNDLE_DIR/Contents/Resources/" -else - rm "$BUNDLE_DIR/Contents/Resources/bmp*.png" - cp $VECTOR_BITMAP_SRC_LOCATION/bmp?????.png "$BUNDLE_DIR/Contents/Resources/" - mkdir "$BUNDLE_DIR/Contents/Resources/scalable" - cp $VECTOR_BITMAP_SRC_LOCATION/*png "$BUNDLE_DIR/Contents/Resources/scalable" -fi +mkdir "$BUNDLE_DIR/Contents/Resources/svg" +cp $SVG_SRC_LOCATION/*svg "$BUNDLE_DIR/Contents/Resources/svg" mkdir "$BUNDLE_DIR/Contents/Resources/fonts"; cp $FONT_SRC_LOCATION/* "$BUNDLE_DIR/Contents/Resources/fonts"; diff --git a/scripts/macOS/package-vst3.sh b/scripts/macOS/package-vst3.sh index 1f0572389f1..8992af9a801 100755 --- a/scripts/macOS/package-vst3.sh +++ b/scripts/macOS/package-vst3.sh @@ -8,9 +8,10 @@ fi # input config RES_SRC_LOCATION="resources" PACKAGE_SRC_LOCATION="$RES_SRC_LOCATION/osx-vst3" -BITMAP_SRC_LOCATION="$RES_SRC_LOCATION/bitmaps" + FONT_SRC_LOCATION="$RES_SRC_LOCATION/fonts" -VECTOR_BITMAP_SRC_LOCATION="assets/${SURGE_USE_VECTOR_SKIN}/exported" +SVG_SRC_LOCATION="assets/${SURGE_USE_VECTOR_SKIN}/SVG/exported" + BUNDLE_RES_SRC_LOCATION="$RES_SRC_LOCATION/osx-resources" EXEC_LOCATION="target/vst3/Release/Surge.dylib" #EXEC_LOCATION="target/vst3/Debug/Surge-Debug.dylib" @@ -40,14 +41,8 @@ cp $PACKAGE_SRC_LOCATION/* "$BUNDLE_DIR/Contents/" # copy bundle resources cp -R "$BUNDLE_RES_SRC_LOCATION" "$BUNDLE_DIR/Contents/Resources" -if [[ -z "$SURGE_USE_VECTOR_SKIN" ]]; then - cp $BITMAP_SRC_LOCATION/* "$BUNDLE_DIR/Contents/Resources/" -else - rm "$BUNDLE_DIR/Contents/Resources/bmp*.png" - cp $VECTOR_BITMAP_SRC_LOCATION/bmp?????.png "$BUNDLE_DIR/Contents/Resources/" - mkdir "$BUNDLE_DIR/Contents/Resources/scalable" - cp $VECTOR_BITMAP_SRC_LOCATION/*png "$BUNDLE_DIR/Contents/Resources/scalable" -fi +mkdir "$BUNDLE_DIR/Contents/Resources/svg" +cp $SVG_SRC_LOCATION/*svg "$BUNDLE_DIR/Contents/Resources/svg" mkdir "$BUNDLE_DIR/Contents/Resources/fonts"; cp $FONT_SRC_LOCATION/* "$BUNDLE_DIR/Contents/Resources/fonts"; diff --git a/scripts/win/emit-vector-rc.py b/scripts/win/emit-vector-rc.py index 1c2d4996f6c..2bdfeb8e933 100644 --- a/scripts/win/emit-vector-rc.py +++ b/scripts/win/emit-vector-rc.py @@ -42,13 +42,14 @@ import os, re assetdir = "assets/original-vector/exported" +svgassetdir = "assets/original-vector/SVG/exported" IDBs=[] digitToIDB = {} IDBtoDigit = {} scaleToOffset = {} -scales = [ "100", "125", "150", "200", "300", "400" ] +scales = [ "100", "125", "150", "200", "300", "400", "SVG" ] xtnToPostfix = { "": "_SCALE_100", "@125x": "_SCALE_125", "@15x": "_SCALE_150", @@ -57,7 +58,6 @@ "@4x": "_SCALE_400" } - with open( "src\\common\\resource.h", "r" ) as r: for line in r: matches = re.match( '#define (IDB\\S+) (\\d+)', line ) @@ -65,7 +65,7 @@ IDBs.append( matches.group(1) ) digitToIDB[ matches.group( 2 ) ] = matches.group( 1 ) IDBtoDigit[ matches.group( 1 ) ] = int( matches.group( 2 ) ) - matchscale = re.match( '#define SCALABLE_(\\d+)_OFFSET\\s+(\\d+)', line ) + matchscale = re.match( '#define SCALABLE_(\\S+)_OFFSET\\s+(\\d+)', line ) if( matchscale ): scaleToOffset[ matchscale.group( 1 ) ] = int( matchscale.group( 2 ) ) @@ -131,4 +131,32 @@ subrc.write( base + ofst + " PNG \"" + assetdir + "/" + file + "\"\n" ) +# Create the SVG rc file +subrc = open( "src\\windows\\svgresources.rc", "w" ); +subrc.write( """ +/* +** THIS IS AN AUTOMATICALLY GENERATED FILE. DO NOT EDIT IT +** +** If you need to modify this file, please read the comment +** in scripts/win/emit-vector-rc.py +** +** This file imports the appropriate scaled SVG files +** for each of the identifiers in scalableresource.h. +** +** You can address these items as IDB_BG_SCALE_SVG or +** IDB_BG + SCALE_OFFSET_SVG in your non-rc code. +*/ + +""") + +lastBase = "" +for file in os.listdir( svgassetdir ): + if file.endswith(".svg"): + fn = os.path.join(svgassetdir, file ) + matches = re.match( 'bmp00(.*).svg', file ); + if( matches ): + base = digitToIDB[matches.group(1)] + subrc.write( base + "_SCALE_SVG DATA \"" + svgassetdir + "/" + file + "\"\n" ) + + diff --git a/src/common/gui/CEffectSettings.cpp b/src/common/gui/CEffectSettings.cpp index bcd319fa953..57a1e387698 100644 --- a/src/common/gui/CEffectSettings.cpp +++ b/src/common/gui/CEffectSettings.cpp @@ -42,12 +42,13 @@ int get_fxtype(int id) CEffectSettings::CEffectSettings(const CRect& size, IControlListener* listener, long tag, - int current) + int current, + std::shared_ptr bitmapStore) : CControl(size, listener, tag, 0) { this->current = current; - bg = getSurgeBitmap(IDB_FXCONF); - labels = getSurgeBitmap(IDB_FXCONF_SYMBOLS); + bg = bitmapStore->getBitmap(IDB_FXCONF); + labels = bitmapStore->getBitmap(IDB_FXCONF_SYMBOLS); disabled = 0; } diff --git a/src/common/gui/CEffectSettings.h b/src/common/gui/CEffectSettings.h index 4045a90c151..64318b508b5 100644 --- a/src/common/gui/CEffectSettings.h +++ b/src/common/gui/CEffectSettings.h @@ -3,11 +3,16 @@ //------------------------------------------------------------------------------------------------------- #pragma once #include "vstcontrols.h" +#include "SurgeBitmaps.h" class CEffectSettings : public VSTGUI::CControl { public: - CEffectSettings(const VSTGUI::CRect& size, VSTGUI::IControlListener* listener, long tag, int current); + CEffectSettings(const VSTGUI::CRect& size, + VSTGUI::IControlListener* listener, + long tag, + int current, + std::shared_ptr bitmapStore); virtual void draw(VSTGUI::CDrawContext* dc); virtual VSTGUI::CMouseEventResult onMouseDown(VSTGUI::CPoint& where, @@ -47,4 +52,4 @@ class CEffectSettings : public VSTGUI::CControl } CLASS_METHODS(CEffectSettings, VSTGUI::CControl) -}; \ No newline at end of file +}; diff --git a/src/common/gui/CModulationSourceButton.cpp b/src/common/gui/CModulationSourceButton.cpp index 391f91fcbd3..dc06c02bca1 100644 --- a/src/common/gui/CModulationSourceButton.cpp +++ b/src/common/gui/CModulationSourceButton.cpp @@ -19,8 +19,12 @@ enum //------------------------------------------------------------------------------------------------ -CModulationSourceButton::CModulationSourceButton( - const CRect& size, IControlListener* listener, long tag, int state, int msid) +CModulationSourceButton::CModulationSourceButton(const CRect& size, + IControlListener* listener, + long tag, + int state, + int msid, + std::shared_ptr bitmapStore) : CCursorHidingControl(size, listener, tag, 0), OldValue(0.f) { this->state = state; @@ -34,6 +38,7 @@ CModulationSourceButton::CModulationSourceButton( controlstate = cs_none; label[0] = 0; blink = 0; + bmp = bitmapStore->getBitmap(IDB_MODSRC_BG); } //------------------------------------------------------------------------------------------------ @@ -223,7 +228,7 @@ void CModulationSourceButton::draw(CDrawContext* dc) where.y = 8 * rh; else where.y = 7 * rh; - getSurgeBitmap(IDB_MODSRC_BG)->draw(dc, sze, where, 0xff); + bmp->draw(dc, sze, where, 0xff); } setDirty(false); diff --git a/src/common/gui/CModulationSourceButton.h b/src/common/gui/CModulationSourceButton.h index f0fb727a0f8..16bc6bcd038 100644 --- a/src/common/gui/CModulationSourceButton.h +++ b/src/common/gui/CModulationSourceButton.h @@ -3,6 +3,7 @@ //------------------------------------------------------------------------------------------------------- #pragma once #include "vstcontrols.h" +#include "SurgeBitmaps.h" class CModulationSourceButton : public CCursorHidingControl { @@ -10,8 +11,12 @@ class CModulationSourceButton : public CCursorHidingControl typedef CCursorHidingControl super; public: - CModulationSourceButton( - const VSTGUI::CRect& size, VSTGUI::IControlListener* listener, long tag, int state, int msid); + CModulationSourceButton(const VSTGUI::CRect& size, + VSTGUI::IControlListener* listener, + long tag, + int state, + int msid, + std::shared_ptr bitmapStore); ~CModulationSourceButton(); virtual void setValue(float val) @@ -35,6 +40,8 @@ class CModulationSourceButton : public CCursorHidingControl VSTGUI::CPoint SourcePoint; float OldValue; + VSTGUI::CBitmap* bmp = nullptr; + void setblink(bool state); void setlabel(const char*); void set_ismeta(bool); diff --git a/src/common/gui/CParameterTooltip.h b/src/common/gui/CParameterTooltip.h index f9d3062c6a2..80992c697ed 100644 --- a/src/common/gui/CParameterTooltip.h +++ b/src/common/gui/CParameterTooltip.h @@ -32,13 +32,13 @@ class CParameterTooltip : public VSTGUI::CControl { visible = true; invalid(); - // setDirty(); + setDirty(true); } void Hide() { visible = false; invalid(); - // setDirty(); + setDirty(true); } bool isNewTag(long tag) { @@ -72,6 +72,7 @@ class CParameterTooltip : public VSTGUI::CControl smaller.x += shrink;*/ auto size = getViewSize(); + size = size.inset(0.75, 0.75); dc->setFrameColor(VSTGUI::kBlackCColor); dc->drawRect(size); VSTGUI::CRect sizem1(size); diff --git a/src/common/gui/CScalableBitmap.cpp b/src/common/gui/CScalableBitmap.cpp index e817a46c5f6..f604393c57b 100644 --- a/src/common/gui/CScalableBitmap.cpp +++ b/src/common/gui/CScalableBitmap.cpp @@ -6,113 +6,145 @@ #include #if MAC #include +#include "vstgui/lib/platform/mac/macglobals.h" #endif #if LINUX #include "ScalablePiggy.h" #endif +#if WINDOWS +#include "vstgui/lib/platform/iplatformresourceinputstream.h" +#endif #include "resource.h" +#include +#include +#include +/* +** CScalableBitmap is the only file which uses the SVG Implementatoin so it is also the one +** and only one which ejexts the link symbols. +*/ +#define NANOSVG_IMPLEMENTATION +#include "nanosvg.h" + using namespace VSTGUI; +#if MAC +static const std::string svgFullFileNameFromBundle(const std::string& filename) +{ + CFStringRef cfStr = CFStringCreateWithCString(nullptr, filename.c_str(), kCFStringEncodingUTF8); + CFURLRef url = CFBundleCopyResourceURL(VSTGUI::getBundleRef(), cfStr, nullptr, nullptr); + CFRelease(cfStr); + if (url) + { + CFStringRef urlStr = CFURLGetString(url); + // std::cout << "URLString = " << urlStr << std::flush << std::endl; + const char* csp = CFStringGetCStringPtr(urlStr, kCFStringEncodingUTF8); + if (csp) + { + std::string resPath(CFStringGetCStringPtr(CFURLGetString(url), kCFStringEncodingUTF8)); + if (resPath.find("file://") != std::string::npos) + resPath = resPath.substr(7); + return resPath; + } + } + + return ""; +} +#endif + #if LINUX -static const struct MemoryBitmap *findMemoryBitmap(const std::string& filename) +static const struct MemorySVG* findMemorySVG(const std::string& filename) { - for (const struct MemoryBitmap *bmp = &memoryBitmapList[0]; - bmp->name != NULL; bmp++) - if (!std::strncmp(filename.c_str(), bmp->name, std::strlen(bmp->name))) - return bmp; + for (const struct MemorySVG* svg = &memorySVGList[0]; svg->name != NULL; svg++) + if (!std::strncmp(filename.c_str(), svg->name, std::strlen(svg->name))) + return svg; - throw Surge::Error(filename + " not found"); + throw Surge::Error(filename + " not found"); +} +#endif + +#if WINDOWS +static int svgContentsFromRCFile(int id, char* svgData, int maxSz) +{ + VSTGUI::IPlatformResourceInputStream::Ptr istr = + VSTGUI::IPlatformResourceInputStream::create(CResourceDescription(id)); + + if (istr == NULL) + { + return -1; + } + memset(svgData, 0, maxSz); + uint32_t readSize = istr->readRaw(svgData, maxSz); + svgData[readSize] = 0; + return readSize; } #endif // Remember this is user zoom * display zoom. See comment in CScalableBitmap.h -int CScalableBitmap::currentPhysicalZoomFactor = 100; void CScalableBitmap::setPhysicalZoomFactor(int zoomFactor) { currentPhysicalZoomFactor = zoomFactor; } -CScalableBitmap::CScalableBitmap(CResourceDescription desc) - : CBitmap(desc) +CScalableBitmap::CScalableBitmap(CResourceDescription desc, VSTGUI::CFrame* f) + : CBitmap(desc), svgImage(nullptr), frame(f) { int id = 0; if(desc.type == CResourceDescription::kIntegerType) id = (int32_t)desc.u.id; - /* - ** Scales are the percentage scale in units of percents. So 100 is 1x. - ** This integerification allows us to hash on the scale values and still support - ** things like a 1.25 bitmap set. - */ - - scales = {{ 100, /* 125, */ 150, 200, 300, 400 }}; // This is the collection of sizes we currently ask skins to export. + resourceID = id; - std::map< int, std::string > scaleFilePostfixes; - scaleFilePostfixes[ 100 ] = ""; - // scaleFilePostfixes[ 125 ] = "@125x"; - scaleFilePostfixes[ 150 ] = "@15x"; - scaleFilePostfixes[ 200 ] = "@2x"; - scaleFilePostfixes[ 300 ] = "@3x"; - scaleFilePostfixes[ 400 ] = "@4x"; + std::stringstream filename; + filename << "svg/bmp" << std::setw(5) << std::setfill('0') << id << ".svg"; -#if WINDOWS - // Only windows uses this integer indexing and knows these offsets - std::map< int, int > scaleIDOffsets; - scaleIDOffsets[ 100 ] = SCALABLE_100_OFFSET; - // scaleIDOffsets[ 125 ] = SCALABLE_125_OFFSET; - scaleIDOffsets[ 150 ] = SCALABLE_150_OFFSET; - scaleIDOffsets[ 200 ] = SCALABLE_200_OFFSET; - scaleIDOffsets[ 300 ] = SCALABLE_300_OFFSET; - scaleIDOffsets[ 400 ] = SCALABLE_400_OFFSET; +#if MAC + std::string fullFileName = svgFullFileNameFromBundle(filename.str()); + svgImage = nsvgParseFromFile(fullFileName.c_str(), "px", 96); #endif - - for(auto sc : scales) - { - CBitmap *scBmp = NULL; -#if MAC || LINUX - std::stringstream filename; - auto postfix = scaleFilePostfixes[sc]; - filename << "scalable/bmp" << std::setw(5) << std::setfill('0') << id - << scaleFilePostfixes[sc] << ".png"; -#endif +#if WINDOWS + int svgid = id + SCALABLE_SVG_OFFSET; + char* svgData = new char[1024 * 1024]; - /* - ** Macintosh addresses resources by path name; Windows addresses them by - ** .rc file ID This fundamental difference means we need to create - ** distinct names for our bitmaps. - ** - ** The mapping of filename to id + offset on windows is automatically - ** generated by the script scripts/win/emit-vector-rc.py. - */ + if (svgContentsFromRCFile(svgid, svgData, 1024 * 1024) > 0) + svgImage = nsvgParse(svgData, "px", 96); + else + svgImage = NULL; -#if MAC - scBmp = new CBitmap(CResourceDescription(filename.str().c_str())); -#elif LINUX - try { - const MemoryBitmap *memBmp = findMemoryBitmap(filename.str()); - auto platBmp = IPlatformBitmap::createFromMemory( - memoryBitmapListStart + memBmp->offset, memBmp->size); - scBmp = new CBitmap(platBmp); - } catch (Surge::Error err) { - std::cerr << err.getMessage() << std::endl; - } -#elif WINDOWS - scBmp = new CBitmap(CResourceDescription(id + scaleIDOffsets[sc])); + delete[] svgData; +#endif + +#if LINUX + try + { + const MemorySVG* memSVG = findMemorySVG(filename.str()); + char* svg = new char[memSVG->size + 1]; + svg[memSVG->size] = '\0'; + strncpy(svg, (const char*)(memorySVGListStart + memSVG->offset), memSVG->size); + svgImage = nsvgParse(svg, "px", 96); + delete svg; + } + catch (Surge::Error err) + { + std::cerr << err.getMessage() << std::endl; + } #endif - if(scBmp && scBmp->getWidth() > 0) - scaledBitmaps[sc] = scBmp; - else - scaledBitmaps[sc] = NULL; + if (!svgImage) + { + std::cout << "Unable to load SVG Image " << filename.str() << std::endl; } - lastSeenZoom = -1; // we haven't seen a zoom yet! extraScaleFactor = 100; + currentPhysicalZoomFactor = 100; } +#define DUMPR(r) \ + "(x=" << r.getTopLeft().x << ",y=" << r.getTopLeft().y << ")+(w=" << r.getWidth() \ + << ",h=" << r.getHeight() << ")" + void CScalableBitmap::draw (CDrawContext* context, const CRect& rect, const CPoint& offset, float alpha ) { /* @@ -146,80 +178,256 @@ void CScalableBitmap::draw (CDrawContext* context, const CRect& rect, const CPoi return; } - if (lastSeenZoom != currentPhysicalZoomFactor) + if (svgImage) { - int ns = -1; - for (auto s : scales) - { - if (s >= currentPhysicalZoomFactor && ns < 0) - ns = s; - } - if (ns<0) - { - ns = scales.back(); - } - bestFitScaleGroup = ns; - lastSeenZoom = currentPhysicalZoomFactor; - } + /* + ** Plan of attack here is to use coffscreencontext into a physicalzoomfactor scaled version + *of rect + ** see vstgui.surge/vstgui/lib/coffscreencontext.h for how that works. So we just need a good + *hash + ** on rect.size, off and physical zoom. + */ + if (lastSeenZoom != currentPhysicalZoomFactor) + { + for (auto const& pair : offscreenCache) + { + auto val = pair.second; + if (val) + val->forget(); + } + offscreenCache.clear(); + lastSeenZoom = currentPhysicalZoomFactor; + } + + CGraphicsTransform tf = + CGraphicsTransform().scale(lastSeenZoom / 100.0, lastSeenZoom / 100.0); + /* + ** VSTGUI has this wierdo bug where it shrinks backgrounds properly but doesn't grow them. Sigh. + ** So asymmetrically treat the extra factor here and only here. + */ + int exs = (extraScaleFactor<100?100:extraScaleFactor); + CGraphicsTransform xtf = + CGraphicsTransform().scale(exs / 100.0, exs / 100.0); + CGraphicsTransform itf = tf.inverse(); + CGraphicsTransform ixtf = xtf.inverse(); + + if (offscreenCache.find(offset) == offscreenCache.end()) + { + VSTGUI::CPoint sz = rect.getSize(); + ixtf.transform(sz); + + VSTGUI::CPoint offScreenSz = sz; + tf.transform(offScreenSz); + + if (auto offscreen = COffscreenContext::create(frame, offScreenSz.x, offScreenSz.y)) + { + offscreen->beginDraw(); + VSTGUI::CRect newRect(0, 0, rect.getWidth(), rect.getHeight()); + + CDrawContext::Transform trsf(*offscreen, tf); + CDrawContext::Transform xtrsf(*offscreen, ixtf); + + drawSVG(offscreen, newRect, offset, alpha); + + offscreen->endDraw(); + CBitmap* tmp = offscreen->getBitmap(); + if (tmp) + { + offscreenCache[offset] = tmp; + tmp->remember(); + } + } + } + + if (offscreenCache.find(offset) != offscreenCache.end()) + { + context->saveGlobalState(); + + CDrawContext::Transform trsf(*context, itf); + CDrawContext::Transform trsf2(*context, xtf); + + VSTGUI::CRect drect = rect; + tf.transform(drect); + + VSTGUI::CRect origClip; + context->getClipRect(origClip); + + VSTGUI::CRect clipR = origClip; + + /* + ** The clipR goes up to and including the edge of the size; but at very high zooms that + *shows a + ** tiny bit of the adjacent image. So make the edge of our clip just inside the size. + ** This only matters at high zoom levels + */ + clipR.bottom -= 0.01; + clipR.right -= 0.01; + context->setClipRect(clipR); - // Check if my bitmaps are there and if so use them - if (scaledBitmaps[ bestFitScaleGroup ] != NULL) - { - // Seems like you would do this backwards; but the TF shrinks and the invtf regrows for positioning - // but it is easier to calculate the grow one since it is at our scale - CGraphicsTransform invtf = CGraphicsTransform().scale( bestFitScaleGroup / 100.0, bestFitScaleGroup / 100.0 ); - CGraphicsTransform tf = invtf.inverse().scale(extraScaleFactor / 100.0, extraScaleFactor / 100.0); - - - CDrawContext::Transform tr(*context, tf); - - // Have to de-const these to do the transform alas - CRect ncrect = rect; - CRect nr = invtf.transform(ncrect); - if(extraScaleFactor<100) - { - /* - ** VSTGUI has lots of bugs. One of them is with scaling backgrounds. It never grows a background. - ** and it never shrinks a background. Hence the extraScaleFactor. But it does shrink (and only shrink) - ** the draw rectangle for the background. So when we are at scales < 1 we have over-shrunk the - ** extra scale factor. So undo that here. Obviously not great. - */ - CGraphicsTransform upExtra = CGraphicsTransform().scale( 100.0/extraScaleFactor,100.0/extraScaleFactor); - nr = upExtra.transform(nr); - } - - - CPoint ncoff = offset; - CPoint no = invtf.transform(ncoff); - #if LINUX - /* - ** There's a bug in VSTGUI where images drawn with an alpha other than 1.0 - ** clip other images. The original fix - turn all 255 into 1.0 - is how we got - ** linux working but in modulation mode Surge draws some elements - slider backgrounds - ** especialy - with alpha 0x7f. - ** - ** The correct fix is to figure out what's wrong with cairo_paint_with_alpha inside - ** the alpha != 1.f at line 407 of vstgui.surge/vstgui/lib/platform/linux/cairocontext.cpp - ** but an expedient approach is to just disable transparency on bitmaps on linux - ** for now so at least elements don't dissapear. - */ - alpha = 1.0f; + alpha = 1.0; #endif + offscreenCache[offset]->draw(context, drect, CPoint(0, 0), alpha); + context->setClipRect(origClip); - scaledBitmaps[ bestFitScaleGroup ]->draw(context, nr, no, alpha); - } - else - { - /* - ** We have not found an asset at this scale, so we will draw the base class - ** asset (which as configured is the original set of PNGs). There are a few - ** cases mostly involving zoom before vector asset implementation in vst2 - ** where you are in this situation but still need to apply an additional - ** zoom to handle background scaling - */ - CGraphicsTransform tf = CGraphicsTransform().scale(extraScaleFactor / 100.0, extraScaleFactor / 100.0); - CDrawContext::Transform tr(*context, tf); - CBitmap::draw(context, rect, offset, alpha); + context->restoreGlobalState(); + return; + } } + + /* SVG File is missing */ + context->setFillColor(VSTGUI::kBlueCColor); + context->drawRect(rect, VSTGUI::kDrawFilled); + context->setFrameColor(VSTGUI::kRedCColor); + context->drawRect(rect, VSTGUI::kDrawStroked); + return; +} + +void CScalableBitmap::drawSVG(CDrawContext* dc, + const CRect& rect, + const CPoint& offset, + float alpha) +{ + VSTGUI::CRect viewS = rect; + + VSTGUI::CDrawMode origMode = dc->getDrawMode(); + VSTGUI::CDrawMode newMode(VSTGUI::kAntiAliasing); + dc->setDrawMode(newMode); + + VSTGUI::CRect origClip; + dc->getClipRect(origClip); + VSTGUI::CRect clipR = viewS; + /* + ** The clipR goes up to and including the edge of the size; but at very high zooms that shows a + ** tiny bit of the adjacent image. So make the edge of our clip just inside the size. + ** This only matters at high zoom levels + */ + clipR.bottom -= 0.01; + clipR.right -= 0.01; + dc->setClipRect(clipR); + + /* + ** Our overall transform moves us to the x/y position of our view rects top left point and shifts + *us by + ** our offset. Don't forgert the extra zoom also! + */ + + VSTGUI::CGraphicsTransform tf = + VSTGUI::CGraphicsTransform() + .translate(viewS.getTopLeft().x - offset.x, viewS.getTopLeft().y - offset.y) + .scale(extraScaleFactor / 100.0, extraScaleFactor / 100.0); + VSTGUI::CDrawContext::Transform t(*dc, tf); + + for (auto shape = svgImage->shapes; shape != NULL; shape = shape->next) + { + if (!(shape->flags & NSVG_FLAGS_VISIBLE)) + continue; + + /* + ** We don't need to even bother drawing shapes outside of clip + */ + CRect shapeBounds(shape->bounds[0], shape->bounds[1], shape->bounds[2], shape->bounds[3]); + tf.transform(shapeBounds); + if (!shapeBounds.rectOverlap(clipR)) + continue; + + /* + ** Build a path for this shape out of each subordinate path as a + ** graphics subpath + */ + VSTGUI::CGraphicsPath* gp = dc->createGraphicsPath(); + for (auto path = shape->paths; path != NULL; path = path->next) + { + for (auto i = 0; i < path->npts - 1; i += 3) + { + float* p = &path->pts[i * 2]; + + if (i == 0) + gp->beginSubpath(p[0], p[1]); + gp->addBezierCurve(p[2], p[3], p[4], p[5], p[6], p[7]); + } + if (path->closed) + gp->closeSubpath(); + } + + /* + ** Fill with constant or gradient + */ + if (shape->fill.type != NSVG_PAINT_NONE) + { + if (shape->fill.type == NSVG_PAINT_COLOR) + { + dc->setFillColor(svgColorToCColor(shape->fill.color, shape->opacity)); + + VSTGUI::CDrawContext::PathDrawMode pdm = VSTGUI::CDrawContext::kPathFilled; + if (shape->fillRule == NSVGfillRule::NSVG_FILLRULE_EVENODD) + { + pdm = VSTGUI::CDrawContext::kPathFilledEvenOdd; + } + dc->drawGraphicsPath(gp, pdm); + } + else if (shape->fill.type == NSVG_PAINT_LINEAR_GRADIENT) + { + bool evenOdd = (shape->fillRule == NSVGfillRule::NSVG_FILLRULE_EVENODD); + NSVGgradient* ngrad = shape->fill.gradient; + + float* x = ngrad->xform; + VSTGUI::CGraphicsTransform gradXform(x[0], x[1], x[2], x[3], x[4], x[5]); + VSTGUI::CGradient::ColorStopMap csm; + VSTGUI::CGradient* cg = VSTGUI::CGradient::create(csm); + + for (int i = 0; i < ngrad->nstops; ++i) + { + auto stop = ngrad->stops[i]; + cg->addColorStop(stop.offset, svgColorToCColor(stop.color)); + } + VSTGUI::CPoint s0(0, 0), s1(0, 1); + VSTGUI::CPoint p0 = gradXform.inverse().transform(s0); + VSTGUI::CPoint p1 = gradXform.inverse().transform(s1); + + dc->fillLinearGradient(gp, *cg, p0, p1, evenOdd); + } + else + { + std::cerr << "No radial gradient support yet" << std::endl; + dc->setFillColor(VSTGUI::kRedCColor); + dc->drawGraphicsPath(gp, VSTGUI::CDrawContext::kPathFilled); + } + } + + /* + ** And then the stroke + */ + if (shape->stroke.type != NSVG_PAINT_NONE) + { + if (shape->stroke.type == NSVG_PAINT_COLOR) + { + dc->setFrameColor(svgColorToCColor(shape->stroke.color)); + } + else + { + std::cerr << "No gradient support yet for stroke" << std::endl; + dc->setFrameColor(VSTGUI::kRedCColor); + } + + dc->setLineWidth(shape->strokeWidth); + VSTGUI::CLineStyle cs((VSTGUI::CLineStyle::LineCap)(shape->strokeLineCap), + (VSTGUI::CLineStyle::LineJoin)(shape->strokeLineJoin)); + dc->setLineStyle(cs); + dc->drawGraphicsPath(gp, VSTGUI::CDrawContext::kPathStroked); + } + gp->forget(); + } + + dc->resetClipRect(); + dc->setDrawMode(origMode); +} + +VSTGUI::CColor CScalableBitmap::svgColorToCColor(int svgColor, float opacity) +{ + int a = ((svgColor & 0xFF000000) >> 24) * opacity; + int b = (svgColor & 0x00FF0000) >> 16; + int g = (svgColor & 0x0000FF00) >> 8; + int r = (svgColor & 0x000000FF); + return VSTGUI::CColor(r, g, b, a); } diff --git a/src/common/gui/CScalableBitmap.h b/src/common/gui/CScalableBitmap.h index 9a2097909b5..f9d4d11e1f3 100644 --- a/src/common/gui/CScalableBitmap.h +++ b/src/common/gui/CScalableBitmap.h @@ -1,3 +1,5 @@ +#pragma once + /* ** CScalableBitmap is an implmentation of VSGTUI::CBitmap which can ** load bitmaps at multiple resolutions and draw them scaled accordingly @@ -8,39 +10,68 @@ #include #include +#include "nanosvg.h" + class CScalableBitmap : public VSTGUI::CBitmap { public: - CScalableBitmap(VSTGUI::CResourceDescription d); - - virtual void draw (VSTGUI::CDrawContext* context, const VSTGUI::CRect& rect, const VSTGUI::CPoint& offset, float alpha); - - /* - ** The 'zoom factor' is set statically across all bitmaps since it is a - ** function of the current editor which contains them. - ** - ** If in the future we have a non 1:1 editor -> instance relationship we - ** may need to reconsider the management of this factor. - ** - ** This zoom factor is the product of the logical (user) zoom factor - ** and any zoom the display may apply, which is checked in SurgeGUIEditor::getDisplayBackingScale - ** and applied *before* this call. See SurgeGUIEditor::setZoomFactor. - */ - static void setPhysicalZoomFactor (int zoomFactor); // See comment on zoom factor units in SurgeGUIEditor.h - - /* - ** VST2 has an error where the background doesn't zoom with the frame. Everything else - ** does though. So we need to hand scale the background and only the background image - ** when we draw it. We do that, simply, by having this class have an extra scale factor - ** which we apply to the BG Bitmap in Vst2PluginInstance::handleZoom. - */ - void setExtraScaleFactor (int a) { extraScaleFactor = a; } + CScalableBitmap(VSTGUI::CResourceDescription d, VSTGUI::CFrame* f); + + virtual void draw(VSTGUI::CDrawContext* context, + const VSTGUI::CRect& rect, + const VSTGUI::CPoint& offset, + float alpha); + + /* + ** The 'zoom factor' is set statically across all bitmaps since it is a + ** function of the current editor which contains them. + ** + ** If in the future we have a non 1:1 editor -> instance relationship we + ** may need to reconsider the management of this factor. + ** + ** This zoom factor is the product of the logical (user) zoom factor + ** and any zoom the display may apply, which is checked in SurgeGUIEditor::getDisplayBackingScale + ** and applied *before* this call. See SurgeGUIEditor::setZoomFactor. + */ + void + setPhysicalZoomFactor(int zoomFactor); // See comment on zoom factor units in SurgeGUIEditor.h + + /* + ** VST2 has an error where the background doesn't zoom with the frame. Everything else + ** does though. So we need to hand scale the background and only the background image + ** when we draw it. We do that, simply, by having this class have an extra scale factor + ** which we apply to the BG Bitmap in Vst2PluginInstance::handleZoom. + */ + void setExtraScaleFactor(int a) + { + extraScaleFactor = a; + } private: - std::vector< int > scales; // 100, 150, 200, 300 etc... - int percentages - std::map< int, VSTGUI::CBitmap * > scaledBitmaps; - int lastSeenZoom, bestFitScaleGroup; - int extraScaleFactor; + struct CPointCompare + { + bool operator()(const VSTGUI::CPoint& k1, const VSTGUI::CPoint& k2) const + { + if (k1.x == k2.x) + return k1.y < k2.y; + return k1.x < k2.x; + } + }; + + std::map offscreenCache; + + int lastSeenZoom, bestFitScaleGroup; + int extraScaleFactor; + int resourceID; + + VSTGUI::CFrame* frame; + + NSVGimage* svgImage; + void drawSVG(VSTGUI::CDrawContext* context, + const VSTGUI::CRect& rect, + const VSTGUI::CPoint& offset, + float alpha); + VSTGUI::CColor svgColorToCColor(int svgColor, float opacity = 1.0); - static int currentPhysicalZoomFactor; + int currentPhysicalZoomFactor; }; diff --git a/src/common/gui/CSnapshotMenu.cpp b/src/common/gui/CSnapshotMenu.cpp index dc1bc266017..895614c8b6f 100644 --- a/src/common/gui/CSnapshotMenu.cpp +++ b/src/common/gui/CSnapshotMenu.cpp @@ -174,11 +174,13 @@ COscMenu::COscMenu(const CRect& size, IControlListener* listener, long tag, SurgeStorage* storage, - OscillatorStorage* osc) + OscillatorStorage* osc, + std::shared_ptr bitmapStore) : CSnapshotMenu(size, listener, tag, storage) { strcpy(mtype, "osc"); this->osc = osc; + bmp = bitmapStore->getBitmap(IDB_OSCMENU); populate(); } @@ -187,7 +189,8 @@ void COscMenu::draw(CDrawContext* dc) CRect size = getViewSize(); int i = osc->type.val.i; int y = i * size.getHeight(); - getSurgeBitmap(IDB_OSCMENU)->draw(dc, size, CPoint(0, y), 0xff); + if (bmp) + bmp->draw(dc, size, CPoint(0, y), 0xff); setDirty(false); } diff --git a/src/common/gui/CSnapshotMenu.h b/src/common/gui/CSnapshotMenu.h index f8e7f2e1beb..53ee46f0ed3 100644 --- a/src/common/gui/CSnapshotMenu.h +++ b/src/common/gui/CSnapshotMenu.h @@ -5,6 +5,7 @@ #include "vstcontrols.h" #include "SurgeStorage.h" #include "PopupEditorSpawner.h" +#include "SurgeBitmaps.h" class CSnapshotMenu : public VSTGUI::COptionMenu { @@ -31,12 +32,14 @@ class COscMenu : public CSnapshotMenu VSTGUI::IControlListener* listener, long tag, SurgeStorage* storage, - OscillatorStorage* osc); + OscillatorStorage* osc, + std::shared_ptr); virtual void draw(VSTGUI::CDrawContext* dc); virtual void loadSnapshot(int type, TiXmlElement* e); protected: OscillatorStorage* osc = nullptr; + VSTGUI::CBitmap* bmp = nullptr; CLASS_METHODS(COscMenu, VSTGUI::CControl) }; diff --git a/src/common/gui/CSurgeSlider.cpp b/src/common/gui/CSurgeSlider.cpp index 37ed65e55b2..4b740d5d92c 100644 --- a/src/common/gui/CSurgeSlider.cpp +++ b/src/common/gui/CSurgeSlider.cpp @@ -20,8 +20,12 @@ enum CSurgeSlider::MoveRateState CSurgeSlider::sliderMoveRateState = kUnInitialized; -CSurgeSlider::CSurgeSlider( - const CPoint& loc, long stylee, IControlListener* listener, long tag, bool is_mod) +CSurgeSlider::CSurgeSlider(const CPoint& loc, + long stylee, + IControlListener* listener, + long tag, + bool is_mod, + std::shared_ptr bitmapStore) : CCursorHidingControl(CRect(loc, CPoint(1, 1)), listener, tag, 0) { this->style = stylee; @@ -55,8 +59,8 @@ CSurgeSlider::CSurgeSlider( if (style & CSlider::kHorizontal) { - pTray = getSurgeBitmap(IDB_FADERH_BG); - pHandle = getSurgeBitmap(IDB_FADERH_HANDLE); + pTray = bitmapStore->getBitmap(IDB_FADERH_BG); + pHandle = bitmapStore->getBitmap(IDB_FADERH_HANDLE); if (style & kWhite) typehy = 1; @@ -72,8 +76,8 @@ CSurgeSlider::CSurgeSlider( if (!(style & CSlider::kTop)) style |= CSlider::kBottom; // CSlider::kBottom by default - pTray = getSurgeBitmap(IDB_FADERV_BG); - pHandle = getSurgeBitmap(IDB_FADERV_HANDLE); + pTray = bitmapStore->getBitmap(IDB_FADERV_BG); + pHandle = bitmapStore->getBitmap(IDB_FADERV_HANDLE); if (style & kWhite) typehy = 0; diff --git a/src/common/gui/CSurgeSlider.h b/src/common/gui/CSurgeSlider.h index a069c1f90ab..c3d307947c9 100644 --- a/src/common/gui/CSurgeSlider.h +++ b/src/common/gui/CSurgeSlider.h @@ -3,7 +3,9 @@ //------------------------------------------------------------------------------------------------------- #pragma once #include "vstcontrols.h" +#include "SurgeBitmaps.h" +// FIXME: This enum being here and being included in SurgePatch means SurgePatch pulls in vstgui enum CControlEnum_turbodeluxe { kBipolar = 1 << 15, @@ -21,9 +23,10 @@ class CSurgeSlider : public CCursorHidingControl public: CSurgeSlider(const VSTGUI::CPoint& loc, long style, - VSTGUI::IControlListener* listener = 0, - long tag = 0, - bool is_mod = false); + VSTGUI::IControlListener* listener, + long tag, + bool is_mod, + std::shared_ptr bitmapStore); ~CSurgeSlider(); virtual void draw(VSTGUI::CDrawContext*); // virtual void mouse (VSTGUI::CDrawContext *pContext, VSTGUI::CPoint &where, long buttons = -1); diff --git a/src/common/gui/SurgeBitmaps.cpp b/src/common/gui/SurgeBitmaps.cpp index 5297350b13e..45ac74df719 100644 --- a/src/common/gui/SurgeBitmaps.cpp +++ b/src/common/gui/SurgeBitmaps.cpp @@ -1,111 +1,86 @@ #include "SurgeBitmaps.h" #include "UserInteractions.h" -#include #include "CScalableBitmap.h" +#include using namespace VSTGUI; -std::map bitmap_registry; - -static std::atomic_int refCount(0); - SurgeBitmaps::SurgeBitmaps() { - if (refCount == 0) - { - addEntry(IDB_BG); - addEntry(IDB_BUTTON_ABOUT); - addEntry(IDB_ABOUT); - addEntry(IDB_FILTERBUTTONS); - addEntry(IDB_OSCSWITCH); - addEntry(IDB_FILTERSUBTYPE); - addEntry(IDB_RELATIVE_TOGGLE); - addEntry(IDB_OSCSELECT); - addEntry(IDB_FBCONFIG); - addEntry(IDB_SCENESWITCH); - addEntry(IDB_SCENEMODE); - addEntry(IDB_OCTAVES); - addEntry(IDB_WAVESHAPER); - addEntry(IDB_POLYMODE); - addEntry(IDB_SWITCH_RETRIGGER); - addEntry(IDB_SWITCH_KTRK); - addEntry(IDB_SWITCH_MUTE); - addEntry(IDB_SWITCH_SOLO); - addEntry(IDB_FMCONFIG); - addEntry(IDB_SWITCH_LINK); - addEntry(IDB_OSCROUTE); - addEntry(IDB_ENVSHAPE); - addEntry(IDB_FXBYPASS); - addEntry(IDB_LFOTRIGGER); - addEntry(IDB_BUTTON_CHECK); - addEntry(IDB_BUTTON_MINUSPLUS); - addEntry(IDB_UNIPOLAR); - addEntry(IDB_CHARACTER); - addEntry(IDB_BUTTON_STORE); - addEntry(IDB_MODSRC_BG); - addEntry(IDB_FXCONF); - addEntry(IDB_FXCONF_SYMBOLS); - addEntry(IDB_OSCMENU); - addEntry(IDB_FADERH_BG); - addEntry(IDB_FADERV_BG); - addEntry(IDB_FADERH_HANDLE); - addEntry(IDB_FADERV_HANDLE); - addEntry(IDB_ENVMODE); - addEntry(IDB_STOREPATCH); - addEntry(IDB_BUTTON_MENU); - } - refCount++; + std::cout << "Constructing a registry" << std::endl; } SurgeBitmaps::~SurgeBitmaps() { - refCount--; - - if (refCount == 0) + std::cout << "Destroying a registry" << std::endl; + for (auto pair : bitmap_registry) { - std::map::iterator iter; - - for (iter = bitmap_registry.begin(); iter != bitmap_registry.end(); ++iter) - { - iter->second->forget(); - } - bitmap_registry.clear(); + pair.second->forget(); } + bitmap_registry.clear(); +} + +void SurgeBitmaps::setupBitmapsForFrame(VSTGUI::CFrame* f) +{ + addEntry(IDB_BG, f); + addEntry(IDB_BUTTON_ABOUT, f); + addEntry(IDB_ABOUT, f); + addEntry(IDB_FILTERBUTTONS, f); + addEntry(IDB_OSCSWITCH, f); + addEntry(IDB_FILTERSUBTYPE, f); + addEntry(IDB_RELATIVE_TOGGLE, f); + addEntry(IDB_OSCSELECT, f); + addEntry(IDB_FBCONFIG, f); + addEntry(IDB_SCENESWITCH, f); + addEntry(IDB_SCENEMODE, f); + addEntry(IDB_OCTAVES, f); + addEntry(IDB_WAVESHAPER, f); + addEntry(IDB_POLYMODE, f); + addEntry(IDB_SWITCH_RETRIGGER, f); + addEntry(IDB_SWITCH_KTRK, f); + addEntry(IDB_SWITCH_MUTE, f); + addEntry(IDB_SWITCH_SOLO, f); + addEntry(IDB_FMCONFIG, f); + addEntry(IDB_SWITCH_LINK, f); + addEntry(IDB_OSCROUTE, f); + addEntry(IDB_ENVSHAPE, f); + addEntry(IDB_FXBYPASS, f); + addEntry(IDB_LFOTRIGGER, f); + addEntry(IDB_BUTTON_CHECK, f); + addEntry(IDB_BUTTON_MINUSPLUS, f); + addEntry(IDB_UNIPOLAR, f); + addEntry(IDB_CHARACTER, f); + addEntry(IDB_BUTTON_STORE, f); + addEntry(IDB_MODSRC_BG, f); + addEntry(IDB_FXCONF, f); + addEntry(IDB_FXCONF_SYMBOLS, f); + addEntry(IDB_OSCMENU, f); + addEntry(IDB_FADERH_BG, f); + addEntry(IDB_FADERV_BG, f); + addEntry(IDB_FADERH_HANDLE, f); + addEntry(IDB_FADERV_HANDLE, f); + addEntry(IDB_ENVMODE, f); + addEntry(IDB_STOREPATCH, f); + addEntry(IDB_BUTTON_MENU, f); } -void SurgeBitmaps::addEntry(int id) +void SurgeBitmaps::addEntry(int id, VSTGUI::CFrame* f) { assert(bitmap_registry.find(id) == bitmap_registry.end()); - VSTGUI::CBitmap *bitmap = new CScalableBitmap(CResourceDescription(id)); + CScalableBitmap* bitmap = new CScalableBitmap(VSTGUI::CResourceDescription(id), f); bitmap_registry[id] = bitmap; } -VSTGUI::CBitmap* getSurgeBitmap(int id, bool newInstance) +CScalableBitmap* SurgeBitmaps::getBitmap(int id) { - if( newInstance ) - { - /* - ** Background images are specially handled by the frame object with scaling and so each needs - ** to maintain an independent 'additional zoom'. For now handle that by allowing the construction of - ** a distinct bitmap. - ** - ** When the arity issues with scalable bitmaps get solved (github issue #356) this code will - ** not be needed any more. Until then it is, but just for the BG image. - */ - if( id != IDB_BG ) - { - // This should never happen. - Surge::UserInteractions::promptError(std::string() + - "You requested a new Instance bitmap with for something other than the BG. Why?", - "Software Error" ); - } - return new CScalableBitmap(CResourceDescription(id)); - } - else - { - return bitmap_registry.at(id); - } + return bitmap_registry.at(id); +} + +void SurgeBitmaps::setPhysicalZoomFactor(int pzf) +{ + for (auto pair : bitmap_registry) + pair.second->setPhysicalZoomFactor(pzf); } diff --git a/src/common/gui/SurgeBitmaps.h b/src/common/gui/SurgeBitmaps.h index 0199ebf07c5..7ead7fca4c3 100644 --- a/src/common/gui/SurgeBitmaps.h +++ b/src/common/gui/SurgeBitmaps.h @@ -2,6 +2,8 @@ #include "resource.h" #include +#include +#include "CScalableBitmap.h" class SurgeBitmaps { @@ -9,17 +11,12 @@ class SurgeBitmaps SurgeBitmaps(); virtual ~SurgeBitmaps(); + void setupBitmapsForFrame(VSTGUI::CFrame* f); + void setPhysicalZoomFactor(int pzf); + + CScalableBitmap* getBitmap(int id); + protected: - void addEntry(int id); + void addEntry(int id, VSTGUI::CFrame* f); + std::map bitmap_registry; }; - -/** - * get the loaded SurgeBitmap by ID. - * - * @param id is the id enumerated in resource.h - * @param newInstance returns a distinct instance of the bitmap - * class rather than a shared one, which allows us to overcome a problem - * with background image scaling in vstgui. In current implementation - * it will result in an error if used with any id other than ID_BG - */ -VSTGUI::CBitmap* getSurgeBitmap(int id, bool newInstance = false); diff --git a/src/common/gui/SurgeGUIEditor.cpp b/src/common/gui/SurgeGUIEditor.cpp index 120e3f89b38..35facd50363 100644 --- a/src/common/gui/SurgeGUIEditor.cpp +++ b/src/common/gui/SurgeGUIEditor.cpp @@ -586,7 +586,7 @@ void SurgeGUIEditor::openOrRecreateEditor() CRect rect(0, 0, 75, 13); rect.offset(104 - 36, 69); CControl* oscswitch = new CHSwitch2(rect, this, tag_osc_select, 3, 13, 1, 3, - getSurgeBitmap(IDB_OSCSELECT), nopoint); + bitmapStore->getBitmap(IDB_OSCSELECT), nopoint); oscswitch->setValue((float)current_osc / 2.0f); frame->addView(oscswitch); } @@ -594,7 +594,7 @@ void SurgeGUIEditor::openOrRecreateEditor() { CRect rect(0, 0, 119, 51); rect.offset(764 + 3, 71); - CEffectSettings* fc = new CEffectSettings(rect, this, tag_fx_select, current_fx); + CEffectSettings* fc = new CEffectSettings(rect, this, tag_fx_select, current_fx, bitmapStore); ccfxconf = fc; for (int i = 0; i < 8; i++) { @@ -617,7 +617,8 @@ void SurgeGUIEditor::openOrRecreateEditor() if (ms == modsource_editor) state |= 4; - gui_modsrc[ms] = new CModulationSourceButton(r, this, tag_mod_source0 + ms, state, ms); + gui_modsrc[ms] = + new CModulationSourceButton(r, this, tag_mod_source0 + ms, state, ms, bitmapStore); ((CModulationSourceButton*)gui_modsrc[ms]) ->update_rt_vals(false, 0, synth->isModsourceUsed(ms)); if ((ms >= ms_ctrl1) && (ms <= ms_ctrl8)) @@ -710,17 +711,18 @@ void SurgeGUIEditor::openOrRecreateEditor() CHSwitch2* mp_cat = new CHSwitch2(CRect(157, 41, 157 + 37, 41 + 12), this, tag_mp_category, 2, 12, 1, 2, - getSurgeBitmap(IDB_BUTTON_MINUSPLUS), nopoint, false); + bitmapStore->getBitmap(IDB_BUTTON_MINUSPLUS), nopoint, false); mp_cat->setUsesMouseWheel(false); // mousewheel on category and patch buttons is undesirable frame->addView(mp_cat); - CHSwitch2* mp_patch = new CHSwitch2(CRect(242, 41, 242 + 37, 41 + 12), this, tag_mp_patch, 2, 12, - 1, 2, getSurgeBitmap(IDB_BUTTON_MINUSPLUS), nopoint, false); + CHSwitch2* mp_patch = + new CHSwitch2(CRect(242, 41, 242 + 37, 41 + 12), this, tag_mp_patch, 2, 12, 1, 2, + bitmapStore->getBitmap(IDB_BUTTON_MINUSPLUS), nopoint, false); mp_patch->setUsesMouseWheel(false);// mousewheel on category and patch buttons is undesirable frame->addView(mp_patch); CHSwitch2* b_store = new CHSwitch2(CRect(591 - 37, 41, 591, 41 + 12), this, tag_store, 1, 12, 1, - 1, getSurgeBitmap(IDB_BUTTON_STORE), nopoint, false); + 1, bitmapStore->getBitmap(IDB_BUTTON_STORE), nopoint, false); frame->addView(b_store); memset(param, 0, 1024 * sizeof(void*)); // see the correct size in SurgeGUIEditor.h @@ -757,7 +759,7 @@ void SurgeGUIEditor::openOrRecreateEditor() CRect rect(0, 0, 129, 18); rect.offset(p->posx - 2, p->posy + 1); CControl* hsw = new CHSwitch2(rect, this, p->id + start_paramtags, 10, 18, 1, 10, - getSurgeBitmap(IDB_FILTERBUTTONS), nopoint, true); + bitmapStore->getBitmap(IDB_FILTERBUTTONS), nopoint, true); rect(3, 0, 124, 14); rect.offset(p->posx, p->posy); hsw->setMouseableArea(rect); @@ -771,7 +773,7 @@ void SurgeGUIEditor::openOrRecreateEditor() CRect rect(0, 0, 12, 18); rect.offset(p->posx + 129, p->posy + 1); CControl* hsw = new CSwitchControl(rect, this, p->id + start_paramtags, - getSurgeBitmap(IDB_FILTERSUBTYPE)); + bitmapStore->getBitmap(IDB_FILTERSUBTYPE)); rect(1, 1, 9, 14); ((CSwitchControl*)hsw)->is_itype = true; ((CSwitchControl*)hsw)->imax = 3; @@ -803,7 +805,7 @@ void SurgeGUIEditor::openOrRecreateEditor() CRect rect(0, 0, 43, 7); rect.offset(p->posx, p->posy); CControl* hsw = new CSwitchControl(rect, this, p->id + start_paramtags, - getSurgeBitmap(IDB_SWITCH_KTRK)); + bitmapStore->getBitmap(IDB_SWITCH_KTRK)); hsw->setValue(p->get_value_f01()); frame->addView(hsw); nonmod_param[i] = hsw; @@ -814,7 +816,7 @@ void SurgeGUIEditor::openOrRecreateEditor() CRect rect(0, 0, 43, 7); rect.offset(p->posx, p->posy); CControl* hsw = new CSwitchControl(rect, this, p->id + start_paramtags, - getSurgeBitmap(IDB_SWITCH_RETRIGGER)); + bitmapStore->getBitmap(IDB_SWITCH_RETRIGGER)); hsw->setValue(p->get_value_f01()); frame->addView(hsw); nonmod_param[i] = hsw; @@ -825,7 +827,7 @@ void SurgeGUIEditor::openOrRecreateEditor() CRect rect(0, 0, 22, 15); rect.offset(p->posx, p->posy); CControl* hsw = new CHSwitch2(rect, this, p->id + start_paramtags, 3, 15, 1, 3, - getSurgeBitmap(IDB_OSCROUTE), nopoint, true); + bitmapStore->getBitmap(IDB_OSCROUTE), nopoint, true); hsw->setValue(p->get_value_f01()); frame->addView(hsw); nonmod_param[i] = hsw; @@ -843,7 +845,7 @@ void SurgeGUIEditor::openOrRecreateEditor() CRect rect(0, 0, 20, 14); rect.offset(p->posx, p->posy); CHSwitch2* hsw = new CHSwitch2(rect, this, p->id + start_paramtags, 3, 14, 1, 3, - getSurgeBitmap(IDB_ENVSHAPE), nopoint, true); + bitmapStore->getBitmap(IDB_ENVSHAPE), nopoint, true); hsw->setValue(p->get_value_f01()); if (p->name[0] == 'd') hsw->imgoffset = 3; @@ -860,7 +862,7 @@ void SurgeGUIEditor::openOrRecreateEditor() CRect rect(0, 0, 34, 15); rect.offset(p->posx, p->posy); CHSwitch2* hsw = new CHSwitch2(rect, this, p->id + start_paramtags, 2, 15, 2, 1, - getSurgeBitmap(IDB_ENVMODE), nopoint, false); + bitmapStore->getBitmap(IDB_ENVMODE), nopoint, false); hsw->setValue(p->get_value_f01()); frame->addView(hsw); @@ -872,7 +874,7 @@ void SurgeGUIEditor::openOrRecreateEditor() CRect rect(0, 0, 51, 39); rect.offset(p->posx, p->posy); CControl* hsw = new CHSwitch2(rect, this, p->id + start_paramtags, 3, 39, 3, 1, - getSurgeBitmap(IDB_LFOTRIGGER), nopoint, true); + bitmapStore->getBitmap(IDB_LFOTRIGGER), nopoint, true); hsw->setValue(p->get_value_f01()); frame->addView(hsw); nonmod_param[i] = hsw; @@ -883,7 +885,7 @@ void SurgeGUIEditor::openOrRecreateEditor() CRect rect(0, 0, 22, 15); rect.offset(p->posx, p->posy); CControl* hsw = new CSwitchControl(rect, this, p->id + start_paramtags, - getSurgeBitmap(IDB_SWITCH_MUTE)); + bitmapStore->getBitmap(IDB_SWITCH_MUTE)); hsw->setValue(p->get_value_f01()); frame->addView(hsw); nonmod_param[i] = hsw; @@ -894,7 +896,7 @@ void SurgeGUIEditor::openOrRecreateEditor() CRect rect(0, 0, 22, 15); rect.offset(p->posx, p->posy); CControl* hsw = new CSwitchControl(rect, this, p->id + start_paramtags, - getSurgeBitmap(IDB_SWITCH_SOLO)); + bitmapStore->getBitmap(IDB_SWITCH_SOLO)); hsw->setValue(p->get_value_f01()); frame->addView(hsw); nonmod_param[i] = hsw; @@ -905,7 +907,7 @@ void SurgeGUIEditor::openOrRecreateEditor() CRect rect(0, 0, 51, 15); rect.offset(p->posx, p->posy); CControl* hsw = new CSwitchControl(rect, this, p->id + start_paramtags, - getSurgeBitmap(IDB_UNIPOLAR)); + bitmapStore->getBitmap(IDB_UNIPOLAR)); hsw->setValue(p->get_value_f01()); frame->addView(hsw); nonmod_param[i] = hsw; @@ -916,7 +918,7 @@ void SurgeGUIEditor::openOrRecreateEditor() CRect rect(0, 0, 12, 18); rect.offset(p->posx + 129, p->posy + 5); CControl* hsw = new CSwitchControl(rect, this, p->id + start_paramtags, - getSurgeBitmap(IDB_RELATIVE_TOGGLE)); + bitmapStore->getBitmap(IDB_RELATIVE_TOGGLE)); rect(1, 1, 9, 14); rect.offset(p->posx + 129, p->posy + 5); hsw->setMouseableArea(rect); @@ -929,7 +931,7 @@ void SurgeGUIEditor::openOrRecreateEditor() CRect rect(0, 0, 12, 18); rect.offset(p->posx + 129, p->posy + 5); CControl* hsw = new CSwitchControl(rect, this, p->id + start_paramtags, - getSurgeBitmap(IDB_SWITCH_LINK)); + bitmapStore->getBitmap(IDB_SWITCH_LINK)); rect(1, 1, 9, 14); rect.offset(p->posx + 129, p->posy + 5); hsw->setMouseableArea(rect); @@ -941,9 +943,9 @@ void SurgeGUIEditor::openOrRecreateEditor() { CRect rect(0, 0, 41, 18); rect.offset(p->posx + 96, p->posy + 1); - CControl* hsw = - new COscMenu(rect, this, tag_osc_menu, &synth->storage, - &synth->storage.getPatch().scene[current_scene].osc[current_osc]); + CControl* hsw = new COscMenu( + rect, this, tag_osc_menu, &synth->storage, + &synth->storage.getPatch().scene[current_scene].osc[current_osc], bitmapStore); hsw->setValue(p->get_value_f01()); frame->addView(hsw); } @@ -966,7 +968,7 @@ void SurgeGUIEditor::openOrRecreateEditor() CRect rect(0, 0, 28, 47); rect.offset(p->posx, p->posy); CControl* hsw = new CHSwitch2(rect, this, p->id + start_paramtags, 6, 47, 6, 1, - getSurgeBitmap(IDB_WAVESHAPER), nopoint, true); + bitmapStore->getBitmap(IDB_WAVESHAPER), nopoint, true); rect(0, 0, 28, 47); rect.offset(p->posx, p->posy); hsw->setMouseableArea(rect); @@ -980,7 +982,7 @@ void SurgeGUIEditor::openOrRecreateEditor() CRect rect(0, 0, 50, 47); rect.offset(p->posx, p->posy); CControl* hsw = new CHSwitch2(rect, this, p->id + start_paramtags, 6, 47, 6, 1, - getSurgeBitmap(IDB_POLYMODE), nopoint, true); + bitmapStore->getBitmap(IDB_POLYMODE), nopoint, true); rect(0, 0, 50, 47); rect.offset(p->posx, p->posy); hsw->setMouseableArea(rect); @@ -994,7 +996,7 @@ void SurgeGUIEditor::openOrRecreateEditor() CRect rect(0, 0, 135, 27); rect.offset(p->posx, p->posy); CControl* hsw = new CHSwitch2(rect, this, p->id + start_paramtags, 4, 27, 1, 4, - getSurgeBitmap(IDB_FXBYPASS), nopoint, true); + bitmapStore->getBitmap(IDB_FXBYPASS), nopoint, true); fxbypass_tag = p->id + start_paramtags; rect(2, 2, 133, 25); rect.offset(p->posx, p->posy); @@ -1009,7 +1011,7 @@ void SurgeGUIEditor::openOrRecreateEditor() CRect rect(0, 0, 96, 18); rect.offset(p->posx, p->posy + 1); CControl* hsw = new CHSwitch2(rect, this, p->id + start_paramtags, 7, 18, 1, 7, - getSurgeBitmap(IDB_OCTAVES), nopoint, true); + bitmapStore->getBitmap(IDB_OCTAVES), nopoint, true); rect(1, 0, 91, 14); rect.offset(p->posx, p->posy); hsw->setMouseableArea(rect); @@ -1023,7 +1025,7 @@ void SurgeGUIEditor::openOrRecreateEditor() CRect rect(0, 0, 134, 52); rect.offset(p->posx, p->posy); CControl* hsw = new CHSwitch2(rect, this, p->id + start_paramtags, 8, 52, 1, 8, - getSurgeBitmap(IDB_FBCONFIG), nopoint, true); + bitmapStore->getBitmap(IDB_FBCONFIG), nopoint, true); hsw->setValue(p->get_value_f01()); frame->addView(hsw); nonmod_param[i] = hsw; @@ -1035,7 +1037,7 @@ void SurgeGUIEditor::openOrRecreateEditor() CRect rect(0, 0, 134, 52); rect.offset(p->posx, p->posy); CControl* hsw = new CHSwitch2(rect, this, p->id + start_paramtags, 4, 52, 1, 4, - getSurgeBitmap(IDB_FMCONFIG), nopoint, true); + bitmapStore->getBitmap(IDB_FMCONFIG), nopoint, true); hsw->setValue(p->get_value_f01()); frame->addView(hsw); nonmod_param[i] = hsw; @@ -1046,7 +1048,7 @@ void SurgeGUIEditor::openOrRecreateEditor() CRect rect(0, 0, 36, 27); rect.offset(p->posx, p->posy); CControl* hsw = new CHSwitch2(rect, this, p->id + start_paramtags, 3, 27, 3, 1, - getSurgeBitmap(IDB_SCENEMODE), nopoint, true); + bitmapStore->getBitmap(IDB_SCENEMODE), nopoint, true); rect(1, 1, 35, 27); rect.offset(p->posx, p->posy); hsw->setMouseableArea(rect); @@ -1077,7 +1079,7 @@ void SurgeGUIEditor::openOrRecreateEditor() CRect rect(0, 0, 51, 27); rect.offset(p->posx, p->posy); CControl* sceneswitch = new CHSwitch2(rect, this, tag_scene_select, 2, 27, 1, 2, - getSurgeBitmap(IDB_SCENESWITCH), nopoint); + bitmapStore->getBitmap(IDB_SCENESWITCH), nopoint); sceneswitch->setValue(p->get_value_f01()); rect(1, 1, 50, 26); rect.offset(p->posx, p->posy); @@ -1090,7 +1092,7 @@ void SurgeGUIEditor::openOrRecreateEditor() CRect rect(0, 0, 135, 12); rect.offset(p->posx, p->posy); CControl* hsw = new CHSwitch2(rect, this, p->id + start_paramtags, 3, 12, 1, 3, - getSurgeBitmap(IDB_CHARACTER), nopoint, true); + bitmapStore->getBitmap(IDB_CHARACTER), nopoint, true); hsw->setValue(p->get_value_f01()); frame->addView(hsw); nonmod_param[i] = hsw; @@ -1136,8 +1138,9 @@ void SurgeGUIEditor::openOrRecreateEditor() { if (synth->isValidModulation(p->id, modsource)) { - CSurgeSlider* hs = new CSurgeSlider(CPoint(p->posx, p->posy + p->posy_offset * yofs), - style, this, p->id + start_paramtags, true); + CSurgeSlider* hs = + new CSurgeSlider(CPoint(p->posx, p->posy + p->posy_offset * yofs), style, this, + p->id + start_paramtags, true, bitmapStore); hs->setModMode(mod_editor ? 1 : 0); hs->setModValue(synth->getModulation(p->id, modsource)); hs->setModPresent(synth->isModDestUsed(p->id)); @@ -1150,8 +1153,9 @@ void SurgeGUIEditor::openOrRecreateEditor() } else { - CSurgeSlider* hs = new CSurgeSlider(CPoint(p->posx, p->posy + p->posy_offset * yofs), - style, this, p->id + start_paramtags); + CSurgeSlider* hs = + new CSurgeSlider(CPoint(p->posx, p->posy + p->posy_offset * yofs), style, this, + p->id + start_paramtags, false, bitmapStore); hs->setValue(p->get_value_f01()); hs->setDefaultValue(p->get_default_value_f01()); hs->setLabel(p->get_name()); @@ -1208,20 +1212,22 @@ void SurgeGUIEditor::openOrRecreateEditor() CRect aboutbrect(892 - 37, 526, 892, 526 + 12); - CHSwitch2* b_settingsMenu = new CHSwitch2(aboutbrect, this, tag_settingsmenu, 1, 27, 1, 1, - getSurgeBitmap(IDB_BUTTON_MENU), nopoint, false); + CHSwitch2* b_settingsMenu = + new CHSwitch2(aboutbrect, this, tag_settingsmenu, 1, 27, 1, 1, + bitmapStore->getBitmap(IDB_BUTTON_MENU), nopoint, false); frame->addView(b_settingsMenu); infowindow = new CParameterTooltip(CRect(0, 0, 0, 0)); frame->addView(infowindow); CRect wsize(0, 0, WINDOW_SIZE_X, WINDOW_SIZE_Y); - aboutbox = new CAboutBox(aboutbrect, this, 0, 0, wsize, nopoint, getSurgeBitmap(IDB_ABOUT)); + aboutbox = + new CAboutBox(aboutbrect, this, 0, 0, wsize, nopoint, bitmapStore->getBitmap(IDB_ABOUT)); frame->addView(aboutbox); CRect dialogSize(148, 8, 598, 8 + 182); saveDialog = new CViewContainer(dialogSize); - saveDialog->setBackground(getSurgeBitmap(IDB_STOREPATCH)); + saveDialog->setBackground(bitmapStore->getBitmap(IDB_STOREPATCH)); saveDialog->setVisible(false); frame->addView(saveDialog); @@ -1311,6 +1317,9 @@ bool PLUGIN_API SurgeGUIEditor::open(void* parent, const PlatformType& platformT CRect wsize(0, 0, WINDOW_SIZE_X, WINDOW_SIZE_Y); frame = new CFrame(wsize, this); + bitmapStore.reset(new SurgeBitmaps()); + bitmapStore->setupBitmapsForFrame(frame); + /* ** vstgui contains an error where setting the scale on the ** frame does not set the scale on the frames getBacground @@ -1324,8 +1333,8 @@ bool PLUGIN_API SurgeGUIEditor::open(void* parent, const PlatformType& platformT #if TARGET_VST2 myOwnBg = true; #endif - - frame->setBackground(getSurgeBitmap(IDB_BG, myOwnBg)); + + frame->setBackground(bitmapStore->getBitmap(IDB_BG)); frame->open(parent, platformType); /*#if TARGET_AUDIOUNIT synth = (sub3_synth*)_effect; @@ -2548,8 +2557,8 @@ void SurgeGUIEditor::setZoomFactor(int zf) float dbs = Surge::GUI::getDisplayBackingScaleFactor(getFrame()); int fullPhysicalZoomFactor = (int)(zf * dbs); - CScalableBitmap::setPhysicalZoomFactor(fullPhysicalZoomFactor); - + if (bitmapStore != nullptr) + bitmapStore->setPhysicalZoomFactor(fullPhysicalZoomFactor); } void SurgeGUIEditor::showSettingsMenu(CRect &menuRect) diff --git a/src/common/gui/SurgeGUIEditor.h b/src/common/gui/SurgeGUIEditor.h index 3035d176ac7..e73db7f06f4 100644 --- a/src/common/gui/SurgeGUIEditor.h +++ b/src/common/gui/SurgeGUIEditor.h @@ -154,7 +154,7 @@ class SurgeGUIEditor : public EditorType, public VSTGUI::IControlListener, publi bool zoomInvalid; int minimumZoom; - SurgeBitmaps bitmap_keeper; + std::shared_ptr bitmapStore = nullptr; VSTGUI::CControl* vu[16]; VSTGUI::CControl *infowindow, *patchname, *ccfxconf = nullptr; diff --git a/src/common/resource.h b/src/common/resource.h index ba8d70ccc96..11bf4816581 100644 --- a/src/common/resource.h +++ b/src/common/resource.h @@ -88,6 +88,7 @@ #define SCALABLE_200_OFFSET 73000 #define SCALABLE_300_OFFSET 74000 #define SCALABLE_400_OFFSET 75000 +#define SCALABLE_SVG_OFFSET 80000 #include "scalableresource.h" // found in src/windows diff --git a/src/linux/DisplayInfoLinux.cpp b/src/linux/DisplayInfoLinux.cpp index a0402c97683..b4f044289d2 100644 --- a/src/linux/DisplayInfoLinux.cpp +++ b/src/linux/DisplayInfoLinux.cpp @@ -14,7 +14,6 @@ using namespace VSTGUI; float getDisplayBackingScaleFactor(CFrame *) { - std::cerr << "BackingDisplayFactor is not implemented on linux. Returning 1.0" << std::endl; return 1.0; } diff --git a/src/windows/scalableresource.h b/src/windows/scalableresource.h index a4cce192b68..93240a07019 100644 --- a/src/windows/scalableresource.h +++ b/src/windows/scalableresource.h @@ -19,373 +19,420 @@ #define IDB_BG_SCALE_125 71102 #define IDB_BG_SCALE_150 72102 #define IDB_BG_SCALE_200 73102 -#define IDB_BG_SCALE_300 74102 -#define IDB_BG_SCALE_400 75102 +#define IDB_BG_SCALE_300 74102 +#define IDB_BG_SCALE_400 75102 +#define IDB_BG_SCALE_SVG 80102 // Offset IDB_FADERV_BG by SCALABLE_100_OFFSET value and so on #define IDB_FADERV_BG_SCALE_100 70105 #define IDB_FADERV_BG_SCALE_125 71105 #define IDB_FADERV_BG_SCALE_150 72105 #define IDB_FADERV_BG_SCALE_200 73105 -#define IDB_FADERV_BG_SCALE_300 74105 -#define IDB_FADERV_BG_SCALE_400 75105 +#define IDB_FADERV_BG_SCALE_300 74105 +#define IDB_FADERV_BG_SCALE_400 75105 +#define IDB_FADERV_BG_SCALE_SVG 80105 // Offset IDB_FILTERBUTTONS by SCALABLE_100_OFFSET value and so on #define IDB_FILTERBUTTONS_SCALE_100 70108 #define IDB_FILTERBUTTONS_SCALE_125 71108 #define IDB_FILTERBUTTONS_SCALE_150 72108 #define IDB_FILTERBUTTONS_SCALE_200 73108 -#define IDB_FILTERBUTTONS_SCALE_300 74108 -#define IDB_FILTERBUTTONS_SCALE_400 75108 +#define IDB_FILTERBUTTONS_SCALE_300 74108 +#define IDB_FILTERBUTTONS_SCALE_400 75108 +#define IDB_FILTERBUTTONS_SCALE_SVG 80108 // Offset IDB_OSCSWITCH by SCALABLE_100_OFFSET value and so on #define IDB_OSCSWITCH_SCALE_100 70110 #define IDB_OSCSWITCH_SCALE_125 71110 #define IDB_OSCSWITCH_SCALE_150 72110 #define IDB_OSCSWITCH_SCALE_200 73110 -#define IDB_OSCSWITCH_SCALE_300 74110 -#define IDB_OSCSWITCH_SCALE_400 75110 +#define IDB_OSCSWITCH_SCALE_300 74110 +#define IDB_OSCSWITCH_SCALE_400 75110 +#define IDB_OSCSWITCH_SCALE_SVG 80110 // Offset IDB_FBCONFIG by SCALABLE_100_OFFSET value and so on #define IDB_FBCONFIG_SCALE_100 70112 #define IDB_FBCONFIG_SCALE_125 71112 #define IDB_FBCONFIG_SCALE_150 72112 #define IDB_FBCONFIG_SCALE_200 73112 -#define IDB_FBCONFIG_SCALE_300 74112 -#define IDB_FBCONFIG_SCALE_400 75112 +#define IDB_FBCONFIG_SCALE_300 74112 +#define IDB_FBCONFIG_SCALE_400 75112 +#define IDB_FBCONFIG_SCALE_SVG 80112 // Offset IDB_SCENESWITCH by SCALABLE_100_OFFSET value and so on #define IDB_SCENESWITCH_SCALE_100 70113 #define IDB_SCENESWITCH_SCALE_125 71113 #define IDB_SCENESWITCH_SCALE_150 72113 #define IDB_SCENESWITCH_SCALE_200 73113 -#define IDB_SCENESWITCH_SCALE_300 74113 -#define IDB_SCENESWITCH_SCALE_400 75113 +#define IDB_SCENESWITCH_SCALE_300 74113 +#define IDB_SCENESWITCH_SCALE_400 75113 +#define IDB_SCENESWITCH_SCALE_SVG 80113 // Offset IDB_SCENEMODE by SCALABLE_100_OFFSET value and so on #define IDB_SCENEMODE_SCALE_100 70114 #define IDB_SCENEMODE_SCALE_125 71114 #define IDB_SCENEMODE_SCALE_150 72114 #define IDB_SCENEMODE_SCALE_200 73114 -#define IDB_SCENEMODE_SCALE_300 74114 -#define IDB_SCENEMODE_SCALE_400 75114 +#define IDB_SCENEMODE_SCALE_300 74114 +#define IDB_SCENEMODE_SCALE_400 75114 +#define IDB_SCENEMODE_SCALE_SVG 80114 // Offset IDB_OCTAVES by SCALABLE_100_OFFSET value and so on #define IDB_OCTAVES_SCALE_100 70118 #define IDB_OCTAVES_SCALE_125 71118 #define IDB_OCTAVES_SCALE_150 72118 #define IDB_OCTAVES_SCALE_200 73118 -#define IDB_OCTAVES_SCALE_300 74118 -#define IDB_OCTAVES_SCALE_400 75118 +#define IDB_OCTAVES_SCALE_300 74118 +#define IDB_OCTAVES_SCALE_400 75118 +#define IDB_OCTAVES_SCALE_SVG 80118 // Offset IDB_OSCMENU by SCALABLE_100_OFFSET value and so on #define IDB_OSCMENU_SCALE_100 70119 #define IDB_OSCMENU_SCALE_125 71119 #define IDB_OSCMENU_SCALE_150 72119 #define IDB_OSCMENU_SCALE_200 73119 -#define IDB_OSCMENU_SCALE_300 74119 -#define IDB_OSCMENU_SCALE_400 75119 +#define IDB_OSCMENU_SCALE_300 74119 +#define IDB_OSCMENU_SCALE_400 75119 +#define IDB_OSCMENU_SCALE_SVG 80119 // Offset IDB_WAVESHAPER by SCALABLE_100_OFFSET value and so on #define IDB_WAVESHAPER_SCALE_100 70120 #define IDB_WAVESHAPER_SCALE_125 71120 #define IDB_WAVESHAPER_SCALE_150 72120 #define IDB_WAVESHAPER_SCALE_200 73120 -#define IDB_WAVESHAPER_SCALE_300 74120 -#define IDB_WAVESHAPER_SCALE_400 75120 +#define IDB_WAVESHAPER_SCALE_300 74120 +#define IDB_WAVESHAPER_SCALE_400 75120 +#define IDB_WAVESHAPER_SCALE_SVG 80120 // Offset IDB_RELATIVE_TOGGLE by SCALABLE_100_OFFSET value and so on #define IDB_RELATIVE_TOGGLE_SCALE_100 70121 #define IDB_RELATIVE_TOGGLE_SCALE_125 71121 #define IDB_RELATIVE_TOGGLE_SCALE_150 72121 #define IDB_RELATIVE_TOGGLE_SCALE_200 73121 -#define IDB_RELATIVE_TOGGLE_SCALE_300 74121 -#define IDB_RELATIVE_TOGGLE_SCALE_400 75121 +#define IDB_RELATIVE_TOGGLE_SCALE_300 74121 +#define IDB_RELATIVE_TOGGLE_SCALE_400 75121 +#define IDB_RELATIVE_TOGGLE_SCALE_SVG 80121 // Offset IDB_OSCSELECT by SCALABLE_100_OFFSET value and so on #define IDB_OSCSELECT_SCALE_100 70122 #define IDB_OSCSELECT_SCALE_125 71122 #define IDB_OSCSELECT_SCALE_150 72122 #define IDB_OSCSELECT_SCALE_200 73122 -#define IDB_OSCSELECT_SCALE_300 74122 -#define IDB_OSCSELECT_SCALE_400 75122 +#define IDB_OSCSELECT_SCALE_300 74122 +#define IDB_OSCSELECT_SCALE_400 75122 +#define IDB_OSCSELECT_SCALE_SVG 80122 // Offset IDB_POLYMODE by SCALABLE_100_OFFSET value and so on #define IDB_POLYMODE_SCALE_100 70123 #define IDB_POLYMODE_SCALE_125 71123 #define IDB_POLYMODE_SCALE_150 72123 #define IDB_POLYMODE_SCALE_200 73123 -#define IDB_POLYMODE_SCALE_300 74123 -#define IDB_POLYMODE_SCALE_400 75123 +#define IDB_POLYMODE_SCALE_300 74123 +#define IDB_POLYMODE_SCALE_400 75123 +#define IDB_POLYMODE_SCALE_SVG 80123 // Offset IDB_MODSRC_BG by SCALABLE_100_OFFSET value and so on #define IDB_MODSRC_BG_SCALE_100 70124 #define IDB_MODSRC_BG_SCALE_125 71124 #define IDB_MODSRC_BG_SCALE_150 72124 #define IDB_MODSRC_BG_SCALE_200 73124 -#define IDB_MODSRC_BG_SCALE_300 74124 -#define IDB_MODSRC_BG_SCALE_400 75124 +#define IDB_MODSRC_BG_SCALE_300 74124 +#define IDB_MODSRC_BG_SCALE_400 75124 +#define IDB_MODSRC_BG_SCALE_SVG 80124 // Offset IDB_SWITCH_KTRK by SCALABLE_100_OFFSET value and so on #define IDB_SWITCH_KTRK_SCALE_100 70125 #define IDB_SWITCH_KTRK_SCALE_125 71125 #define IDB_SWITCH_KTRK_SCALE_150 72125 #define IDB_SWITCH_KTRK_SCALE_200 73125 -#define IDB_SWITCH_KTRK_SCALE_300 74125 -#define IDB_SWITCH_KTRK_SCALE_400 75125 +#define IDB_SWITCH_KTRK_SCALE_300 74125 +#define IDB_SWITCH_KTRK_SCALE_400 75125 +#define IDB_SWITCH_KTRK_SCALE_SVG 80125 // Offset IDB_SWITCH_RETRIGGER by SCALABLE_100_OFFSET value and so on #define IDB_SWITCH_RETRIGGER_SCALE_100 70126 #define IDB_SWITCH_RETRIGGER_SCALE_125 71126 #define IDB_SWITCH_RETRIGGER_SCALE_150 72126 #define IDB_SWITCH_RETRIGGER_SCALE_200 73126 -#define IDB_SWITCH_RETRIGGER_SCALE_300 74126 -#define IDB_SWITCH_RETRIGGER_SCALE_400 75126 +#define IDB_SWITCH_RETRIGGER_SCALE_300 74126 +#define IDB_SWITCH_RETRIGGER_SCALE_400 75126 +#define IDB_SWITCH_RETRIGGER_SCALE_SVG 80126 // Offset IDB_NUMBERS by SCALABLE_100_OFFSET value and so on #define IDB_NUMBERS_SCALE_100 70127 #define IDB_NUMBERS_SCALE_125 71127 #define IDB_NUMBERS_SCALE_150 72127 #define IDB_NUMBERS_SCALE_200 73127 -#define IDB_NUMBERS_SCALE_300 74127 -#define IDB_NUMBERS_SCALE_400 75127 +#define IDB_NUMBERS_SCALE_300 74127 +#define IDB_NUMBERS_SCALE_400 75127 +#define IDB_NUMBERS_SCALE_SVG 80127 // Offset IDB_MODSRC_SYMBOL by SCALABLE_100_OFFSET value and so on #define IDB_MODSRC_SYMBOL_SCALE_100 70128 #define IDB_MODSRC_SYMBOL_SCALE_125 71128 #define IDB_MODSRC_SYMBOL_SCALE_150 72128 #define IDB_MODSRC_SYMBOL_SCALE_200 73128 -#define IDB_MODSRC_SYMBOL_SCALE_300 74128 -#define IDB_MODSRC_SYMBOL_SCALE_400 75128 +#define IDB_MODSRC_SYMBOL_SCALE_300 74128 +#define IDB_MODSRC_SYMBOL_SCALE_400 75128 +#define IDB_MODSRC_SYMBOL_SCALE_SVG 80128 // Offset IDB_FADERH_LABELS by SCALABLE_100_OFFSET value and so on #define IDB_FADERH_LABELS_SCALE_100 70131 #define IDB_FADERH_LABELS_SCALE_125 71131 #define IDB_FADERH_LABELS_SCALE_150 72131 #define IDB_FADERH_LABELS_SCALE_200 73131 -#define IDB_FADERH_LABELS_SCALE_300 74131 -#define IDB_FADERH_LABELS_SCALE_400 75131 +#define IDB_FADERH_LABELS_SCALE_300 74131 +#define IDB_FADERH_LABELS_SCALE_400 75131 +#define IDB_FADERH_LABELS_SCALE_SVG 80131 // Offset IDB_SWITCH_SOLO by SCALABLE_100_OFFSET value and so on #define IDB_SWITCH_SOLO_SCALE_100 70132 #define IDB_SWITCH_SOLO_SCALE_125 71132 #define IDB_SWITCH_SOLO_SCALE_150 72132 #define IDB_SWITCH_SOLO_SCALE_200 73132 -#define IDB_SWITCH_SOLO_SCALE_300 74132 -#define IDB_SWITCH_SOLO_SCALE_400 75132 +#define IDB_SWITCH_SOLO_SCALE_300 74132 +#define IDB_SWITCH_SOLO_SCALE_400 75132 +#define IDB_SWITCH_SOLO_SCALE_SVG 80132 // Offset IDB_SWITCH_FM by SCALABLE_100_OFFSET value and so on #define IDB_SWITCH_FM_SCALE_100 70133 #define IDB_SWITCH_FM_SCALE_125 71133 #define IDB_SWITCH_FM_SCALE_150 72133 #define IDB_SWITCH_FM_SCALE_200 73133 -#define IDB_SWITCH_FM_SCALE_300 74133 -#define IDB_SWITCH_FM_SCALE_400 75133 +#define IDB_SWITCH_FM_SCALE_300 74133 +#define IDB_SWITCH_FM_SCALE_400 75133 +#define IDB_SWITCH_FM_SCALE_SVG 80133 // Offset IDB_SWITCH_MUTE by SCALABLE_100_OFFSET value and so on #define IDB_SWITCH_MUTE_SCALE_100 70134 #define IDB_SWITCH_MUTE_SCALE_125 71134 #define IDB_SWITCH_MUTE_SCALE_150 72134 #define IDB_SWITCH_MUTE_SCALE_200 73134 -#define IDB_SWITCH_MUTE_SCALE_300 74134 -#define IDB_SWITCH_MUTE_SCALE_400 75134 +#define IDB_SWITCH_MUTE_SCALE_300 74134 +#define IDB_SWITCH_MUTE_SCALE_400 75134 +#define IDB_SWITCH_MUTE_SCALE_SVG 80134 // Offset IDB_CONF by SCALABLE_100_OFFSET value and so on #define IDB_CONF_SCALE_100 70135 #define IDB_CONF_SCALE_125 71135 #define IDB_CONF_SCALE_150 72135 #define IDB_CONF_SCALE_200 73135 -#define IDB_CONF_SCALE_300 74135 -#define IDB_CONF_SCALE_400 75135 +#define IDB_CONF_SCALE_300 74135 +#define IDB_CONF_SCALE_400 75135 +#define IDB_CONF_SCALE_SVG 80135 // Offset IDB_FXCONF_SYMBOLS by SCALABLE_100_OFFSET value and so on #define IDB_FXCONF_SYMBOLS_SCALE_100 70136 #define IDB_FXCONF_SYMBOLS_SCALE_125 71136 #define IDB_FXCONF_SYMBOLS_SCALE_150 72136 #define IDB_FXCONF_SYMBOLS_SCALE_200 73136 -#define IDB_FXCONF_SYMBOLS_SCALE_300 74136 -#define IDB_FXCONF_SYMBOLS_SCALE_400 75136 +#define IDB_FXCONF_SYMBOLS_SCALE_300 74136 +#define IDB_FXCONF_SYMBOLS_SCALE_400 75136 +#define IDB_FXCONF_SYMBOLS_SCALE_SVG 80136 // Offset IDB_FXCONF by SCALABLE_100_OFFSET value and so on #define IDB_FXCONF_SCALE_100 70137 #define IDB_FXCONF_SCALE_125 71137 #define IDB_FXCONF_SCALE_150 72137 #define IDB_FXCONF_SCALE_200 73137 -#define IDB_FXCONF_SCALE_300 74137 -#define IDB_FXCONF_SCALE_400 75137 +#define IDB_FXCONF_SCALE_300 74137 +#define IDB_FXCONF_SCALE_400 75137 +#define IDB_FXCONF_SCALE_SVG 80137 // Offset IDB_SWITCH_TEMPOSYNC by SCALABLE_100_OFFSET value and so on #define IDB_SWITCH_TEMPOSYNC_SCALE_100 70140 #define IDB_SWITCH_TEMPOSYNC_SCALE_125 71140 #define IDB_SWITCH_TEMPOSYNC_SCALE_150 72140 #define IDB_SWITCH_TEMPOSYNC_SCALE_200 73140 -#define IDB_SWITCH_TEMPOSYNC_SCALE_300 74140 -#define IDB_SWITCH_TEMPOSYNC_SCALE_400 75140 +#define IDB_SWITCH_TEMPOSYNC_SCALE_300 74140 +#define IDB_SWITCH_TEMPOSYNC_SCALE_400 75140 +#define IDB_SWITCH_TEMPOSYNC_SCALE_SVG 80140 // Offset IDB_SWITCH_LINK by SCALABLE_100_OFFSET value and so on #define IDB_SWITCH_LINK_SCALE_100 70140 #define IDB_SWITCH_LINK_SCALE_125 71140 #define IDB_SWITCH_LINK_SCALE_150 72140 #define IDB_SWITCH_LINK_SCALE_200 73140 -#define IDB_SWITCH_LINK_SCALE_300 74140 -#define IDB_SWITCH_LINK_SCALE_400 75140 +#define IDB_SWITCH_LINK_SCALE_300 74140 +#define IDB_SWITCH_LINK_SCALE_400 75140 +#define IDB_SWITCH_LINK_SCALE_SVG 80140 // Offset IDB_VFADER_MINI_BG_BLACK by SCALABLE_100_OFFSET value and so on #define IDB_VFADER_MINI_BG_BLACK_SCALE_100 70141 #define IDB_VFADER_MINI_BG_BLACK_SCALE_125 71141 #define IDB_VFADER_MINI_BG_BLACK_SCALE_150 72141 #define IDB_VFADER_MINI_BG_BLACK_SCALE_200 73141 -#define IDB_VFADER_MINI_BG_BLACK_SCALE_300 74141 -#define IDB_VFADER_MINI_BG_BLACK_SCALE_400 75141 +#define IDB_VFADER_MINI_BG_BLACK_SCALE_300 74141 +#define IDB_VFADER_MINI_BG_BLACK_SCALE_400 75141 +#define IDB_VFADER_MINI_BG_BLACK_SCALE_SVG 80141 // Offset IDB_OSCROUTE by SCALABLE_100_OFFSET value and so on #define IDB_OSCROUTE_SCALE_100 70143 #define IDB_OSCROUTE_SCALE_125 71143 #define IDB_OSCROUTE_SCALE_150 72143 #define IDB_OSCROUTE_SCALE_200 73143 -#define IDB_OSCROUTE_SCALE_300 74143 -#define IDB_OSCROUTE_SCALE_400 75143 +#define IDB_OSCROUTE_SCALE_300 74143 +#define IDB_OSCROUTE_SCALE_400 75143 +#define IDB_OSCROUTE_SCALE_SVG 80143 // Offset IDB_FXBYPASS by SCALABLE_100_OFFSET value and so on #define IDB_FXBYPASS_SCALE_100 70144 #define IDB_FXBYPASS_SCALE_125 71144 #define IDB_FXBYPASS_SCALE_150 72144 #define IDB_FXBYPASS_SCALE_200 73144 -#define IDB_FXBYPASS_SCALE_300 74144 -#define IDB_FXBYPASS_SCALE_400 75144 +#define IDB_FXBYPASS_SCALE_300 74144 +#define IDB_FXBYPASS_SCALE_400 75144 +#define IDB_FXBYPASS_SCALE_SVG 80144 // Offset IDB_ENVSHAPE by SCALABLE_100_OFFSET value and so on #define IDB_ENVSHAPE_SCALE_100 70145 #define IDB_ENVSHAPE_SCALE_125 71145 #define IDB_ENVSHAPE_SCALE_150 72145 #define IDB_ENVSHAPE_SCALE_200 73145 -#define IDB_ENVSHAPE_SCALE_300 74145 -#define IDB_ENVSHAPE_SCALE_400 75145 +#define IDB_ENVSHAPE_SCALE_300 74145 +#define IDB_ENVSHAPE_SCALE_400 75145 +#define IDB_ENVSHAPE_SCALE_SVG 80145 // Offset IDB_LFOTRIGGER by SCALABLE_100_OFFSET value and so on #define IDB_LFOTRIGGER_SCALE_100 70146 #define IDB_LFOTRIGGER_SCALE_125 71146 #define IDB_LFOTRIGGER_SCALE_150 72146 #define IDB_LFOTRIGGER_SCALE_200 73146 -#define IDB_LFOTRIGGER_SCALE_300 74146 -#define IDB_LFOTRIGGER_SCALE_400 75146 +#define IDB_LFOTRIGGER_SCALE_300 74146 +#define IDB_LFOTRIGGER_SCALE_400 75146 +#define IDB_LFOTRIGGER_SCALE_SVG 80146 // Offset IDB_BUTTON_STORE by SCALABLE_100_OFFSET value and so on #define IDB_BUTTON_STORE_SCALE_100 70148 #define IDB_BUTTON_STORE_SCALE_125 71148 #define IDB_BUTTON_STORE_SCALE_150 72148 #define IDB_BUTTON_STORE_SCALE_200 73148 -#define IDB_BUTTON_STORE_SCALE_300 74148 -#define IDB_BUTTON_STORE_SCALE_400 75148 +#define IDB_BUTTON_STORE_SCALE_300 74148 +#define IDB_BUTTON_STORE_SCALE_400 75148 +#define IDB_BUTTON_STORE_SCALE_SVG 80148 // Offset IDB_BUTTON_MINUSPLUS by SCALABLE_100_OFFSET value and so on #define IDB_BUTTON_MINUSPLUS_SCALE_100 70149 #define IDB_BUTTON_MINUSPLUS_SCALE_125 71149 #define IDB_BUTTON_MINUSPLUS_SCALE_150 72149 #define IDB_BUTTON_MINUSPLUS_SCALE_200 73149 -#define IDB_BUTTON_MINUSPLUS_SCALE_300 74149 -#define IDB_BUTTON_MINUSPLUS_SCALE_400 75149 +#define IDB_BUTTON_MINUSPLUS_SCALE_300 74149 +#define IDB_BUTTON_MINUSPLUS_SCALE_400 75149 +#define IDB_BUTTON_MINUSPLUS_SCALE_SVG 80149 // Offset IDB_BUTTON_CHECK by SCALABLE_100_OFFSET value and so on #define IDB_BUTTON_CHECK_SCALE_100 70150 #define IDB_BUTTON_CHECK_SCALE_125 71150 #define IDB_BUTTON_CHECK_SCALE_150 72150 #define IDB_BUTTON_CHECK_SCALE_200 73150 -#define IDB_BUTTON_CHECK_SCALE_300 74150 -#define IDB_BUTTON_CHECK_SCALE_400 75150 +#define IDB_BUTTON_CHECK_SCALE_300 74150 +#define IDB_BUTTON_CHECK_SCALE_400 75150 +#define IDB_BUTTON_CHECK_SCALE_SVG 80150 // Offset IDB_FMCONFIG by SCALABLE_100_OFFSET value and so on #define IDB_FMCONFIG_SCALE_100 70151 #define IDB_FMCONFIG_SCALE_125 71151 #define IDB_FMCONFIG_SCALE_150 72151 #define IDB_FMCONFIG_SCALE_200 73151 -#define IDB_FMCONFIG_SCALE_300 74151 -#define IDB_FMCONFIG_SCALE_400 75151 +#define IDB_FMCONFIG_SCALE_300 74151 +#define IDB_FMCONFIG_SCALE_400 75151 +#define IDB_FMCONFIG_SCALE_SVG 80151 // Offset IDB_UNIPOLAR by SCALABLE_100_OFFSET value and so on #define IDB_UNIPOLAR_SCALE_100 70152 #define IDB_UNIPOLAR_SCALE_125 71152 #define IDB_UNIPOLAR_SCALE_150 72152 #define IDB_UNIPOLAR_SCALE_200 73152 -#define IDB_UNIPOLAR_SCALE_300 74152 -#define IDB_UNIPOLAR_SCALE_400 75152 +#define IDB_UNIPOLAR_SCALE_300 74152 +#define IDB_UNIPOLAR_SCALE_400 75152 +#define IDB_UNIPOLAR_SCALE_SVG 80152 // Offset IDB_FADERH_HANDLE by SCALABLE_100_OFFSET value and so on #define IDB_FADERH_HANDLE_SCALE_100 70153 #define IDB_FADERH_HANDLE_SCALE_125 71153 #define IDB_FADERH_HANDLE_SCALE_150 72153 #define IDB_FADERH_HANDLE_SCALE_200 73153 -#define IDB_FADERH_HANDLE_SCALE_300 74153 -#define IDB_FADERH_HANDLE_SCALE_400 75153 +#define IDB_FADERH_HANDLE_SCALE_300 74153 +#define IDB_FADERH_HANDLE_SCALE_400 75153 +#define IDB_FADERH_HANDLE_SCALE_SVG 80153 // Offset IDB_FADERH_BG by SCALABLE_100_OFFSET value and so on #define IDB_FADERH_BG_SCALE_100 70154 #define IDB_FADERH_BG_SCALE_125 71154 #define IDB_FADERH_BG_SCALE_150 72154 #define IDB_FADERH_BG_SCALE_200 73154 -#define IDB_FADERH_BG_SCALE_300 74154 -#define IDB_FADERH_BG_SCALE_400 75154 +#define IDB_FADERH_BG_SCALE_300 74154 +#define IDB_FADERH_BG_SCALE_400 75154 +#define IDB_FADERH_BG_SCALE_SVG 80154 // Offset IDB_FADERV_HANDLE by SCALABLE_100_OFFSET value and so on #define IDB_FADERV_HANDLE_SCALE_100 70157 #define IDB_FADERV_HANDLE_SCALE_125 71157 #define IDB_FADERV_HANDLE_SCALE_150 72157 #define IDB_FADERV_HANDLE_SCALE_200 73157 -#define IDB_FADERV_HANDLE_SCALE_300 74157 -#define IDB_FADERV_HANDLE_SCALE_400 75157 +#define IDB_FADERV_HANDLE_SCALE_300 74157 +#define IDB_FADERV_HANDLE_SCALE_400 75157 +#define IDB_FADERV_HANDLE_SCALE_SVG 80157 // Offset IDB_ABOUT by SCALABLE_100_OFFSET value and so on #define IDB_ABOUT_SCALE_100 70158 #define IDB_ABOUT_SCALE_125 71158 #define IDB_ABOUT_SCALE_150 72158 #define IDB_ABOUT_SCALE_200 73158 -#define IDB_ABOUT_SCALE_300 74158 -#define IDB_ABOUT_SCALE_400 75158 +#define IDB_ABOUT_SCALE_300 74158 +#define IDB_ABOUT_SCALE_400 75158 +#define IDB_ABOUT_SCALE_SVG 80158 // Offset IDB_BUTTON_ABOUT by SCALABLE_100_OFFSET value and so on #define IDB_BUTTON_ABOUT_SCALE_100 70159 #define IDB_BUTTON_ABOUT_SCALE_125 71159 #define IDB_BUTTON_ABOUT_SCALE_150 72159 #define IDB_BUTTON_ABOUT_SCALE_200 73159 -#define IDB_BUTTON_ABOUT_SCALE_300 74159 -#define IDB_BUTTON_ABOUT_SCALE_400 75159 +#define IDB_BUTTON_ABOUT_SCALE_300 74159 +#define IDB_BUTTON_ABOUT_SCALE_400 75159 +#define IDB_BUTTON_ABOUT_SCALE_SVG 80159 // Offset IDB_FILTERSUBTYPE by SCALABLE_100_OFFSET value and so on #define IDB_FILTERSUBTYPE_SCALE_100 70160 #define IDB_FILTERSUBTYPE_SCALE_125 71160 #define IDB_FILTERSUBTYPE_SCALE_150 72160 #define IDB_FILTERSUBTYPE_SCALE_200 73160 -#define IDB_FILTERSUBTYPE_SCALE_300 74160 -#define IDB_FILTERSUBTYPE_SCALE_400 75160 +#define IDB_FILTERSUBTYPE_SCALE_300 74160 +#define IDB_FILTERSUBTYPE_SCALE_400 75160 +#define IDB_FILTERSUBTYPE_SCALE_SVG 80160 // Offset IDB_CHARACTER by SCALABLE_100_OFFSET value and so on #define IDB_CHARACTER_SCALE_100 70161 #define IDB_CHARACTER_SCALE_125 71161 #define IDB_CHARACTER_SCALE_150 72161 #define IDB_CHARACTER_SCALE_200 73161 -#define IDB_CHARACTER_SCALE_300 74161 -#define IDB_CHARACTER_SCALE_400 75161 +#define IDB_CHARACTER_SCALE_300 74161 +#define IDB_CHARACTER_SCALE_400 75161 +#define IDB_CHARACTER_SCALE_SVG 80161 // Offset IDB_ENVMODE by SCALABLE_100_OFFSET value and so on #define IDB_ENVMODE_SCALE_100 70162 #define IDB_ENVMODE_SCALE_125 71162 #define IDB_ENVMODE_SCALE_150 72162 #define IDB_ENVMODE_SCALE_200 73162 -#define IDB_ENVMODE_SCALE_300 74162 -#define IDB_ENVMODE_SCALE_400 75162 +#define IDB_ENVMODE_SCALE_300 74162 +#define IDB_ENVMODE_SCALE_400 75162 +#define IDB_ENVMODE_SCALE_SVG 80162 // Offset IDB_STOREPATCH by SCALABLE_100_OFFSET value and so on #define IDB_STOREPATCH_SCALE_100 70163 #define IDB_STOREPATCH_SCALE_125 71163 #define IDB_STOREPATCH_SCALE_150 72163 #define IDB_STOREPATCH_SCALE_200 73163 -#define IDB_STOREPATCH_SCALE_300 74163 -#define IDB_STOREPATCH_SCALE_400 75163 +#define IDB_STOREPATCH_SCALE_300 74163 +#define IDB_STOREPATCH_SCALE_400 75163 +#define IDB_STOREPATCH_SCALE_SVG 80163 // Offset IDB_BUTTON_MENU by SCALABLE_100_OFFSET value and so on #define IDB_BUTTON_MENU_SCALE_100 70164 #define IDB_BUTTON_MENU_SCALE_125 71164 #define IDB_BUTTON_MENU_SCALE_150 72164 #define IDB_BUTTON_MENU_SCALE_200 73164 -#define IDB_BUTTON_MENU_SCALE_300 74164 -#define IDB_BUTTON_MENU_SCALE_400 75164 +#define IDB_BUTTON_MENU_SCALE_300 74164 +#define IDB_BUTTON_MENU_SCALE_400 75164 +#define IDB_BUTTON_MENU_SCALE_SVG 80164 diff --git a/src/windows/surge.rc b/src/windows/surge.rc index a8f524ab241..a200251025d 100644 --- a/src/windows/surge.rc +++ b/src/windows/surge.rc @@ -28,7 +28,7 @@ LANGUAGE LANG_NEUTRAL, // // PNG // - +#if INCLUDE_PNG_WHICH_WE_DONT IDB_FILTERBUTTONS PNG "resources/bitmaps/bmp00108.png" IDB_FBCONFIG PNG "resources/bitmaps/bmp00112.png" IDB_SCENESWITCH PNG @@ -65,9 +65,10 @@ LANGUAGE LANG_NEUTRAL, "resources/bitmaps/bmp00161.png" IDB_ENVMODE PNG "resources/bitmaps/bmp00162.png" IDB_STOREPATCH PNG "resources/bitmaps/bmp00163.png" IDB_BUTTON_MENU PNG "resources/bitmaps/bmp00164.png" - #include "scalableui.rc" +#endif +#include "svgresources.rc" ///////////////////////////////////////////////////////////////////////////// // diff --git a/src/windows/svgresources.rc b/src/windows/svgresources.rc new file mode 100644 index 00000000000..749757ec3f5 --- /dev/null +++ b/src/windows/svgresources.rc @@ -0,0 +1,52 @@ + +/* +** THIS IS AN AUTOMATICALLY GENERATED FILE. DO NOT EDIT IT +** +** If you need to modify this file, please read the comment +** in scripts/win/emit-vector-rc.py +** +** This file imports the appropriate scaled SVG files +** for each of the identifiers in scalableresource.h. +** +** You can address these items as IDB_BG_SCALE_SVG or +** IDB_BG + SCALE_OFFSET_SVG in your non-rc code. +*/ + +IDB_BG_SCALE_SVG DATA "assets/original-vector/SVG/exported/bmp00102.svg" +IDB_FADERV_BG_SCALE_SVG DATA "assets/original-vector/SVG/exported/bmp00105.svg" +IDB_FILTERBUTTONS_SCALE_SVG DATA "assets/original-vector/SVG/exported/bmp00108.svg" +IDB_FBCONFIG_SCALE_SVG DATA "assets/original-vector/SVG/exported/bmp00112.svg" +IDB_SCENESWITCH_SCALE_SVG DATA "assets/original-vector/SVG/exported/bmp00113.svg" +IDB_SCENEMODE_SCALE_SVG DATA "assets/original-vector/SVG/exported/bmp00114.svg" +IDB_OCTAVES_SCALE_SVG DATA "assets/original-vector/SVG/exported/bmp00118.svg" +IDB_OSCMENU_SCALE_SVG DATA "assets/original-vector/SVG/exported/bmp00119.svg" +IDB_WAVESHAPER_SCALE_SVG DATA "assets/original-vector/SVG/exported/bmp00120.svg" +IDB_RELATIVE_TOGGLE_SCALE_SVG DATA "assets/original-vector/SVG/exported/bmp00121.svg" +IDB_OSCSELECT_SCALE_SVG DATA "assets/original-vector/SVG/exported/bmp00122.svg" +IDB_POLYMODE_SCALE_SVG DATA "assets/original-vector/SVG/exported/bmp00123.svg" +IDB_MODSRC_BG_SCALE_SVG DATA "assets/original-vector/SVG/exported/bmp00124.svg" +IDB_SWITCH_KTRK_SCALE_SVG DATA "assets/original-vector/SVG/exported/bmp00125.svg" +IDB_SWITCH_RETRIGGER_SCALE_SVG DATA "assets/original-vector/SVG/exported/bmp00126.svg" +IDB_SWITCH_SOLO_SCALE_SVG DATA "assets/original-vector/SVG/exported/bmp00132.svg" +IDB_SWITCH_MUTE_SCALE_SVG DATA "assets/original-vector/SVG/exported/bmp00134.svg" +IDB_FXCONF_SYMBOLS_SCALE_SVG DATA "assets/original-vector/SVG/exported/bmp00136.svg" +IDB_FXCONF_SCALE_SVG DATA "assets/original-vector/SVG/exported/bmp00137.svg" +IDB_SWITCH_LINK_SCALE_SVG DATA "assets/original-vector/SVG/exported/bmp00140.svg" +IDB_OSCROUTE_SCALE_SVG DATA "assets/original-vector/SVG/exported/bmp00143.svg" +IDB_FXBYPASS_SCALE_SVG DATA "assets/original-vector/SVG/exported/bmp00144.svg" +IDB_ENVSHAPE_SCALE_SVG DATA "assets/original-vector/SVG/exported/bmp00145.svg" +IDB_LFOTRIGGER_SCALE_SVG DATA "assets/original-vector/SVG/exported/bmp00146.svg" +IDB_BUTTON_STORE_SCALE_SVG DATA "assets/original-vector/SVG/exported/bmp00148.svg" +IDB_BUTTON_MINUSPLUS_SCALE_SVG DATA "assets/original-vector/SVG/exported/bmp00149.svg" +IDB_FMCONFIG_SCALE_SVG DATA "assets/original-vector/SVG/exported/bmp00151.svg" +IDB_UNIPOLAR_SCALE_SVG DATA "assets/original-vector/SVG/exported/bmp00152.svg" +IDB_FADERH_HANDLE_SCALE_SVG DATA "assets/original-vector/SVG/exported/bmp00153.svg" +IDB_FADERH_BG_SCALE_SVG DATA "assets/original-vector/SVG/exported/bmp00154.svg" +IDB_FADERV_HANDLE_SCALE_SVG DATA "assets/original-vector/SVG/exported/bmp00157.svg" +IDB_ABOUT_SCALE_SVG DATA "assets/original-vector/SVG/exported/bmp00158.svg" +IDB_BUTTON_ABOUT_SCALE_SVG DATA "assets/original-vector/SVG/exported/bmp00159.svg" +IDB_FILTERSUBTYPE_SCALE_SVG DATA "assets/original-vector/SVG/exported/bmp00160.svg" +IDB_CHARACTER_SCALE_SVG DATA "assets/original-vector/SVG/exported/bmp00161.svg" +IDB_ENVMODE_SCALE_SVG DATA "assets/original-vector/SVG/exported/bmp00162.svg" +IDB_STOREPATCH_SCALE_SVG DATA "assets/original-vector/SVG/exported/bmp00163.svg" +IDB_BUTTON_MENU_SCALE_SVG DATA "assets/original-vector/SVG/exported/bmp00164.svg"