Hololens - Show/hide media controls according to playback state

This commit is contained in:
Fernando Jimenez Moreno 2019-11-28 16:37:50 +01:00
parent c810962d78
commit d633c8b9da
7 changed files with 69 additions and 4 deletions

View file

@ -432,6 +432,15 @@ void ServoControl::OnServoIMEStateChanged(bool aShow) {
// https://docs.microsoft.com/en-us/windows/win32/winauto/uiauto-implementingtextandtextrange
}
void ServoControl::OnServoMediaSessionMetadata(hstring title, hstring artist,
hstring album) {
RunOnUIThread([=] { mOnMediaSessionMetadataEvent(title, artist, album); });
}
void ServoControl::OnServoMediaSessionPlaybackStateChange(int state) {
RunOnUIThread([=] { mOnMediaSessionPlaybackStateChangeEvent(*this, state); });
}
template <typename Callable> void ServoControl::RunOnUIThread(Callable cb) {
Dispatcher().RunAsync(CoreDispatcherPriority::High, cb);
}