Browse Source

user-manual: update Scripting chapter

* mention ECMAScript support
* update scripting dialog image
audio_region_bpm_change_fix
Alexandros Theodotou 4 months ago
parent
commit
905c7dda9a
Signed by: alex
GPG Key ID: 022EAE42313D70F3
  1. BIN
      doc/user/_static/img/scripting-interface.png
  2. 3
      doc/user/getting-started/getting-plugins.rst
  3. 663
      doc/user/locale/af_ZA/LC_MESSAGES/zrythm-manual.po
  4. 662
      doc/user/locale/ar/LC_MESSAGES/zrythm-manual.po
  5. 694
      doc/user/locale/ca/LC_MESSAGES/zrythm-manual.po
  6. 669
      doc/user/locale/de/LC_MESSAGES/zrythm-manual.po
  7. 673
      doc/user/locale/el/LC_MESSAGES/zrythm-manual.po
  8. 663
      doc/user/locale/en_GB/LC_MESSAGES/zrythm-manual.po
  9. 665
      doc/user/locale/es/LC_MESSAGES/zrythm-manual.po
  10. 662
      doc/user/locale/fa/LC_MESSAGES/zrythm-manual.po
  11. 672
      doc/user/locale/fr/LC_MESSAGES/zrythm-manual.po
  12. 665
      doc/user/locale/gl/LC_MESSAGES/zrythm-manual.po
  13. 662
      doc/user/locale/he/LC_MESSAGES/zrythm-manual.po
  14. 662
      doc/user/locale/hi/LC_MESSAGES/zrythm-manual.po
  15. 662
      doc/user/locale/hu/LC_MESSAGES/zrythm-manual.po
  16. 662
      doc/user/locale/id/LC_MESSAGES/zrythm-manual.po
  17. 663
      doc/user/locale/it/LC_MESSAGES/zrythm-manual.po
  18. 672
      doc/user/locale/ja/LC_MESSAGES/zrythm-manual.po
  19. 663
      doc/user/locale/ko/LC_MESSAGES/zrythm-manual.po
  20. 668
      doc/user/locale/nb_NO/LC_MESSAGES/zrythm-manual.po
  21. 662
      doc/user/locale/nl/LC_MESSAGES/zrythm-manual.po
  22. 662
      doc/user/locale/pl/LC_MESSAGES/zrythm-manual.po
  23. 673
      doc/user/locale/pt/LC_MESSAGES/zrythm-manual.po
  24. 663
      doc/user/locale/pt_BR/LC_MESSAGES/zrythm-manual.po
  25. 673
      doc/user/locale/ru/LC_MESSAGES/zrythm-manual.po
  26. 664
      doc/user/locale/sv/LC_MESSAGES/zrythm-manual.po
  27. 662
      doc/user/locale/th/LC_MESSAGES/zrythm-manual.po
  28. 662
      doc/user/locale/tr/LC_MESSAGES/zrythm-manual.po
  29. 663
      doc/user/locale/uk/LC_MESSAGES/zrythm-manual.po
  30. 662
      doc/user/locale/vi/LC_MESSAGES/zrythm-manual.po
  31. 668
      doc/user/locale/zh_CN/LC_MESSAGES/zrythm-manual.po
  32. 663
      doc/user/locale/zh_TW/LC_MESSAGES/zrythm-manual.po
  33. 3
      doc/user/scripting/examples.rst
  34. 3
      doc/user/scripting/examples.rst.in
  35. 53
      doc/user/scripting/overview.rst
  36. 21
      doc/user/scripting/scripting-interface.rst
  37. 1
      inc/guile/guile.h
  38. 3
      src/gui/widgets/dialogs/scripting_dialog.c
  39. 2
      src/guile/guile.c

BIN
doc/user/_static/img/scripting-interface.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 78 KiB

After

Width:  |  Height:  |  Size: 78 KiB

3
doc/user/getting-started/getting-plugins.rst

@ -1,5 +1,6 @@ @@ -1,5 +1,6 @@
.. SPDX-FileCopyrightText: © 2019-2020 Alexandros Theodotou <alex@zrythm.org>
.. SPDX-License-Identifier: GFDL-1.3-invariants-or-later
.. This is part of the Zrythm Manual.
Copyright (C) 2019-2020 Alexandros Theodotou <alex at zrythm dot org>
See the file index.rst for copying conditions.
.. sectionauthor:: Alexandros Theodotou <alex@zrythm.org>

663
doc/user/locale/af_ZA/LC_MESSAGES/zrythm-manual.po

File diff suppressed because it is too large Load Diff

662
doc/user/locale/ar/LC_MESSAGES/zrythm-manual.po

File diff suppressed because it is too large Load Diff

694
doc/user/locale/ca/LC_MESSAGES/zrythm-manual.po

File diff suppressed because it is too large Load Diff

669
doc/user/locale/de/LC_MESSAGES/zrythm-manual.po

File diff suppressed because it is too large Load Diff

673
doc/user/locale/el/LC_MESSAGES/zrythm-manual.po

File diff suppressed because it is too large Load Diff

663
doc/user/locale/en_GB/LC_MESSAGES/zrythm-manual.po

File diff suppressed because it is too large Load Diff

665
doc/user/locale/es/LC_MESSAGES/zrythm-manual.po

File diff suppressed because it is too large Load Diff

662
doc/user/locale/fa/LC_MESSAGES/zrythm-manual.po

File diff suppressed because it is too large Load Diff

672
doc/user/locale/fr/LC_MESSAGES/zrythm-manual.po

File diff suppressed because it is too large Load Diff

665
doc/user/locale/gl/LC_MESSAGES/zrythm-manual.po

File diff suppressed because it is too large Load Diff

662
doc/user/locale/he/LC_MESSAGES/zrythm-manual.po

File diff suppressed because it is too large Load Diff

662
doc/user/locale/hi/LC_MESSAGES/zrythm-manual.po

File diff suppressed because it is too large Load Diff

662
doc/user/locale/hu/LC_MESSAGES/zrythm-manual.po

File diff suppressed because it is too large Load Diff

662
doc/user/locale/id/LC_MESSAGES/zrythm-manual.po

File diff suppressed because it is too large Load Diff

663
doc/user/locale/it/LC_MESSAGES/zrythm-manual.po

File diff suppressed because it is too large Load Diff

672
doc/user/locale/ja/LC_MESSAGES/zrythm-manual.po

File diff suppressed because it is too large Load Diff

663
doc/user/locale/ko/LC_MESSAGES/zrythm-manual.po

File diff suppressed because it is too large Load Diff

668
doc/user/locale/nb_NO/LC_MESSAGES/zrythm-manual.po

File diff suppressed because it is too large Load Diff

662
doc/user/locale/nl/LC_MESSAGES/zrythm-manual.po

File diff suppressed because it is too large Load Diff

662
doc/user/locale/pl/LC_MESSAGES/zrythm-manual.po

File diff suppressed because it is too large Load Diff

673
doc/user/locale/pt/LC_MESSAGES/zrythm-manual.po

File diff suppressed because it is too large Load Diff

663
doc/user/locale/pt_BR/LC_MESSAGES/zrythm-manual.po

File diff suppressed because it is too large Load Diff

673
doc/user/locale/ru/LC_MESSAGES/zrythm-manual.po

File diff suppressed because it is too large Load Diff

664
doc/user/locale/sv/LC_MESSAGES/zrythm-manual.po

File diff suppressed because it is too large Load Diff

662
doc/user/locale/th/LC_MESSAGES/zrythm-manual.po

File diff suppressed because it is too large Load Diff

662
doc/user/locale/tr/LC_MESSAGES/zrythm-manual.po

File diff suppressed because it is too large Load Diff

663
doc/user/locale/uk/LC_MESSAGES/zrythm-manual.po

File diff suppressed because it is too large Load Diff

662
doc/user/locale/vi/LC_MESSAGES/zrythm-manual.po

File diff suppressed because it is too large Load Diff

668
doc/user/locale/zh_CN/LC_MESSAGES/zrythm-manual.po

File diff suppressed because it is too large Load Diff

663
doc/user/locale/zh_TW/LC_MESSAGES/zrythm-manual.po

File diff suppressed because it is too large Load Diff

3
doc/user/scripting/examples.rst

@ -1,5 +1,6 @@ @@ -1,5 +1,6 @@
.. SPDX-FileCopyrightText: © 2020 Alexandros Theodotou <alex@zrythm.org>
.. SPDX-License-Identifier: GFDL-1.3-invariants-or-later
.. This is part of the Zrythm Manual.
Copyright (C) 2020 Alexandros Theodotou <alex at zrythm dot org>
See the file index.rst for copying conditions.
Examples

3
doc/user/scripting/examples.rst.in

@ -1,5 +1,6 @@ @@ -1,5 +1,6 @@
.. SPDX-FileCopyrightText: © 2020-2021 Alexandros Theodotou <alex@zrythm.org>
.. SPDX-License-Identifier: GFDL-1.3-invariants-or-later
.. This is part of the Zrythm Manual.
Copyright (C) 2020-2021 Alexandros Theodotou <alex at zrythm dot org>
See the file index.rst for copying conditions.
Examples

53
doc/user/scripting/overview.rst

@ -1,27 +1,52 @@ @@ -1,27 +1,52 @@
.. SPDX-FileCopyrightText: © 2020, 2022 Alexandros Theodotou <alex@zrythm.org>
.. SPDX-License-Identifier: GFDL-1.3-invariants-or-later
.. This is part of the Zrythm Manual.
Copyright (C) 2020 Alexandros Theodotou <alex at zrythm dot org>
See the file index.rst for copying conditions.
Overview
========
Zrythm offers a scripting interface using the
`GNU Guile language <https://www.gnu.org/software/guile/>`_,
an implementation of
`Scheme <https://en.wikipedia.org/wiki/Scheme_%28programming_language%29>`_,
which is a dialect of
`LISP <https://en.wikipedia.org/wiki/Lisp_(programming_language)>`_.
Zrythm offers a scripting interface implemented
using
`GNU Guile <https://www.gnu.org/software/guile/>`_
that supports multiple scripting languages.
Zrythm currently supports the following scripting
languages:
The next section is a comprehensive list of all
available procedures in the API. Each section
in the API corresponds to a specific Guile module,
so for example, to use the procedures in
the :scheme:`audio position` section, one would do
:scheme:`(use-modules (audio position))` at the top
of the script.
- `ECMAScript <https://en.wikipedia.org/wiki/ECMAScript>`_
- `Scheme <https://en.wikipedia.org/wiki/Scheme_%28programming_language%29>`_
.. - `Emacs Lisp <https://en.wikipedia.org/wiki/Emacs_Lisp>`_
.. warning:: The Guile API is experimental.
.. note:: The Guile API is not available on Windows.
See `this ticket <https://github.com/msys2/MINGW-packages/issues/3298>`_
for details.
The :ref:`API section <scripting/api/intro:API>`
is a comprehensive list of all
available procedures in the API. Each section
in the API corresponds to a specific Guile module.
Using Modules
~~~~~~~~~~~~~
To use the :scheme:`audio position` module from
Scheme, use the following code:
.. code-block:: scheme
(use-modules (audio position))
(let* ((pos (position-new 1 1 1 0 0)))
(position-print pos))
To use it from ECMAScript, use:
.. code-block:: javascript
var position_module = require ('audio.position');
var position_new = position_module['position-new'];
var pos = position_new (1, 1, 1, 0, 0);
var position_print = position_module['position-print'];
position_print (pos);

21
doc/user/scripting/scripting-interface.rst

@ -1,5 +1,6 @@ @@ -1,5 +1,6 @@
.. SPDX-FileCopyrightText: © 2022 Alexandros Theodotou <alex@zrythm.org>
.. SPDX-License-Identifier: GFDL-1.3-invariants-or-later
.. This is part of the Zrythm Manual.
Copyright (C) 2022 Alexandros Theodotou <alex at zrythm dot org>
See the file index.rst for copying conditions.
Scripting Interface
@ -16,6 +17,18 @@ will bring up the scripting interface dialog. @@ -16,6 +17,18 @@ will bring up the scripting interface dialog.
Scripting interface
Scripts can be edited in the editor found in the
top part of the scrpiting interface. Pressing
:guilabel:`Execute` will execute the script and
print any output in the label at the bottom.
top part of the scrpiting interface.
Execution
~~~~~~~~~
Pressing :guilabel:`Execute` will execute the
script and print any output in the label at the
bottom.
Changing Language
~~~~~~~~~~~~~~~~~
The language of the script can be selected using
the provided dropdown. Changing the language will
also affect code highlighting.

1
inc/guile/guile.h

@ -38,6 +38,7 @@ typedef enum GuileScriptLanguage @@ -38,6 +38,7 @@ typedef enum GuileScriptLanguage
{
GUILE_SCRIPT_LANGUAGE_SCHEME,
GUILE_SCRIPT_LANGUAGE_ECMASCRIPT,
//GUILE_SCRIPT_LANGUAGE_ELISP,
NUM_GUILE_SCRIPT_LANGUAGES,
} GuileScriptLanguage;

3
src/gui/widgets/dialogs/scripting_dialog.c

@ -71,6 +71,9 @@ on_lang_selection_changed ( @@ -71,6 +71,9 @@ on_lang_selection_changed (
case GUILE_SCRIPT_LANGUAGE_ECMASCRIPT:
source_lang_str = "js";
break;
case GUILE_SCRIPT_LANGUAGE_ELISP:
source_lang_str = "commonlisp";
break;
default:
g_return_if_reached ();
}

2
src/guile/guile.c

@ -36,11 +36,13 @@ typedef struct ExecutionInfo @@ -36,11 +36,13 @@ typedef struct ExecutionInfo
static const char * guile_lang_strings[] = {
"Scheme",
"ECMAScript",
"Emacs Lisp",
};
static const char * guile_lang_canonical_strings[] = {
"scheme",
"ecmascript",
"elisp",
};
const char *

Loading…
Cancel
Save