125 const std::string &room,
Audio engine, responsible for one "room" worth of audio.
Definition: engine.h:28
Generic data type.
Definition: parsnip.h:81
std::vector< const char * > Definitions
Definition: parsnip_command.h:90
Connection to a pianod client, along with context and state of that connection.
Definition: connection.h:54
virtual void connectionClose(const FB_EVENT *event) override
Invoked when a connection is closing.
Definition: connection.cpp:154
Media::Source *const source() const
Get the connection's selected source.
Definition: connection.h:86
void event(WaitEvent::Type type, const void *detail, RESPONSE_CODE reply)
Process an event for a connection.
Definition: connection.cpp:262
void waitForEvent(WaitEvent::Type type, const void *detail)
Begin waiting for an event on a connection.
Definition: connection.cpp:229
bool haveRank(Rank rank) const
Definition: connection.cpp:203
void close_after_events()
Close after events are handled, or now if not waiting on one.
Definition: connection.cpp:290
ResponseGroup updateConnection()
Definition: connection.cpp:150
std::string username(void) const
Definition: connection.h:83
static bool line_connections_only(FB_CONNECTION *)
Callback function used to identify line protocol connections.
Definition: connection.cpp:95
bool havePrivilege(Privilege priv) const
Determine if the user has a privilege.
Definition: connection.cpp:211
Media::Source * _source
The current source.
Definition: connection.h:61
void waitForEventWithOptions(WaitEvent::Type type, const Parsnip::Data &options, const void *detail)
Interpret options and begin waiting for an event on a connection.
Definition: connection.cpp:242
bool use_json
Set to true if protocol is JSON.
Definition: connection.h:63
virtual void newConnection(const FB_EVENT *event) override
Invoked when a new connection has arrived/greeted.
Definition: connection.cpp:115
Rank effectiveRank(void) const
Get connected user's rank.
Definition: connection.cpp:198
WaitEvent pending
An event this connection is waited for.
Definition: connection.h:62
ResponseGroup sendSelectedSource() const
Report the selected source to the connection.
Definition: connection.cpp:347
bool authenticated(void) const
Determine if the connection is authenticated, i.e., has a user.
Definition: connection.h:81
static bool json_connections_only(FB_CONNECTION *)
Callback function used to identify JSON connections.
Definition: connection.cpp:86
void checkTimeouts()
Check if a pending event has timed out.
Definition: connection.cpp:276
User * user
Definition: connection.h:76
ResponseGroup sendEffectivePrivileges() const
Transmit the user's effective privileges.
Definition: connection.cpp:356
void announceToRoom(ResponseGroup &&announcement) const
Send some messages to all users in a room.
Definition: connection.cpp:305
void announceToAll(ResponseGroup &&announcement) const
Broadcast some messages to all connected sessions, all rooms.
Definition: connection.cpp:327
virtual ~PianodConnection() override
Definition: connection.cpp:36
PianodService & service(void) const
Definition: connection.h:105
bool transmitJSON() const
Definition: connection.h:67
virtual void inputReceived(const FB_EVENT *event) override
Invoked when a completed message is received.
Definition: connection.cpp:163
Dispatcher based on Parsnip template, customized for pianod by adding help support.
Definition: interpreter.h:80
Pianod service, a customized FootballService for Pianod connections.
Definition: connection.h:115
~PianodService()
Definition: connection.cpp:371
void serviceShutdown(void)
When a service has been completely shut down, remove it from the service manager.
Definition: connection.cpp:377
PianodService(const FB_SERVICE_OPTIONS &options, const std::string &room, const AudioSettings &audio, PianodService *parent, const Parsnip::ParserRef &parser, const PianodSchemaRef &schema)
Definition: connection.cpp:39
void announceToRoom(const Response &message)
Send a message to all users in a room.
Definition: connection.cpp:387
const std::string room_name
Definition: connection.h:119
AudioEngine * engine
Definition: connection.h:118
PianodDispatcher dispatch
Definition: connection.h:121
void usersChangedNotification(void)
Definition: connection.cpp:381
const std::string & roomName(void)
Definition: connection.h:132
AudioEngine * audioEngine()
Definition: connection.h:130
Container for multiple Responses.
Definition: response.h:155
Type combining RESPONSE_CODE with a value or explanation:
Definition: response.h:49
Contains and manages all the services/rooms.
Definition: servicemanager.h:30
Data about each user.
Definition: user.h:53
const std::string & username(void) const
Definition: user.h:82
Details of an event being awaited.
Definition: connection.h:28
Type
Kinds of events that can be waited for.
Definition: connection.h:31
bool close_after_event
True if connection is 'AS USER' and should closed after event.
Definition: connection.h:40
static time_t nextTimeout
Definition: connection.h:43
const void * parameter
Identifies a specific event instance.
Definition: connection.h:38
time_t timeout
Time at which to stop waiting.
Definition: connection.h:39
Essential data structures and support.
enum server_status_t RESPONSE_CODE
pianod command processing.
std::shared_ptr< PianodSchema > PianodSchemaRef
Definition: interpreter.h:75
std::shared_ptr< Parser > ParserRef
Definition: parsnip_command.h:138
Parser for options for events/WAIT commands.
Definition: connection.cpp:59
const Parsnip::OptionParser::Definitions & parser_definitions()
Create a parser.
Definition: connection.cpp:64
void extract_options(const Parsnip::Data &options, WaitEvent *dest)
Extract the wait options into the WaitEvent structure.
Definition: connection.cpp:72
Parsnip command-line parsing.
Send messages of various kinds to clients.
Audio output device & driver parameters.
Definition: fundamentals.h:52
Connection state information.
Definition: fb_service.h:199
Events are returned in this structure.
Definition: fb_public.h:42
Service options are passed to a new service, defining its behavior.
Definition: fb_public.h:75
User data, privileges, details and preferences implementation.
Privilege
User privilege flags, corresponding to an array position.
Definition: user.h:32
Rank
User types in ascending ranks/level of authority.
Definition: user.h:24