14 #include <unordered_map>
39 while (!empty() && front() < time (
nullptr)) {
47 bool skip (time_t *when =
nullptr);
54 template <
typename InfoType>
60 mutable std::unordered_map<std::string, Retainer<InfoType *>>
cache;
74 void erase (InfoType *item);
114 virtual void rename (
const std::string &newname)
override;
115 virtual void erase()
override;
143 class StationLookup :
public std::unordered_map<std::string, Retainer<Station *>> {};
A PianodPlaylist that is self-contained.
Definition: encapmusic.h:201
virtual PlaylistType playlistType(void) const override
Mix, everything, transient or single list.
Definition: encapmusic.h:216
virtual const std::string & playlistName(void) const override
Name of the playlist.
Definition: encapmusic.h:218
virtual Media::Source *const source(void) const override
MediaSource from which this thingie originates.
Definition: encapmusic.h:214
Base class for songs, albums, artists, playlists, genres, etc.
Definition: musictypes.h:77
Type
Definition: musictypes.h:86
Class representing a mix of all of a user's Pandora stations.
Definition: pandorastation.h:131
MixEverythingStation(Source *const src, const Parsnip::Data &message)
Definition: pandorastation.h:133
Class representing the Pandora quick mix station.
Definition: pandorastation.h:123
QuickMixStation(Source *const src, const Parsnip::Data &message)
Definition: pandorastation.h:125
A class to manage Pandora skips.
Definition: pandorastation.h:33
void setLimit(int limit)
Definition: pandorastation.h:48
bool skip(time_t *when=nullptr)
Check if a skip is available, and record one if it is.
Definition: pandorastation.cpp:57
SkipTracker(int limit, int interv)
Construct a skip tracker.
Definition: pandorastation.cpp:36
bool canSkip(time_t *when)
Check if (and when) a skip is available.
Definition: pandorastation.cpp:42
size_t skip_limit
The limit on the number of skips.
Definition: pandorastation.h:34
time_t interval
The duration over which the limit applies.
Definition: pandorastation.h:35
void purge()
Remove expired skips from the front of the list.
Definition: pandorastation.h:38
Definition: pandorastation.h:55
bool isSeedPresent(const MusicThingie *seed) const
See if details originated from this list.
Definition: pandoraseeds.cpp:58
MusicThingie::Type type
The primary type stored herein.
Definition: pandorastation.h:59
const ListType & list() const
Definition: pandorastation.h:66
StationDefinitionDetails(MusicThingie::Type ty)
Definition: pandorastation.h:65
ListType info_list
The authoritative list of details.
Definition: pandorastation.h:58
RetainedList< InfoType * > ListType
Definition: pandorastation.h:56
void operator=(ListType &&list)
Replace the details stored and clear cache.
Definition: pandoraseeds.cpp:67
void storeDetail(const MusicThingie *primary, InfoType *rating)
Add a single new detail item.
Definition: pandoraseeds.cpp:76
InfoType * getDetail(const MusicThingie *primary) const
Retrieve details for an item.
Definition: pandoraseeds.cpp:88
std::unordered_map< std::string, Retainer< InfoType * > > cache
Faster access to info.
Definition: pandorastation.h:60
void erase(InfoType *item)
Remove a detail record from the list and cache.
Definition: pandoraseeds.cpp:103
InfoType * find(const MusicThingie *primary) const
Search the authoritative list for a matching item.
Definition: pandoraseeds.cpp:34
Definition: pandorastation.h:77
void forceRefreshDetails()
Definition: pandoraseeds.cpp:287
bool in_quick_mix
The station is participating in the quickmix/shuffle.
Definition: pandorastation.h:83
void takePossession()
Convert a shared Pandora station into a private one.
Definition: pandorastation.cpp:106
Source *const pandora() const
Definition: pandorastation.h:103
virtual bool includedInMix(void) const override final
Definition: pandorastation.cpp:142
std::string station_token
Definition: pandorastation.h:80
virtual bool seed(MusicThingie::Type seedType, const MusicThingie *music) const override
Check if there is a seed of a particular type for this thingie.
Definition: pandoraseeds.cpp:152
SkipTracker skips
Definition: pandorastation.h:96
Station(Source *const owner, const Parsnip::Data &message)
Definition: pandorastation.cpp:70
virtual void erase() override
Definition: pandorastation.cpp:129
bool seedAppliesToStation(const MusicThingie *seed) const
Check if a seed record is applicable to the current station.
Definition: pandoraseeds.cpp:138
void refreshSeedsAndRatings()
Retrieve a station's seed information on file with the servers.
Definition: pandoraseeds.cpp:254
bool is_shared
The station is owned by another listener (like a symlink)
Definition: pandorastation.h:81
virtual ThingieList getSeeds(void) const override
Get the seed list for a playlist.
Definition: pandoraseeds.cpp:292
bool may_rename
The user may rename the station.
Definition: pandorastation.h:82
virtual bool canSeed(MusicThingie::Type seedType) const override
Determine if a particular type of seeding is possible.
Definition: pandoraseeds.cpp:130
StationDefinitionDetails< SongSeed > song_seeds
Definition: pandorastation.h:98
StationDefinitionDetails< SongRating > feedback
Definition: pandorastation.h:97
time_t details_expiration
Time at which seeds expire.
Definition: pandorastation.h:85
virtual void rename(const std::string &newname) override
Definition: pandorastation.cpp:116
StationDefinitionDetails< GenreSeed > genre_seeds
Definition: pandorastation.h:100
const std::string & getToken() const
Definition: pandorastation.h:117
StationDefinitionDetails< ArtistSeed > artist_seeds
Definition: pandorastation.h:99
Station & operator=(const Station &update)
This is not a full-copy assignment, this is to update station details in the master when changes are ...
Definition: pandorastation.cpp:95
Station lookup.
Definition: pandorastation.h:143
Generic data type.
Definition: parsnip.h:81
@ MIX
Definition: musictypes.h:420
@ EVERYTHING
Definition: musictypes.h:421
Base class for storing lists of thingies, which need to be reference counted accurately.
Definition: retainedlist.h:20
Playlist / Artist / Album / Song datatypes that are self-implemented.
Essential data structures and support.
Playlist / Artist / Album / Song data types.
uint32_t value
Definition: audiooutput.cpp:68
Pandora source, player and related datatype specializations.
Definition: pandora.h:32
const int StationDetailCacheTime
Definition: pandorastation.cpp:22
const int StationListCacheTime
Definition: pandorastation.cpp:21
Collections for music thingie types.
Smart pointers for music thingie types.