Interface OnAirListener


  • public interface OnAirListener
    The listener interface for receiving on-air status messages. Classes that are interested in knowing when the mixer reports which channels are on and off the air (audible in its audio output) can implement this interface. The listener object created is then registered using BeatFinder.addOnAirListener(OnAirListener). Whenever a relevant message is received, the channelsOnAir(Set) method in the listener object is invoked.
    Author:
    James Elliott
    • Method Detail

      • channelsOnAir

        void channelsOnAir​(Set<Integer> audibleChannels)
        Invoked when we have received a message telling us which channels are currently on the air. A channel may be off the air because of the cross fader the channel fader, or the mixer being configured to use a different kind of input (such as USB) for that channel, rather than a CDJ.

        To reduce latency, on-air updates are delivered to listeners directly on the thread that is receiving them them from the network, so if you want to interact with user interface objects in this method, you need to use javax.swing.SwingUtilities.invokeLater(Runnable) to do so on the Event Dispatch Thread. Even if you are not interacting with user interface objects, any code in this method must finish quickly, or it will add latency for other listeners, and beat announcements will back up. If you want to perform lengthy processing of any sort, do so on another thread.

        Parameters:
        audibleChannels - holds the device numbers of all channels that can currently be heard in the mixer output