-
-
Notifications
You must be signed in to change notification settings - Fork 63
Improve support for macOS #579
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
6f0487f to
f9f7771
Compare
|
Is there a reason why you removed the amd64 macOS Github Workflow? |
|
Rebased and tested on Tahoe |
4316d4c to
4725041
Compare
6407c86 to
9a08e7f
Compare
|
Build currently fails on 9a08e7f because there's a missing include for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds comprehensive macOS support to the Fooyin project by implementing the Now Playing Center integration and setting up CI/CD infrastructure for macOS builds.
Key Changes:
- Implements macOS Now Playing Center (similar to MPRIS on Linux) to display current track information and enable media control integration
- Adds GitHub Actions workflow for building and packaging on both Intel and Apple Silicon architectures
- Configures platform-specific build settings including Info.plist, rpath handling, and FFmpeg detection for macOS
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
src/plugins/nowplaying/nowplayingplugin.mm |
Implements the Now Playing plugin with MediaPlayer framework integration for track metadata and remote control commands |
src/plugins/nowplaying/nowplayingplugin.h |
Header file defining the NowPlayingPlugin class interface |
src/plugins/nowplaying/nowplaying.json.in |
Plugin metadata configuration file |
src/plugins/nowplaying/CMakeLists.txt |
Build configuration for the Now Playing plugin on macOS |
src/plugins/CMakeLists.txt |
Adds the nowplaying subdirectory for macOS builds |
data/mac_Info.plist.in |
macOS application bundle configuration with supported file types and app metadata |
cmake/modules/FindFFmpeg.cmake |
Updates FFmpeg library detection to recognize macOS dylib files |
cmake/FooyinMacros.cmake |
Adds macOS-specific rpath handling for proper library linking |
ci/macos-depends.sh |
Script to install build dependencies via Homebrew |
ci/macos-build.sh |
Script to configure and build the project on macOS |
CMakeLists.txt |
Adds Info.plist configuration for the macOS application bundle |
.github/workflows/build.yml |
Adds GitHub Actions jobs for building on Intel and Apple Silicon Macs |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); | ||
| on_scope_exit releaseColorSpace([&] { CGColorSpaceRelease(colorSpace); }); | ||
|
|
||
| // 修复颜色通道顺序和字节序 |
Copilot
AI
Dec 16, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment contains non-English text. Should be translated to English or removed.
| // 修复颜色通道顺序和字节序 | |
| // Fix color channel order and byte order |
| CGImageRelease(cgImage); | ||
| return result; | ||
| }]; |
Copilot
AI
Dec 16, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CGImageRelease is called inside the block but cgImage is used in initWithCGImage on the line before. NSImage may not retain the CGImage immediately, leading to a potential use-after-free. The CGImageRelease should be moved outside the block or the ownership should be properly managed.
| CGImageRelease(cgImage); | |
| return result; | |
| }]; | |
| return result; | |
| }]; | |
| CGImageRelease(cgImage); |
| return MPRemoteCommandHandlerStatusSuccess; | ||
| } | ||
| - (MPRemoteCommandHandlerStatus)ratingCommand:(MPRatingCommandEvent *)event { | ||
| self.plugin->playerController()->currentTrack().setRating(event.rating); |
Copilot
AI
Dec 16, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
setRating is being called on a temporary Track object returned by currentTrack(). This likely has no effect as the changes are made to a copy. The track should be retrieved by reference or the modified track should be saved back to the player controller.
| self.plugin->playerController()->currentTrack().setRating(event.rating); | |
| auto track = self.plugin->playerController()->currentTrack(); | |
| track.setRating(event.rating); | |
| self.plugin->playerController()->setCurrentTrack(track); |
Uh oh!
There was an error while loading. Please reload this page.