pianod2
multisource multiuser scriptable networked music player
Classes | Namespaces | Macros | Enumerations | Functions | Variables
tuner.cpp File Reference

Playlist "tuner". More...

#include <config.h>
#include <cassert>
#include <cstdio>
#include <string>
#include <vector>
#include <algorithm>
#include "callback.h"
#include "callbackimpl.h"
#include "interpreter.h"
#include "logging.h"
#include "connection.h"
#include "response.h"
#include "user.h"
#include "users.h"
#include "mediaunit.h"
#include "mediamanager.h"
#include "predicate.h"
#include "retainedlist.h"
#include "tuner.h"
Include dependency graph for tuner.cpp:

Classes

struct  Tuner::PlaylistSummary
 A structure used for autotuning calculations. More...
 

Namespaces

 Tuner
 Store and maintain mixes and perform autotuning.
 

Macros

#define KEY_CONSIDER   "consider"
 
#define KEY_VETO   "vetoRating"
 
#define KEY_REJECT   "rejectionRating"
 
#define KEY_INCLUDE   "inclusionRating"
 
#define KEY_QUANTITY_GOAL   "quantityGoal"
 
#define KEY_QUALITY_MARGIN   "qualityMargin"
 
#define KEY_RANDOMIZE_METHOD   "randomizeBy"
 
#define KEY_ADJUST_ACTION   "action"
 
#define KEY_DETAIL   "detail"
 
#define DETAIL_OPTIONS   "[" KEY_DETAIL ":names|details|list]"
 

Enumerations

enum class  Tuner::PlaylistDetailLevel { Tuner::NAME , Tuner::DETAIL }
 
enum class  Tuner::AutotuneConsiders { Tuner::LOGIN , Tuner::FLAG , Tuner::ALL }
 

Functions

const Parsnip::OptionParser::DefinitionsTuner::autotuning_option_parser_definitions ()
 
void Tuner::interpret_autotune_options (const Parsnip::Data &options, AutotuneSettings *dest)
 Interpret options into the AutotuneSettings structure. More...
 
const Parsnip::Parser::DefinitionsTuner::parser_definitions ()
 
const PianodSchema::CommandIdsTuner::json_request_names ()
 Retrieve names for our JSON requests. More...
 
static ResponseCollector Tuner::sendPlaylistList (PlaylistList &list, PlaylistDetailLevel format)
 Send a list of playlists. More...
 

Variables

const LookupTable< CartsVerbCartsWord
 Text to enumeration translations for playlist mix actions. More...
 
const LookupTable< Media::SelectionMethodSelectionMethodWords
 Text to enumeration translations for randomization methods. More...
 
const LookupTable< PlaylistDetailLevel > Tuner::PlaylistDetailLevels
 Text to enumeration values for detail level in playlist lists. More...
 
static const LookupTable< AutotuneConsiders > Tuner::AutotuneConsiderLookup ({ { "login", AutotuneConsiders::LOGIN }, { "flag", AutotuneConsiders::FLAG }, { "all", AutotuneConsiders::ALL } })
 

Detailed Description

Playlist "tuner".

Manages the playlists included in a mix.

Macro Definition Documentation

◆ DETAIL_OPTIONS

#define DETAIL_OPTIONS   "[" KEY_DETAIL ":names|details|list]"

◆ KEY_ADJUST_ACTION

#define KEY_ADJUST_ACTION   "action"

◆ KEY_CONSIDER

#define KEY_CONSIDER   "consider"

◆ KEY_DETAIL

#define KEY_DETAIL   "detail"

◆ KEY_INCLUDE

#define KEY_INCLUDE   "inclusionRating"

◆ KEY_QUALITY_MARGIN

#define KEY_QUALITY_MARGIN   "qualityMargin"

◆ KEY_QUANTITY_GOAL

#define KEY_QUANTITY_GOAL   "quantityGoal"

◆ KEY_RANDOMIZE_METHOD

#define KEY_RANDOMIZE_METHOD   "randomizeBy"

◆ KEY_REJECT

#define KEY_REJECT   "rejectionRating"

◆ KEY_VETO

#define KEY_VETO   "vetoRating"

Variable Documentation

◆ CartsWord

const LookupTable<CartsVerb> CartsWord
Initial value:
{
{ "Clear", CartsVerb::CLEAR },
{ "Add", CartsVerb::ADD },
{ "Remove", CartsVerb::REMOVE },
{ "Delete", CartsVerb::REMOVE },
{ "Toggle", CartsVerb::TOGGLE },
{ "Set", CartsVerb::SET }
}

Text to enumeration translations for playlist mix actions.

Lookup table for inclusion/exclusion (CARTS) actions.

◆ SelectionMethodWords

const LookupTable<Media::SelectionMethod> SelectionMethodWords
Initial value:
{
}
@ Artist
An artist is picked randomly, then a few of their songs are picked.
@ Random
One of the above methods is randomly chosen.
@ Song
Songs are picked randomly from the union of applicable playlists.
@ Playlist
A playlist is picked randomly, then a few of its songs randomly.
@ Album
An entire album is picked randomly from a playlist.

Text to enumeration translations for randomization methods.