The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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 ()
 
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

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

Definition at line 120 of file soundsource.cpp.

References faderange_, and range_.

soundsource::positional_source::~positional_source ( )

Definition at line 137 of file soundsource.cpp.

References DISTANCE_SILENT, id_, and sound::reposition_sound().

Member Function Documentation

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

Definition at line 142 of file soundsource.cpp.

References locations_.

Referenced by update_positions().

void soundsource::positional_source::update ( unsigned int  time,
const display disp 
)
void soundsource::positional_source::update_positions ( unsigned int  time,
const display disp 
)
void soundsource::positional_source::write_config ( config cfg) const

Serializes attributes as WML config.

Parameters
cfgA reference to a [sound_source] tag object.

Definition at line 220 of file soundsource.cpp.

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

Member Data Documentation

int soundsource::positional_source::chance_
private

Definition at line 38 of file soundsource.hpp.

Referenced by update(), and write_config().

bool soundsource::positional_source::check_fogged_
private

Definition at line 43 of file soundsource.hpp.

Referenced by calculate_volume(), and write_config().

bool soundsource::positional_source::check_shrouded_
private

Definition at line 44 of file soundsource.hpp.

Referenced by calculate_volume(), and write_config().

int soundsource::positional_source::faderange_
private

Definition at line 42 of file soundsource.hpp.

Referenced by calculate_volume(), positional_source(), and write_config().

std::string soundsource::positional_source::files_
private

Definition at line 45 of file soundsource.hpp.

Referenced by update(), and write_config().

const unsigned int soundsource::positional_source::id_
private

Definition at line 40 of file soundsource.hpp.

Referenced by update(), update_positions(), and ~positional_source().

unsigned int soundsource::positional_source::last_id = 0
staticprivate

Definition at line 50 of file soundsource.hpp.

unsigned int soundsource::positional_source::last_played_
private

Definition at line 36 of file soundsource.hpp.

Referenced by update().

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

Definition at line 46 of file soundsource.hpp.

Referenced by is_global(), update(), update_positions(), and write_config().

int soundsource::positional_source::loops_
private

Definition at line 39 of file soundsource.hpp.

Referenced by update(), and write_config().

int soundsource::positional_source::min_delay_
private

Definition at line 37 of file soundsource.hpp.

Referenced by update(), and write_config().

int soundsource::positional_source::range_
private

Definition at line 41 of file soundsource.hpp.

Referenced by calculate_volume(), positional_source(), and write_config().


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