Conquer Chess
Chess and Starcraft combined
Loading...
Searching...
No Matches
volume.h
Go to the documentation of this file.
1#ifndef VOLUME_H
2#define VOLUME_H
3
4#include <iosfwd>
5
9class volume
10{
11public:
14 explicit volume(const int volume_in_percent);
15
18 int get_percentage() const noexcept { return m_volume_in_percent; }
19
20private:
21
24 int m_volume_in_percent;
25};
26
28volume get_next(const volume& v) noexcept;
29
31volume get_previous(const volume& v) noexcept;
32
34void test_volume();
35
36bool operator==(const volume& lhs, const volume& rhs) noexcept;
37bool operator!=(const volume& lhs, const volume& rhs) noexcept;
38
39std::ostream& operator<<(std::ostream& os, const volume& v) noexcept;
40
41#endif // VOLUME_H
A relative sound intensity.
Definition volume.h:10
int get_percentage() const noexcept
Get the volume in percents, i.e.
Definition volume.h:18
bool operator!=(const volume &lhs, const volume &rhs) noexcept
Definition volume.cpp:86
void test_volume()
Test this class and its free functions.
Definition volume.cpp:28
volume get_next(const volume &v) noexcept
Get the next volume, i.e. the volume when the user presses right.
Definition volume.cpp:14
volume get_previous(const volume &v) noexcept
Get the previous volume, i.e. the volume when the user presses left.
Definition volume.cpp:21
bool operator==(const volume &lhs, const volume &rhs) noexcept
Definition volume.cpp:81
std::ostream & operator<<(std::ostream &os, const volume &v) noexcept
Definition volume.cpp:91