Commit graph

197 commits

Author SHA1 Message Date
Kyle Neideck
ffa86bbcd9
Add workaround for Discord voice chat volume. 2018-06-19 22:39:40 +10:00
Kyle Neideck
5f31f54a85
Use a larger disk image in Travis CI builds.
Builds for "DEBUG" tags are running out of space.
2018-06-05 12:01:02 +10:00
Kyle Neideck
2a41204fc0
Update the years in some copyright notices. 2018-06-05 01:13:14 +10:00
Kyle Neideck
cb9cdb00b6
Support creating .pkg installers using the debug build configuration.
Users reporting bugs will be able to use these packages to install debug
builds of Background Music without having to install from source. This
is mainly useful because debug builds have more detailed logging.
Hopefully we'll get around to adding an option to enable debug logging
at runtime, but this should work well enough for now.

Also:
 - Use newer macOS images in Travis CI builds.
 - Fix an xcrun command in build_and_install.sh that was accidentally
   being started in the background.
 - Fix build_and_install.sh building libPublicUtility.a twice for no
   reason.
2018-06-05 00:40:21 +10:00
Kyle Neideck
ed06a257a8
Add auto-pause support for Swinsian. See #141. 2018-02-25 12:01:43 +11:00
Kyle Neideck
7171cfcb78
Add a test for BGM_Device::DoIOOperation. 2018-02-24 21:44:09 +11:00
Kyle Neideck
3ba53a50ac
Support building snapshot releases by creating tags.
If HEAD is tagged, check for "SNAPSHOT" or "DEBUG" in the tag name when
generating the version string for a build. If found, add
"-SNAPSHOT-abcdef0" or "-DEBUG-abcdef0" at the end of the version
string (where "abcdef0" is the short commit ID for HEAD).
2018-02-24 17:55:29 +11:00
Kyle Neideck
944fc11212
Add workaround for FaceTime volume.
FaceTime plays call audio using a daemon called avconferenced, so
BGMDriver can't tell where the audio is actually coming from. As a
hopefully temporary fix, BGMApp now just sets avconferenced's volume to
match FaceTime's. See #139.

Also,
 - set a tooltip and accessibility label for BGMApp's status bar item
   (the thing you click to show the main menu), and
 - some minor refactoring.
2018-02-24 15:23:18 +11:00
Kyle Neideck
287bae0923
Fix mocks in BGMMusicPlayersUnitTests. 2018-01-21 13:43:30 +11:00
Kyle Neideck
6117bc285c
Fix BGMApp crashing at launch if BGMDriver isn't installed. 2018-01-20 22:28:32 +11:00
Kyle Neideck
18aa97f055
Fix some minor bugs, mostly found by Coverity.
BGMDeviceControlsList: Set some members to null before they've been
lazily initialised.

BGM_TaskQueue: Fix the destructor possibly throwing.

BGM_Device and BGM_NullDevice: Fix integer division when calculating the
host clock frequency.

BGM_Utils: Fix the C++ utility function used to explicitly cast
__nullable values to __nonnull. (Was previously unused.)
2017-12-28 18:46:52 +11:00
Kyle Neideck
ac2130c3c3
build_and_install.sh: Fix printing the last command in error_handler. 2017-12-27 18:23:25 +11:00
Kyle Neideck
e83d07f00b
.travis.yml: Update Xcode versions. Print logs if package.sh fails.
Travis CI no longer supports building with Xcode 8, 8.1 or 8.2.
2017-12-27 17:53:28 +11:00
Kyle Neideck
b693a8af1e
Add .editorconfig file to fix tab width on GitHub. 2017-12-27 15:22:17 +11:00
Kyle Neideck
b3b60559f2
Link BGMDriver tests with Accelerate framework. 2017-12-27 13:46:58 +11:00
Kyle Neideck
f64cf41f8a
Add a volume slider for system sounds.
System sounds are UI-related sounds like mail notifications or terminal
bells.

Xcode 9.2 doesn't support saving .xib files in Xcode 7 format any more,
so building Background Music now requires Xcode 8 or above.

Also, fix some of the tooltips that would only work if BGMApp was the
foreground app, which it shouldn't be.
2017-12-26 23:10:57 +11:00
Kyle Neideck
bd90399ce3
Update the link to eqMac in the README. 2017-12-11 08:49:33 +11:00
Kyle Neideck
425cb4af9d
When the output device is changed, update its volume slider.
The label above the slider is set to the name of the new output device
and the slider's value is set to its volume.

Also,
 - clean up some code in BGMAudioDeviceManager and
   BGMOutputVolumeMenuItem, and
 - return from BGMAppDelegate::applicationDidFinishLaunching early if
   the launch is being aborted.
2017-11-26 16:12:56 +11:00
Kyle Neideck
4c6de2f77f
Add new QuickLook bundle ID to fix App Volumes for Finder.
QuickLook's bundle ID has changed in High Sierra, which broke the
workaround that BGMApp uses to change QuickLook's app volume when
Finder's is changed.

Reported in #134.
2017-11-25 13:28:43 +11:00
Kyle Neideck
ec81520379
Fix BGMApp unit tests not compiling. 2017-10-29 01:00:37 +11:00
Kyle Neideck
1171bee102
Refactor non-UI code out of BGMAppVolumes. 2017-10-28 18:13:08 +11:00
Kyle Neideck
fb0740c4c1
Enable new compiler warnings suggested by Xcode. 2017-10-23 21:40:30 +11:00
Kyle Neideck
db63ae0cf1
Add BGMTermination files forgotten in previous commit. 2017-10-23 21:35:49 +11:00
Kyle Neideck
59e70fb9d1
Set the OS default audio device back if BGMApp exits abnormally.
This is mostly so BGMApp won't leave BGMDevice as the default if BGMApp
crashes, which would stop audio from playing until the user changed the
default device themselves. Also handles SIGINT, SIGTERM and SIGQUIT.

For crashes where the BGMApp process may be in an unknown state, e.g.
segfaults, BGMXPCHelper handles changing the default device.

Should fix the Travis Xcode 9 build, which is currently failing because
the AppleScript we use to quit BGMApp in .travis.yml gets "user
cancelled" for some reason.

Also makes some minor improvements to the reports generated by
CrashReporter. The way CrashReporter works with Background Music should
otherwise be unchanged.
2017-10-23 20:19:42 +11:00
Kyle Neideck
47ff99303a
Fix compiler warnings in Xcode 9.
Mostly -Wpartial-availability. Fixes #129.
2017-10-12 22:20:28 +11:00
Kyle Neideck
173914e343
Add Xcode 9.0 and 9.1 to .travis.yml. 2017-10-11 09:01:05 +11:00
Kyle Neideck
cce8111251
Add an App Volumes submenu for apps that aren't shown in the dock.
Specifically, apps with NSApplicationActivationPolicyAccessory. That
includes status bar apps like Background Music, but also includes some
that aren't intended to be shown to users as applications like
SystemUIServer.

I'm not sure how much we can do about that. It would probably help if we
hid apps that BGMDriver isn't able to match to a CoreAudio client.

Resolves #122.
2017-09-25 13:05:00 +10:00
Kyle Neideck
df67e4fa2b
Accessibility improvements for the volumes menu items. 2017-09-18 15:21:32 +10:00
Kyle Neideck
e4b98e4099
Add a UI test for the output volume slider. 2017-09-17 16:43:51 +10:00
Kyle Neideck
9fd5c89b27
Move the code for the output volume slider into a new class. 2017-09-16 22:09:03 +10:00
Kyle Neideck
3c001066c4
Set the output volume slider to 0 when the output device is muted. 2017-09-14 00:06:24 +10:00
Kyle Neideck
289f6b3d27
Fix a crash in BGMBackgroundMusicDevice::ResponsibleBundleIDsOf.
If the bundle ID passed to the function (a CACFString) was wrapping a
null CFStringRef, one of the comparison operator functions of CACFString
would pass null to CFStringCompare.
2017-09-12 20:09:04 +10:00
Kyle Neideck
07a419fb34
Add an output volume slider above the app volume sliders.
Similar to the one in macOS's Volume menu extra.

I'm mainly adding it so we can increase the output volume when the user
sets an app volume above 50%. Currently, setting an app volume above 50%
(the default) risks clipping, so it doesn't make sense to do so unless
your main output volume is at its max.

The volume slider added in this commit will make it clear to the user
that their main output volume is also increasing.

The other app volumes won't change, so in the ideal case the user
wouldn't need to be aware that their output device's volume is being
changed. But they might play audio to the device directly and would
expect it to play at the same volume as before they changed the app
volume.
2017-09-12 19:48:42 +10:00
Kyle Neideck
283db29fb4
App Volumes: Fix the hardcoded HAL client process bundle IDs.
Fix the workaround for apps whose bundle IDs don't match their CoreAudio
clients. BGMBackgroundMusicDevice::ResponsibleBundleIDsOf was always
returning an empty list.

Also fix over-releasing the app's bundle ID CFString in
BGMAVM_VolumeSlider::appVolumeChanged and
BGMAVM_PanSlider::appPanPositionChanged.

Both bugs were introduced two commits ago in
e05acde351.
2017-08-06 22:47:57 +10:00
Kyle Neideck
02558cd275
BGMApp: Move some more code into BGMBackgroundMusicDevice.
Mostly code for getting and setting BGMDevice's custom properties. Also
adds some stricter checking for property data received from BGMDevice.
2017-08-06 22:16:17 +10:00
Kyle Neideck
e05acde351
BGMApp: Move functions for talking to BGMDevice into their own class.
There's still some code left that should be moved into the new class,
BGMBackgroundMusicDevice, but I think this is most of it.

This also helps reduce/contain the code that has to be aware of the
second instance of BGMDevice, which handles UI-related audio.
2017-08-05 21:15:10 +10:00
Kyle Neideck
09aacabefa
Support Finder's Quicklook in App Volumes
Resolves #124.
2017-08-01 21:51:29 +10:00
Kyle Neideck
b715212cab
Ignore UI sounds when auto-pausing.
On macOS, apps are supposed to play UI-related sounds using the "system
default" device. This commit creates a new instance of BGM_Driver, which
BGMApp sets as the system default device. BGMApp ignores audio played to
that device when deciding whether to pause/unpause the user's music
player.

Since UI sounds are short, this helps avoid pausing the music player and
unpausing it shortly after.
2017-07-30 18:16:25 +10:00
Kyle Neideck
a6e9179f2d
Travis: Skip packaging with Xcode 7.
It seems to be failing because of the "-enableAddressSanitizer NO"
option in build_and_install.sh, but I haven't looked into it.
2017-06-25 14:04:01 +10:00
Kyle Neideck
ccac7d7001
Rename BGMDevice from "Background Music Device" to "Background Music".
Resolves #116.
2017-06-25 12:39:34 +10:00
Kyle Neideck
243c798ccd
Disable AddressSanitizer in release builds. 2017-06-24 22:28:11 +10:00
Kyle Neideck
a4a9530513
Change build dir back in build_and_install.sh to fix package.sh. 2017-06-24 21:40:17 +10:00
Kyle Neideck
9aec1aed34
Enable AddressSanitizer by default in debug builds and tests.
Except when running BGMDriver because you have to change coreaudiod's
sandbox profile for that. And you have to disable SIP (rootless) to do
that.
2017-06-24 20:20:16 +10:00
Kyle Neideck
7f784b5d94
Add client bundle ID for Parallels to App Volumes.
Fixes #86.
2017-06-23 00:49:27 +10:00
Kyle Neideck
c907f13554
Partial fix for apps' bundle IDs not matching their HAL clients.
Some apps have different bundle IDs to their CoreAudio clients, so
the bundle ID BGMApp sends with the app's volume doesn't match any
client in BGMDriver.

This change hardcodes the bundle IDs used by some popular apps and the
bundle IDs their clients use. We should be able to fix this for all
(almost all?) apps at some point.
2017-06-22 19:36:17 +10:00
Kyle Neideck
5a657a01a6
Fix dropped frames when starting IO.
It turns out that the HAL will sometimes call BGM_Driver::StartIO before
sending kAudioDevicePropertyDeviceIsRunning to BGMPlayThrough. In that
case, BGMApp would start playthrough and tell BGMDriver to return from
StartIO immediately, which meant we would drop the initial frames while
the output device started up.

So now BGMApp waits for the output device in that case as well.

Fixes #7.
2017-06-22 19:36:17 +10:00
Kyle Neideck
aa8d9ae518
Increment minor version number. 2017-06-22 19:36:17 +10:00
Kyle Neideck
36b4b7e0c4 README.md: Move build info out of the Download section. 2017-06-18 22:16:09 +10:00
Kyle Neideck
462bdee9cd Fix formatting in README.md. 2017-06-18 22:03:39 +10:00
Kyle Neideck
bf9faaef55
Link to the 0.1.1 pkg installer in README.md. 2017-06-18 21:07:42 +10:00