removed unused include and added MRMediaRemoteGetNowPlayingApplicationPID

This commit is contained in:
EinTim23 2024-11-05 11:29:02 +01:00
parent 06514cc4a0
commit c9f28744c2
2 changed files with 9 additions and 2 deletions

View File

@ -1,9 +1,18 @@
#ifdef __APPLE__
#include <Foundation/Foundation.h>
#include <AppKit/AppKit.h>
#include "../MediaRemote.hpp"
#include "../backend.hpp"
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) {
if (result) {
NSDictionary *playingInfo = (__bridge NSDictionary *)(result);

View File

@ -6,8 +6,6 @@
#include <wx/wx.h>
#include <chrono>
#include <fstream>
#include <iostream>
#include <thread>
#include "backend.hpp"