Main Page · Modules · All Classes · Class Hierarchy |
Speaker controller class. More...
#include <MASpeakerController.hpp>
Public Member Functions | |
virtual MA::DeviceList | GetMotors () const override |
Get the list of the motors. More... | |
bool | IsFree () const |
Check if any sound is being played back. More... | |
void | SwitchSoundProfile () |
Switch the sound profile. | |
std::string | GetSoundProfileName () const |
Get sound profile name. More... | |
void | SetSoundProfileName (const std::string &profile_name) |
Set sound profile name. More... | |
virtual void | LoadSoundProfile () |
Load the sound profile. | |
virtual void | SaveSoundProfile () |
Save the sound profile. | |
virtual void | LoadVolumeControl () |
Load the volume control. | |
virtual void | SaveVolumeControl () |
Save the volume control. | |
bool | Preload (const std::string &name) |
Preload a sound. More... | |
void | FreePreloadedSound (const std::string &name) |
Free a preloaded sound. More... | |
int | Play (const std::string &name) |
Play a sound by name. More... | |
int | Play (MA::SoundBaseSPtr sound) |
Play a sound and register the playback. More... | |
bool | IsPlayed (const int playback_id) const |
Check if a playback ID is active. More... | |
bool | IsPlayed (const std::string &sound_name) const |
Check if a sound playback is active. More... | |
void | SetVolume (const MA::VolumeType new_volume) |
Set a new volume level. More... | |
![]() | |
MAController (MA::ControllerType controller_type) | |
Class constructor. More... | |
MC::StringList | GetTransitionNames () const |
Get the list of the transition names. More... | |
MC::StringList | GetActiveTransitionsByDevice (const MADevice &device) |
Get a transition list by device. More... | |
virtual int | StartTransition (const std::string &name) |
Start a transition. More... | |
virtual void | StopTransition (const std::string &name) |
Stop a transition. More... | |
bool | IsTransitionActive (const std::string &name) |
Whenever the transition is still active. More... | |
bool | IsAnyActiveTransition () |
Check if any transition is active. More... | |
bool | IsAnyActiveSkitTransition () |
Check if any skit transition is active. More... | |
bool | IsTransitionSuccessful (const std::string &name) |
Whenever the transition is successful. More... | |
bool | TransitionHasCheck (const std::string &name) |
Test if the transition has a check. More... | |
![]() | |
MARobotStateUpdater (MA::RobotStateUpdateType update_type) | |
Struct constructor. | |
virtual | ~MARobotStateUpdater () |
Struct destructor. | |
![]() | |
MAContainerLocker (const std::string &class_name, const std::string &file_name) | |
Class constructor. More... | |
int | RegisterContainer (const std::string &container_name) |
Register a container for locking. More... | |
int | Lock (int container_id, int line, const char *file_name=nullptr) |
Lock a container. More... | |
int | Unlock (int container_id, int line, const char *file_name=nullptr) |
Unlock a container. More... | |
Static Public Member Functions | |
static void | RegisterFutureSound (const int id, const std::string &name, const int duration) |
Register a sound for future playback. More... | |
![]() | |
static void | SetVerbose (bool new_state) |
Set the verbosity of the controller domain. More... | |
static bool | IsVerbose () |
Get the verbosity of the controller domain. More... | |
![]() | |
static void | RegisterUpdater (MARobotStateUpdater &updater) |
Register a robot state updater. More... | |
static void | Run (MARobotState &state) |
Run the robot state updates. More... | |
Protected Member Functions | |
virtual MA::DeviceGeneratorsMap | GetSkitTransitionGenerators (MA::SkitBaseSPtr skit) override |
Get skit transition generators. More... | |
![]() | |
void | GeneratorContainerExpired (MAGeneratorContainer &container) |
Slot for the expired generator containers. More... | |
MA::TransitionMap::iterator | RegisterSkitTransition (const std::string &skit_name) |
Register a skit transition if it has not been. More... | |
Protected Attributes | |
int | BufferSize |
Determinates the buffer duration for the playback. | |
MA::SoundPlaybackMap | Playbacks |
Actual playback list of the sound files. | |
boost::shared_ptr< MASpeakerDevice > | SpeakerDevice |
Speaker device. | |
![]() | |
MA::ControllerType | Type |
Controller type. | |
MA::TransitionMap | Transitions |
The map of the transitions. | |
Private Member Functions | |
virtual void | UpdateRobotState (MARobotState &state) override |
Update the robot state. More... | |
Speaker controller class.
Definition at line 59 of file MASpeakerController.hpp.
void MASpeakerController::FreePreloadedSound | ( | const std::string & | name | ) |
Free a preloaded sound.
name | Sound name prefix (without profile name and extension) |
Definition at line 223 of file MASpeakerController.cpp.
|
overridevirtual |
Get the list of the motors.
Implements MAController.
Definition at line 121 of file MASpeakerController.cpp.
|
overrideprotectedvirtual |
Get skit transition generators.
skit | Motion skit |
Implements MAController.
Definition at line 427 of file MASpeakerController.cpp.
std::string MASpeakerController::GetSoundProfileName | ( | ) | const |
Get sound profile name.
Definition at line 156 of file MASpeakerController.cpp.
bool MASpeakerController::IsFree | ( | ) | const |
Check if any sound is being played back.
Definition at line 136 of file MASpeakerController.cpp.
bool MASpeakerController::IsPlayed | ( | const int | playback_id | ) | const |
Check if a playback ID is active.
playback_id | Playback ID |
Definition at line 307 of file MASpeakerController.cpp.
bool MASpeakerController::IsPlayed | ( | const std::string & | sound_name | ) | const |
Check if a sound playback is active.
sound_name | Sound name |
Definition at line 323 of file MASpeakerController.cpp.
int MASpeakerController::Play | ( | const std::string & | name | ) |
Play a sound by name.
name | Sound name |
Definition at line 255 of file MASpeakerController.cpp.
int MASpeakerController::Play | ( | MA::SoundBaseSPtr | sound | ) |
Play a sound and register the playback.
sound | In-memory sound data |
Definition at line 279 of file MASpeakerController.cpp.
bool MASpeakerController::Preload | ( | const std::string & | name | ) |
Preload a sound.
name | Sound name prefix (without profile name and extension) |
Definition at line 196 of file MASpeakerController.cpp.
|
static |
Register a sound for future playback.
id | Playback ID |
name | Sound name |
duration | Expected playback duration |
This method is for testing purposes. Never use for production code.
Definition at line 128 of file MASpeakerController.cpp.
void MASpeakerController::SetSoundProfileName | ( | const std::string & | profile_name | ) |
Set sound profile name.
profile_name | Profile name |
Definition at line 162 of file MASpeakerController.cpp.
void MASpeakerController::SetVolume | ( | const MA::VolumeType | new_volume | ) |
Set a new volume level.
new_volume | New volume level |
Definition at line 337 of file MASpeakerController.cpp.
|
overrideprivatevirtual |
Update the robot state.
state | Robot state to be updated |
Implements MARobotStateUpdater.
Definition at line 113 of file MASpeakerController.cpp.