Update to v103r15 release.

byuu says:

Changelog:

  - ruby: rewrote the API interfaces for Video, Audio, Input
  - ruby/audio: can now select the number of output channels (not useful
    to higan, sorry)
  - ruby/asio: various improvements
  - tomoko: audio settings panel can now select separate audio devices
    (for ASIO, OSS so far)
  - tomoko: audio settings panel frequency and latency lists are
    dynamically populated now

Note: due to the ruby API rewrite, most drivers will not compile. Right
now, the following work:

  - video: Direct3D, XShm
  - audio: ASIO, OSS
  - input: Windows, SDL, Xlib

It takes a really long time to rewrite these (six hours to do the
above), so it's going to be a while before we're back at 100%
functionality again.

Errata:

  - ASIO needs device(), setDevice()
  - need to call setDevice() at program startup to populate
    frequency/latency settings properly
  - changing the device and/or frequency needs to update the emulator
    resampler rates

The really hard part is going to be the last one: the only way to change
the emulator frequency is to flush all the audio streams and then
recompute all the coefficients for the resamplers. If this is called
during emulation, all audio streams will be erased and thus no sound
will be output. I'll most likely be forced to simply ignore
device/frequency changes until the user loads another game. It is at
least possible to toggle the latency dynamically.
This commit is contained in:
Tim Allen
2017-07-17 15:11:18 +10:00
parent 17697317d4
commit 4129630d97
29 changed files with 998 additions and 886 deletions

View File

@@ -7,11 +7,11 @@ struct InputMouseXlib {
shared_pointer<HID::Mouse> hid{new HID::Mouse};
uintptr_t handle = 0;
uintptr handle = 0;
Display* display = nullptr;
Window rootWindow;
Cursor invisibleCursor;
Window rootWindow = 0;
Cursor invisibleCursor = 0;
unsigned screenWidth = 0;
unsigned screenHeight = 0;
@@ -24,6 +24,10 @@ struct InputMouseXlib {
unsigned relativeY = 0;
} ms;
auto acquired() -> bool {
return ms.acquired;
}
auto acquire() -> bool {
if(acquired()) return true;
@@ -53,10 +57,6 @@ struct InputMouseXlib {
return true;
}
auto acquired() -> bool {
return ms.acquired;
}
auto assign(unsigned groupID, unsigned inputID, int16_t value) -> void {
auto& group = hid->group(groupID);
if(group.input(inputID).value() == value) return;
@@ -103,7 +103,10 @@ struct InputMouseXlib {
devices.append(hid);
}
auto init(uintptr_t handle) -> bool {
auto initialize(uintptr handle) -> bool {
terminate();
if(!handle) return false;
this->handle = handle;
display = XOpenDisplay(0);
rootWindow = DefaultRootWindow(display);
@@ -143,10 +146,16 @@ struct InputMouseXlib {
return true;
}
auto term() -> void {
auto terminate() -> void {
release();
XFreeCursor(display, invisibleCursor);
XCloseDisplay(display);
if(invisibleCursor) {
XFreeCursor(display, invisibleCursor);
invisibleCursor = 0;
}
if(display) {
XCloseDisplay(display);
display = nullptr;
}
}
};