-
Notifications
You must be signed in to change notification settings - Fork 0
/
QRetroAudioVideoEnable.h
50 lines (42 loc) · 1.56 KB
/
QRetroAudioVideoEnable.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#ifndef QRETRO_AUDIOVIDEOENABLE_H
#define QRETRO_AUDIOVIDEOENABLE_H
/**
* A class used for callback RETRO_ENVIRONMENT_GET_AUDIO_VIDEO_ENABLE that
* reports to the core whether or not the frontend wants certain data.
*/
class QRetroAudioVideoEnable
{
public:
QRetroAudioVideoEnable(bool audio = true, bool video = true, bool ufss = false, bool hda = false)
{
m_Flags.fields.enableAudio = audio;
m_Flags.fields.enableVideo = video;
m_Flags.fields.useFastSavestates = ufss;
m_Flags.fields.hardDisableAudio = hda;
}
void setEnableAudio(bool enabled) { m_Flags.fields.enableAudio = enabled; }
bool enableAudio(void) { return m_Flags.fields.enableAudio; }
void setEnableVideo(bool enabled) { m_Flags.fields.enableVideo = enabled; }
bool enableVideo(void) { return m_Flags.fields.enableVideo; }
void setUseFastSavestates(bool enabled) { m_Flags.fields.useFastSavestates = enabled; }
bool useFastSavestates(void) { return m_Flags.fields.useFastSavestates; }
void setHardDisableAudio(bool enabled) { m_Flags.fields.hardDisableAudio = enabled; }
bool hardDisableAudio(void) { return m_Flags.fields.hardDisableAudio; }
int getFlags(void) { return m_Flags.bits; }
void setFlags(int flags) { m_Flags.bits = flags; }
private:
union m_Flags
{
struct
{
int enableAudio : 1;
int enableVideo : 1;
int useFastSavestates : 1;
int hardDisableAudio : 1;
int unused : 28;
} fields;
int bits;
} m_Flags;
static_assert(sizeof(m_Flags) == sizeof(int), "QRetroAudioVideoEnable size does not match API!");
};
#endif