[PATCH 4/6] services: Split ladspa-service-type from pulseaudio-service-type.

  • Done
  • quality assurance status badge
Details
2 participants
  • Leo Prikler
  • Marius Bakke
Owner
unassigned
Submitted by
Leo Prikler
Severity
normal
Merged with
L
L
Leo Prikler wrote on 10 Jan 2020 02:48
(address . guix-patches@gnu.org)(address . 39053@debbugs.gnu.org)
20200110014823.10595-4-leo.prikler@student.tugraz.at
* gnu/services/sound.scm (ladspa-configuration): New record.
(ladspa-environment): New procedure.
(ladspa-service-type): New service type.
(pulseaudio-environment): Remove LADSPA_PATH.
* doc/guix.texi: Adjust documentation.
---
doc/guix.texi | 20 +++++++++++---------
gnu/services/sound.scm | 33 ++++++++++++++++++++++++++++++++-
2 files changed, 43 insertions(+), 10 deletions(-)

Toggle diff (86 lines)
diff --git a/doc/guix.texi b/doc/guix.texi
index 60491af4d4..431895aa7d 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -15951,19 +15951,21 @@ pcm.!default @{
See @uref{https://www.alsa-project.org/main/index.php/Asoundrc} for the
details.
-@deffn {Scheme Variable} pulseaudio-service-type
-This is the type for the @uref{http://www.pulseaudio.org/, PulseAudio
-sound server}, which sets the @var{LADSPA_PATH} environment variable to
-allow PulseAudio load modules from @code{swh-plugins} package.
+@deffn {Scheme Variable} ladspa-service-type
+This service sets the @var{LADSPA_PATH} variable, so that programs, which
+respect it, e.g. PulseAudio, can load LADSPA plugins.
-See @uref{http://plugin.org.uk/ladspa-swh/docs/ladspa-swh.html} for the
-details.
-
-The following example will setup the service:
+The following example will setup the service to enable modules from the
+@code{swh-plugins} package:
@lisp
-(service pulseaudio-service-type)
+(service ladspa-service-type
+ (ladspa-configuration (plugins (list swh-plugins))))
@end lisp
+
+See @uref{http://plugin.org.uk/ladspa-swh/docs/ladspa-swh.html} for the
+details.
+
@end deffn
@node Database Services
diff --git a/gnu/services/sound.scm b/gnu/services/sound.scm
index 5d72b3ada2..64b45f585f 100644
--- a/gnu/services/sound.scm
+++ b/gnu/services/sound.scm
@@ -35,7 +35,10 @@
alsa-service-type
pulseaudio-configuration
- pulseaudio-service-type))
+ pulseaudio-service-type
+
+ ladspa-configuration
+ ladspa-service-type))
;;; Commentary:
;;;
@@ -162,4 +165,32 @@ ctl.!default {
(default-value (pulseaudio-configuration))
(description "Configure PulseAudio sound support.")))
+
+;;;
+;;; LADSPA
+;;;
+
+(define-record-type* <ladspa-configuration>
+ ladspa-configuration make-ladspa-configuration
+ ladspa-configuration?
+ (plugins ladspa-plugins (default '())))
+
+(define (ladspa-environment config)
+ ;; Define this variable in the global environment such that
+ ;; pulseaudio swh-plugins (and similar LADSPA plugins) work.
+ `(("LADSPA_PATH" .
+ (string-join
+ ',(map (lambda (package) (file-append package "/lib/ladspa"))
+ (ladspa-plugins config))
+ ":"))))
+
+(define ladspa-service-type
+ (service-type
+ (name 'ladspa)
+ (extensions
+ (list (service-extension session-environment-service-type
+ ladspa-environment)))
+ (default-value (ladspa-configuration))
+ (description "Configure LADSPA plugins.")))
+
;;; sound.scm ends here
--
2.24.1
M
M
Marius Bakke wrote on 11 Jan 2020 17:54
(address . control@debbugs.gnu.org)
87v9piyluy.fsf@devup.no
merge 39053 39052 39054 39055 39062 39061 39063 39065 39064
thanks
M
M
Marius Bakke wrote on 11 Jan 2020 18:00
(address . 39053@debbugs.gnu.org)
87o8vayll9.fsf@devup.no
Leo Prikler <leo.prikler@student.tugraz.at> writes:

Toggle quote (6 lines)
> * gnu/services/sound.scm (ladspa-configuration): New record.
> (ladspa-environment): New procedure.
> (ladspa-service-type): New service type.
> (pulseaudio-environment): Remove LADSPA_PATH.
> * doc/guix.texi: Adjust documentation.

This forgot to actually remove LADSPA_PATH from PULSEAUDIO-ENVIRONMENT;
fixed!

The previous pulseaudio-service-type is so recent that I don't think a
deprecation notice is necessary.
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAl4Z/zIACgkQoqBt8qM6
VPorxwf/fzQVqYCtE2l+9oO1DJ8ojWz2pjs2Tgh93UGTSkEZs6RA+g37PwYIBdr5
aYn/RXEWRSurDRGVMxyyY3aMftdiEfDt7LTzML24PLBjPhpKwXPpASDCMfWFz4s0
S2nHHm9I1j7D2IwBgyl5q1F87dFP1sRFP2vhuGxBKTVFcYgrAaZL8+bPshMvcAX1
fY4vmjrEfsHNpwclxioZA/9/aN1q3OWk/HPb3qdyLlV5NZ8c8nshkUwsCvTwJ5l/
EUhwi012iAA/O9QiwCkfonQ1f86TEVWtvBKE+EPytCFS/7iKAFbcNXfoiLRvOOAN
HM47ptVk8g7kXsCCA7uqBik27YLDAw==
=r1jm
-----END PGP SIGNATURE-----

?