Commit 0b1a35b1 authored by Brandon Invergo's avatar Brandon Invergo

Include the option to open a MIDI sequencer or create an

input remapper in configure-device
parent 7398dce4
......@@ -1027,13 +1027,22 @@ These optional arguments will then be passed to the
@end defun
@defun configure-device @
[alsa-name input-name remap-events controls idle-wait idle-hooks @
exit-hooks init]
[alsa-name input-name open-midi-seq create-input-remapper @
remap-events controls idle-wait idle-hooks exit-hooks init]
Open a device using ALSA device @var{alsa-name} and/or input device
@var{input-name}. The device is further configured through additional
keyword arguments. An argument that is not present or set to
@samp{#f} is ignored.
@var{input-name}.
If @var{open-midi-seq} is @samp{#t} open an ALSA MIDI sequencer for
the device (which will be called ``Librekontrol <alsa-name>
read/write''). If @var{create-input-remapper} is @samp{#t}, an input
remapper is created for the device, which is required to send new
input events. Both @var{open-midi-seq} and
@var{create-input-remapper} default to @samp{#t} if they are not
specified.
The device is further configured through additional keyword arguments.
An argument that is not present or set to @samp{#f} is ignored.
Any ``virtual'' input events to be generated by the device through
event-remapping must first be listed in @var{remap-events}. The
......
......@@ -90,12 +90,16 @@ activated (i.e. when the input event associated with CONTROL occurs)."
;; Device configuration ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;
(define* (configure-device #:key alsa-name input-name
(open-midi-seq #t)
(create-input-remapper #t)
remap-events controls
(idle-wait 1.0) idle-hooks
exit-hooks init)
"Open a device using ALSA device ALSA-NAME and input device
INPUT-NAME. Set up the device further through optional arguments:
#:open-midi-seq -- Open a MIDI sequencer (default: #t)
#:create-input-remapper -- Create an input remapper (default: #t)
#:remap-events -- A list of input events constructed using 'make-input-event',
enabling the device to remap input events to these events.
#:controls -- A list of control definitions, each specified as a list
......@@ -105,7 +109,8 @@ INPUT-NAME. Set up the device further through optional arguments:
#:idle-hooks -- A list of procedures to run on the idle timer
#:exit-hooks -- A list of procedures to run when the program exits
#:init -- Extra device initialization routines"
(let ((device (open-device alsa-name input-name #t #t)))
(let ((device (open-device alsa-name input-name open-midi-seq
create-input-remapper)))
(when device
(if remap-events
(begin
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment