Skip to main content

Crate prolink

Crate prolink 

Source
Expand description

Pioneer Pro DJ Link, both directions.

  • Consume: see the media in CDJs on the network, browse their libraries the way the LINK button does, and stream their tracks.
  • Serve: appear as another CDJ with a USB and an SD slot, and let real players browse and play a local rekordbox medium.

§Passive by default

discovery::Discovery transmits nothing. It can be run next to a live rig without contending for a device number or disturbing anything, and it is enough to see every device and to pull a player’s database over NFS.

Announcing is a separate, explicit step, because it is the one that carries risk: virtual_cdj::VirtualCdj claims a device number and starts emitting status. That is required for anything a peer has to offer us — slot contents, tempo master, and being browsable at all.

§What the other players have in their slots

VirtualCdj::peer_media answers it, and it is filled from two sources because the protocol splits the answer in two. Whether a slot holds anything is published in status packets and nowhere else, so it costs nothing but having announced; the volume label and the track and playlist counts come only from a media query, which VirtualCdj::survey_media sends. A deck answers for an empty slot too, with everything zeroed, so occupancy is read from the status byte rather than inferred from the counts.

§What a device must do to be browsable

Learned by getting each one wrong in turn, and the order matters:

  1. Announce on UDP 50000 — keep-alive at least, the claim chain to hold a number, and that number must be in 1–4 (F45). Outside that range every later step still works and none of them is ever reached.
  2. Emit status on UDP 50002, unicast per peer at 200 ms, with the slot state set. Media presence is advertised there and nowhere else.
  3. Answer media queries with true track and playlist counts.
  4. Serve NFS — and this comes before dbserver. A portmapper on UDP/111 is mandatory: with nothing there a deck retries GETPORT once a second indefinitely and never falls back to the well-known ports.
  5. Answer the port query on TCP 12523.
  6. Serve dbserver on the advertised port, and never answer an unknown request with an error.
  7. Optionally answer the settings query, for LOAD SETTINGS.

Re-exports§

pub use device::Device;
pub use device::DeviceEvent;
pub use device::DeviceTable;
pub use discovery::Discovery;
pub use interface::Interface;
pub use media::MediaDescription;
pub use media::MediaSource;
pub use monitor::Monitor;
pub use monitor::MonitorEvent;
pub use monitor::PlayerState;
pub use playback::BeatPosition;
pub use playback::Playback;
pub use playback::PlaybackCell;
pub use serve::MediaSet;
pub use serve::Medium;
pub use serve::VirtualPlayer;
pub use serve::VirtualPlayerConfig;
pub use virtual_cdj::Numbering;
pub use virtual_cdj::OBSERVER_NUMBER;
pub use virtual_cdj::PeerMedia;
pub use virtual_cdj::PeerSlot;
pub use virtual_cdj::VirtualCdj;
pub use virtual_cdj::VirtualCdjConfig;
pub use volumes::Volume;
pub use volumes::local_volumes;
pub use volumes::rekordbox_volumes;

Modules§

consume
Browsing and streaming from the CDJs on the network.
device
The peer table: who is on the Pro DJ Link network right now.
discovery
Listening on UDP 50000: who is on the network.
interface
Choosing the network interface that faces the CDJs.
media
What a virtual CDJ says is in its slots.
monitor
What is playing, at what tempo, where in the bar — and who is master.
playback
What this host is playing, in the terms the network understands.
serve
Serving a local medium to real players: a rekordbox one, or a stick of plain files served by its folders.
virtual_cdj
Announcing ourselves as a player: the claim chain, the keep-alive and the status stream.
volumes
Finding the sticks plugged into this machine: rekordbox ones, and sticks of plain music files.

Structs§

Beat
The beat-packet types that appear in monitor’s signatures. A device starting a beat.
BeatInBar
The beat-packet types that appear in monitor’s signatures. Which of the four beats of a bar a player is on: 1, 2, 3 or 4.
BrowsableDeviceNumber
Re-exported so callers do not need a direct dependency on the codec crate for the handful of its types that appear in this one’s signatures. A device number in 1–4: the range a peer will actually browse.
DeviceKind
Re-exported so callers do not need a direct dependency on the codec crate for the handful of its types that appear in this one’s signatures. The device model byte. Critical for impersonation.
DeviceName
Re-exported so callers do not need a direct dependency on the codec crate for the handful of its types that appear in this one’s signatures. A 20-byte NUL-padded device name.
DeviceNumber
Re-exported so callers do not need a direct dependency on the codec crate for the handful of its types that appear in this one’s signatures. A device number a peer can hold.
MacAddress
Re-exported so callers do not need a direct dependency on the codec crate for the handful of its types that appear in this one’s signatures. A 6-byte hardware address.
Pitch
The beat-packet types that appear in monitor’s signatures. The pitch fader, as the wire encodes it: a 32-bit fixed-point multiplier.
Slot
Re-exported so callers do not need a direct dependency on the codec crate for the handful of its types that appear in this one’s signatures. A media slot, numbered as the status packets number them.

Enums§

Error
An error from the Pro DJ Link runtime.

Type Aliases§

Result
Result alias for this crate.