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

Sound source info class. More...

#include <soundsource.hpp>

Public Member Functions

 sourcespec (const std::string &id, const std::string &files, int min_delay, int chance)
 Parameter-list constructor. More...
 
 sourcespec (const config &cfg)
 WML constructor. More...
 
void write (config &cfg) const
 Serializes information into cfg as a new (appended) child of key "sound_source". More...
 
int loops () const
 
void set_loops (int value)
 
bool check_fogged () const
 
bool check_shrouded () const
 
void set_check_fogged (bool value)
 
void set_check_shrouded (bool value)
 
const std::vector< map_location > & get_locations () const
 
int full_range () const
 
void set_full_range (int value)
 
int fade_range () const
 
void set_fade_range (int value)
 
int minimum_delay () const
 
void set_minimum_delay (int value)
 
int chance () const
 
void set_chance (int value)
 
const std::string & id () const
 
const std::string & files () const
 

Private Attributes

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

Detailed Description

Sound source info class.

Encapsulates sound source parameters, so that they're easier to pass around/extend/read.

Definition at line 114 of file soundsource.hpp.

Constructor & Destructor Documentation

◆ sourcespec() [1/2]

soundsource::sourcespec::sourcespec ( const std::string &  id,
const std::string &  files,
int  min_delay,
int  chance 
)
inline

Parameter-list constructor.

Definition at line 132 of file soundsource.hpp.

References write().

◆ sourcespec() [2/2]

soundsource::sourcespec::sourcespec ( const config cfg)

WML constructor.

Definition at line 218 of file soundsource.cpp.

References locations_, and read_locations().

Member Function Documentation

◆ chance()

int soundsource::sourcespec::chance ( ) const
inline

Definition at line 193 of file soundsource.hpp.

References soundsource::positional_source::chance_.

◆ check_fogged()

bool soundsource::sourcespec::check_fogged ( ) const
inline

Definition at line 160 of file soundsource.hpp.

References soundsource::positional_source::check_fogged_.

◆ check_shrouded()

bool soundsource::sourcespec::check_shrouded ( ) const
inline

Definition at line 161 of file soundsource.hpp.

References soundsource::positional_source::check_shrouded_.

◆ fade_range()

int soundsource::sourcespec::fade_range ( ) const
inline

Definition at line 181 of file soundsource.hpp.

References soundsource::positional_source::faderange_.

◆ files()

const std::string& soundsource::sourcespec::files ( ) const
inline

Definition at line 201 of file soundsource.hpp.

References soundsource::positional_source::files_.

◆ full_range()

int soundsource::sourcespec::full_range ( ) const
inline

Definition at line 175 of file soundsource.hpp.

References soundsource::positional_source::range_.

◆ get_locations()

const std::vector<map_location>& soundsource::sourcespec::get_locations ( ) const
inline

Definition at line 171 of file soundsource.hpp.

References soundsource::positional_source::locations_.

◆ id()

const std::string& soundsource::sourcespec::id ( ) const
inline

Definition at line 199 of file soundsource.hpp.

References soundsource::positional_source::id_.

Referenced by soundsource::manager::add().

◆ loops()

int soundsource::sourcespec::loops ( ) const
inline

Definition at line 154 of file soundsource.hpp.

References soundsource::positional_source::loops_.

◆ minimum_delay()

int soundsource::sourcespec::minimum_delay ( ) const
inline

Definition at line 187 of file soundsource.hpp.

References soundsource::positional_source::min_delay_.

◆ set_chance()

void soundsource::sourcespec::set_chance ( int  value)
inline

Definition at line 195 of file soundsource.hpp.

◆ set_check_fogged()

void soundsource::sourcespec::set_check_fogged ( bool  value)
inline

Definition at line 163 of file soundsource.hpp.

◆ set_check_shrouded()

void soundsource::sourcespec::set_check_shrouded ( bool  value)
inline

Definition at line 167 of file soundsource.hpp.

◆ set_fade_range()

void soundsource::sourcespec::set_fade_range ( int  value)
inline

Definition at line 183 of file soundsource.hpp.

◆ set_full_range()

void soundsource::sourcespec::set_full_range ( int  value)
inline

Definition at line 177 of file soundsource.hpp.

◆ set_loops()

void soundsource::sourcespec::set_loops ( int  value)
inline

Definition at line 156 of file soundsource.hpp.

◆ set_minimum_delay()

void soundsource::sourcespec::set_minimum_delay ( int  value)
inline

Definition at line 189 of file soundsource.hpp.

◆ write()

void soundsource::sourcespec::write ( config cfg) const

Serializes information into cfg as a new (appended) child of key "sound_source".

Member Data Documentation

◆ chance_

int soundsource::sourcespec::chance_
private

Definition at line 120 of file soundsource.hpp.

◆ check_fogged_

bool soundsource::sourcespec::check_fogged_
private

Definition at line 125 of file soundsource.hpp.

◆ check_shrouded_

bool soundsource::sourcespec::check_shrouded_
private

Definition at line 126 of file soundsource.hpp.

◆ faderange_

int soundsource::sourcespec::faderange_
private

Definition at line 124 of file soundsource.hpp.

◆ files_

const std::string soundsource::sourcespec::files_
private

Definition at line 117 of file soundsource.hpp.

◆ id_

const std::string soundsource::sourcespec::id_
private

Definition at line 116 of file soundsource.hpp.

◆ locations_

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

Definition at line 128 of file soundsource.hpp.

Referenced by sourcespec().

◆ loops_

int soundsource::sourcespec::loops_
private

Definition at line 122 of file soundsource.hpp.

◆ min_delay_

int soundsource::sourcespec::min_delay_
private

Definition at line 119 of file soundsource.hpp.

◆ range_

int soundsource::sourcespec::range_
private

Definition at line 123 of file soundsource.hpp.


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