public void sendFaderStartCommand ( Set < Integer > deviceNumbersToStart , Set < Integer > deviceNumbersToStop ) throws IOException { ensureRunning ( ) ; byte [ ] payload = new byte [ FADER_START_PAYLOAD . length ] ; System . arraycopy ( FADER_START_PAYLOAD , 0 , payload , 0 , FADER_START_PAYLOAD . length ) ; payload [ 2 ] = getDeviceNumber ( ) ; for ( int i = 1 ; i <= 4 ; i ++ ) { if ( deviceNumbersToStart . contains ( i ) ) { payload [ i + 4 ] = 0 ; } if ( deviceNumbersToStop . contains ( i ) ) { payload [ i + 4 ] = 1 ; } } assembleAndSendPacket ( Util . PacketType . FADER_START_COMMAND , payload , getBroadcastAddress ( ) , BeatFinder . BEAT_PORT ) ; }
Broadcast a packet that tells some players to start playing and others to stop . If a player number is in both sets it will be told to stop . Numbers outside the range 1 to 4 are ignored .