This is only ever queried and not set outside of the Core.cpp, so this
should just be hidden internally and just have a function exposed that
allows querying it.
This clashes with X11's preprocessor define named Success (because using
non-prefixed lowercase identifiers in C was apparently a fantastic idea
at some point), causing compilation errors.
Places all of the SI code under the SerialInterface namespace instead of
only the main source file. This keeps all SI code under a common name,
as well as out of the global namespace
Gets some constants out of the ControllerEmu namespace, and modifies
ControlGroup so that it uses the enum type itself to represent the
underlying type, rather than a u32 value.
4bd5674 changed "Wiimote" to "Wii Remote" in the GUI
(intentionally) but also did the same change for two INI
keys (seemingly unintentional, breaks backwards compatibility,
and is inconsistent with the INI's filename). This commit
reverts the INI keys but not the GUI strings.
This commit uses the same approach as cbd539e used for GameCube
sticks (but I made sure to avoid the bug that 56531a0 fixed).
ControllerEmu::Control instances have a unique_ptr<ControlReference>
member, which is passed either an InputReference or OutputReference.
Without this virtual destructor, deleting a derived class through a
pointer to the base class is undefined behavior.
ControllerEmu, the class, is essentially acting like a namespace for
ControlGroup. This makes it impossible to forward declare any of the
internals. It also globs a bunch of classes together which is kind of a
pain to manage.
This splits ControlGroup and the classes it contains into their own source
files and situates them all within a namespace, which gets them out of
global scope.
Since this allows forward declarations for the once-internal classes, it
now requires significantly less files to be rebuilt if anything is changed
in the ControllerEmu portion of code.
It does not split out the settings classes yet, however, as it
would be preferable to make a settings base class that all settings derive
from, but this would be a functional change -- this commit only intends to
move around existing code. Extracting the settings class will be done in
another commit.
The three parameter AnalogStick constructor takes an internal name, a
display name, and a default radius argument. The delegated constructor is
the one that calls the ControlGroup constructor, setting the group type,
so passing the group type here is a logic bug.
The only reason this appeared to work despite this bug is because
GROUP_TYPE_STICK has a value of 1, and the default radius value used for
attachment sticks is 1.0.
Better separation of concerns. Relegates `ControllerInterface` to
enumerating input controls, and the new `ControlReference` deals with
combining inputs and configuration expression parsing.
ControllerEmu is a massive class with a lot of nested public classes.
The only reason these are nested is because the outer class acts as a
namespace. There's no reason to keep these classes nested just for that.
Keeping these classes nested makes it impossible to forward declare them, which leads to quite a few includes in other headers, making compilation take
longer.
This moves the source files to their own directory so classes can be
separated as necessary to their own source files, and be namespaced under the
ControllerEmu namespace.
libusb on Windows is limited to only a single context. Trying to open
more than one can cause device enumerations to fail randomly.
libusb is thread-safe and we don't use the manual polling support (with
`poll()`) so this should be safe.