Music Hub  ..
A session-wide music playback service
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
service.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2013 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 #ifndef CORE_UBUNTU_MEDIA_SERVICE_H_
19 #define CORE_UBUNTU_MEDIA_SERVICE_H_
20 
21 #include <core/media/player.h>
22 
23 #include <memory>
24 
25 namespace core
26 {
27 namespace ubuntu
28 {
29 namespace media
30 {
31 class Service : public std::enable_shared_from_this<Service>
32 {
33  public:
34  struct Client
35  {
36  static const std::shared_ptr<Service> instance();
37  };
38 
39  Service(const Service&) = delete;
40  virtual ~Service() = default;
41 
42  Service& operator=(const Service&) = delete;
43  bool operator==(const Service&) const = delete;
44 
45  virtual std::shared_ptr<Player> create_session(const Player::Configuration&) = 0;
46  virtual void pause_other_sessions(Player::PlayerKey) = 0;
47 
48  protected:
49  Service() = default;
50 };
51 }
52 }
53 }
54 
55 #endif // CORE_UBUNTU_MEDIA_SERVICE_H_
virtual std::shared_ptr< Player > create_session(const Player::Configuration &)=0
static const std::shared_ptr< Service > instance()
Definition: service.cpp:25
bool operator==(const Service &) const =delete
virtual void pause_other_sessions(Player::PlayerKey)=0
Service & operator=(const Service &)=delete
virtual ~Service()=default