pianod2
multisource multiuser scriptable networked music player
Functions
response.cpp File Reference

Manage messages of various kinds to clients. More...

#include <config.h>
#include <cstdarg>
#include <cassert>
#include <ctime>
#include <exception>
#include <sstream>
#include <iomanip>
#include <football/fb_public.h>
#include <parsnip/parsnip.h>
#include "logging.h"
#include "musictypes.h"
#include "retainedlist.h"
#include "musickeys.h"
#include "response.h"
#include "connection.h"
#include "servicemanager.h"
#include "fundamentals.h"
#include "utility.h"
#include "user.h"
#include "mediaunit.h"
#include <stdexcept>
#include <future>
#include <regex>
#include "filter.h"
#include "querylist.h"
Include dependency graph for response.cpp:

Functions

std::string format_duration (time_t duration, int minute_places)
 Format a duration as minutes and seconds. More...
 
const char * ResponseText (RESPONSE_CODE response)
 Retrieve the text for a success, failure, event or data message. More...
 
void sendUpdatedRatings (PianodConnection &conn, const PianodSong *song, CommandReply *response)
 Send updated ratings. More...
 
static Response standard_exception (const std::exception &except)
 Translate a standard exception message into a Response. More...
 

Detailed Description

Manage messages of various kinds to clients.

Function Documentation

◆ format_duration()

std::string format_duration ( time_t  duration,
int  minute_places 
)

Format a duration as minutes and seconds.

Parameters
durationThe duration.
minute_placesThe minimum number of digits to use for minutes. If less than this are required, the duration is zero-padded.
Returns
The duration in m:ss format.
Here is the caller graph for this function:

◆ ResponseText()

const char* ResponseText ( RESPONSE_CODE  response)

Retrieve the text for a success, failure, event or data message.

Parameters
responseThe number of the status or datum.
Returns
The corresponding text.
Here is the caller graph for this function:

◆ sendUpdatedRatings()

void sendUpdatedRatings ( PianodConnection conn,
const PianodSong song,
CommandReply response 
)

Send updated ratings.

Parameters
connThe connection initiating the ratings change.
songThe ratings to send.
responseThe reply in which ratings are inserted.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ standard_exception()

static Response standard_exception ( const std::exception &  except)
static

Translate a standard exception message into a Response.

Parameters
exceptAn exception.
Here is the caller graph for this function: