Conquer Chess
Chess and Starcraft combined
Loading...
Searching...
No Matches
sound_effects.h
Go to the documentation of this file.
1#ifndef SOUND_EFFECTS_H
2#define SOUND_EFFECTS_H
3
4#ifndef LOGIC_ONLY
5
6
7#include "ccfwd.h"
8#include "message.h"
9
10#include <SFML/Audio.hpp>
11
14{
15public:
17
18 int get_n_sound_effects() const noexcept {
19 return sizeof(*this)
20 / (sizeof(m_attacking_high) + sizeof(m_attacking_high_buffer));
21 }
22
24 void play(const message& effect);
25
27 void play_bark(const int number);
28
30 void play_countdown() noexcept;
31
33 void play_hide() noexcept;
34
36 void set_master_volume(const volume& v);
37
38private:
39 sf::Sound m_attacking_high;
40 sf::Sound m_attacking_low;
41 sf::Sound m_attacking_mid;
42 sf::Sound m_bark_1;
43 sf::Sound m_bark_2;
44 sf::Sound m_countdown;
45 sf::Sound m_done_high;
46 sf::Sound m_done_low;
47 sf::Sound m_done_mid;
48 sf::Sound m_faring_into_battle;
49 sf::Sound m_heu_high;
50 sf::Sound m_heu_low;
51 sf::Sound m_heu_mid;
52 sf::Sound m_hide;
53 sf::Sound m_hmm_high;
54 sf::Sound m_hmm_low;
55 sf::Sound m_hmm_mid;
56 sf::Sound m_i_cannot_high;
57 sf::Sound m_i_cannot_low;
58 sf::Sound m_i_cannot_mid;
59 sf::Sound m_i_cant_high;
60 sf::Sound m_i_cant_low;
61 sf::Sound m_i_cant_mid;
62 sf::Sound m_its_time_to_rock;
63 sf::Sound m_jumping_into_battle;
64 sf::Sound m_lets_rule;
65 sf::Sound m_moving_forward;
66 sf::Sound m_no_high;
67 sf::Sound m_no_low;
68 sf::Sound m_no_mid;
69 sf::Sound m_nope_high;
70 sf::Sound m_nope_low;
71 sf::Sound m_nope_mid;
72 sf::Sound m_to_rule_is_to_act;
73 sf::Sound m_yes_high;
74 sf::Sound m_yes_low;
75 sf::Sound m_yes_mid;
76
77 sf::SoundBuffer m_attacking_high_buffer;
78 sf::SoundBuffer m_attacking_low_buffer;
79 sf::SoundBuffer m_attacking_mid_buffer;
80 sf::SoundBuffer m_bark_1_buffer;
81 sf::SoundBuffer m_bark_2_buffer;
82 sf::SoundBuffer m_countdown_buffer;
83 sf::SoundBuffer m_done_high_buffer;
84 sf::SoundBuffer m_done_low_buffer;
85 sf::SoundBuffer m_done_mid_buffer;
86 sf::SoundBuffer m_faring_into_battle_buffer;
87 sf::SoundBuffer m_heu_high_buffer;
88 sf::SoundBuffer m_heu_low_buffer;
89 sf::SoundBuffer m_heu_mid_buffer;
90 sf::SoundBuffer m_hide_buffer;
91 sf::SoundBuffer m_hmm_high_buffer;
92 sf::SoundBuffer m_hmm_low_buffer;
93 sf::SoundBuffer m_hmm_mid_buffer;
94 sf::SoundBuffer m_i_cannot_high_buffer;
95 sf::SoundBuffer m_i_cannot_low_buffer;
96 sf::SoundBuffer m_i_cannot_mid_buffer;
97 sf::SoundBuffer m_i_cant_high_buffer;
98 sf::SoundBuffer m_i_cant_low_buffer;
99 sf::SoundBuffer m_i_cant_mid_buffer;
100 sf::SoundBuffer m_its_time_to_rock_buffer;
101 sf::SoundBuffer m_jumping_into_battle_buffer;
102 sf::SoundBuffer m_lets_rule_buffer;
103 sf::SoundBuffer m_moving_forward_buffer;
104 sf::SoundBuffer m_no_high_buffer;
105 sf::SoundBuffer m_no_low_buffer;
106 sf::SoundBuffer m_no_mid_buffer;
107 sf::SoundBuffer m_nope_high_buffer;
108 sf::SoundBuffer m_nope_low_buffer;
109 sf::SoundBuffer m_nope_mid_buffer;
110 sf::SoundBuffer m_to_rule_is_to_act_buffer;
111 sf::SoundBuffer m_yes_high_buffer;
112 sf::SoundBuffer m_yes_low_buffer;
113 sf::SoundBuffer m_yes_mid_buffer;
114
116 std::vector<std::tuple<std::reference_wrapper<sf::Sound>, std::reference_wrapper<sf::SoundBuffer>, std::string>> get_table() noexcept;
117};
118
121
122#endif // LOGIC_ONLY
123
124#endif // SOUND_EFFECTS_H
A message.
Definition message.h:15
The sound effects.
Definition sound_effects.h:14
void play_hide() noexcept
Play the 'wooosh' effect.
Definition sound_effects.cpp:231
void play(const message &effect)
Play a sound effect.
Definition sound_effects.cpp:75
void set_master_volume(const volume &v)
Set the master volume for all sounds.
Definition sound_effects.cpp:236
int get_n_sound_effects() const noexcept
Definition sound_effects.h:18
void play_bark(const int number)
Play a Thema bark. Number can be either 1 or 2.
Definition sound_effects.cpp:211
sound_effects()
Definition sound_effects.cpp:11
void play_countdown() noexcept
Play the robotic countdown effect.
Definition sound_effects.cpp:226
A relative sound intensity.
Definition volume.h:10
void test_sound_effects()
Test this class and its free functions.