kyleneideck / BackgroundMusic

Background Music, a macOS audio utility: automatically pause your music, set individual apps' volumes and record system audio.
GNU General Public License v2.0
16.31k stars 677 forks source link

Install Failed for BGM 0.4.3 on macOS 10.13 and Xcode 10.1 #773

Open Taikuh opened 1 month ago

Taikuh commented 1 month ago

Description of the bug

Some commits seem to break installation for macOS 10.13. I don't know c++ nor Xcode development but have managed to revert the offending parts of certain files, resulting in a successful install. I will list the errors, files, commits, and my fix in the sections below Versions. They are listed in the order I encountered them.

Apologies for improper github etiquette and not using pull requests. It's been years since I've fiddled with any software project. I hope the owner can implement a better fix than mine to maintain support for macOS 10.13.

Steps to reproduce

  1. Download the project.
  2. Follow manual installation instructions.
  3. Get some errors and fail to install.

Versions

Errors from Installing XPC Helper

VirtualMainVolume Errors

This is a set of 5 errors arising from BGMAudioDevice.cpp, Lines:

Error Message

/{...}/BackgroundMusic-master/BGMApp/BGMApp/BGMAudioDevice.cpp:84:9: error: use of undeclared identifier
      'kAudioHardwareServiceDeviceProperty_VirtualMainVolume'; did you mean 'kAudioHardwareServiceDeviceProperty_VirtualMasterVolume'?
        kAudioHardwareServiceDeviceProperty_VirtualMainVolume,
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        kAudioHardwareServiceDeviceProperty_VirtualMasterVolume
In file included from /{...}/BackgroundMusic-master/BGMApp/BGMApp/BGMAudioDevice.cpp:30:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AudioServices.h:22:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AudioHardwareService.h:66:5: note: 
      'kAudioHardwareServiceDeviceProperty_VirtualMasterVolume' declared here
    kAudioHardwareServiceDeviceProperty_VirtualMasterVolume     = 'vmvc',
    ^

The are 5 total error messages similar to the above.

Relevant Commit

8ddfb81148ca578bc89aa7d5eb0f693d00229541

My Fix

Change all instances of Main to Master in those 5 lines.

BGMStatusBarItem Error

Error Message

/{...}/BackgroundMusic-master/BGMApp/BGMApp/BGMStatusBarItem.mm:
129:42: error: no known class method for selector
      'imageWithSystemSymbolName:accessibilityDescription:'
        volumeIcon0SoundWaves = [NSImage imageWithSystemSymbolName:@"speaker.fill" accessibilityDescription:nil];
                                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

There are 4 total error messages similar to the above.

Relevant Commit

a8f4ace099296719623c6a683a46d3a1e80d1e3e

My Fix

Ignore that commit by rolling back its changes:

  1. Delete Lines 128 to 133 and Line 138.
  2. De-indent the remaining four lines.

Error from Installing Background Music.app to /Applications

BGMAppDelegate Error

Error Message

/{...}/BackgroundMusic-master/BGMApp/BGMApp/BGMAppDelegate.mm:
238:32: error: unused parameter 
'menu' [-Werror,-Wunused-parameter]

- (void) menuWillOpen:(NSMenu*)menu {
                               ^

Relevant Commit

076514c83a7ffd49bfd5ccfb05a50c9344ac284a

My Fix

Remove Lines 238 to 298.