![]() |
![]() |
![]() |
![]() |
Get information about the current track session
#include <mme/mme.h> int mme_trksession_get_info( mme_hdl_t *hdl, uint64_t *trksessionid, uint64_t *current_trk, uint64_t *total_trk );
mme
The function mme_trksession_get_info() retrieves the following information about the current track session:
This information provides a snapshot of a track session and what the MME is doing with the track session. For example, a track session with total_trk set to 0 (zero) indicates that the MME found no tracks or files that meet the criteria used to create the track session (artist, genre, etc.).
Always use this function to retrieve track session information. The MME may to need to retrieve track session information from an external device, such as an iPod, because information stored in an external device will not be available in the trksession table.
Don't use the track session table trksession to retrieve track session information, because this method will miss information on external devices.
![]() |
The values of a track's sequentialid and randomid fields in the trksessionview table have no bearing on the value of current_trk. The value returned in current_trk is just the one-based offset in the track session of the currently playing track. For example, in a track session with 10 tracks, if playback is at the third track, current_trk will be 3, while the sequentialid field for the track may be 7, or some other number used to sort the tracks (ORDER BY) when the track session was created. |
The method used by the MME to count the tracks played in a track session differs in sequential and random modes, and is consistent with the method used by iPods.
For track sessions in sequential mode, the MME assigns current_trk the number of the track in the track session, and increments its value by 1 (one) each time it begins playing a new track. For example, if the end-user chooses to start playing in sequential mode on track 3 of the track session, current_track the value of current_track will be 3. The MME will continue playing tracks to the end of the track session, but will not play tracks 0, 1 or 2 (unless repeat mode is on, in which case the MME will continue playing through the track list until instructed to stop). The value of current_trk is therefore always the same as the track number in the tracklist.
When the MME is asked to start playing a track session in random mode, it uses the QDB random() function to create a pseudo-random order, and makes a list of tracks to play in this order. The MME assigns current_trk the value 0 (zero) when it starts playing the first track in its pseudo-random list,and increments this value by 1 (one) each time it begins playing a new track. Thus, the value of current_trk is the number or tracks played plus 1 for the current track, and has no relationship to the track number in the track session.
For both sequential and random modes, to calculate the number of tracks left to play in the track session, simply subtract current_trk from total_trk. The end of the track session is reached when current_trk=total_trk.
None delivered.
This function returns immediately.
QNX Neutrino
Safety: | |
---|---|
Interrupt handler | No |
Signal handler | No |
Thread | Yes |
mme_play_resume_msid(), mme_set_msid_resume_trksession(), mme_trksession_resume_state(), mme_trksession_save_state(), mme_trksessionview_update()
![]() |
![]() |
![]() |
![]() |