Browse Source

use guile to generate the gsettings schema

cairo_optimizations
Alexandros Theodotou 3 years ago
parent
commit
a489a157dd
Signed by: alex
GPG Key ID: 022EAE42313D70F3
  1. 9
      HACKING.md
  2. 10
      data/meson.build
  3. 772
      data/org.zrythm.Zrythm.gschema.xml
  4. 7
      doc/user/meson.build
  5. 58
      meson.build
  6. 4
      meson_options.txt
  7. 7
      po/meson.build
  8. 7
      resources/ui/preferences.ui
  9. 2
      scripts/collect_translatables.sh
  10. 2
      scripts/generic_guile_wrap.sh
  11. 684
      scripts/gschema-gen.scm
  12. 29
      scripts/guile-utils.scm
  13. 72
      scripts/meson.build
  14. 4
      src/gui/widgets/main_window.c
  15. 3
      src/guile/meson.build
  16. 11
      src/meson.build

9
HACKING.md

@ -184,9 +184,11 @@ In alphabetic order: @@ -184,9 +184,11 @@ In alphabetic order:
4. Any other headers
## Line Length
Please keep lines within 60 characters. This works
We keep lines within 60 characters. This works
nicely with 4 columns of files open simultaneously
in a tiled editor like vim.
in a tiled editor like vim, but if you find this
difficult to work with < 80 characters is acceptable
too.
## Licensing
If you contributed significant (for copyright
@ -199,6 +201,9 @@ We prefer code contributions in the form of patches. Use `git format-patch` to g @@ -199,6 +201,9 @@ We prefer code contributions in the form of patches. Use `git format-patch` to g
post them in a new issue on
[Redmine](https://redmine.zrythm.org/projects/zrythm/issues) or
send them to the dev mailing list at dev@zrythm.org.
You may also use `git-send-email` for this.
If you are having difficulties creating patches
please contact us and we will guide you.
# Troubleshooting
## Getting random GUI related errors with no trace in valgrind or GTK warnings

10
data/meson.build

@ -15,8 +15,14 @@ @@ -15,8 +15,14 @@
# You should have received a copy of the GNU Affero General Public License
# along with Zrythm. If not, see <https://www.gnu.org/licenses/>.
install_data (
'org.zrythm.Zrythm.gschema.xml',
gschema_top = 'org.zrythm.Zrythm'
gschema = configure_file (
input: gschema_gen_wrap,
output: gschema_top + '.gschema.xml',
command: [
'@INPUT0@', '@OUTPUT@', gschema_top,
],
install: true,
install_dir: schemasdir)
# install fonts if needed

772
data/org.zrythm.Zrythm.gschema.xml

@ -1,772 +0,0 @@ @@ -1,772 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2018-2019 Alexandros Theodotou <alex at zrythm dot org>
This file is part of Zrythm
Zrythm is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Zrythm is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with Zrythm. If not, see <https://www.gnu.org/licenses/>.
-->
<schemalist>
<schema
id="org.zrythm.Zrythm"
gettext-domain="zrythm"
path="/org/zrythm/Zrythm/">
</schema>
<enum id="org.zrythm.Zrythm.preferences.audio-backend-enum">
<value nick="none" value="0"/>
<value nick="alsa" value="1"/>
<value nick="jack" value="2"/>
<value nick="portaudio" value="3"/>
<value nick="sdl" value="4"/>
<value nick="rtaudio" value="5"/>
</enum>
<enum id="org.zrythm.Zrythm.preferences.midi-backend-enum">
<value nick="none" value="0"/>
<value nick="alsa" value="1"/>
<value nick="jack" value="2"/>
<value nick="windows-mme" value="3"/>
<value nick="rtmidi" value="4"/>
</enum>
<enum id="org.zrythm.Zrythm.preferences.language-enum">
<value nick="ar" value="0"/>
<value nick="cs" value="1"/>
<value nick="da" value="2"/>
<value nick="de" value="3"/>
<value nick="en" value="4"/>
<value nick="en_GB" value="5"/>
<value nick="el" value="6"/>
<value nick="es" value="7"/>
<value nick="et" value="8"/>
<value nick="fi" value="9"/>
<value nick="fr" value="10"/>
<value nick="gd" value="11"/>
<value nick="gl" value="12"/>
<value nick="hi" value="13"/>
<value nick="it" value="14"/>
<value nick="ja" value="15"/>
<value nick="ko" value="16"/>
<value nick="nb_NO" value="17"/>
<value nick="nl" value="18"/>
<value nick="pl" value="19"/>
<value nick="pt" value="20"/>
<value nick="pt_BR" value="21"/>
<value nick="ru" value="22"/>
<value nick="sv" value="23"/>
<value nick="zh" value="24"/>
</enum>
<enum id="org.zrythm.Zrythm.preferences.export-time-range-enum">
<value nick="loop" value="0"/>
<value nick="song" value="1"/>
<value nick="custom" value="2"/>
</enum>
<enum id="org.zrythm.Zrythm.preferences.export-format-enum">
<value nick="FLAC" value="0"/>
<value nick="OGG" value="1"/>
<value nick="WAV" value="2"/>
<value nick="MP3" value="3"/>
<value nick="MID" value="4"/>
</enum>
<enum id="org.zrythm.Zrythm.preferences.export-bit-depth-enum">
<value nick="16" value="0"/>
<value nick="24" value="1"/>
<value nick="23" value="2"/>
</enum>
<enum id="org.zrythm.Zrythm.ui.notenotation">
<value nick="notes" value="0"/>
<value nick="numbers" value="1"/>
</enum>
<enum id="org.zrythm.Zrythm.ui.plugin-browser-tab">
<value nick="collection" value="0"/>
<value nick="category" value="1"/>
<value nick="protocol" value="2"/>
</enum>
<enum id="org.zrythm.Zrythm.ui.plugin-browser-filter">
<value nick="none" value="0"/>
<value nick="instrument" value="1"/>
<value nick="effect" value="2"/>
<value nick="modulator" value="3"/>
<value nick="midi-effect" value="4"/>
</enum>
<enum id="org.zrythm.Zrythm.ui.piano-roll-highlight-enum">
<value nick="none" value="0"/>
<value nick="chord" value="1"/>
<value nick="scale" value="2"/>
<value nick="both" value="3"/>
</enum>
<enum id="org.zrythm.Zrythm.ui.piano-roll-midi-modifier-enum">
<value nick="velocity" value="0"/>
<value nick="pitch-wheel" value="1"/>
<value nick="mod-wheel" value="2"/>
<value nick="aftertouch" value="3"/>
</enum>
<enum id="org.zrythm.Zrythm.preferences.pan-law-enum">
<value nick="zero-db" value="0"/>
<value nick="minus-three-db" value="1"/>
<value nick="minus-six-db" value="2"/>
</enum>
<enum id="org.zrythm.Zrythm.preferences.pan-algo-enum">
<value nick="linear" value="0"/>
<value nick="sqrt" value="1"/>
<value nick="sine" value="2"/>
</enum>
<enum id="org.zrythm.Zrythm.preferences.curve-algorithm-enum">
<value nick="exponent" value="0"/>
<value nick="superellipse" value="1"/>
<value nick="vital" value="2"/>
</enum>
<enum id="org.zrythm.Zrythm.preferences.buffer-size-enum">
<value nick="16" value="0"/>
<value nick="32" value="1"/>
<value nick="64" value="2"/>
<value nick="128" value="3"/>
<value nick="256" value="4"/>
<value nick="512" value="5"/>
<value nick="1024" value="6"/>
<value nick="2048" value="7"/>
<value nick="4096" value="8"/>
</enum>
<enum id="org.zrythm.Zrythm.preferences.samplerate-enum">
<value nick="22050" value="0"/>
<value nick="32000" value="1"/>
<value nick="44100" value="2"/>
<value nick="48000" value="3"/>
<value nick="88200" value="4"/>
<value nick="96000" value="5"/>
<value nick="192000" value="6"/>
</enum>
<!-- GENERAL schema -->
<schema
id="org.zrythm.Zrythm.general"
gettext-domain="zrythm"
path="/org/zrythm/Zrythm/general/">
<key name="recent-projects" type="as">
<default>[]</default>
<summary>Recent project list</summary>
<description>A list of recent projects to be
referenced on startup.</description>
</key>
<key name="first-run" type="b">
<default>true</default>
<summary>First run</summary>
<description>Whether this is the first
run or not.</description>
</key>
<key name="dir" type="s">
<default>""</default>
<summary>Zrythm directory</summary>
<description>This is the directory used to
save projects and other files in.</description>
</key>
<key name="install-dir" type="s">
<default>""</default>
<summary>Installation directory</summary>
<description>This is the directory Zrythm
is installed in. Currently only used on
Windows.</description>
</key>
<key name="last-project-dir" type="s">
<default>""</default>
<summary>Last project directory</summary>
<description>
Last directory a project was
created in.
</description>
</key>
</schema> <!-- end GENERAL schema -->
<!-- PREFERENCES schema -->
<schema
id="org.zrythm.Zrythm.preferences"
gettext-domain="zrythm"
path="/org/zrythm/Zrythm/preferences/">
<!-- KEY: audio-backend -->
<key name="audio-backend"
enum="org.zrythm.Zrythm.preferences.audio-backend-enum">
<default>"none"</default>
<summary>Audio Backend</summary>
<description>
The audio back end to use.
</description>
</key>
<!-- KEY: sdl-audio-device-name -->
<key name="sdl-audio-device-name" type="s">
<default>""</default>
<summary>SDL audio device name</summary>
<description>
The name of the SDL audio device to open.
</description>
</key>
<!-- KEY: rtaudio-audio-device-name -->
<key name="rtaudio-audio-device-name" type="s">
<default>""</default>
<summary>RtAudio device name</summary>
<description>
The name of the RtAudio device to open.
</description>
</key>
<!-- KEY: samplerate -->
<key name="samplerate" enum="org.zrythm.Zrythm.preferences.samplerate-enum">
<default>"48000"</default>
<summary>Samplerate</summary>
<description>
Samplerate to pass to the backend, if not
JACK.
</description>
</key>
<!-- KEY: buffer-size -->
<key name="buffer-size" enum="org.zrythm.Zrythm.preferences.buffer-size-enum">
<default>"512"</default>
<summary>Buffer size</summary>
<description>
Buffer size to pass to the backend, if not
JACK.
</description>
</key>
<!-- KEY: undo-stack-length -->
<key name="undo-stack-length" type="i">
<default>128</default>
<summary>Undo stack length</summary>
<description>
Maximum undo history stack length. Set to -1
for unlimited.
</description>
</key>
<!-- KEY: pan-algorithm -->
<key name="pan-algo"
enum="org.zrythm.Zrythm.preferences.pan-algo-enum">
<default>"sine"</default>
<summary>The panning algorithm</summary>
<description>
The panning algorithm to use when
applying pan on channels.
</description>
</key>
<!-- KEY: pan-law -->
<key name="pan-law"
enum="org.zrythm.Zrythm.preferences.pan-law-enum">
<default>"minus-three-db"</default>
<summary>The Pan Law</summary>
<description>
The Pan Law to use when
applying pan on channels.
</description>
</key>
<!-- KEY: fade-algorithm -->
<key name="fade-algorithm"
enum="org.zrythm.Zrythm.preferences.curve-algorithm-enum">
<default>"superellipse"</default>
<summary>Fade algorithm</summary>
<description>
Default fade algorithm to use for fade
ins/outs.
</description>
</key>
<!-- KEY: automation-curve-algorithm -->
<key name="automation-curve-algorithm"
enum="org.zrythm.Zrythm.preferences.curve-algorithm-enum">
<default>"superellipse"</default>
<summary>Automation curve algorithm</summary>
<description>
Default algorithm to use for automation
curves.
</description>
</key>
<!-- KEY: midi-backend -->
<key name="midi-backend"
enum="org.zrythm.Zrythm.preferences.midi-backend-enum">
<default>"none"</default>
<summary>MIDI Backend</summary>
<description>
The MIDI backend to use
</description>
</key>
<!-- KEY: midi-controllers -->
<key name="midi-controllers" type="as">
<default>[]</default>
<summary>A list of controllers that should be
auto-connected.</summary>
<description>A list of controllers that
should
be auto-connected.</description>
</key>
<!-- Selected language -->
<key name="language"
enum="org.zrythm.Zrythm.preferences.language-enum">
<default>"en"</default>
<summary>UI interface language</summary>
<description>
The interface language.
</description>
</key>
<!-- KEY: bounce-with-effects -->
<key name="bounce-with-effects" type="b">
<default>true</default>
<summary>Bounce to audio with effects</summary>
<description>
If send to true, the effects chain will be
included in the bounced material.
</description>
</key>
<!-- KEY: bounce-tail -->
<key name="bounce-tail" type="i">
<default>0</default>
<summary>Bounce tail (ms)</summary>
<description>
Tail to allow when bouncing (for example to
catch reverb tails after a region finishes)
in milliseconds.
</description>
</key>
<!-- KEY: open-plugin-uis-on-instantiate -->
<key name="open-plugin-uis-on-instantiate" type="b">
<default>true</default>
<summary>Open plugin UIs when they are instantiated</summary>
<description>
Open plugin UIs when they are dragged and
dropped or activated in the plugin browser
or not.
</description>
</key>
<!-- KEY: plugin-uis-stay-on-top -->
<key name="plugin-uis-stay-on-top" type="b">
<default>true</default>
<summary>Whether plugin UIs should always be shown on top of the main window</summary>
<description>
If this is set to 1, plugin UIs will always
be shown on top of the main window.
</description>
</key>
<!-- KEY: generic-plugin-uis -->
<key name="generic-plugin-uis" type="b">
<default>false</default>
<summary>Force generic plugin UIs</summary>
<description>
Whether to force generic plugin UIs or not.
If this is set to 1, custom plugin UIs will
be ignored.
</description>
</key>
<!-- KEY: plugin-ui-refresh-rate -->
<key name="plugin-ui-refresh-rate" type="i">
<default>0</default>
<summary>Plugin UI refresh rate</summary>
<description>
The refresh rate to use for the UI, in Hz.
If set to 0, the screen's refresh rate will
be used.
</description>
</key>
<!-- KEY: sfz-search-path -->
<key name="sfz-search-paths" type="as">
<default>[]</default>
<summary>Search paths for SFZ instruments</summary>
<description>
The search paths to scan for SFZ
instruments.
</description>
</key>
<!-- KEY: sf2-search-path -->
<key name="sf2-search-paths" type="as">
<default>[]</default>
<summary>Search paths for SF2 instruments</summary>
<description>
The search paths to scan for SF2
instruments.
</description>
</key>
<!-- KEY: vst-search-path-windows -->
<key name="vst-search-paths-windows" type="as">
<default>[ "C:\\Program Files\\Common Files\\VST2",
"C:\\Program Files\\VSTPlugins",
"C:\\Program Files\\Steinberg\\VSTPlugins",
"C:\\Program Files\\Common Files\\VST2",
"C:\\Program Files\\Common Files\\Steinberg\\VST2" ]</default>
<summary>Search paths for VST plugins</summary>
<description>
The search paths to scan for VST
plugins in. Duplicate paths will be
deduplicated.
</description>
</key>
<!-- KEY: edit-region-size -->
<key name="edit-region-size" type="i">
<default>4</default>
<summary>Region Size</summary>
<description>
The default region size to use for automatically
created regions
</description>
</key>
<!-- KEY: export artist -->
<key name="export-artist" type="s">
<default>"Zrythm"</default>
<summary>Artist to use when exporting</summary>
<description>
The artist to use by default when exporting. This value is saved/loaded in the export dialog.
</description>
</key>
<!-- KEY: export genre -->
<key name="export-genre" type="s">
<default>"Electronic"</default>
<summary>Genre to use when exporting</summary>
<description>
The genre to use by default when exporting. This value is saved/loaded in the export dialog.
</description>
</key>
<!-- KEY: export time range -->
<key name="export-time-range"
enum="org.zrythm.Zrythm.preferences.export-time-range-enum">
<default>"song"</default>
<summary>Time range to use when exporting</summary>
<description>
The time range to display as selected by default when exporting. This value is saved when an export is done and remembered the next time the export dialog is displayed.
</description>
</key>
<!-- KEY: export format -->
<key name="export-format"
enum="org.zrythm.Zrythm.preferences.export-format-enum">
<default>"FLAC"</default>
<summary>Format to use when exporting</summary>
<description>
The format to display as selected by default when exporting. This value is saved when an export is done and remembered the next time the export dialog is displayed.
</description>
</key>
<!-- KEY: export dither -->
<key name="export-dither" type="b">
<default>false</default>
<summary>Add dither to export</summary>
<description>
Add dither while exporting.
</description>
</key>
<!-- KEY: export bit depth -->
<key name="export-bit-depth"
enum="org.zrythm.Zrythm.preferences.export-bit-depth-enum">
<default>"24"</default>
<summary>Bit depth to use when exporting</summary>
<description>
Bit depth to use when exporting.
</description>
</key>
<!-- KEY: autosave interval -->
<key name="autosave-interval" type="u">
<default>1</default>
<summary>Autosave interval in minutes</summary>
<description>
Interval to auto-save the current project,
in minutes. If this is 0, autosave will be
disabled.
</description>
</key>
</schema> <!-- end PREFERENCES schema -->
<!-- UI schema -->
<schema
id="org.zrythm.Zrythm.ui"
gettext-domain="zrythm"
path="/org/zrythm/Zrythm/ui/">
<!-- KEY: note notation -->
<key name="note-notation"
enum="org.zrythm.Zrythm.ui.notenotation">
<default>"notes"</default>
<summary>Note Notation</summary>
<description>
The note notation used in the piano roll. (note numbers or notes like C, C#)
</description>
</key>
<!-- KEY: metronome-enabled -->
<key name="metronome-enabled" type="b">
<default>false</default>
<summary>Metronome enabled</summary>
<description>
Metronome is enabled or not.
</description>
</key>
<!-- KEY: musical-mode -->
<key name="musical-mode" type="b">
<default>true</default>
<summary>Musical mode on/off</summary>
<description>
Whether to use musical mode. If this
is on, time-stretching will be applied to
events so that they match the project BPM.
This mostly applies to audio regions.
</description>
</key>
<!-- KEY: listen-notes -->
<key name="listen-notes" type="b">
<default>true</default>
<summary>Listen to notes on/off</summary>
<description>
Whether to listen to MIDI notes while
dragging them in the piano roll.
</description>
</key>
<!-- KEY: piano roll highlighting -->
<key name="piano-roll-highlight"
enum="org.zrythm.Zrythm.ui.piano-roll-highlight-enum">
<default>"none"</default>
<summary>Piano Roll Highlight</summary>
<description>
Whether to highlight chords, scales, both
or none in the Piano Roll.
</description>
</key>
<!-- KEY: piano roll midi modifier -->
<key name="piano-roll-midi-modifier"
enum="org.zrythm.Zrythm.ui.piano-roll-midi-modifier-enum">
<default>"velocity"</default>
<summary>Piano Roll MIDI Modifier</summary>
<description>
The MIDI modifier to display in the
MIDI modifier arranger.
</description>
</key>
<!-- KEY: browser divider position -->
<key name="browser-divider-position" type="i">
<default>220</default>
<summary>Divider position</summary>
<description>
Height of the instrument browser on the top side of
the GtkPaned.
</description>
</key>
<!-- KEY: left panel divider position -->
<key name="left-panel-divider-position" type="i">
<default>220</default>
<summary>Left panel divider position</summary>
<description>
Position of the resize handle of the left
panel.
</description>
</key>
<!-- KEY: right panel divider position -->
<key name="right-panel-divider-position"
type="i">
<default>180</default>
<summary>Right panel divider position</summary>
<description>
Position of the resize handle of the right
panel.
</description>
</key>
<!-- KEY: bot panel divider position -->
<key name="bot-panel-divider-position"
type="i">
<default>180</default>
<summary>Bottom panel divider position</summary>
<description>
Position of the resize handle of the bot
panel.
</description>
</key>
<!-- KEY: plugin browser tab -->
<key name="plugin-browser-tab"
enum="org.zrythm.Zrythm.ui.plugin-browser-tab">
<default>"category"</default>
<summary>Plugin Browser tab</summary>
<description>
Selected Plugin Browser tab.
</description>
</key>
<!-- KEY: plugin browser filter -->
<key name="plugin-browser-filter"
enum="org.zrythm.Zrythm.ui.plugin-browser-filter">
<default>"none"</default>
<summary>Plugin Browser filter</summary>
<description>
Selected Plugin Browser filter.
</description>
</key>
<!-- KEY: timeline event viewer visible -->
<key name="timeline-event-viewer-visible"
type="b">
<default>false</default>
<summary>Timeline event viewer visibility</summary>
<description>
Whether the timeline event viewer is visible
or not.
</description>
</key>
<!-- KEY: editor event viewer visible -->
<key name="editor-event-viewer-visible"
type="b">
<default>false</default>
<summary>Editor event viewer visibility</summary>
<description>
Whether the editor event viewer is visible
or not.
</description>
</key>
<!-- KEY: monitor out volume -->
<key name="monitor-out-vol"
type="d">
<default>1.0</default>
<summary>Monitor out volume</summary>
<description>
The monitor out volume in amplitude (0.0
to 2.0).
</description>
</key>
</schema> <!-- end UI schema -->
<!-- Inspector schema -->
<schema
id="org.zrythm.Zrythm.ui.inspector"
gettext-domain="zrythm"
path="/org/zrythm/Zrythm/ui/inspector/">
<!-- KEY: track-properties-expanded -->
<key name="track-properties-expanded" type="b">
<default>true</default>
<summary>Track properties expanded</summary>
<description>
Whether track properties is expanded.
</description>
</key>
<!-- KEY: track-outputs-expanded -->
<key name="track-outputs-expanded" type="b">
<default>true</default>
<summary>Track outputs expanded</summary>
<description>
Whether track outputs is expanded.
</description>
</key>
<!-- KEY: track-sends-expanded -->
<key name="track-sends-expanded" type="b">
<default>true</default>
<summary>Track sends expanded</summary>
<description>
Whether track sends is expanded.
</description>
</key>
<!-- KEY: track-inputs-expanded -->
<key name="track-inputs-expanded" type="b">
<default>true</default>
<summary>Track inputs expanded</summary>
<description>
Whether track inputs is expanded.
</description>
</key>
<!-- KEY: track-controls-expanded -->
<key name="track-controls-expanded" type="b">
<default>true</default>
<summary>Track controls expanded</summary>
<description>
Whether track controls is expanded.
</description>
</key>
<!-- KEY: track-inserts-expanded -->
<key name="track-inserts-expanded" type="b">
<default>true</default>
<summary>Track inserts expanded</summary>
<description>
Whether track inserts is expanded.
</description>
</key>
<!-- KEY: track-midi_fx-expanded -->
<key name="track-midi-fx-expanded" type="b">
<default>true</default>
<summary>Track midi_fx expanded</summary>
<description>
Whether track midi_fx is expanded.
</description>
</key>
<!-- KEY: track-fader-expanded -->
<key name="track-fader-expanded" type="b">
<default>true</default>
<summary>Track fader expanded</summary>
<description>
Whether track fader is expanded.
</description>
</key>
<!-- KEY: track-comment-expanded -->
<key name="track-comment-expanded" type="b">
<default>true</default>
<summary>Track comment expanded</summary>
<description>
Whether track comment is expanded.
</description>
</key>
</schema> <!-- End inspector schema -->
</schemalist>

7
doc/user/meson.build

@ -94,9 +94,12 @@ if get_option ('enable_guile') and get_option ('guile_snarf_docs_path') != '' @@ -94,9 +94,12 @@ if get_option ('enable_guile') and get_option ('guile_snarf_docs_path') != ''
rst_doc = custom_target (
rst_file,
output: rst_file,
input: [ texi_doc, guile_gen_docs, ],
input: [
texi_doc,
meson.build_root () / 'scripts' / 'guile-gen-docs.scm',
],
command: [
meson.build_root () / 'guile-gen-docs.scm',
'@INPUT1@',
guile_dep.name(),
meson.build_root () / '@INPUT0@',
meson.build_root () / '@OUTPUT@',

58
meson.build

@ -187,54 +187,6 @@ pandoc = find_program ( @@ -187,54 +187,6 @@ pandoc = find_program (
['pandoc'], required: false)
texi2html = find_program (
['texi2html'], required: false)
scripts_conf = {
'SCRIPTS_DIR': meson.source_root () / 'scripts',
'MESON_BUILD_ROOT': meson.build_root (),
'MESON_SOURCE_ROOT': meson.source_root (),
}
if os_windows
scripts_conf += { 'GUILE': 'guile' }
else
scripts_conf += { 'GUILE': guile.path() }
endif
if pandoc.found()
scripts_conf += { 'PANDOC_BIN': pandoc.path() }
endif
if texi2html.found()
scripts_conf += {
'TEXI2HTML_BIN': texi2html.path() }
endif
if guile_snarf.found()
guile_snarf_wrap = configure_file (
output: 'guile-snarf-wrap.scm',
input: 'scripts' / 'guile-snarf-wrap.scm',
configuration: scripts_conf + {
'GUILE_SNARF': guile_snarf.path() },
)
endif
if get_option('guile_snarf_docs_path') != ''
guile_gen_docs = configure_file (
output: 'guile-gen-docs.scm',
input: 'scripts' / 'guile-gen-docs.scm',
configuration: scripts_conf + {
'GUILE_SNARF_DOCS_BIN': get_option (
'guile_snarf_docs_path'),
'GUILD_BIN': guild.path() },
)
endif
meson_post_install_path = 'scripts' / 'meson-post-install.scm'
meson_post_install = configure_file (
output: 'meson-post-install.scm',
input: meson_post_install_path,
configuration: scripts_conf,
)
# wrap is needed on windows mingw
configure_file (
output: 'meson_post_install_wrap.sh',
input: 'scripts' / 'generic_guile_wrap.sh',
configuration: scripts_conf + {
'SCRIPT_NAME': 'meson-post-install.scm'},
)
check_headers = [
'unistd.h',
@ -260,14 +212,12 @@ jack_dep = dependency ( @@ -260,14 +212,12 @@ jack_dep = dependency (
if not jack_dep.found ()
jack_dep = dependency ('jack', required: false)
endif
if get_option ('enable_jack') and jack_dep.found ()
if (not get_option ('enable_jack').disabled ()) and jack_dep.found ()
cdata.set('HAVE_JACK', 1)
check_functions += [
['jack_set_property',[jack_dep]],
['jack_client_stop_thread', [jack_dep]],
]
elif get_option ('enable_jack')
error ('libjack not found. Please install it or set \'enable_jack\' to false')
endif
foreach func : check_functions
@ -680,6 +630,7 @@ add_project_link_arguments ( @@ -680,6 +630,7 @@ add_project_link_arguments (
ext_srcs = []
subdir ('scripts')
subdir ('po')
subdir ('ext')
subdir ('resources')
@ -687,10 +638,9 @@ subdir ('data') @@ -687,10 +638,9 @@ subdir ('data')
subdir ('src')
subdir ('tests')
subdir ('doc')
subdir ('scripts')
meson.add_install_script (
meson.build_root() / 'meson_post_install_wrap.sh')
meson.build_root() / 'scripts' / 'meson_post_install_wrap.sh')
meson.add_dist_script (
'scripts' / 'meson_dist.sh')
@ -711,7 +661,7 @@ summary({ @@ -711,7 +661,7 @@ summary({
summary({
'FFmpeg': get_option('enable_ffmpeg'),
'Jack': get_option('enable_jack'),
'Jack': not get_option('enable_jack').disabled(),
'PortAudio': get_option('enable_portaudio'),
'RtMidi': get_option('enable_rtmidi'),
'RtAudio': get_option('enable_rtaudio'),

4
meson_options.txt

@ -71,8 +71,8 @@ option ( @@ -71,8 +71,8 @@ option (
option (
'enable_jack',
type: 'boolean',
value: true,
type: 'feature',
value: 'auto',
description: 'Compile with JACK support')
option (

7
po/meson.build

@ -30,3 +30,10 @@ i18n.gettext ( @@ -30,3 +30,10 @@ i18n.gettext (
'--add-comments'
],
)
collect_translatables = run_target (
'collect-translatables',
command: [
meson.source_root () / 'scripts' / 'collect_translatables.sh',
],
)

7
resources/ui/preferences.ui

@ -56,7 +56,6 @@ @@ -56,7 +56,6 @@
<child>
<object class="GtkButton" id="cancel">
<property name="label" translatable="yes">Cancel</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<signal name="clicked" handler="on_cancel_clicked" object="PreferencesWidget" swapped="no"/>
@ -357,12 +356,6 @@ @@ -357,12 +356,6 @@
<property name="width">2</property>
</packing>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
</object>
</child>
<child type="tab">

2
scripts/collect_translatables.sh

@ -38,6 +38,8 @@ for path in ['inc', 'src', 'resources', 'data']: @@ -38,6 +38,8 @@ for path in ['inc', 'src', 'resources', 'data']:
potfiles.write (str + '\n')
count = count + 1
potfiles.write (os.path.join ('build', 'data', 'org.zrythm.Zrythm.gschema.xml'))
print (
"wrote {} entries to {}".format (
count, potfiles.name))

2
scripts/generic_guile_wrap.sh

@ -2,5 +2,5 @@ @@ -2,5 +2,5 @@
# This is a generic wrapper for calling guile scripts
# to work around a bug with guile/mingw/windows
cd @MESON_BUILD_ROOT@
cd @SCRIPTS_DIR@
@GUILE@ -s @SCRIPT_NAME@ "$@"

684
scripts/gschema-gen.scm

@ -0,0 +1,684 @@ @@ -0,0 +1,684 @@
;;;
;;; Copyright (C) 2020 Alexandros Theodotou <alex at zrythm dot org>
;;;
;;; This file is part of Zrythm.
;;;
;;; Zrythm is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU Affero General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; Zrythm is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;;; GNU Affero General Public License for more details.
;;;
;;; You should have received a copy of the GNU Affero General Public License
;;; along with Zrythm. If not, see <http://www.gnu.org/licenses/>.
;;; This file generates the gsettings schema
(add-to-load-path "@SCRIPTS_DIR@")
(define-module (gschema-gen)
#:use-module (guile-utils)
#:use-module (ice-9 string-fun)
#:use-module (ice-9 format)
#:use-module (ice-9 match)
#:use-module (srfi srfi-1)
#:use-module (srfi srfi-9) ; records
#:use-module (sxml simple))
(define top-id "org.zrythm.Zrythm")
(define-record-type <schema-key>
(make-schema-key name type default summary
description)
schema-key?
(name schema-key-name)
(type schema-key-type)
(default schema-key-default)
(summary schema-key-summary)
(description schema-key-description)
(enum schema-key-enum
set-schema-key-enum!)
(range-min schema-key-range-min
set-schema-key-range-min!)
(range-max schema-key-range-max
set-schema-key-range-max!))
(define (make-schema-key-with-enum
name enum default summary description)
(let ((key (make-schema-key
name "" default summary description)))
(set-schema-key-enum! key enum)
key))
(define (make-schema-key-with-range
name type range-min range-max default
summary description)
(let ((key (make-schema-key
name type default summary description)))
(set-schema-key-range-min! key range-min)
(set-schema-key-range-max! key range-max)
key))
(define-record-type <schema>
(make-schema local-id keys)
schema?
;; ID after "org.zrythm.Zrythm."
(local-id schema-local-id)
(keys schema-keys)
(preferences-category
schema-preferences-category
set-schema-preferences-category!))
(define (schema-id schema)
(string-append
top-id "."
(if (string?
(schema-preferences-category schema))
(string-append
"preferences."
(schema-preferences-category schema) ".")
"")
(schema-local-id schema)))
(define (schema-path schema)
(string-append
"/"
(string-replace-substring
(schema-id schema) "." "/")
"/"))
(define (schema-print schema)
;; display header
(display
(string-append
" <schema id=\"" (schema-id schema) "\"
path=\"" (schema-path schema) "\">\n"))
;; display keys
(fold
(lambda (key keys)
(format #t
" <key name=\"~a\" ~a=\"~a\">
<default>~a</default>
<summary>~a</summary>
<description>~a</description>
</key>\n"
(schema-key-name key)
(if (string? (schema-key-enum key))
"enum"
"type")
(if (string? (schema-key-enum key))
(string-append
top-id "." (schema-key-enum key) "-enum")
(schema-key-type key))
(if (or
(string? (schema-key-enum key))
(string=? (schema-key-type key) "s"))
(string-append
"\"" (schema-key-default key) "\"")
(schema-key-default key))
(schema-key-summary key)
(schema-key-description key)))
'()
(schema-keys schema))
;; close
(display " </schema>\n\n"))
;; leave for reference
(define (print-enum-using-sxml in-id nicks)
(display " ")
(let* ((enum-id
(string-append top-id "."
in-id "-enum"))
(nicks
(let loop ((nicks nicks)
(idx 0)
(res '()))
(match nicks
(() (reverse res))
((nick . rest)
(loop
rest (1+ idx)
(cons `(value (@ (nick ,nick)
(value ,idx)))
res))))))
(sxml `(enum (@ (id ,enum-id)) ,nicks)))
(display (sxml->xml sxml)))
(newline))
(define (print-enum id nicks)
(display
(string-append
" <enum id=\"" top-id "." id "-enum\">\n"))
(fold
(lambda (nick idx)
(format #t
" <value nick=\"~a\" value=\"~d\"/>\n"
nick idx)
(1+ idx))
0
nicks)
(display " </enum>\n"))
(define-record-type <preferences-category>
(make-preferences-category name schemas)
preferences-category?
(name preferences-category-name)
(schemas preferences-category-schemas))
(define (preferences-category-print category)
;; display each schema in this preference category
(fold
(lambda (schema schemas)
(set-schema-preferences-category!
schema (preferences-category-name category))
(schema-print schema))
'()
(preferences-category-schemas category)))
#!
Args:
1: output file
2: top schema delimited by "."
!#
(define (main . args)
;; verify number of args
(unless (eq? (length args) 3)
(display "Need 2 arguments")
(newline)
(exit -1))
;; get args
(match args
((this-program output-file in-top-id)
(set! top-id in-top-id)
;; open file
(with-output-to-file output-file
(lambda ()
;; print top
(display
"<?xml version=\"1.0\" encoding=\"utf-8\"?>
<!--
Copyright (C) 2018-2020 Alexandros Theodotou <alex at zrythm dot org>
This file is part of Zrythm
Zrythm is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Zrythm is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with Zrythm. If not, see <https://www.gnu.org/licenses/>.
-->
<schemalist
gettext-domain=\"zrythm\">
")
;; print enums
(print-enum
"audio-backend"
'("none" "alsa" "jack" "portaudio" "sdl"
"rtaudio"))
(print-enum
"midi-backend"
'("none" "alsa" "jack" "windows-mme"
"rtmidi"))
(print-enum
"language"
'("ar" "cs" "da" "de" "en" "en_GB" "el"
"es" "et" "fi" "fr" "gd" "gl" "hi" "it"
"ja" "ko" "nb_NO" "nl" "pl" "pt" "pt_BR"
"ru" "sv" "zh"))
(print-enum
"export-time-range"
'("loop" "song" "custom"))
(print-enum
"export-format"
'("flac" "ogg" "wav" "mp3" "mid"))
(print-enum
"export-bit-depth"
'("16" "24"))
;; TODO
(print-enum
"note-length"
'("2/1" "1/1" "1/2"))
(print-enum
"note-type"
'("normal" "dotted" "triplet"))
(print-enum
"midi-modifier"
'("velocity" "aftertouch"))
(print-enum
"note-notation"
'("notes" "numbers"))
(print-enum
"plugin-browser-tab"
'("collection" "category" "protocol"))
(print-enum
"plugin-browser-filter"
'("none" "instrument" "effect" "modulator"
"midi-effect"))
(print-enum
"piano-roll-highlight"
'("none" "chord" "scale" "both"))
(print-enum
"pan-law"
'("zero-db" "minus-three-db"
"minus-six-db" ))
(print-enum
"pan-algorithm"
'("linear" "sqrt" "sine"))
(print-enum
"curve-algorithm"
'("exponent" "superellipse" "vital"))
(print-enum
"buffer-size"
'("16" "32" "64" "128" "256" "512" "1024"
"2048" "4096"))
(print-enum
"sample-rate"
'("22050" "32000" "44100" "48000" "88200"
"96000" "192000"))
(newline)
;; -- print normal schemas --
(schema-print
(make-schema
"general"
(list
(make-schema-key
"recent-projects" "as" "[]"
"Recent project list"
"A list of recent projects to be referenced on startup.")
(make-schema-key
"first-run" "b" "true"
"First run"
"Whether this is the first run or not.")
(make-schema-key
"install-dir" "s" ""
"Installation directory"
"This is the directory Zrythm is installed in. Currently only used on Windows.")
(make-schema-key
"last-project-dir" "s" ""
"Last project directory"
"Last directory a project was created in.")
))) ;; general
(schema-print
(make-schema
"ui"
(list
(make-schema-key
"bounce-with-effects" "b" "true"
"Bounce with effects"
"If set to true, the effects chain will be included in the bounced material.")
(make-schema-key
"bounce-tail" "i" "0"
"Bounce tail"
"Tail to allow when bouncing (for example to catch reverb tails), in milliseconds.")
(make-schema-key-with-enum
"timeline-object-length"
"note-length" "1/1"
"Timeline object length"
"Default length to use when creating timelinle objects, eg in edit mode.")
(make-schema-key-with-enum
"timeline-object-length-type"
"note-type" "normal"
"Timeline object length type"
"Default length type to use when creating timelinle objects, eg in edit mode.")
(make-schema-key-with-enum
"editor-object-length"
"note-length" "1/1"
"Editor object length"
"Default length to use when creating timelinle objects, eg in edit mode.")
(make-schema-key-with-enum
"editor-object-length-type"
"note-type" "normal"
"Editor object length type"
"Default length type to use when creating timelinle objects, eg in edit mode.")
(make-schema-key-with-enum
"piano-roll-note-notation"
"note-notation" "notes"
"Note notation"
"The note notation used in the piano roll - MIDI pitch index or notes (C, C#, etc.)")
(make-schema-key
"metronome-enabled" "b" "false"
"Metronome enabled"
"Whether the metronome is enabled.")
(make-schema-key
"musical-mode" "b" "true"
"Musical mode"
"Whether to use musical mode. If this is on, time-stretching will be applied to events so that they match the project BPM. This mostly applies to audio regions.")
(make-schema-key
"listen-notes" "b" "true"
"Listen to notes while they are moved"
"Whether to listen to MIDI notes while dragging them in the piano roll.")
(make-schema-key-with-enum
"piano-roll-highlight"
"piano-roll-highlight" "none"
"Piano roll highlight"
"Whether to highlight chords, scales, both or none in the piano roll.")
(make-schema-key-with-enum
"piano-roll-midi-modifier"
"midi-modifier" "velocity"
"Piano roll MIDI modifier"
"The MIDI modifier to display in the MIDI editor (only velocity is valid at the moment).")
(make-schema-key
"browser-divider-position" "i" "220"
"Browser divider position"
"Height of the top part of the plugin/file browser.")
(make-schema-key
"left-panel-divider-position" "i"
"180"
"Left panel divider position"
"Position of the resize handle of the left panel.")
(make-schema-key
"right-panel-divider-position" "i"
"180"
"Right panel divider position"
"Position of the resize handle of the right panel.")
(make-schema-key
"bot-panel-divider-position" "i"
"180"
"Bot panel divider position"
"Position of the resize handle of the bot panel.")
(make-schema-key-with-enum
"plugin-browser-tab"
"plugin-browser-tab" "category"
"Plugin browser tab"
"Selected plugin browser tab.")
(make-schema-key-with-enum
"plugin-browser-filter"
"plugin-browser-filter" "none"
"Plugin browser filter"
"Selected plugin browser filter")
(make-schema-key
"timeline-event-viewer-visible" "b"
"false"
"Timeline event viewer visibility"
"Whether the timeline event viewer is visible or not.")
(make-schema-key
"editor-event-viewer-visible" "b"
"false"
"Editor event viewer visibility"
"Whether the editor event viewer is visible or not.")
(make-schema-key-with-range
"monitor-out-vol" "d"
"0.0" "2.0" "1.0"
"Monitor out volume"
"The monitor out volume in amplitude (0 to 2).")
))) ;; ui
(schema-print
(make-schema
"export"
(list
(make-schema-key
"genre" "s" "Electronic"
"Genre"
"Genre to use when exporting, if the file type supports it.")
(make-schema-key-with-enum
"time-range" "export-time-range"
"song"
"Time range"
"Time range to export.")
(make-schema-key-with-enum
"format" "export-format" "flac"
"Format"
"Format to export to.")
(make-schema-key
"dither" "b" "false"
"Dither"
"Add dither while exporting, if applicable.")
(make-schema-key-with-enum
"bit-depth"
"export-bit-depth" "24"
"Bit depth"
"Bit depth to use when exporting")
))) ;; export
(schema-print
(make-schema
"ui.inspector"
(list
(make-schema-key
"track-properties-expanded" "b"
"true"
"Track properties expanded"
"Whether track properties is expanded.")
(make-schema-key
"track-outputs-expanded" "b"
"true"
"Track outputs expanded"
"Whether track outputs is expanded.")
(make-schema-key
"track-sends-expanded" "b"
"true"
"Track sends expanded"
"Whether track sends is expanded.")
(make-schema-key
"track-inputs-expanded" "b"
"true"
"Track inputs expanded"
"Whether track inputs is expanded.")
(make-schema-key
"track-controls-expanded" "b"
"true"
"Track controls expanded"
"Whether track controls is expanded.")
(make-schema-key
"track-inserts-expanded" "b"
"true"
"Track inserts expanded"
"Whether track inserts is expanded.")
(make-schema-key
"track-midi-fx-expanded" "b"
"true"
"Track midi-fx expanded"
"Whether track midi-fx is expanded.")
(make-schema-key
"track-fader-expanded" "b"
"true"
"Track fader expanded"
"Whether track fader is expanded.")
(make-schema-key
"track-comment-expanded" "b"
"true"
"Track comment expanded"
"Whether track comment is expanded.")
))) ;; ui.inspector
;; -- print preferences schemas --
(preferences-category-print
(make-preferences-category
"general"
(list
(make-schema
"engine"
(list
(make-schema-key-with-enum
"audio-backend" "audio-backend"
"none" "Audio backend"
"The audio backend to use.")
(make-schema-key
"rtaudio-audio-device-name" "s"
"" "RtAudio device"
"The name of the RtAudio device to use.")
(make-schema-key-with-enum
"sample-rate" "sample-rate"
"48000" "Samplerate"
"Samplerate to pass to the backend.")
(make-schema-key-with-enum
"buffer-size" "buffer-size"
"512" "Buffer size"
"Buffer size to pass to the backend.")
(make-schema-key-with-enum
"midi-backend" "midi-backend"
"none" "MIDI backend"
"The MIDI backend to use.")
(make-schema-key
"midi-controllers" "as"
"[]" "MIDI controllers"
"A list of controllers to auto-connect to.")
)) ;; general/engine
(make-schema
"paths"
(list
(make-schema-key
"zrythm-dir" "s"
"" "Zrythm path"
"The directory used to save projects and other files in.")
)) ;; general/paths