LCC Fusion Project 1.0
LCC Automation
Loading...
Searching...
No Matches
SoundRemoteConfiguredConsumer Class Reference

Consumer class for receiving sound player related events and sending them to MP3 players (DFPlayer) More...

#include <SoundConfiguredConsumer.h>

Inheritance diagram for SoundRemoteConfiguredConsumer:
Collaboration diagram for SoundRemoteConfiguredConsumer:

Public Member Functions

UpdateAction apply_configuration (int fd, bool initial_load, BarrierNotifiable *done) OVERRIDE
 Invoked on initial load of CDI and when CDI is udpated.
Register configured events with OpenMRN. More...
 
void factory_reset (int fd) OVERRIDE
 
void handle_event_report (const openlcb::EventRegistryEntry &registry_entry, openlcb::EventReport *event, BarrierNotifiable *done) OVERRIDE
 Process consumed event. Use args passed with the event to determine which event occurred and the player information.
 
void handle_identify_global (const openlcb::EventRegistryEntry &registry_entry, openlcb::EventReport *event, BarrierNotifiable *done) OVERRIDE
 Process global request to identify events.
 
void handle_identify_consumer (const openlcb::EventRegistryEntry &registry_entry, openlcb::EventReport *event, BarrierNotifiable *done) OVERRIDE
 Process request to identify produced events.
 
void applyPlayerConfiguration (int fd, uint8_t cardNum, uint8_t numPlayers, size_t playersCdiOffset, const std::vector< std::vector< SoundPlayerDevice * > > &pPlayers)
 applyPlayerConfiguration invoke to apply (register events) for the group of players using the user specified CDI More...
 

Private Member Functions

void _do_unregister ()
 Removed registration of this event handler from the global event registry.
 
void _sendConsumerIdentified (const openlcb::EventRegistryEntry &registry_entry, openlcb::EventReport *event, BarrierNotifiable *done)
 Sends out a ConsumerIdentified message for the given registration entry.
 

Detailed Description

Consumer class for receiving sound player related events and sending them to MP3 players (DFPlayer)

Parameters
nodeis the OpenLCB node object from the stack.
configis the repeated group of objects in the configuration space that represents a group of sound cards
Usage:
SoundRemoteConfiguredConsumer soundCardsConfigObject( lccNode.node(), cfg.soundCardsSeg().soundCards() );
openlcb::Node * node()
node() returns a pointer to the NODE object within memory
Definition: LccNode.h:204
Consumer class for receiving sound player related events and sending them to MP3 players (DFPlayer)
LccNode lccNode(COMM_TYPES::CAN_TWAI|COMM_TYPES::CAN_SLCAN_SERIAL_BRIDGE)
instantiates all consumer and producers

Definition at line 376 of file SoundConfiguredConsumer.h.

Member Function Documentation

◆ apply_configuration()

UpdateAction SoundRemoteConfiguredConsumer::apply_configuration ( int  fd,
bool  initial_load,
BarrierNotifiable *  done 
)
inline

Invoked on initial load of CDI and when CDI is udpated.
Register configured events with OpenMRN.


Parameters
fdfile descriptor used to access CDI data
initial_loadis true when CDI is loaded after a reboot
done

Definition at line 426 of file SoundConfiguredConsumer.h.

Here is the call graph for this function:

◆ applyPlayerConfiguration()

void SoundConfiguredConsumer::applyPlayerConfiguration ( int  fd,
uint8_t  cardNum,
uint8_t  numPlayers,
size_t  playersCdiOffset,
const std::vector< std::vector< SoundPlayerDevice * > > &  pPlayers 
)
inlineinherited

applyPlayerConfiguration invoke to apply (register events) for the group of players using the user specified CDI


Parameters
fdis the file descriptor provided by openMRN
cardNumis the current card number the player(s) is associated with. Used to qualifying the default event ID to a specific card.
numPlayersis the number of players in the group of players (1 or more)
playersCdiOffsetis the offset in memory for the CDI configuration for this group of players
pPlayersis a vector of pointers to the SoundPlayerDevice objects created for each player
Note
player specific information is stored in the event's 4-byte user argument. Later when the event is received an being processed, these 4-bytes are used to identify the specific player information (player request type, card number, player number, file number and volume %)

Definition at line 128 of file SoundConfiguredConsumer.h.

Here is the caller graph for this function:

◆ factory_reset()

void SoundRemoteConfiguredConsumer::factory_reset ( int  fd)
inline

Reset CDI configuration entries to their initial (default) values

Parameters
fdused to access the CDI information in the file system

Definition at line 459 of file SoundConfiguredConsumer.h.


The documentation for this class was generated from the following file: