diff --git a/core/pen/include/os.h b/core/pen/include/os.h index 1f4654b6..1d22e787 100644 --- a/core/pen/include/os.h +++ b/core/pen/include/os.h @@ -70,6 +70,7 @@ namespace pen void (*pause)(bool) = nullptr; void (*next)(bool) = nullptr; void (*tick)(void) = nullptr; + void (*like)(void) = nullptr; }; struct music_file diff --git a/core/pen/source/ios/os.mm b/core/pen/source/ios/os.mm index 92dd5361..72372cee 100644 --- a/core/pen/source/ios/os.mm +++ b/core/pen/source/ios/os.mm @@ -67,6 +67,7 @@ -(MPRemoteCommandHandlerStatus)play; -(MPRemoteCommandHandlerStatus)pause; -(MPRemoteCommandHandlerStatus)prev; -(MPRemoteCommandHandlerStatus)next; +-(MPRemoteCommandHandlerStatus)like; @end namespace @@ -117,6 +118,7 @@ void enable_remote_control_internal() [commandCenter.playCommand addTarget:s_context.app_delegate action:@selector(play)]; [commandCenter.nextTrackCommand addTarget:s_context.app_delegate action:@selector(next)]; [commandCenter.previousTrackCommand addTarget:s_context.app_delegate action:@selector(prev)]; + [commandCenter.likeCommand addTarget:s_context.app_delegate action:@selector(like)]; } } @@ -205,6 +207,15 @@ -(MPRemoteCommandHandlerStatus)next { } return MPRemoteCommandHandlerStatusNoSuchContent; } + +-(MPRemoteCommandHandlerStatus)like { + if(s_context.music_remote.like) + { + s_context.music_remote.like(); + return MPRemoteCommandHandlerStatusSuccess; + } + return MPRemoteCommandHandlerStatusNoSuchContent; +} @end @implementation pen_mtk_renderer