Home2L - C/C++ API v1.4-0-g38cc (2024-05-25)
Smart Tools for a Private Home
All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
app_music.H
Go to the documentation of this file.
1/*
2 * This file is part of the Home2L project.
3 *
4 * (C) 2015-2021 Gundolf Kiefer
5 *
6 * Home2L is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * Home2L is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with Home2L. If not, see <https://www.gnu.org/licenses/>.
18 *
19 */
20
21
22#ifndef _APP_MUSIC_
23#define _APP_MUSIC_
24
25#include "base.H"
26
27
39#if WITH_MUSIC == 1 || DOXYGEN
40
41
47
48
49bool AppMusicSetServer (const char *id);
51
52
59bool AppMusicIsPlayingForSure (int minDb = -INT_MAX);
68
69
70#else // WITH_MUSIC == 1
71
72
73static inline void AppMusicPlayerOn () {}
74static inline void AppMusicPlayerOff () {}
75
76static inline bool AppMusicIsPlaying () { return false; }
77static inline bool AppMusicIsPlayingOrShouldBe () { return false; }
78static inline bool AppMusicIsPlayingForSure (int minDb = -INT_MAX) { return false; }
79
80
81#endif // WITH_MUSIC == 1
82
83
86
87
88#endif // _APP_MUSIC_
void AppMusicPlayerOn()
Switch on the music player. If necessary, a connection the the last MPD servcer is openend,...
bool AppMusicSetServer(const char *id)
Select MPD server by its ID.
bool AppMusicIsPlayingForSure(int minDb=-INT_MAX)
Return 'true' if the player is actually playing and it is guaranteed that either the user can hear so...
bool AppMusicIsPlayingOrShouldBe()
Return 'true' if the player is either actually playing or should be playing, but is not for a reason ...
bool AppMusicIsPlaying()
Return 'true' if the player is actually playing.
void AppMusicPlayerOff()
Stop the music player.