Commit graph

30 commits

Author SHA1 Message Date
Kyle Neideck
73f221e423
skip-ui-tests.py: Update the path to Python as macOS dropped Python 2. 2024-03-07 08:42:01 +11:00
Kyle Neideck
d048287140
Fix slider knob sizes.
Also,
 - Update copyright years.
 - Drop support for macOS 10.9.
2022-06-12 14:36:59 +10:00
Kyle Neideck
3040a20766
GH Actions: Try to grant BGMApp mic authorization by modifying TCC.db. 2022-05-19 17:24:33 +10:00
Kyle Neideck
30ec1c24b7
GH Actions: Try to fix mic authorization dialog not closing. 2022-05-15 16:04:31 +10:00
Kyle Neideck
909615617a
GH Actions: More logging to help diagnose UI test failures. 2022-05-15 14:49:08 +10:00
Kyle Neideck
058af733be
Automatically accept the input device permission dialog in UI tests. 2022-05-15 02:06:35 +10:00
Kyle Neideck
7afb8a6c12
GH Actions: Re-enable the UI tests.
GitHub Action's macOS image has been updates and UI tests might work
now: <https://github.com/actions/virtual-environments/pull/5417>.

Also, remove some supporting files/code for CI builds that we don't need
anymore.
2022-05-13 20:53:12 +10:00
Antoine Cœur
f31aebcf51 spelling 2022-01-21 09:35:16 +08:00
Kyle Neideck
488ed16dfc
Hopefully fix a segfault caused by BGM_PlayThrough.
Issue #276 reported a segfault that occurred while BGMApp was launching.
It was caused by BGM_PlayThrough's output IOProc when it tried to read
from the ring buffer. I haven't been able to reproduce the problem, so I
don't know whether this commit will actually fix it. Hopefully it will
at least make it easier to diagnose.

This commit adds locking around accesses to the buffer so that the
IOProcs will skip the current IO cycle if it isn't safe to use the ring
buffer. That should only happen during launch or when changing the
output device. (And only if something else has gone wrong.)
2020-04-18 22:00:49 +10:00
Kyle Neideck
2c1677305d
Add optional debug logging in release builds.
Clicking the status bar icon with the option key held now reveals a
setting that enables debug logging in BGMApp. It's enabled by default in
debug builds.

It doesn't enable debug logging in BGMDriver or BGMXPCHelper yet.

This will hopefully make it easier for people to include logs when they
report bugs that don't occur with most hardware or are otherwise hard to
reproduce.

Enabling debug logging should be unlikely to cause audio glitches, but I
haven't tried to make it completely safe.

Also,
 - add some basic unit tests for BGMPlayThrough and expand the mocks for
   the CoreAudio HAL API,
 - fix the UI tests so you can run them without code signing them, and
 - update copyright years.
2020-01-24 08:07:34 +11:00
Kyle Neideck
d1f5492a47
Fix compilation errors with Clang 8 in BGMAppUITests.
You can't run the UI tests in Xcode 8 anyway, so now we just skip
compiling them.
2018-11-04 18:15:52 +11:00
Kyle Neideck
7b8d1a0e0d
Rename BGMOutputDevicePrefs to BGMOutputDeviceMenuSection. 2018-11-04 15:28:01 +11:00
Kyle Neideck
5e12f9fc01
Move the output device menu items to the main menu.
I don't know why I put them in the Preferences menu initially. This is
more convenient.

Closes #170.

Also:
 - Update the output device menu items as needed instead of when the
   user opens the menu. This saves a bit of CPU time and means if the
   user has the menu open, changes are made when they're needed instead
   of the next time the user opens the menu.
 - Fix BGMAppUITests::testCycleOutputDevices for the latest Xcode/macOS.
2018-11-04 12:30:43 +11:00
Kyle Neideck
287bae0923
Fix mocks in BGMMusicPlayersUnitTests. 2018-01-21 13:43:30 +11:00
Kyle Neideck
e4b98e4099
Add a UI test for the output volume slider. 2017-09-17 16:43:51 +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
b986b687ea
Fix exception in Mock_CAHALAudioObject during BGMApp unit tests.
Also, avoid initialising BGMDeviceControlsList in
BGMMockAudioDeviceManager::init.
2017-06-01 20:10:35 +10:00
Kyle Neideck
c617d98f9d
BGMDevice: Only enable volume/mute if the output device also has them.
BGMApp now disables BGMDevice's volume and/or mute controls if the
output device selected in BGMApp doesn't have matching controls. This
prevents the controls from being presented to the user when they don't
do anything.

In BGMPlayThrough, wait much longer for our IOProcs to stop themselves
before assuming something's gone wrong. In testing, rapidly changing
between output devices with and without controls while playing audio
would occasionally cause one of the IOProcs to take too long to stop
itself.

Also adds some basic scriptability, mainly so UI tests can use
AppleScript to check BGMApp's state that would be complicated to check
otherwise. (In this case, to check which output device is selected.)

Fixes #101.
2017-05-30 23:22:48 +10:00
Kyle Neideck
78e2813af1
Fix encoding issue on Travis caused by "©" char in Python script. 2017-02-19 20:50:11 +11:00
Kyle Neideck
87af15d290
Skip the UI tests on Travis by directly editing BGMApp's Xcode scheme.
Skipping them by overriding runTest didn't work and this is the only other way
I can think of. xcodebuild's -skip-testing option would work, but only with
recent versions of Xcode.
2017-02-19 20:25:54 +11:00
Kyle Neideck
7b32b6ef66
Skip the UI tests on Travis because it doesn't support UI testing. 2017-02-19 17:43:45 +11:00
Kyle Neideck
60e1b3564b
Add a UI tests target for BGMApp. Only has one test so far.
The UI tests run with clean user defaults, but BGMDevice and Scripting Bridge
still need to be mocked/stubbed out. That also means that the UI tests can only
run if BGMDriver is installed and that changes to BGMDriver's state made during
the tests will persist.
2017-02-19 13:39:34 +11:00
Kyle Neideck
9b5d5bf921
Remove BGMAppTests, which was essentially empty. 2017-02-18 18:59:32 +11:00
Kyle Neideck
07c1c2320b
Reorganise the BGMApp test dirs slightly. 2017-02-18 18:12:40 +11:00
Kyle Neideck
ab9d4cdc2b
Add more exception handling to BGMApp...
And other reliability improvements. Mostly in BGMPlayThrough and the
classes that use it. Trying to catch C++ exceptions as early as possible
in the Objective-C++ code and, if necessary, convert them to NSErrors.

More errors are logged in release builds now, which will hopefully help
with debugging issues the developers can't reproduce themselves.
2016-12-15 03:20:07 +11:00
Kyle Neideck
e31f2b1c29 Refactor and clean up BGMApp's music player code and add tests. Also...
- Destroy the Scripting Bridge application object for a music player
  when that music player isn't running.
- Move the UI code for the auto-pause menu item into its own class.
- Add a User Defaults class to BGMApp.
- Enable some more warnings for the BGMApp project.
2016-09-17 18:24:19 +10:00
Kyle Neideck
4dba9412fb Install NullAudio driver before tests run on Travis. 2016-05-11 10:02:31 +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
b17d736382 Initial commit 2016-02-19 16:25:34 +11:00