Changeset 4379:5861284631eb in roaraudio
- Timestamp:
- 09/14/10 22:16:53 (14 years ago)
- Branch:
- default
- Phase:
- public
- Location:
- roard
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
roard/hwmixer.c
r4378 r4379 137 137 streams_set_mixerstream(basestream, stream); 138 138 139 // try to get in sync with HW mixer. 140 // if possible read hw mixer state. 141 // if not possible write to force a sync value. 139 142 if ( streams_get(basestream, &ss) == 0 ) { 140 hwmixer_set_volume(basestream, ss, stream, &(ss->mixer)); 143 if ( mixer->get_vol != NULL ) { 144 hwmixer_get_volume(basestream, ss, stream, &(ss->mixer)); 145 } else { 146 hwmixer_set_volume(basestream, ss, stream, &(ss->mixer)); 147 } 141 148 } 142 149 … … 162 169 if ( mstream->hwmixer->set_vol != NULL ) 163 170 return mstream->hwmixer->set_vol(mstream, ROAR_STREAM(ss)->info.channels, HWMIXER_MODE_SET, settings); 171 172 return 0; 173 } 174 175 int hwmixer_get_volume(int id, struct roar_stream_server * ss, struct hwmixer_stream * mstream, struct roar_mixer_settings * 176 settings) { 177 if ( mstream->hwmixer->get_vol != NULL ) 178 return mstream->hwmixer->get_vol(mstream, ROAR_STREAM(ss)->info.channels, HWMIXER_MODE_ASK, settings); 164 179 165 180 return 0; -
roard/include/hwmixer.h
r4378 r4379 29 29 #include <roaraudio.h> 30 30 31 #define HWMIXER_MODE_ASK 0 31 32 #define HWMIXER_MODE_SET 1 32 33 … … 46 47 47 48 int hwmixer_set_volume(int id, struct roar_stream_server * ss, struct hwmixer_stream * mstream, struct roar_mixer_settings * settings); 49 int hwmixer_get_volume(int id, struct roar_stream_server * ss, struct hwmixer_stream * mstream, struct roar_mixer_settings * settings); 48 50 49 51 struct hwmixer_stream * hwmixer_substream_new(struct hwmixer_stream * parent); -
roard/include/streams.h
r4361 r4379 171 171 struct hwmixer_stream * streams_get_mixerstream(int id); 172 172 int streams_set_mixerstream(int id, struct hwmixer_stream * mstream); 173 int streams_read_mixervalues(int id); 173 174 174 175 int streams_ctl (int id, int_least32_t cmd, void * data); -
roard/streams.c
r4365 r4379 1221 1221 } 1222 1222 1223 int streams_read_mixervalues(int id) { 1224 struct roar_stream_server * ss; 1225 1226 _CHECK_SID(id); 1227 1228 if ( (ss = g_streams[id]) == NULL ) 1229 return -1; 1230 1231 if ( ss->mixerstream == NULL ) 1232 return -1; 1233 1234 return hwmixer_get_volume(id, ss, ss->mixerstream, &(ss->mixer)); 1235 } 1223 1236 1224 1237 int streams_ctl (int id, int_least32_t cmd, void * data) {
Note: See TracChangeset
for help on using the changeset viewer.