• R/O
  • HTTP
  • SSH
  • HTTPS

cinnamon: Commit

Cinnamon audio library


Commit MetaInfo

Revisiónb3cf89ae38c6664675ed2557efa7337d9ffcf6ec (tree)
Tiempo2020-01-05 08:33:29
AutorAlaskanEmily <emily@alas...>
CommiterAlaskanEmily

Log Message

Add dummy implementation of OSS SoundGetVolume/SoundSetVolume

Cambiar Resumen

Diferencia incremental

--- a/src/oss/cin_oss_sound.c
+++ b/src/oss/cin_oss_sound.c
@@ -85,6 +85,9 @@ enum Cin_LoaderError Cin_LoaderFinalize(struct Cin_Loader *ld,
8585
8686 /* Store the ID */
8787 out->sound_id = id;
88+
89+ /* Set the default volume. */
90+ out->volume = 0xFF;
8891 }
8992 out->drv = drv;
9093 cin_loader_fail:
@@ -112,6 +115,30 @@ enum Cin_SoundError Cin_SoundStop(struct Cin_Sound *snd){
112115
113116 /*****************************************************************************/
114117
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+
115142 void Cin_DestroySound(struct Cin_Sound *snd){
116143 enum Cin_SoundError err = cin_sound_command(snd, CIN_OSS_DELETE);
117144 assert(err == Cin_eSoundSuccess);
--- a/src/oss/cin_oss_sound.h
+++ b/src/oss/cin_oss_sound.h
@@ -29,6 +29,7 @@ struct Cin_Sound {
2929 struct Cin_MixerSound *snd;
3030 struct Cin_Driver *drv;
3131 unsigned short sound_id;
32+ unsigned char volume;
3233 };
3334
3435 /*****************************************************************************/
Show on old repository browser