removed unused include and added MRMediaRemoteGetNowPlayingApplicationPID
This commit is contained in:
parent
06514cc4a0
commit
c9f28744c2
|
@ -1,9 +1,18 @@
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
#include <Foundation/Foundation.h>
|
#include <Foundation/Foundation.h>
|
||||||
|
#include <AppKit/AppKit.h>
|
||||||
#include "../MediaRemote.hpp"
|
#include "../MediaRemote.hpp"
|
||||||
#include "../backend.hpp"
|
#include "../backend.hpp"
|
||||||
|
|
||||||
std::shared_ptr<MediaInfo> backend::getMediaInformation() {
|
std::shared_ptr<MediaInfo> 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) {
|
MRMediaRemoteGetNowPlayingInfo(dispatch_get_main_queue(), ^(CFDictionaryRef result) {
|
||||||
if (result) {
|
if (result) {
|
||||||
NSDictionary *playingInfo = (__bridge NSDictionary *)(result);
|
NSDictionary *playingInfo = (__bridge NSDictionary *)(result);
|
||||||
|
|
|
@ -6,8 +6,6 @@
|
||||||
#include <wx/wx.h>
|
#include <wx/wx.h>
|
||||||
|
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include <fstream>
|
|
||||||
#include <iostream>
|
|
||||||
#include <thread>
|
#include <thread>
|
||||||
|
|
||||||
#include "backend.hpp"
|
#include "backend.hpp"
|
||||||
|
|
Loading…
Reference in New Issue