|
pianod2
multisource multiuser scriptable networked music player
|
#include <pandora.h>


Public Member Functions | |
| const ConnectionParameters * | connectionParams () const |
| Source (const ConnectionParameters ¶ms) | |
| ~Source () | |
| Destroy a source. More... | |
| virtual const char * | kind (void) const override |
| A unique string identifying the type of source. More... | |
| virtual bool | requireNameForCreatePlaylist (void) const override |
| Indicate if a name is required when creating a playlist. More... | |
| virtual bool | flush (void) override |
| Persist data for a source. More... | |
| virtual float | periodic (void) override |
| Do intermittent or background tasks. More... | |
| virtual PlaylistList | getPlaylists (const Filter &filter=Filter::All) override |
| Retrieve the source's playlists. More... | |
| virtual PianodPlaylist * | getMixPlaylist (void) override |
| Retrieve the mix playlist. More... | |
| virtual PianodPlaylist * | getEverythingPlaylist (void) override |
| Retrieve the everything playlist. More... | |
| virtual Media::Player * | getPlayer (const AudioSettings &audio, PianodSong *song) override |
| virtual MusicThingie * | getAnythingById (const Media::SplitId &id) override |
| virtual ThingieList | getSuggestions (const Filter &filter, SearchRange where) override |
| virtual PianodPlaylist * | createPlaylist (const char *name, MusicThingie::Type type, MusicThingie *from) override |
| Create a playlist using a thingie as an initial seed. More... | |
| virtual SongList | getRandomSongs (PianodPlaylist *playlist, const UserList &, Media::SelectionMethod) override |
| virtual MusicThingie * | getSuggestion (MusicThingie *thing, MusicThingie::Type type, SearchRange where) override |
| Retrieve an equivalent or related album, artist, or song from a source. More... | |
| Station * | getStationByStationId (const std::string &station_id) |
| void | removeStationByStationId (const std::string &station_id) |
| Status | executeRequest (Request &request) |
| const UserFeatures & | userFeatures () const |
Public Member Functions inherited from Media::Source | |
| Source (SourceParameters *params) | |
| Initialize the source. More... | |
| void | persist (void) const |
| Persist source parameters, attaching them to the owner's user data. More... | |
| bool | isReady (void) const |
| Check if the source is online. More... | |
| SerialNumber | serialNumber (void) const |
| Get the source's unique number assigned by the media manager. More... | |
| const Statistics & | getStatistics () const |
| Retrieve playback statistics about the source. More... | |
| const bool | isLockedOut () const |
| Check if source is temporarily locked out due to repeated failures. More... | |
| Parsnip::Data | serializeIdentity () const |
| std::string | identify () const |
| Identify the unique source. More... | |
| void | alert (RESPONSE_CODE message) const |
| Send an alert notification regarding this source. More... | |
| void | alert (RESPONSE_CODE message, const char *detail, const char *reason=nullptr) const |
| Send an alert notification regarding this source. More... | |
| void | reportStatus (const char *detail) const |
| Send a status notification regarding this source. More... | |
| void | reportStatus (const std::string &detail) const |
| const std::string & | name (void) const |
| Get the name of this source. More... | |
| std::string | key (void) const |
| Key is a combination of kind and name. More... | |
| std::string | filename (void) const |
| Provide a filename for persisting the source's data. More... | |
| virtual bool | canExpandToAllSongs (void) const |
| Indicate if arbitrary tracks can be requested from this source. More... | |
| PianodPlaylist * | getPlaylistByName (const char *name) |
| Retrieve a playlist by name. More... | |
| virtual PianodPlaylist * | getTransientPlaylist (const Filter &criteria) |
| Create a temporary playlist based on a filter. More... | |
| virtual PianodPlaylist * | createPlaylist (const char *name, const Filter &filter) |
| Create a playlist using a filter. More... | |
| void | playbackComplete (bool played, bool successfully) |
| Update playback statistics. More... | |
| virtual void | playbackProblem (void) |
| MusicThingie * | getSuggestion (MusicThingie *thing, SearchRange where=SearchRange::SHALLOW) |
| Retrieve an equivalent album, artist, or song from a source. More... | |
Public Member Functions inherited from PrimaryOwnership | |
| PrimaryOwnership (void) | |
| Default construct ownership: No owner, private access. More... | |
| PrimaryOwnership (Type rule, User *owner=nullptr) | |
| Construct ownership. More... | |
| ~PrimaryOwnership (void) | |
| void | abandon (void) |
| Disassociate ownership from any owner, and mark as disowned. More... | |
| void | abandon (const User *user) |
| Conditionally dissociate ownership. More... | |
| User * | getOwner (void) const |
| bool | isOwned (void) const |
| const std::string & | ownerName (void) const |
| Retrieve the name of the owner. More... | |
| virtual bool | isOwnedBy (const User *user) const override |
| Check if we are owned by a user. More... | |
| virtual bool | hasPermission (const User *user, Action action) const override |
| Determine if a user has permission to use this item in some manner. More... | |
Public Member Functions inherited from Ownership | |
| bool | isVisibleBy (const User *user) const |
| bool | isUsableBy (const User *user) const |
| bool | isDecendableBy (const User *user) const |
| bool | isReadableBy (const User *user) const |
| bool | isEditableBy (const User *user) const |
Public Attributes | |
| Library | library |
| Lookup table of things we gave out. More... | |
| SearchResults | prior_searches |
| Search results saved for reuse;. More... | |
| SkipTracker | skips {60, 86400} |
| Skip counts for limiting. More... | |
Private Types | |
| using | SearchResults = std::unordered_map< std::string, ThingieList > |
Private Member Functions | |
| bool | updateStationList (PianodPlaylist::PlaylistType mixSetting=PianodPlaylist::SINGLE) |
| Get initial or refresh station list. More... | |
| void | updateGenreStations () |
| Get initial or refresh genre station list. More... | |
| bool | initializeMix () |
| void | pushMixToServers (bool mix_all=false) |
| Update the quickmix/station shuffle by sending a list of desired stations to Pandora. More... | |
| void | setMixAllOnServers () |
| bool | restore () |
| bool | persist () const |
Private Attributes | |
| StationLookup | stations |
| A collection of stations, indexed by station ID. More... | |
| time_t | station_list_expiration = 0 |
| When cached station list expires. More... | |
| std::string | station_list_checksum |
| Checksum from last station list received. More... | |
| time_t | genre_stations_expiration = 0 |
| When genre stations list expires. More... | |
| std::string | genre_stations_checksum |
| Checksum from last genre station list received. More... | |
| PlaylistList | genre_stations |
| The genre stations. More... | |
| Retainer< Station * > | mix_playlist |
| The mix/shuffle meta-playlist. More... | |
| Retainer< Station * > | everything_playlist |
| The everything meta-playlist. More... | |
| Communication | comm |
| Pandora server communicator. More... | |
| std::unique_ptr< Parsnip::Data > | recovery |
| Data from persistence file. More... | |
Additional Inherited Members | |
Public Types inherited from Media::Source | |
| typedef unsigned long | SerialNumber |
Public Types inherited from Ownership | |
| enum class | Type { DISOWNED , PRIVATE , SHARED , PUBLISHED , PUBLIC } |
| Access levels for an object. More... | |
| enum class | Action { SEE , USE , READ , ALTER } |
| Access actions for an object. More... | |
Protected Types inherited from Media::Source | |
| enum class | State { INITIALIZING , VALID , READY , DEAD } |
Protected Member Functions inherited from Media::Source | |
| MusicThingie * | getSuggestion (MusicThingie *thing, MusicThingie::Type type, SearchRange where, bool fully_confirm) |
| Get a thing as a suggestion of a specific type. More... | |
Protected Attributes inherited from Media::Source | |
| State | state = State::INITIALIZING |
| const SourceParameters * | parameters = nullptr |
| Configuration details for this source, provided on source creation. More... | |
|
private |
| Pandora::Source::Source | ( | const ConnectionParameters & | params | ) |

|
virtual |
Destroy a source.
Reimplemented from Media::Source.
|
inline |

|
overridevirtual |
Create a playlist using a thingie as an initial seed.
Seed type allows, for example, to use a song's artist.
| name | The name of the playlist. |
| type | The type of seed to create. |
| from | The initial seed. |
| CommandError | if a request is invalid. |
Reimplemented from Media::Source.



|
overridevirtual |
Persist data for a source.
Reimplemented from Media::Source.


|
overridevirtual |
|
overridevirtual |
Retrieve the everything playlist.
Implements Media::Source.
|
overridevirtual |
Retrieve the mix playlist.
Implements Media::Source.
|
overridevirtual |
|
overridevirtual |
Retrieve the source's playlists.
| filter | Criteria specifying the subset of the playlists to retrieve. |
Implements Media::Source.

|
overridevirtual |
| Station * Pandora::Source::getStationByStationId | ( | const std::string & | station_id | ) |
Retrieve station from station list by station ID.
| station_id | The station ID of the station. |

|
overridevirtual |
Retrieve an equivalent or related album, artist, or song from a source.
To support pianod's engine, this converts items between sources. The engine should not be asking for type conversions within a source.
| thing | The item to match. |
| type | The desired type to find. |
| where | Selects the depth/exhaustiveness of search. |
| CommandError | with:
|
Implements Media::Source.


|
overridevirtual |
|
private |
|
overridevirtual |
A unique string identifying the type of source.
Implements Media::Source.
|
overridevirtual |
Do intermittent or background tasks.
Reimplemented from Media::Source.

|
private |


|
private |
Update the quickmix/station shuffle by sending a list of desired stations to Pandora.


| void Pandora::Source::removeStationByStationId | ( | const std::string & | station_id | ) |
Delete station from station list by station ID.
| station_id | The station ID of the station. |

|
overridevirtual |
Indicate if a name is required when creating a playlist.
Reimplemented from Media::Source.
|
private |


|
inlineprivate |


|
private |
Get initial or refresh genre station list.


|
private |
Get initial or refresh station list.
| mixSetting | The playing mix setting (single playlist, mix, or everything). |


|
inline |


|
private |
Pandora server communicator.
|
private |
The genre stations.
|
private |
Checksum from last genre station list received.
|
private |
When genre stations list expires.
| Library Pandora::Source::library |
Lookup table of things we gave out.
| SearchResults Pandora::Source::prior_searches |
Search results saved for reuse;.
|
private |
Data from persistence file.
| SkipTracker Pandora::Source::skips {60, 86400} |
Skip counts for limiting.
|
private |
Checksum from last station list received.
|
private |
When cached station list expires.
|
private |
A collection of stations, indexed by station ID.