Music Hub ..
A session-wide music playback service
Loading...
Searching...
No Matches
client_death_observer.cpp
Go to the documentation of this file.
1/*
2 * Copyright © 2014 Canonical Ltd.
3 * Copyright © 2022 UBports Foundation.
4 *
5 * Contact: Alberto Mardegan <mardy@users.sourceforge.net>
6 *
7 * This program is free software: you can redistribute it and/or modify it
8 * under the terms of the GNU Lesser General Public License version 3,
9 * as published by the Free Software Foundation.
10 *
11 * This program 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 Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 *
19 * Authored by: Thomas Voß <thomas.voss@canonical.com>
20 */
21
22#include "logging.h"
23
27
29
30using namespace media;
31
32namespace {
33
34// Accesses the default client death observer implementation for the platform.
36platform_default_client_death_observer(ClientDeathObserver *q)
37{
39 switch (b)
40 {
42 return new media::HybrisClientDeathObserver(q);
45 return new media::DBusClientDeathObserver(q);
46 default:
47 MH_INFO("Invalid or no A/V backend specified, using \"hybris\" as a default.");
48 return new media::HybrisClientDeathObserver(q);
49 }
50}
51
52} // namespace
53
55 QObject(parent),
56 d_ptr(platform_default_client_death_observer(this))
57{
58 qRegisterMetaType<Player::PlayerKey>("Player::PlayerKey");
59}
60
62
64{
66 d->registerForDeathNotifications(client);
67}
void registerForDeathNotifications(const Player::Client &client)
#define MH_INFO(...)
Definition logging.h:39
static Backend get_backend_type()
Returns the type of audio/video decoding/encoding backend being used.
Definition backend.cpp:28