private void handleEventRequest ( EventModel eventModel ) { playingThread = submit ( ( Runnable ) ( ) -> { //noinspection RedundantIfStatement if ( runsInPlay ) { isRunning = false ; } else { isRunning = true ; } isPlaying = true ; fireStartMusicRequest ( eventModel ) ; } ) . thenRun ( ( ) -> play ( eventModel ) ) . thenRun ( ( ) -> { if ( runsInPlay ) { isRunning = false ; isPlaying = false ; endedSound ( ) ; } } ) ; }
handles the a request to start playing music via Event