You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to compare to ma_device_id objects to figure out if they refer to the same hardware device. I couldn't find any API function to compare ma_device_id objects, and I considered using std::memcmp, but I am not sure if the ma_device_id object is intended to be compared that way.
Is there a way to reliably compare two ma_device_id for equality, or -- more generally -- check if two hardware devices detected through miniaudio are the same?
The text was updated successfully, but these errors were encountered:
memcmp(&id0, &id1, sizeof(ma_device_id)) should do the job. I thought I actually had a function for comparing device IDs, but looking now it appears that no such function exists. Probably worth adding that. In any case, ma_device_id is explicitly a fixed sized struct, no matter what backends are enabled/disabled, and it should be padded with zeros, so it should be reliable. If I add a function to compare IDs, memcmp() is how I'd be doing it.
I am trying to compare to
ma_device_id
objects to figure out if they refer to the same hardware device. I couldn't find any API function to comparema_device_id
objects, and I considered usingstd::memcmp
, but I am not sure if thema_device_id
object is intended to be compared that way.Is there a way to reliably compare two
ma_device_id
for equality, or -- more generally -- check if two hardware devices detected throughminiaudio
are the same?The text was updated successfully, but these errors were encountered: