PHP Class SSLRealtimeModelDeck, sslscrobbler

Generally you would notify the deck of a bunch of SSLTracks (usually from the Serato History file) using notify(), and it would cherry pick relevant entries based on the deck number. After processing the Tracks, various status methods are pollable for the deck's current state and information about what changed. You may also ask the deck information about how long the current track has been playing for, etc.
See also: SSLRealtimeModel for more info on the statuses, transitions and their meanings.
Author: ben
Datei anzeigen Open project: ben-xo/sslscrobbler Class Usage Examples

Protected Properties

Property Type Description
$deck_number
$end_time
$max_row
$pre_update_track SSLTrack Stores the track on the deck at the beginning of the update pass.
$previous_track SSLTrack Stores the last played track on the deck.
$start_time
$status
$track SSLTrack Stores the track currently on the deck.
$track_started
$track_stopped * Status flags that are updated by notify()
$track_updated

Public Methods

Method Description
__construct ( $deck_number )
getCurrentTrack ( ) : SSLTrack Returns the currently playing track or null if the deck is empty
getEndTime ( )
getPlaytime ( ) : integer Returns the play time of the track in seconds.
getPreviousTrack ( ) : SSLTrack Returns the previously played track or null if the deck was previously empty
getStartTime ( )
getStatus ( )
notify ( SSLHistoryDiffDom $diff ) Notify the deck of a group of changes written to the History File.
trackStarted ( ) Returns a track, if one started since the last notify.
trackStopped ( ) Returns a track, if one stopped since the last notify.
trackUpdated ( ) Returns a track, if one was updated since the last notify.
transitionTo ( SSLTrack $track ) Transition combinations

Protected Methods

Method Description
resetFlags ( )
transitionFromEmptyTo ( SSLTrack $track )
transitionFromEmptyToNew ( SSLTrack $track )
transitionFromNewTo ( SSLTrack $track )
transitionFromNewToPlaying ( SSLTrack $track )
transitionFromNewToSkipped ( SSLTrack $track )
transitionFromPlayedTo ( SSLTrack $track )
transitionFromPlayedToNew ( SSLTrack $track )
transitionFromPlayingTo ( SSLTrack $track )
transitionFromPlayingToPlayed ( SSLTrack $track )
transitionFromSkippedTo ( SSLTrack $track )
transitionFromSkippedToNew ( SSLTrack $track ) Base transitions

Method Details

__construct() public method

public __construct ( $deck_number )

getCurrentTrack() public method

Returns the currently playing track or null if the deck is empty
public getCurrentTrack ( ) : SSLTrack
return SSLTrack

getEndTime() public method

public getEndTime ( )

getPlaytime() public method

Returns the play time of the track in seconds.
public getPlaytime ( ) : integer
return integer

getPreviousTrack() public method

Returns the previously played track or null if the deck was previously empty
public getPreviousTrack ( ) : SSLTrack
return SSLTrack

getStartTime() public method

public getStartTime ( )

getStatus() public method

public getStatus ( )

notify() public method

SSL batches writes of track info, but doesn't output them in the natural transition order - that is, sometimes information about the following song appears in the log before closing info on the previous song, as the History File is track oriented, not deck oriented. During notify(), we reorder this information into an order that's transition compatible (that is, row ID ascending order). The implication of sending a bunch of track notifications together (rather than one by one) is that they happen simultaneously, and the end result is what's important rather than every step to get there. As diffs usually only come during track load, change or eject, it would be abnormal to see information about more than 2 tracks on a single deck here, and abnormal for neither of them to be the one currently on the deck. However, it can happen - for example, loading a historical file or starting the monitor half way through a session.
public notify ( SSLHistoryDiffDom $diff )
$diff SSLHistoryDiffDom

resetFlags() protected method

protected resetFlags ( )

trackStarted() public method

Returns a track, if one started since the last notify.
public trackStarted ( )

trackStopped() public method

Returns a track, if one stopped since the last notify.
public trackStopped ( )

trackUpdated() public method

Returns a track, if one was updated since the last notify.
public trackUpdated ( )

transitionFromEmptyTo() protected method

protected transitionFromEmptyTo ( SSLTrack $track )
$track SSLTrack

transitionFromEmptyToNew() protected method

protected transitionFromEmptyToNew ( SSLTrack $track )
$track SSLTrack

transitionFromNewTo() protected method

protected transitionFromNewTo ( SSLTrack $track )
$track SSLTrack

transitionFromNewToPlaying() protected method

protected transitionFromNewToPlaying ( SSLTrack $track )
$track SSLTrack

transitionFromNewToSkipped() protected method

protected transitionFromNewToSkipped ( SSLTrack $track )
$track SSLTrack

transitionFromPlayedTo() protected method

protected transitionFromPlayedTo ( SSLTrack $track )
$track SSLTrack

transitionFromPlayedToNew() protected method

protected transitionFromPlayedToNew ( SSLTrack $track )
$track SSLTrack

transitionFromPlayingTo() protected method

protected transitionFromPlayingTo ( SSLTrack $track )
$track SSLTrack

transitionFromPlayingToPlayed() protected method

protected transitionFromPlayingToPlayed ( SSLTrack $track )
$track SSLTrack

transitionFromSkippedTo() protected method

protected transitionFromSkippedTo ( SSLTrack $track )
$track SSLTrack

transitionFromSkippedToNew() protected method

Base transitions
protected transitionFromSkippedToNew ( SSLTrack $track )
$track SSLTrack

transitionTo() public method

Transition combinations
public transitionTo ( SSLTrack $track )
$track SSLTrack

Property Details

$deck_number protected_oe property

protected $deck_number

$end_time protected_oe property

protected $end_time

$max_row protected_oe property

protected $max_row

$pre_update_track protected_oe property

Stores the track on the deck at the beginning of the update pass.
protected SSLTrack $pre_update_track
return SSLTrack

$previous_track protected_oe property

Stores the last played track on the deck.
protected SSLTrack $previous_track
return SSLTrack

$start_time protected_oe property

protected $start_time

$status protected_oe property

protected $status

$track protected_oe property

Stores the track currently on the deck.
protected SSLTrack $track
return SSLTrack

$track_started protected_oe property

protected $track_started

$track_stopped protected_oe property

* Status flags that are updated by notify()
protected $track_stopped

$track_updated protected_oe property

protected $track_updated