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  *
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 
20 
24 
25 namespace media = core::ubuntu::media;
26 
27 #if defined(MEDIA_HUB_HAVE_HYBRIS_MEDIA_COMPAT_LAYER)
29 
30 // Accesses the default client death observer implementation for the platform.
32 {
34  switch (b)
35  {
36  case media::AVBackend::Backend::hybris:
38  case media::AVBackend::Backend::none:
39  MH_WARNING(
40  "No video backend selected. Client disconnect functionality won't work."
41  );
43  default:
44  MH_INFO("Invalid or no A/V backend specified, using \"hybris\" as a default.");
46  }
47 }
48 #else // MEDIA_HUB_HAVE_HYBRIS_MEDIA_COMPAT_LAYER
49 // Just throws a std::logic_error as we have not yet defined a default way to
50 // identify client death changes. One possible way of implementing the interface
51 // would be to listen to dbus name changes and react accordingly.
53 {
54  throw std::logic_error
55  {
56  "No platform-specific death observer implementation known."
57  };
58 }
59 #endif // MEDIA_HUB_HAVE_HYBRIS_MEDIA_COMPAT_LAYER
#define MH_INFO(...)
Definition: logger.h:125
std::shared_ptr< ClientDeathObserver > Ptr
#define MH_WARNING(...)
Definition: logger.h:127
static Backend get_backend_type()
Returns the type of audio/video decoding/encoding backend being used.
Definition: backend.cpp:26
ClientDeathObserver::Ptr platform_default_client_death_observer()