Merge lp:~phablet-team/media-hub/fix-1538703 into lp:media-hub
- fix-1538703
- Merge into trunk
Status: | Approved |
---|---|
Approved by: | Alfonso Sanchez-Beato |
Approved revision: | 185 |
Proposed branch: | lp:~phablet-team/media-hub/fix-1538703 |
Merge into: | lp:media-hub |
Diff against target: |
322 lines (+125/-17) 9 files modified
debian/libmedia-hub-doc.install (+1/-1) doc/CMakeLists.txt (+2/-2) include/core/media/service.h (+0/-3) src/core/media/player_configuration.h (+3/-0) src/core/media/player_implementation.cpp (+68/-6) src/core/media/player_skeleton.h (+2/-0) src/core/media/service_implementation.cpp (+3/-3) src/core/media/service_skeleton.cpp (+35/-2) src/core/media/service_skeleton.h (+11/-0) |
To merge this branch: | bzr merge lp:~phablet-team/media-hub/fix-1538703 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Alfonso Sanchez-Beato | Approve | ||
Review via email:
|
This proposal supersedes a proposal from 2016-04-12.
Commit message
A rewrite of how the current player is set which is what the MPRIS control interface actively uses.
Description of the change
A rewrite of how the current player is set which is what the MPRIS control interface actively uses.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Alfonso Sanchez-Beato (alfonsosanchezbeato) wrote : Posted in a previous version of this proposal | # |
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Jim Hodapp (jhodapp) wrote : Posted in a previous version of this proposal | # |
> Looks good, but maybe we need to call update_
> complete track lists? Which is done with AddTrack(s) DBus calls.
Can you explain more why you think we need to do this? I don't see any gap that this would fix.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Jim Hodapp (jhodapp) wrote : Posted in a previous version of this proposal | # |
Addressed review comments.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Alfonso Sanchez-Beato (alfonsosanchezbeato) wrote : Posted in a previous version of this proposal | # |
LGTM
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Alfonso Sanchez-Beato (alfonsosanchezbeato) wrote : Posted in a previous version of this proposal | # |
So I have just seen that Jim modified service.h too to add reset_current_
I think that changing PlayerSkeleton so player_service is a pointer to ServiceSkeleton, and implementing these functions only in ServiceSkeleton should work. We will make sure the DBus interface is not contaminated and we remove the need for dummy implementations in ServiceStub and ServiceImplemen
@Konrad maybe we con wait for Jim if you do not feel comfortable with this change.
Finally, I appreciate the long description in the last commit message, but I think most of it should move to a comment inside the code so it is more easily found.
The change looks good beside this issue with service.h.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Konrad Zapałowicz (kzapalowicz) wrote : Posted in a previous version of this proposal | # |
Thanks for the review and I will try to make the changes that you suggest. Either I'm successful or not and the Jim will take over when he is back however before that happens I will get my hands dirty :)
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Alfonso Sanchez-Beato (alfonsosanchezbeato) wrote : | # |
LGTM
- 186. By Jim Hodapp
-
Pass a Service* instead of ServiceSkeleton* to avoid weird inheritance segfault
Unmerged revisions
- 186. By Jim Hodapp
-
Pass a Service* instead of ServiceSkeleton* to avoid weird inheritance segfault
Preview Diff
1 | === modified file 'debian/libmedia-hub-doc.install' | |||
2 | --- debian/libmedia-hub-doc.install 2014-03-06 22:51:51 +0000 | |||
3 | +++ debian/libmedia-hub-doc.install 2016-04-20 15:59:04 +0000 | |||
4 | @@ -1,1 +1,1 @@ | |||
6 | 1 | usr/share/doc/music-hub/html | 1 | usr/share/doc/media-hub/html |
7 | 2 | 2 | ||
8 | === modified file 'doc/CMakeLists.txt' | |||
9 | --- doc/CMakeLists.txt 2013-08-14 18:05:23 +0000 | |||
10 | +++ doc/CMakeLists.txt 2016-04-20 15:59:04 +0000 | |||
11 | @@ -26,5 +26,5 @@ | |||
12 | 26 | COMMENT "Generating API documentation with Doxygen" VERBATIM) | 26 | COMMENT "Generating API documentation with Doxygen" VERBATIM) |
13 | 27 | install( | 27 | install( |
14 | 28 | DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html | 28 | DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html |
15 | 29 | DESTINATION share/doc/music-hub) | ||
16 | 30 | endif(DOXYGEN_FOUND) | ||
17 | 31 | \ No newline at end of file | 29 | \ No newline at end of file |
18 | 30 | DESTINATION share/doc/media-hub) | ||
19 | 31 | endif(DOXYGEN_FOUND) | ||
20 | 32 | 32 | ||
21 | === modified file 'include/core/media/service.h' | |||
22 | --- include/core/media/service.h 2015-09-08 20:03:56 +0000 | |||
23 | +++ include/core/media/service.h 2016-04-20 15:59:04 +0000 | |||
24 | @@ -60,9 +60,6 @@ | |||
25 | 60 | /** @brief Resumes a fixed-name session directly by player key. */ | 60 | /** @brief Resumes a fixed-name session directly by player key. */ |
26 | 61 | virtual std::shared_ptr<Player> resume_session(Player::PlayerKey) = 0; | 61 | virtual std::shared_ptr<Player> resume_session(Player::PlayerKey) = 0; |
27 | 62 | 62 | ||
28 | 63 | /** @brief Sets the current player that the MPRIS interface will control */ | ||
29 | 64 | virtual void set_current_player(Player::PlayerKey) = 0; | ||
30 | 65 | |||
31 | 66 | /** @brief Pauses sessions other than the supplied one. */ | 63 | /** @brief Pauses sessions other than the supplied one. */ |
32 | 67 | virtual void pause_other_sessions(Player::PlayerKey) = 0; | 64 | virtual void pause_other_sessions(Player::PlayerKey) = 0; |
33 | 68 | 65 | ||
34 | 69 | 66 | ||
35 | === modified file 'src/core/media/player_configuration.h' | |||
36 | --- src/core/media/player_configuration.h 2015-04-17 16:44:30 +0000 | |||
37 | +++ src/core/media/player_configuration.h 2016-04-20 15:59:04 +0000 | |||
38 | @@ -19,6 +19,7 @@ | |||
39 | 19 | #define CORE_UBUNTU_MEDIA_PLAYER_CLIENT_CONFIGURATION_H_ | 19 | #define CORE_UBUNTU_MEDIA_PLAYER_CLIENT_CONFIGURATION_H_ |
40 | 20 | 20 | ||
41 | 21 | #include <core/media/player.h> | 21 | #include <core/media/player.h> |
42 | 22 | #include <core/media/service.h> | ||
43 | 22 | 23 | ||
44 | 23 | #include <core/dbus/bus.h> | 24 | #include <core/dbus/bus.h> |
45 | 24 | #include <core/dbus/object.h> | 25 | #include <core/dbus/object.h> |
46 | @@ -35,6 +36,8 @@ | |||
47 | 35 | std::shared_ptr<core::dbus::Service> service; | 36 | std::shared_ptr<core::dbus::Service> service; |
48 | 36 | // The actual session object representing a player instance. | 37 | // The actual session object representing a player instance. |
49 | 37 | std::shared_ptr<core::dbus::Object> session; | 38 | std::shared_ptr<core::dbus::Object> session; |
50 | 39 | // The Service instance that manages Player instances | ||
51 | 40 | core::ubuntu::media::Service* player_service; | ||
52 | 38 | }; | 41 | }; |
53 | 39 | 42 | ||
54 | 40 | #endif // CORE_UBUNTU_MEDIA_PLAYER_CLIENT_CONFIGURATION_H_ | 43 | #endif // CORE_UBUNTU_MEDIA_PLAYER_CLIENT_CONFIGURATION_H_ |
55 | 41 | 44 | ||
56 | === modified file 'src/core/media/player_implementation.cpp' | |||
57 | --- src/core/media/player_implementation.cpp 2016-02-19 16:14:42 +0000 | |||
58 | +++ src/core/media/player_implementation.cpp 2016-04-20 15:59:04 +0000 | |||
59 | @@ -17,7 +17,10 @@ | |||
60 | 17 | * Jim Hodapp <jim.hodapp@canonical.com> | 17 | * Jim Hodapp <jim.hodapp@canonical.com> |
61 | 18 | */ | 18 | */ |
62 | 19 | 19 | ||
63 | 20 | #include <core/media/service.h> | ||
64 | 21 | |||
65 | 20 | #include "player_implementation.h" | 22 | #include "player_implementation.h" |
66 | 23 | #include "service_skeleton.h" | ||
67 | 21 | #include "util/timeout.h" | 24 | #include "util/timeout.h" |
68 | 22 | 25 | ||
69 | 23 | #include <unistd.h> | 26 | #include <unistd.h> |
70 | @@ -302,14 +305,14 @@ | |||
71 | 302 | } | 305 | } |
72 | 303 | } | 306 | } |
73 | 304 | 307 | ||
75 | 305 | void update_mpris_properties(void) | 308 | void update_mpris_properties() |
76 | 306 | { | 309 | { |
78 | 307 | bool has_previous = track_list->has_previous() | 310 | const bool has_previous = track_list->has_previous() |
79 | 308 | or parent->Parent::loop_status() != Player::LoopStatus::none; | 311 | or parent->Parent::loop_status() != Player::LoopStatus::none; |
81 | 309 | bool has_next = track_list->has_next() | 312 | const bool has_next = track_list->has_next() |
82 | 310 | or parent->Parent::loop_status() != Player::LoopStatus::none; | 313 | or parent->Parent::loop_status() != Player::LoopStatus::none; |
85 | 311 | auto n_tracks = track_list->tracks()->size(); | 314 | const auto n_tracks = track_list->tracks()->size(); |
86 | 312 | bool has_tracks = (n_tracks > 0) ? true : false; | 315 | const bool has_tracks = (n_tracks > 0) ? true : false; |
87 | 313 | 316 | ||
88 | 314 | std::cout << "Updating MPRIS TrackList properties" | 317 | std::cout << "Updating MPRIS TrackList properties" |
89 | 315 | << "; Tracks: " << n_tracks | 318 | << "; Tracks: " << n_tracks |
90 | @@ -323,6 +326,40 @@ | |||
91 | 323 | parent->can_go_next().set(has_next); | 326 | parent->can_go_next().set(has_next); |
92 | 324 | } | 327 | } |
93 | 325 | 328 | ||
94 | 329 | ServiceSkeleton* get_player_service_skeleton() const | ||
95 | 330 | { | ||
96 | 331 | return reinterpret_cast<ServiceSkeleton*>(config.parent.player_service); | ||
97 | 332 | } | ||
98 | 333 | |||
99 | 334 | bool update_current_player(const media::Player::PlayerKey& key) | ||
100 | 335 | { | ||
101 | 336 | if (not config.parent.player_service) | ||
102 | 337 | return false; | ||
103 | 338 | |||
104 | 339 | get_player_service_skeleton()->set_current_player(key); | ||
105 | 340 | return true; | ||
106 | 341 | } | ||
107 | 342 | |||
108 | 343 | // Utility to hide the complexity of getting the ptr to current player | ||
109 | 344 | bool is_current_player(const media::PlayerImplementation<Parent> *p) const | ||
110 | 345 | { | ||
111 | 346 | return p == get_player_service_skeleton()->get_current_player().get(); | ||
112 | 347 | } | ||
113 | 348 | |||
114 | 349 | bool is_multimedia_role() const | ||
115 | 350 | { | ||
116 | 351 | return get_player_service_skeleton()->is_multimedia_role(); | ||
117 | 352 | } | ||
118 | 353 | |||
119 | 354 | bool reset_current_player() | ||
120 | 355 | { | ||
121 | 356 | if (not get_player_service_skeleton()) | ||
122 | 357 | return false; | ||
123 | 358 | |||
124 | 359 | get_player_service_skeleton()->reset_current_player(); | ||
125 | 360 | return true; | ||
126 | 361 | } | ||
127 | 362 | |||
128 | 326 | // Our link back to our parent. | 363 | // Our link back to our parent. |
129 | 327 | media::PlayerImplementation<Parent>* parent; | 364 | media::PlayerImplementation<Parent>* parent; |
130 | 328 | // We just store the parameters passed on construction. | 365 | // We just store the parameters passed on construction. |
131 | @@ -479,6 +516,20 @@ | |||
132 | 479 | // are cleared | 516 | // are cleared |
133 | 480 | d->clear_wakelocks(); | 517 | d->clear_wakelocks(); |
134 | 481 | d->track_list->reset(); | 518 | d->track_list->reset(); |
135 | 519 | |||
136 | 520 | // Here it is decided if it is good to reset the current player. The | ||
137 | 521 | // conditions to do so are very simple. It must be a multimedia role | ||
138 | 522 | // and the Player that disconnected must be the last player to play | ||
139 | 523 | // audio/video. | ||
140 | 524 | if (d->is_multimedia_role() && d->is_current_player(this)) | ||
141 | 525 | { | ||
142 | 526 | // This is not a fatal error but merely | ||
143 | 527 | // a warning that should be logged | ||
144 | 528 | if (not d->reset_current_player()) | ||
145 | 529 | std::cerr << "Failed to reset current player in " | ||
146 | 530 | << __PRETTY_FUNCTION__ << std::endl; | ||
147 | 531 | } | ||
148 | 532 | |||
149 | 482 | // And tell the outside world that the client has gone away | 533 | // And tell the outside world that the client has gone away |
150 | 483 | d->on_client_disconnected(); | 534 | d->on_client_disconnected(); |
151 | 484 | }); | 535 | }); |
152 | @@ -688,7 +739,8 @@ | |||
153 | 688 | d->track_list->reset(); | 739 | d->track_list->reset(); |
154 | 689 | 740 | ||
155 | 690 | // If empty uri, give the same meaning as QMediaPlayer::setMedia("") | 741 | // If empty uri, give the same meaning as QMediaPlayer::setMedia("") |
157 | 691 | if (uri.empty()) { | 742 | if (uri.empty()) |
158 | 743 | { | ||
159 | 692 | cout << __PRETTY_FUNCTION__ << ": resetting current media" << endl; | 744 | cout << __PRETTY_FUNCTION__ << ": resetting current media" << endl; |
160 | 693 | return true; | 745 | return true; |
161 | 694 | } | 746 | } |
162 | @@ -698,6 +750,7 @@ | |||
163 | 698 | // Don't set new track as the current track to play since we're calling open_resource_for_uri above | 750 | // Don't set new track as the current track to play since we're calling open_resource_for_uri above |
164 | 699 | static const bool make_current = false; | 751 | static const bool make_current = false; |
165 | 700 | d->track_list->add_track_with_uri_at(uri, media::TrackList::after_empty_track(), make_current); | 752 | d->track_list->add_track_with_uri_at(uri, media::TrackList::after_empty_track(), make_current); |
166 | 753 | |||
167 | 701 | return ret; | 754 | return ret; |
168 | 702 | } | 755 | } |
169 | 703 | 756 | ||
170 | @@ -722,6 +775,15 @@ | |||
171 | 722 | template<typename Parent> | 775 | template<typename Parent> |
172 | 723 | void media::PlayerImplementation<Parent>::play() | 776 | void media::PlayerImplementation<Parent>::play() |
173 | 724 | { | 777 | { |
174 | 778 | if (Parent::audio_stream_role() == media::Player::AudioStreamRole::multimedia) | ||
175 | 779 | { | ||
176 | 780 | std::cout << "==== Updating the current player from " << __PRETTY_FUNCTION__ << std::endl; | ||
177 | 781 | // This player will begin playing so make sure it's the current player. If | ||
178 | 782 | // this operation fails it is not a fatal condition but should be logged | ||
179 | 783 | if (not d->update_current_player(d->config.key)) | ||
180 | 784 | std::cerr << "Failed to update current player in " << __PRETTY_FUNCTION__ << std::endl; | ||
181 | 785 | } | ||
182 | 786 | |||
183 | 725 | d->engine->play(); | 787 | d->engine->play(); |
184 | 726 | } | 788 | } |
185 | 727 | 789 | ||
186 | 728 | 790 | ||
187 | === modified file 'src/core/media/player_skeleton.h' | |||
188 | --- src/core/media/player_skeleton.h 2015-04-17 15:13:56 +0000 | |||
189 | +++ src/core/media/player_skeleton.h 2016-04-20 15:59:04 +0000 | |||
190 | @@ -57,6 +57,8 @@ | |||
191 | 57 | std::shared_ptr<core::dbus::Service> service; | 57 | std::shared_ptr<core::dbus::Service> service; |
192 | 58 | // The session object that we want to expose the skeleton upon. | 58 | // The session object that we want to expose the skeleton upon. |
193 | 59 | std::shared_ptr<core::dbus::Object> session; | 59 | std::shared_ptr<core::dbus::Object> session; |
194 | 60 | // The Service instance that manages Player instances | ||
195 | 61 | core::ubuntu::media::Service* player_service; | ||
196 | 60 | // Our functional dependencies. | 62 | // Our functional dependencies. |
197 | 61 | apparmor::ubuntu::RequestContextResolver::Ptr request_context_resolver; | 63 | apparmor::ubuntu::RequestContextResolver::Ptr request_context_resolver; |
198 | 62 | apparmor::ubuntu::RequestAuthenticator::Ptr request_authenticator; | 64 | apparmor::ubuntu::RequestAuthenticator::Ptr request_authenticator; |
199 | 63 | 65 | ||
200 | === modified file 'src/core/media/service_implementation.cpp' | |||
201 | --- src/core/media/service_implementation.cpp 2016-03-02 18:32:46 +0000 | |||
202 | +++ src/core/media/service_implementation.cpp 2016-04-20 15:59:04 +0000 | |||
203 | @@ -185,11 +185,13 @@ | |||
204 | 185 | auto player = std::make_shared<media::PlayerImplementation<media::PlayerSkeleton>> | 185 | auto player = std::make_shared<media::PlayerImplementation<media::PlayerSkeleton>> |
205 | 186 | (media::PlayerImplementation<media::PlayerSkeleton>::Configuration | 186 | (media::PlayerImplementation<media::PlayerSkeleton>::Configuration |
206 | 187 | { | 187 | { |
207 | 188 | // Derive a PlayerSkeleton-specific Configuration based on Player::Configuration | ||
208 | 188 | media::PlayerSkeleton::Configuration | 189 | media::PlayerSkeleton::Configuration |
209 | 189 | { | 190 | { |
210 | 190 | conf.bus, | 191 | conf.bus, |
211 | 191 | conf.service, | 192 | conf.service, |
212 | 192 | conf.session, | 193 | conf.session, |
213 | 194 | conf.player_service, | ||
214 | 193 | d->request_context_resolver, | 195 | d->request_context_resolver, |
215 | 194 | d->request_authenticator | 196 | d->request_authenticator |
216 | 195 | }, | 197 | }, |
217 | @@ -259,13 +261,11 @@ | |||
218 | 259 | 261 | ||
219 | 260 | void media::ServiceImplementation::set_current_player(Player::PlayerKey) | 262 | void media::ServiceImplementation::set_current_player(Player::PlayerKey) |
220 | 261 | { | 263 | { |
222 | 262 | // no impl | 264 | // no impl |
223 | 263 | } | 265 | } |
224 | 264 | 266 | ||
225 | 265 | void media::ServiceImplementation::pause_other_sessions(media::Player::PlayerKey key) | 267 | void media::ServiceImplementation::pause_other_sessions(media::Player::PlayerKey key) |
226 | 266 | { | 268 | { |
227 | 267 | std::cout << __PRETTY_FUNCTION__ << std::endl; | ||
228 | 268 | |||
229 | 269 | if (not d->configuration.player_store->has_player_for_key(key)) | 269 | if (not d->configuration.player_store->has_player_for_key(key)) |
230 | 270 | { | 270 | { |
231 | 271 | cerr << "Could not find Player by key: " << key << endl; | 271 | cerr << "Could not find Player by key: " << key << endl; |
232 | 272 | 272 | ||
233 | === modified file 'src/core/media/service_skeleton.cpp' | |||
234 | --- src/core/media/service_skeleton.cpp 2016-03-02 18:32:46 +0000 | |||
235 | +++ src/core/media/service_skeleton.cpp 2016-04-20 15:59:04 +0000 | |||
236 | @@ -131,7 +131,8 @@ | |||
237 | 131 | key, | 131 | key, |
238 | 132 | impl->access_bus(), | 132 | impl->access_bus(), |
239 | 133 | impl->access_service(), | 133 | impl->access_service(), |
241 | 134 | impl->access_service()->add_object_for_path(op) | 134 | impl->access_service()->add_object_for_path(op), |
242 | 135 | impl | ||
243 | 135 | }; | 136 | }; |
244 | 136 | 137 | ||
245 | 137 | cout << "Session created by request of: " << msg->sender() | 138 | cout << "Session created by request of: " << msg->sender() |
246 | @@ -366,7 +367,8 @@ | |||
247 | 366 | key, | 367 | key, |
248 | 367 | impl->access_bus(), | 368 | impl->access_bus(), |
249 | 368 | impl->access_service(), | 369 | impl->access_service(), |
251 | 369 | impl->access_service()->add_object_for_path(op) | 370 | impl->access_service()->add_object_for_path(op), |
252 | 371 | impl | ||
253 | 370 | }; | 372 | }; |
254 | 371 | 373 | ||
255 | 372 | auto session = impl->create_session(config); | 374 | auto session = impl->create_session(config); |
256 | @@ -787,6 +789,22 @@ | |||
257 | 787 | std::cout << __PRETTY_FUNCTION__ << std::endl; | 789 | std::cout << __PRETTY_FUNCTION__ << std::endl; |
258 | 788 | // And announce that we can no longer be controlled. | 790 | // And announce that we can no longer be controlled. |
259 | 789 | player.properties.can_control->set(false); | 791 | player.properties.can_control->set(false); |
260 | 792 | player.properties.can_play->set(false); | ||
261 | 793 | player.properties.can_pause->set(false); | ||
262 | 794 | player.properties.can_go_previous->set(false); | ||
263 | 795 | player.properties.can_go_next->set(false); | ||
264 | 796 | |||
265 | 797 | // Reset to null event connections | ||
266 | 798 | connections.seeked_to = the_empty_signal.connect([](){}); | ||
267 | 799 | connections.duration_changed = the_empty_signal.connect([](){}); | ||
268 | 800 | connections.position_changed = the_empty_signal.connect([](){}); | ||
269 | 801 | connections.playback_status_changed = the_empty_signal.connect([](){}); | ||
270 | 802 | connections.loop_status_changed = the_empty_signal.connect([](){}); | ||
271 | 803 | connections.can_play_changed = the_empty_signal.connect([](){}); | ||
272 | 804 | connections.can_pause_changed = the_empty_signal.connect([](){}); | ||
273 | 805 | connections.can_go_previous_changed = the_empty_signal.connect([](){}); | ||
274 | 806 | connections.can_go_next_changed = the_empty_signal.connect([](){}); | ||
275 | 807 | |||
276 | 790 | current_player.reset(); | 808 | current_player.reset(); |
277 | 791 | } | 809 | } |
278 | 792 | 810 | ||
279 | @@ -901,6 +919,21 @@ | |||
280 | 901 | d->exported.set_current_player(player); | 919 | d->exported.set_current_player(player); |
281 | 902 | } | 920 | } |
282 | 903 | 921 | ||
283 | 922 | bool media::ServiceSkeleton::is_multimedia_role() const | ||
284 | 923 | { | ||
285 | 924 | return d->exported.is_multimedia_role(); | ||
286 | 925 | } | ||
287 | 926 | |||
288 | 927 | std::shared_ptr<media::Player> media::ServiceSkeleton::get_current_player() const | ||
289 | 928 | { | ||
290 | 929 | return d->exported.current_player.lock(); | ||
291 | 930 | } | ||
292 | 931 | |||
293 | 932 | void media::ServiceSkeleton::reset_current_player() | ||
294 | 933 | { | ||
295 | 934 | d->exported.reset_current_player(); | ||
296 | 935 | } | ||
297 | 936 | |||
298 | 904 | void media::ServiceSkeleton::pause_other_sessions(media::Player::PlayerKey key) | 937 | void media::ServiceSkeleton::pause_other_sessions(media::Player::PlayerKey key) |
299 | 905 | { | 938 | { |
300 | 906 | d->configuration.impl->pause_other_sessions(key); | 939 | d->configuration.impl->pause_other_sessions(key); |
301 | 907 | 940 | ||
302 | === modified file 'src/core/media/service_skeleton.h' | |||
303 | --- src/core/media/service_skeleton.h 2015-09-08 20:03:56 +0000 | |||
304 | +++ src/core/media/service_skeleton.h 2016-04-20 15:59:04 +0000 | |||
305 | @@ -60,6 +60,17 @@ | |||
306 | 60 | std::shared_ptr<Player> create_fixed_session(const std::string& name, const Player::Configuration&); | 60 | std::shared_ptr<Player> create_fixed_session(const std::string& name, const Player::Configuration&); |
307 | 61 | std::shared_ptr<Player> resume_session(Player::PlayerKey); | 61 | std::shared_ptr<Player> resume_session(Player::PlayerKey); |
308 | 62 | void set_current_player(Player::PlayerKey key); | 62 | void set_current_player(Player::PlayerKey key); |
309 | 63 | |||
310 | 64 | /** @brief returns true for multimedia role */ | ||
311 | 65 | bool is_multimedia_role() const; | ||
312 | 66 | |||
313 | 67 | /** @brief gets the current player controlled by MRIS */ | ||
314 | 68 | std::shared_ptr<Player> get_current_player() const; | ||
315 | 69 | |||
316 | 70 | /** @detail Resets the current player so that the MPRIS interface will no | ||
317 | 71 | * longer have a current player to control | ||
318 | 72 | */ | ||
319 | 73 | void reset_current_player(); | ||
320 | 63 | void pause_other_sessions(Player::PlayerKey key); | 74 | void pause_other_sessions(Player::PlayerKey key); |
321 | 64 | 75 | ||
322 | 65 | void run(); | 76 | void run(); |
Looks good, but maybe we need to call update_ current_ player( ) also when adding complete track lists? Which is done with AddTrack(s) DBus calls.