Changeset 4378:df6cda763dce in roaraudio
- Timestamp:
- 09/14/10 22:07:07 (14 years ago)
- Branch:
- default
- Phase:
- public
- Location:
- roard
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
roard/hwmixer.c
r4373 r4378 43 43 44 44 struct hwmixer g_hwmixers[] = { 45 {"oss", "OSS Mixer", "/dev/mixer*", FLAG_FHSEC, hwmixer_oss_open, hwmixer_oss_close, hwmixer_oss_set_vol, NULL},45 {"oss", "OSS Mixer", "/dev/mixer*", FLAG_FHSEC, hwmixer_oss_open, hwmixer_oss_close, hwmixer_oss_set_vol, hwmixer_oss_get_vol}, 46 46 {"file", "Write to plain file", "/some/file", FLAG_FHSEC, NULL, NULL, NULL, NULL}, 47 47 {"dstr", "Write to DSTR", "/some/file", FLAG_NONE, hwmixer_dstr_open, hwmixer_dstr_close, hwmixer_dstr_set_vol, NULL}, -
roard/hwmixer_oss.c
r4373 r4378 182 182 } 183 183 184 int hwmixer_oss_get_vol(struct hwmixer_stream * stream, int channels, int mode, struct roar_mixer_settings * settings) { 185 struct roar_vio_calls * vio = stream->baseud; 186 struct roar_vio_sysio_ioctl ctl; 187 struct subdev * subdev = stream->ud; 188 int i; 189 int l, r; 190 191 ctl.cmd = subdev->cmd_read; 192 ctl.argp = &i; 193 194 if ( roar_vio_ctl(vio, ROAR_VIO_CTL_SYSIO_IOCTL, &ctl) == -1 ) 195 return -1; 196 197 l = i & 0xFF; 198 r = (i >> 8) & 0xFF; 199 200 if ( subdev->channels == 1 ) 201 r = l; 202 203 settings->scale = OSS_VOLUME_SCALE; 204 205 if ( channels == 1 ) { 206 settings->mixer[0] = (l + r) / 2; 207 } else if ( channels == 2 ) { 208 settings->mixer[0] = l; 209 settings->mixer[1] = r; 210 } else { 211 return -1; 212 } 213 214 return 0; 215 } 216 184 217 //ll -
roard/include/hwmixer.h
r4373 r4378 60 60 int hwmixer_oss_close(struct hwmixer_stream * stream); 61 61 int hwmixer_oss_set_vol(struct hwmixer_stream * stream, int channels, int mode, struct roar_mixer_settings * settings); 62 int hwmixer_oss_get_vol(struct hwmixer_stream * stream, int channels, int mode, struct roar_mixer_settings * settings); 62 63 63 64 #endif
Note: See TracChangeset
for help on using the changeset viewer.