PHP Класс 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.
См. также: SSLRealtimeModel for more info on the statuses, transitions and their meanings.
Автор: ben
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$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

Открытые методы

Метод Описание
__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

Защищенные методы

Метод Описание
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

Описание методов

__construct() публичный Метод

public __construct ( $deck_number )

getCurrentTrack() публичный Метод

Returns the currently playing track or null if the deck is empty
public getCurrentTrack ( ) : SSLTrack
Результат SSLTrack

getEndTime() публичный Метод

public getEndTime ( )

getPlaytime() публичный Метод

Returns the play time of the track in seconds.
public getPlaytime ( ) : integer
Результат integer

getPreviousTrack() публичный Метод

Returns the previously played track or null if the deck was previously empty
public getPreviousTrack ( ) : SSLTrack
Результат SSLTrack

getStartTime() публичный Метод

public getStartTime ( )

getStatus() публичный Метод

public getStatus ( )

notify() публичный Метод

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 resetFlags ( )

trackStarted() публичный Метод

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

trackStopped() публичный Метод

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

trackUpdated() публичный Метод

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

transitionFromEmptyTo() защищенный Метод

protected transitionFromEmptyTo ( SSLTrack $track )
$track SSLTrack

transitionFromEmptyToNew() защищенный Метод

protected transitionFromEmptyToNew ( SSLTrack $track )
$track SSLTrack

transitionFromNewTo() защищенный Метод

protected transitionFromNewTo ( SSLTrack $track )
$track SSLTrack

transitionFromNewToPlaying() защищенный Метод

protected transitionFromNewToPlaying ( SSLTrack $track )
$track SSLTrack

transitionFromNewToSkipped() защищенный Метод

protected transitionFromNewToSkipped ( SSLTrack $track )
$track SSLTrack

transitionFromPlayedTo() защищенный Метод

protected transitionFromPlayedTo ( SSLTrack $track )
$track SSLTrack

transitionFromPlayedToNew() защищенный Метод

protected transitionFromPlayedToNew ( SSLTrack $track )
$track SSLTrack

transitionFromPlayingTo() защищенный Метод

protected transitionFromPlayingTo ( SSLTrack $track )
$track SSLTrack

transitionFromPlayingToPlayed() защищенный Метод

protected transitionFromPlayingToPlayed ( SSLTrack $track )
$track SSLTrack

transitionFromSkippedTo() защищенный Метод

protected transitionFromSkippedTo ( SSLTrack $track )
$track SSLTrack

transitionFromSkippedToNew() защищенный Метод

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

transitionTo() публичный Метод

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

Описание свойств

$deck_number защищенное свойство

protected $deck_number

$end_time защищенное свойство

protected $end_time

$max_row защищенное свойство

protected $max_row

$pre_update_track защищенное свойство

Stores the track on the deck at the beginning of the update pass.
protected SSLTrack $pre_update_track
Результат SSLTrack

$previous_track защищенное свойство

Stores the last played track on the deck.
protected SSLTrack $previous_track
Результат SSLTrack

$start_time защищенное свойство

protected $start_time

$status защищенное свойство

protected $status

$track защищенное свойство

Stores the track currently on the deck.
protected SSLTrack $track
Результат SSLTrack

$track_started защищенное свойство

protected $track_started

$track_stopped защищенное свойство

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

$track_updated защищенное свойство

protected $track_updated