Commit graph

16 commits

Author SHA1 Message Date
Kyle Neideck
c91af08d54 Enable more warnings in BGMDriver.
The PublicUtility classes are now built as a separate target so we can
disable some of those warnings for it.
2016-09-08 00:24:57 +10:00
Kyle Neideck
484ffa16f3 BGMDriver: Clean up constructor initializer lists.
See https://isocpp.org/wiki/faq/ctors#ctor-initializer-order.
2016-09-06 22:18:11 +10:00
Josh Junon
808fe1b6b3 Short circuit audible loop
Slight micro-opt that will short circuit the `BufferIsAudible` loop if we've already found something audible.

Was looking through your IO layout and noticed this.
2016-09-02 12:14:29 -07:00
Kyle Neideck
23fd57713d Fix nullability warnings in builds using the macOS 10.12 SDK.
Fixes #70.
2016-08-22 00:42:55 +10:00
Kyle Neideck
679d624860 Add BGM_Driver tests: get/set the music player bundle ID property. 2016-07-04 16:32:59 +10:00
Kyle Neideck
1ee9fa348e Fix build failure on case-sensitive file systems. Fixes #64.
It seems that BGMDriver was failing to compile on case-sensitive file
systems because BGM_Types.h included "AudioServerPlugin.h" instead of
"AudioServerPlugIn.h". (Lowercase "i".)

I tried building with the project and Xcode on a case-sensitive disk
image and it would fail without this patch. So I figure it should at
least build now. I haven't had time to test Background Music on a system
running on a case-insensitive file system yet, so I added a TODO about
it in TODO.md.

Also, some unrelated tidying up.
2016-06-16 18:38:29 +10:00
Kyle Neideck
b58ad2a1f8 Fix possible deadlock when starting IO.
BGM_Device::StartIO was holding the state mutex longer than it needed
to, which meant HasProperty, GetProperty, etc. couldn't return. If
BGMPlayThrough was notified about IO starting after StartIO locked the
mutex, BGMPlayThrough would get stuck trying to get one of BGMDevice's
properties.

Fixes #46.
2016-04-30 21:28:16 +10:00
Kyle Neideck
960fe0d28d Fix rare race condition in BGM_TaskQueue (hopefully).
Also enable a few more warnings in the BGMDriver project.
2016-04-30 20:50:29 +10:00
Kyle Neideck
8acc5d4c9e Change the min and max sample rates in BGM_Driver. 2016-04-25 08:38:45 +10:00
Kyle Neideck
6ea4361135 Add Xcode schemes. 2016-04-08 05:12:11 +10:00
Kyle Neideck
690d6221d7 Add script that builds and installs BGMApp, BGMDriver and BGMXPCHelper 2016-04-05 16:56:38 +10:00
Kyle Neideck
1672bb8ed0 BGMXPCHelper can now be installed with xcodebuild.
The "install" action for BGMXPCHelper now checks the owner/permissions
of the installation directory. It also installs BGMXPCHelper's
launchd.plist and "bootstraps" it.
2016-04-04 04:55:17 +10:00
Kyle Neideck
33b6b17115 Add an XPC helper. Sync BGMApp and BGMDriver with it while starting IO.
The BGMApp project now builds an XPC service bundle called BGMXPCHelper,
which vends a Mach service that BGMApp and BGMDriver can use to
communicate. This will hopefully be useful for some of the tasks HAL
notifications aren't suited to.

In this commit, BGMDriver uses the XPC helper when starting IO, to wait
until BGMApp is ready for playthrough. BGMApp can only start playthrough
when the output hardware is ready for IO. BGMDriver can now tell the HAL
when we're ready for IO, which means we don't have to keep the output
hardware running all the time (or drop frames or increase latency).

The end result is that playthrough doesn't waste CPU time while idle any
more. This also means that now playthrough won't prevent the system from
sleeping when idle.
2016-03-31 11:42:24 +11:00
Kyle Neideck
199f5f6a6b Prefer list initialization for in-class initialized member objects 2016-02-20 17:21:05 +11:00
Kyle Neideck
096eb4e1eb Remove unnecessary includes from BGM_Device.cpp 2016-02-19 17:37:11 +11:00
Kyle Neideck
b17d736382 Initial commit 2016-02-19 16:25:34 +11:00