Commit 57e31283 authored by Brandon Invergo's avatar Brandon Invergo

Wrap up low-level programming documentation

parent 5cbca4d6
......@@ -3014,28 +3014,170 @@ MIDI controls:
@node Low-Level Programming
@section Low-Level Programming Reference
All of the procedures described in the following sections are defined
in the @samp{(librekontrol core)} module.
@menu
* Low-Level Devices::
* Low-Level ALSA Hardware Controls::
* Low-Level Input Events::
* Low-Level MIDI::
* Hooks::
* MIDI::
* Remapping Events::
@end menu
@node Low-Level Devices
@subsection Low-Level Devices
@defun open-device alsa-name input-name open-midi-seq? open-input-remapper?
Open the device associated with ALSA device @var{ALSA-NAME} and/or
input device @var{input-name}. Optionally open a MIDI sequencer for
the device if @var{open-midi-seq?} is @samp{#t}. Optionally open an
input remapper if @var{open-input-remapper?} is @samp{#t}.
Return @var{#f} if something goes wrong.
@end defun
@node Low-Level ALSA Hardware Controls
@subsection Low-Level ALSA Hardware Controls
@defun open-ctl device idnum
Open the ALSA control with numeric ID @var{idnum} on @var{device}.
Return @var{#f} if something goes wrong.
@end defun
@defun set-boolean-ctl alsa-ctl value
@defunx toggle-boolean-ctl alsa-ctl
@defunx get-boolean-ctl alsa-ctl
Set a boolean-valued @var{alsa-ctl} to @var{value}, toggle its value
between @samp{#f} and @samp{#t}, or get its current value.
@end defun
@defun set-integer-ctl alsa-ctl value
@defunx get-integer-ctl alsa-ctl
Set an integer-valued @var{alsa-ctl} to @var{value}, or get its
current value.
@end defun
@defun integer-ctl-max alsa-ctl
@defunx integer-ctl-min alsa-ctl
Get the maximum or minimum allowable values for integer-valued
@var{alsa-ctl}.
@end defun
@node Low-Level Input Events
@subsection Low-Level Input Events
@defun abs-input-max device event-code
@defunx abs-input-min device event-code
Get the maximum or minimum possible values for an absolute-position
input event @var{event-code} on @var{device}.
@end defun
@defun remap-enable-event device type code
@defunx remap-disable-event device type code
Enable/disable the event corresponding to @var{type} and @var{code}
for @var{device}'s input remapper.
@end defun
@defun remap-set-abs-info device code min max resolution fuzz flat
Set parameters related to absolute-position event @var{code} that has
been enabled for @var{device}'s input remapper. @var{min} and
@var{max} set the minimum and maximum values, respectively.
@var{resolution}, @var{fuzz} and @var{flat} modify the sensitivity of
the event(?). All of the parameters should have integer values.
@end defun
@defun finalize-remap-dev device
Finalize the input remapper for @var{device}. This function must be
called after all desired remap events have been enabled but before any
remapped events are actually generated.
@end defun
@defun send-remap-event device type code value
Generate a remap event for @var{device} corresponding to @var{type}
and @var{code} at @var{value}. The event must have already been
enabled via @var{remap-enable-event} and the remapper must have
already been finalized via @var{finalize-remap-dev}.
@end defun
@node Low-Level MIDI
@subsection Low-Level MIDI
All MIDI event-related arguments should be integers (@var{channel},
@var{note}, etc).
@defun send-midi-keypress device channel note velocity
Send a MIDI keypress event to @var{device}'s MIDI sequencer on
@var{channel} for @var{note} at @var{velocity}. All MIDI arguments should
be integers.
@end defun
@defun send-midi-note device channel note velocity duration
Send a MIDI keypress event to @var{device}'s MIDI sequencer on
@var{channel} for @var{note} at @var{velocity} for @var{duration}.
All MIDI arguments should be integers.
@end defun
@defun send-midi-noteon device channel note velocity
@defunx send-midi-noteoff device channel note velocity
Send a MIDI note on/off event to @var{device}'s MIDI sequencer on
@var{channel} for @var{note} at @var{velocity}. All MIDI arguments should
be integers.
@end defun
@defun send-midi-pgmchange device channel value
Send a MIDI program-change event to @var{device's} MIDI sequencer on
@var{channel} for @var{value}. All MIDI arguments should be integers.
@end defun
@defun send-midi-pitchbend device channel value
Send a MIDI pitchbend event to @var{device's} MIDI sequencer on
@var{channel} for @var{value}.
@end defun
@defun send-midi-control device channel param value
Send a MIDI control-change event to @var{device's} MIDI sequencer on
@var{channel}, setting @var{param} to @var{value}.
@end defun
@node Hooks
@subsection Hooks
@node MIDI
@subsection MIDI
@defun add-event-hook! device event proc
@defunx remove-event-hook! device event proc
Add/remove @var{proc} to/from the list of procedures to be called when
@var{event} is generated by @var{device}.
@end defun
@defun reset-event-hook! device event
Remove all procedures associated with @var{event} on @var{device}.
@end defun
@defun add-idle-hook! device proc
@defunx remove-idle-hook! device proc
Add/remove @var{proc} to/from the list of procedures to be called on
@var{device}'s idle thread at periodic intervals.
@end defun
@defun reset-idle-hook! device
Remove all idle procedures for @var{device}.
@end defun
@defun set-idle-wait! device value
Set the number of seconds to wait before triggering @var{device}'s
idle procedures to @var{value}.
@end defun
@node Remapping Events
@subsection Remapping Events
@defun add-exit-hook! device proc
@defunx remove-exit-hook! device proc
Add/remove @var{proc} to/from the list of procedures to be called for
@var{device} when Librekontrol exits
@end defun
@defun reset-exit-hook! device
Remove all exit procedures for @var{device}.
@end defun
@node Specific Devices
@section Specific Devices
......
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