Music Hub
..
A session-wide music playback service
engine.cpp
Go to the documentation of this file.
1
/*
2
* Copyright © 2013-2014 Canonical Ltd.
3
*
4
* This program is free software: you can redistribute it and/or modify it
5
* under the terms of the GNU Lesser General Public License version 3,
6
* as published by the Free Software Foundation.
7
*
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU Lesser General Public License for more details.
12
*
13
* You should have received a copy of the GNU Lesser General Public License
14
* along with this program. If not, see <http://www.gnu.org/licenses/>.
15
*
16
* Authored by: Thomas Voß <thomas.voss@canonical.com>
17
* Jim Hodapp <jim.hodapp@canonical.com>
18
*/
19
20
#include "
engine.h
"
21
22
#include <exception>
23
#include <stdexcept>
24
25
namespace
media
=
core::ubuntu::media
;
26
27
double
media::Engine::Volume::min()
28
{
29
return
0.;
30
}
31
32
double
media::Engine::Volume::max()
33
{
34
return
1.;
35
}
36
37
media::Engine::Volume::Volume(
double
v) : value(v)
38
{
39
if
(
value
<
min
() ||
value
>
max
())
40
throw
std::runtime_error(
"Value exceeds limits"
);
41
}
42
43
bool
media::Engine::Volume::operator!=
(
const
media::Engine::Volume
& rhs)
const
44
{
45
return
value != rhs.
value
;
46
}
47
48
bool
media::Engine::Volume::operator==
(
const
media::Engine::Volume
& rhs)
const
49
{
50
return
value == rhs.
value
;
51
}
engine.h
core::ubuntu::media::Engine::Volume::operator!=
bool operator!=(const Volume &rhs) const
Definition:
engine.cpp:43
core::ubuntu::media::Engine::Volume::max
static double max()
Definition:
engine.cpp:32
core::ubuntu::media::Engine::Volume::min
static double min()
Definition:
engine.cpp:27
core::ubuntu::media::Engine::Volume::value
double value
Definition:
engine.h:59
core::ubuntu::media
Definition:
player.h:37
core::ubuntu::media::Engine::Volume
Definition:
engine.h:49
core::ubuntu::media::Engine::Volume::operator==
bool operator==(const Volume &rhs) const
Definition:
engine.cpp:48
src
core
media
engine.cpp
Generated on Mon Sep 7 2015 10:37:43 for Music Hub by
1.8.9.1