Crate djio

Source
Expand description

§djio

crates.io Docs Dependencies Testing License: MPL 2.0

Application-independent interfaces for accessing hardware DJ controllers through MIDI or HID.

§Supported Controllers

§MIDI

  • Denon DJ MC6000MK2
  • Korg KAOSS DJ
  • Pioneer DDJ-400

§HID

  • Native Instruments TRAKTOR KONTROL S4MK3

§Examples

§Hotplugging of DJ MIDI controllers

RUST_LOG=debug cargo run --example midi-dj-controller-hotplug

§Credits

We have been inspired by and adopted some ideas from the following projects:

§License

Licensed under the Mozilla Public License 2.0 (MPL-2.0) (see MPL-2.0.txt or https://www.mozilla.org/MPL/2.0/).

Permissions of this copyleft license are conditioned on making available source code of licensed files and modifications of those files under the same license (or in certain cases, one of the GNU licenses). Copyright and license notices must be preserved. Contributors provide an express grant of patent rights. However, a larger work using the licensed work may be distributed under different terms and without source code for files added in the larger work.

§Contribution

Any contribution intentionally submitted for inclusion in the work by you shall be licensed under the Mozilla Public License 2.0 (MPL-2.0).

It is required to add the following header with the corresponding SPDX short identifier to the top of each file:

// SPDX-License-Identifier: MPL-2.0

Re-exports§

pub use self::hid::HidApi;
pub use self::hid::HidDevice;
pub use self::hid::HidDeviceError;
pub use self::hid::HidError;
pub use self::hid::HidResult;
pub use self::hid::HidThread;
pub use self::hid::HidUsagePage;
pub use self::deck::Observables as DeckObservables;
pub use self::deck::Adapter as DeckAdapter;
pub use self::deck::Input as DeckInput;

Modules§

deck
Virtual DJ deck utilities.
devices
hid

Structs§

AudioInterfaceDescriptor
BlinkingLedOutput
BlinkingLedTicker
CenterSliderInput
A continuous fader or knob with a symmetric center position.
Control
Generic, indexed input/output control value.
ControlIndex
Index for addressing either or both device inputs and outputs in a generic manner.
ControlValue
A generic, encoded control value.
ControllerDescriptor
ControllerThread
Dedicated thread for each controller.
DeviceDescriptor
Common, information properties about a device.
DimLedOutput
Dimmable LED
InputEvent
Time-stamped input event
MidiDeviceDescriptor
MIDI-related, extended DeviceDescriptor
MidiInputDecodeError
MidiPortDescriptor
MidirDevice
MIDI device driven by midir.
MidirDeviceManager
Identifies and connects MidirDevices.
MidirInputPort
MidirOutputPort
PadButtonInput
A pad button with pressure information.
PortIndex
Index for addressing multiple, connected devices.
PortIndexGenerator
Thread-safe PortIndex generator
RgbLedOutput
RGB LED
SelectorInput
Choose one out of many, discrete possible choices
SendOutputsError
First error after sending multiple outputs
SingleMidiControllerContext
SliderEncoderInput
An endless encoder that sends continuous delta values
SliderInput
A continuous fader or knob.
StepEncoderInput
An endless encoder that sends discrete delta values
TimeStamp
Time stamp with microsecond precision
VirtualLed
Virtual LED

Enums§

ButtonInput
A simple two-state button.
CrossfaderCurve
LedOutput
Simple LED
LedState
MidiPortError
OutputError

Constants§

DEFAULT_BLINKING_LED_PERIOD

Traits§

ControlInputEventSink
ControlOutputGateway
Controller
ControllerTypes
MidiControlOutputGateway
MidiController
MidiInputConnector
MidiInputEventDecoder
Decode and map received MIDI messages into ControlInputEvents.
MidiInputGateway
MidiInputHandler
Passive callback for sinking MIDI input messages
MidiOutputConnection
MidiOutputGateway
NewMidiInputGateway

Functions§

blinking_led_task
consume_midi_input_event
input_events_ordered_chronologically
spawn_blinking_led_task
Spawn a task that periodically emits a blinking LED trigger.
split_crossfader_input_amplitude_preserving_approx
split_crossfader_input_energy_preserving_approx
split_crossfader_input_linear
split_crossfader_input_square
u7_be_to_u14
A commonly needed conversion for MIDI and (maybe other) devices.

Type Aliases§

BoxedControllerTask
Asynchronous context listener task.
BoxedMidiController
BoxedMidiOutputConnection
ControlInputEvent
OutputResult