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
Afficher le fichier Open project: ben-xo/sslscrobbler Class Usage Examples

Protected Properties

Свойство 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

Méthodes publiques

Méthode 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

Méthodes protégées

Méthode 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 méthode

public __construct ( $deck_number )

getCurrentTrack() public méthode

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

getEndTime() public méthode

public getEndTime ( )

getPlaytime() public méthode

Returns the play time of the track in seconds.
public getPlaytime ( ) : integer
Résultat integer

getPreviousTrack() public méthode

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

getStartTime() public méthode

public getStartTime ( )

getStatus() public méthode

public getStatus ( )

notify() public méthode

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 méthode

protected resetFlags ( )

trackStarted() public méthode

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

trackStopped() public méthode

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

trackUpdated() public méthode

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

transitionFromEmptyTo() protected méthode

protected transitionFromEmptyTo ( SSLTrack $track )
$track SSLTrack

transitionFromEmptyToNew() protected méthode

protected transitionFromEmptyToNew ( SSLTrack $track )
$track SSLTrack

transitionFromNewTo() protected méthode

protected transitionFromNewTo ( SSLTrack $track )
$track SSLTrack

transitionFromNewToPlaying() protected méthode

protected transitionFromNewToPlaying ( SSLTrack $track )
$track SSLTrack

transitionFromNewToSkipped() protected méthode

protected transitionFromNewToSkipped ( SSLTrack $track )
$track SSLTrack

transitionFromPlayedTo() protected méthode

protected transitionFromPlayedTo ( SSLTrack $track )
$track SSLTrack

transitionFromPlayedToNew() protected méthode

protected transitionFromPlayedToNew ( SSLTrack $track )
$track SSLTrack

transitionFromPlayingTo() protected méthode

protected transitionFromPlayingTo ( SSLTrack $track )
$track SSLTrack

transitionFromPlayingToPlayed() protected méthode

protected transitionFromPlayingToPlayed ( SSLTrack $track )
$track SSLTrack

transitionFromSkippedTo() protected méthode

protected transitionFromSkippedTo ( SSLTrack $track )
$track SSLTrack

transitionFromSkippedToNew() protected méthode

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

transitionTo() public méthode

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
Résultat SSLTrack

$previous_track protected_oe property

Stores the last played track on the deck.
protected SSLTrack $previous_track
Résultat 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
Résultat 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