The Battle for Wesnoth  1.15.2+dev
Public Member Functions | Private Attributes | Static Private Attributes | List of all members
soundsource::positional_source Class Reference

#include <soundsource.hpp>

Public Member Functions

 positional_source (const sourcespec &spec)
 ~positional_source ()
bool is_global () const
void update (unsigned int time, const display &disp)
void update_positions (unsigned int time, const display &disp)
int calculate_volume (const map_location &loc, const display &disp)
void write_config (config &cfg) const
 Serializes attributes as WML config. More...

Private Attributes

unsigned int last_played_
int min_delay_
int chance_
int loops_
const unsigned int id_
int range_
int faderange_
bool check_fogged_
bool check_shrouded_
std::string files_
std::vector< map_locationlocations_

Static Private Attributes

static unsigned int last_id = 0

Detailed Description

Definition at line 35 of file soundsource.hpp.

Constructor & Destructor Documentation

◆ positional_source()

soundsource::positional_source::positional_source ( const sourcespec spec)

Definition at line 105 of file soundsource.cpp.

References faderange_, and range_.

◆ ~positional_source()

soundsource::positional_source::~positional_source ( )

Definition at line 122 of file soundsource.cpp.

References id_, and sound::stop_sound().

Member Function Documentation

◆ calculate_volume()

int soundsource::positional_source::calculate_volume ( const map_location loc,
const display disp 

◆ is_global()

bool soundsource::positional_source::is_global ( ) const

Definition at line 127 of file soundsource.cpp.

References locations_.

Referenced by update_positions().

◆ update()

void soundsource::positional_source::update ( unsigned int  time,
const display disp 

◆ update_positions()

void soundsource::positional_source::update_positions ( unsigned int  time,
const display disp 

◆ write_config()

void soundsource::positional_source::write_config ( config cfg) const

Serializes attributes as WML config.

cfgA reference to a [sound_source] tag object.

Definition at line 205 of file soundsource.cpp.

References chance_, check_fogged_, check_shrouded_, faderange_, files_, locations_, loops_, min_delay_, range_, and write_locations().

Member Data Documentation

◆ chance_

int soundsource::positional_source::chance_

Definition at line 38 of file soundsource.hpp.

Referenced by soundsource::sourcespec::chance(), update(), and write_config().

◆ check_fogged_

bool soundsource::positional_source::check_fogged_

◆ check_shrouded_

bool soundsource::positional_source::check_shrouded_

◆ faderange_

int soundsource::positional_source::faderange_

◆ files_

std::string soundsource::positional_source::files_

Definition at line 45 of file soundsource.hpp.

Referenced by soundsource::sourcespec::files(), update(), and write_config().

◆ id_

const unsigned int soundsource::positional_source::id_

◆ last_id

unsigned int soundsource::positional_source::last_id = 0

Definition at line 50 of file soundsource.hpp.

◆ last_played_

unsigned int soundsource::positional_source::last_played_

Definition at line 36 of file soundsource.hpp.

Referenced by update().

◆ locations_

std::vector<map_location> soundsource::positional_source::locations_

◆ loops_

int soundsource::positional_source::loops_

Definition at line 39 of file soundsource.hpp.

Referenced by soundsource::sourcespec::loops(), update(), and write_config().

◆ min_delay_

int soundsource::positional_source::min_delay_

Definition at line 37 of file soundsource.hpp.

Referenced by soundsource::sourcespec::minimum_delay(), update(), and write_config().

◆ range_

int soundsource::positional_source::range_

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