リビジョン | b3cf89ae38c6664675ed2557efa7337d9ffcf6ec (tree) |
---|---|
日時 | 2020-01-05 08:33:29 |
作者 | AlaskanEmily <emily@alas...> |
コミッター | AlaskanEmily |
Add dummy implementation of OSS SoundGetVolume/SoundSetVolume
@@ -85,6 +85,9 @@ enum Cin_LoaderError Cin_LoaderFinalize(struct Cin_Loader *ld, | ||
85 | 85 | |
86 | 86 | /* Store the ID */ |
87 | 87 | out->sound_id = id; |
88 | + | |
89 | + /* Set the default volume. */ | |
90 | + out->volume = 0xFF; | |
88 | 91 | } |
89 | 92 | out->drv = drv; |
90 | 93 | cin_loader_fail: |
@@ -112,6 +115,30 @@ enum Cin_SoundError Cin_SoundStop(struct Cin_Sound *snd){ | ||
112 | 115 | |
113 | 116 | /*****************************************************************************/ |
114 | 117 | |
118 | +enum Cin_SoundError Cin_SoundSetVolume(struct Cin_Sound *snd, | |
119 | + unsigned char volume){ | |
120 | + | |
121 | + assert(snd != NULL); | |
122 | + | |
123 | + /* TODO: This is obviously just lying. */ | |
124 | + snd->volume = volume; | |
125 | + return Cin_eSoundSuccess; | |
126 | +} | |
127 | + | |
128 | +/*****************************************************************************/ | |
129 | + | |
130 | +enum Cin_SoundError Cin_SoundGetVolume(const struct Cin_Sound *snd, | |
131 | + unsigned char *out_volume){ | |
132 | + | |
133 | + assert(snd != NULL); | |
134 | + assert(out_volume != NULL); | |
135 | + | |
136 | + out_volume[0] = snd->volume; | |
137 | + return Cin_eSoundSuccess; | |
138 | +} | |
139 | + | |
140 | +/*****************************************************************************/ | |
141 | + | |
115 | 142 | void Cin_DestroySound(struct Cin_Sound *snd){ |
116 | 143 | enum Cin_SoundError err = cin_sound_command(snd, CIN_OSS_DELETE); |
117 | 144 | assert(err == Cin_eSoundSuccess); |
@@ -29,6 +29,7 @@ struct Cin_Sound { | ||
29 | 29 | struct Cin_MixerSound *snd; |
30 | 30 | struct Cin_Driver *drv; |
31 | 31 | unsigned short sound_id; |
32 | + unsigned char volume; | |
32 | 33 | }; |
33 | 34 | |
34 | 35 | /*****************************************************************************/ |