Music Hub
..
A session-wide music playback service
hybris_client_death_observer.h
Go to the documentation of this file.
1
/*
2
* Copyright © 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
*/
18
19
#ifndef CORE_UBUNTU_MEDIA_HYBRIS_CLIENT_DEATH_OBSERVER_H_
20
#define CORE_UBUNTU_MEDIA_HYBRIS_CLIENT_DEATH_OBSERVER_H_
21
22
#include <
core/media/client_death_observer.h
>
23
24
namespace
core
25
{
26
namespace
ubuntu
27
{
28
namespace
media
29
{
30
// Models functionality to be notified whenever a client
31
// of the service goes away, and thus allows us to clean
32
// up in that case.
33
// Specific implementation for a hybris-based platform.
34
class
HybrisClientDeathObserver
:
public
ClientDeathObserver
,
35
public
std::enable_shared_from_this<HybrisClientDeathObserver>
36
{
37
public
:
38
// Our static callback that we inject to the hybris world.
39
static
void
on_client_died_cb
(
void
* context);
40
41
// Creates an instance of the HybrisClientDeathObserver or throws
42
// if the underlying platform does not support it.
43
static
ClientDeathObserver::Ptr
create
();
44
45
// Make std::unique_ptr happy for forward declared Private internals.
46
~HybrisClientDeathObserver
();
47
48
// Registers the client with the given key for death notifications.
49
void
register_for_death_notifications_with_key
(
const
Player::PlayerKey
&)
override
;
50
51
// Emitted whenever a client dies, reporting the key under which the
52
// respective client was known.
53
const
core::Signal<Player::PlayerKey>&
on_client_with_key_died
()
const override
;
54
55
private
:
56
HybrisClientDeathObserver
();
57
58
core::Signal<media::Player::PlayerKey> client_with_key_died;
59
};
60
}
61
}
62
}
63
64
#endif
// CORE_UBUNTU_MEDIA_HYBRIS_CLIENT_DEATH_OBSERVER_H_
core::ubuntu::media::HybrisClientDeathObserver
Definition:
hybris_client_death_observer.h:36
core::ubuntu::media::HybrisClientDeathObserver::on_client_died_cb
static void on_client_died_cb(void *context)
Definition:
hybris_client_death_observer.cpp:31
core::ubuntu::media::HybrisClientDeathObserver::~HybrisClientDeathObserver
~HybrisClientDeathObserver()
Definition:
hybris_client_death_observer.cpp:59
core::ubuntu::media::HybrisClientDeathObserver::register_for_death_notifications_with_key
void register_for_death_notifications_with_key(const Player::PlayerKey &) override
Definition:
hybris_client_death_observer.cpp:63
core::ubuntu::media::HybrisClientDeathObserver::on_client_with_key_died
const core::Signal< Player::PlayerKey > & on_client_with_key_died() const override
Definition:
hybris_client_death_observer.cpp:68
core::ubuntu::media::HybrisClientDeathObserver::create
static ClientDeathObserver::Ptr create()
Definition:
hybris_client_death_observer.cpp:50
core::ubuntu::media::Player::PlayerKey
uint32_t PlayerKey
Definition:
player.h:63
client_death_observer.h
core::ubuntu::media
Definition:
player.h:38
core
Definition:
player.h:34
core::ubuntu::media::ClientDeathObserver
Definition:
client_death_observer.h:38
core::ubuntu::media::ClientDeathObserver::Ptr
std::shared_ptr< ClientDeathObserver > Ptr
Definition:
client_death_observer.h:40
src
core
media
hybris_client_death_observer.h
Generated on Tue May 30 2023 02:08:39 for Music Hub by
1.9.4