Music Hub  ..
A session-wide music playback service
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 
24 #include "client_death_observer.h"
27 
28 namespace media = lomiri::MediaHubService;
29 
30 using namespace media;
31 
32 namespace {
33 
34 // Accesses the default client death observer implementation for the platform.
36 platform_default_client_death_observer(ClientDeathObserver *q)
37 {
39  switch (b)
40  {
41  case media::AVBackend::Backend::hybris:
43  case media::AVBackend::Backend::mir:
44  case media::AVBackend::Backend::none:
45  return new media::DBusClientDeathObserver(q);
46  default:
47  MH_INFO("Invalid or no A/V backend specified, using \"hybris\" as a default.");
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 }
QObject
lomiri::MediaHubService::ClientDeathObserver::~ClientDeathObserver
virtual ~ClientDeathObserver()
hybris_client_death_observer.h
lomiri::MediaHubService::ClientDeathObserver
Definition: client_death_observer.h:39
dbus_client_death_observer.h
lomiri::MediaHubService::AVBackend::Backend
Backend
Definition: player.h:36
lomiri::MediaHubService::Player::Client
Definition: player.h:61
lomiri::MediaHubService::AVBackend::get_backend_type
static Backend get_backend_type()
Returns the type of audio/video decoding/encoding backend being used.
Definition: backend.cpp:28
client_death_observer.h
lomiri::MediaHubService::ClientDeathObserverPrivate
Definition: client_death_observer_p.h:27
lomiri::MediaHubService
Definition: context.h:28
lomiri::MediaHubService::ClientDeathObserver::ClientDeathObserver
ClientDeathObserver(QObject *parent=nullptr)
Definition: client_death_observer.cpp:54
lomiri::MediaHubService::ClientDeathObserver::registerForDeathNotifications
void registerForDeathNotifications(const Player::Client &client)
Definition: client_death_observer.cpp:63
lomiri::MediaHubService::DBusClientDeathObserver
Definition: dbus_client_death_observer.h:31
MH_INFO
#define MH_INFO(...)
Definition: logging.h:39
lomiri::MediaHubService::HybrisClientDeathObserver
Definition: hybris_client_death_observer.h:37
logging.h