The Battle for Wesnoth  1.17.0-dev
Public Member Functions | Private Types | Private Attributes | List of all members
soundsource::manager Class Reference

#include <soundsource.hpp>

Inheritance diagram for soundsource::manager:

Public Member Functions

 manager (const display &disp)
 
 ~manager ()
 
void handle_generic_event (const std::string &event_name)
 
void add (const sourcespec &source)
 
void remove (const std::string &id)
 
sourcespec get (const std::string &id)
 
bool contains (const std::string &id)
 
void update ()
 
void update_positions ()
 
void write_sourcespecs (config &cfg) const
 Serializes information into cfg as new children of key "sound_source", appended to existing content. More...
 
- Public Member Functions inherited from events::observer
virtual ~observer ()
 

Private Types

typedef std::map< std::string, std::unique_ptr< positional_source > > positional_source_map
 
typedef positional_source_map::iterator positional_source_iterator
 
typedef positional_source_map::const_iterator positional_source_const_iterator
 

Private Attributes

positional_source_map sources_
 
const displaydisp_
 

Detailed Description

Definition at line 76 of file soundsource.hpp.

Member Typedef Documentation

◆ positional_source_const_iterator

typedef positional_source_map::const_iterator soundsource::manager::positional_source_const_iterator
private

Definition at line 81 of file soundsource.hpp.

◆ positional_source_iterator

typedef positional_source_map::iterator soundsource::manager::positional_source_iterator
private

Definition at line 80 of file soundsource.hpp.

◆ positional_source_map

typedef std::map<std::string, std::unique_ptr<positional_source> > soundsource::manager::positional_source_map
private

Definition at line 79 of file soundsource.hpp.

Constructor & Destructor Documentation

◆ manager()

soundsource::manager::manager ( const display disp)

◆ ~manager()

soundsource::manager::~manager ( )

Definition at line 39 of file soundsource.cpp.

References sources_.

Member Function Documentation

◆ add()

void soundsource::manager::add ( const sourcespec source)

Definition at line 50 of file soundsource.cpp.

References soundsource::sourcespec::id(), and sources_.

Referenced by impl_sndsrc_set(), and impl_source_set().

◆ contains()

bool soundsource::manager::contains ( const std::string &  id)

Definition at line 76 of file soundsource.cpp.

References sources_.

◆ get()

sourcespec soundsource::manager::get ( const std::string &  id)

Definition at line 55 of file soundsource.cpp.

References sources_.

◆ handle_generic_event()

void soundsource::manager::handle_generic_event ( const std::string &  event_name)
virtual

Implements events::observer.

Definition at line 44 of file soundsource.cpp.

References update_positions().

◆ remove()

void soundsource::manager::remove ( const std::string &  id)

Definition at line 65 of file soundsource.cpp.

References sources_.

Referenced by impl_sndsrc_set().

◆ update()

void soundsource::manager::update ( )

Definition at line 81 of file soundsource.cpp.

References disp_, and sources_.

Referenced by impl_sndsrc_set(), and impl_source_set().

◆ update_positions()

void soundsource::manager::update_positions ( )

Definition at line 90 of file soundsource.cpp.

References disp_, and sources_.

Referenced by handle_generic_event(), and manager().

◆ write_sourcespecs()

void soundsource::manager::write_sourcespecs ( config cfg) const

Serializes information into cfg as new children of key "sound_source", appended to existing content.

Definition at line 99 of file soundsource.cpp.

References config::add_child(), i, and sources_.

Member Data Documentation

◆ disp_

const display& soundsource::manager::disp_
private

Definition at line 84 of file soundsource.hpp.

Referenced by manager(), update(), and update_positions().

◆ sources_

positional_source_map soundsource::manager::sources_
private

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