diff --git a/src/backends/darwin.mm b/src/backends/darwin.mm index 93a6802..fc8f1ec 100644 --- a/src/backends/darwin.mm +++ b/src/backends/darwin.mm @@ -1,9 +1,18 @@ #ifdef __APPLE__ #include +#include #include "../MediaRemote.hpp" #include "../backend.hpp" std::shared_ptr backend::getMediaInformation() { + MRMediaRemoteGetNowPlayingApplicationPID(dispatch_get_main_queue(), ^(pid_t pid) { + if (pid > 0) { + NSRunningApplication *app = [NSRunningApplication runningApplicationWithProcessIdentifier:pid]; + if (app) { + NSLog(@"%@", app.bundleIdentifier); + } + } + }); MRMediaRemoteGetNowPlayingInfo(dispatch_get_main_queue(), ^(CFDictionaryRef result) { if (result) { NSDictionary *playingInfo = (__bridge NSDictionary *)(result); diff --git a/src/main.cpp b/src/main.cpp index af84b1d..e632ae5 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -6,8 +6,6 @@ #include #include -#include -#include #include #include "backend.hpp"