LeechCraft  0.6.70-15082-g543737046d
Modular cross-platform feature rich live environment.
Media::IAudioScrobbler Class Referenceabstract

Interface for plugins that support scrobbling. More...

#include "iaudioscrobbler.h"

Public Types

enum  Feature { Feature::Backdating }
 A list of optional features a scrobbler may support. More...
 
using BackdatedTrack_t = QPair< Media::AudioInfo, QDateTime >
 A backdated track - a track with its real playback time. More...
 
using BackdatedTracks_t = QList< BackdatedTrack_t >
 A list of backdated tracks. More...
 

Public Member Functions

virtual ~IAudioScrobbler ()
 
virtual bool SupportsFeature (Feature feature) const =0
 Queries whether a given feature is supported. More...
 
virtual QString GetServiceName () const =0
 Returns the service name. More...
 
virtual void NowPlaying (const AudioInfo &audio)=0
 Notifies the scrobbler that a new track is playing. More...
 
virtual void SendBackdated (const BackdatedTracks_t &list)=0
 Sends a list of backdated tracks. More...
 
virtual void PlaybackStopped ()=0
 Notifies the scrobbler that playback is stopped. More...
 
virtual void LoveCurrentTrack ()=0
 Notifies the scrobbler that user loves current track. More...
 
virtual void BanCurrentTrack ()=0
 Notifies the scrobbler that user hates current track. More...
 

Detailed Description

Interface for plugins that support scrobbling.

Plugins supporting scrobbling listened tracks to services like Last.FM or Jamendo should implement this interface.

Definition at line 27 of file iaudioscrobbler.h.

Member Typedef Documentation

◆ BackdatedTrack_t

A backdated track - a track with its real playback time.

Definition at line 41 of file iaudioscrobbler.h.

◆ BackdatedTracks_t

A list of backdated tracks.

Definition at line 45 of file iaudioscrobbler.h.

Member Enumeration Documentation

◆ Feature

A list of optional features a scrobbler may support.

See also
HasFeature()
Enumerator
Backdating 

Whether the scrobbler allows sending audiotracks marked by past timestamps.

See also
SendBackdated()

Definition at line 51 of file iaudioscrobbler.h.

Constructor & Destructor Documentation

◆ ~IAudioScrobbler()

virtual Media::IAudioScrobbler::~IAudioScrobbler ( )
inlinevirtual

Definition at line 36 of file iaudioscrobbler.h.

Member Function Documentation

◆ BanCurrentTrack()

virtual void Media::IAudioScrobbler::BanCurrentTrack ( )
pure virtual

Notifies the scrobbler that user hates current track.

This function should be called when user explicitly states that he hates the current track, that is, the track described by the last call to NowPlaying().

See also
LoveCurrentTrack()

◆ GetServiceName()

virtual QString Media::IAudioScrobbler::GetServiceName ( ) const
pure virtual

Returns the service name.

This string returns a human-readable string with the service name, like "Last.FM".

Returns
The human-readable service name.

◆ LoveCurrentTrack()

virtual void Media::IAudioScrobbler::LoveCurrentTrack ( )
pure virtual

Notifies the scrobbler that user loves current track.

This function should be called when user explicitly states that he loves the current track, that is, the track described by the last call to NowPlaying().

See also
BanCurrentTrack()

◆ NowPlaying()

virtual void Media::IAudioScrobbler::NowPlaying ( const AudioInfo audio)
pure virtual

Notifies the scrobbler that a new track is playing.

This function should be called by an audio player when a new track is playing. The track data is contained in the audio parameter.

This function should only be called when a track has been changed, or when the user has explicitly restarted track playback. This function should not be called after pausing and resuming playback.

Parameters
[in]audioThe information about currently playing track.

◆ PlaybackStopped()

virtual void Media::IAudioScrobbler::PlaybackStopped ( )
pure virtual

Notifies the scrobbler that playback is stopped.

This function should be called when user stops the playback of the current track. This function should not be called on pausing.

◆ SendBackdated()

virtual void Media::IAudioScrobbler::SendBackdated ( const BackdatedTracks_t list)
pure virtual

Sends a list of backdated tracks.

If a scrobbler implements this method, it's also worth making sure SupportsFeature() returns true for Feature::Backdating.

Parameters
[in]listThe list of tracks to send.

◆ SupportsFeature()

virtual bool Media::IAudioScrobbler::SupportsFeature ( Feature  feature) const
pure virtual

Queries whether a given feature is supported.

Parameters
[in]featureThe feature to check.
Returns

The documentation for this class was generated from the following file: