guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

05/07: services: Split ladspa-service-type from pulseaudio-service-type.


From: guix-commits
Subject: 05/07: services: Split ladspa-service-type from pulseaudio-service-type.
Date: Sat, 11 Jan 2020 12:22:57 -0500 (EST)

mbakke pushed a commit to branch master
in repository guix.

commit f1022fbf2f16b0c9ae9fa0f8af4e61e035fec4cf
Author: Leo Prikler <address@hidden>
AuthorDate: Fri Jan 10 02:48:22 2020 +0100

    services: Split ladspa-service-type from pulseaudio-service-type.
    
    * 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.
    
    Signed-off-by: Marius Bakke <address@hidden>
---
 doc/guix.texi          | 20 +++++++++++---------
 gnu/services/sound.scm | 38 +++++++++++++++++++++++++++++++++-----
 2 files changed, 44 insertions(+), 14 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 3693bb5..af6ffbb 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 4ec6120..a1c9282 100644
--- a/gnu/services/sound.scm
+++ b/gnu/services/sound.scm
@@ -36,7 +36,10 @@
             alsa-service-type
 
             pulseaudio-configuration
-            pulseaudio-service-type))
+            pulseaudio-service-type
+
+            ladspa-configuration
+            ladspa-service-type))
 
 ;;; Commentary:
 ;;;
@@ -125,10 +128,7 @@ ctl.!default {
                         (file-append pulseaudio "/etc/pulse/system.pa"))))
 
 (define (pulseaudio-environment config)
-  ;; Define this variable in the global environment such that
-  ;; pulseaudio swh-plugins works.
-  `(("LADSPA_PATH" . ,(file-append swh-plugins "/lib/ladspa"))
-    ;; Define these variables, so that pulseaudio honors /etc.
+  `(;; Define these variables, so that pulseaudio honors /etc.
     ("PULSE_CONFIG" . "/etc/pulse/daemon.conf")
     ("PULSE_CLIENTCONFIG" . "/etc/pulse/client.conf")))
 
@@ -166,4 +166,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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]