Changeset 4379:5861284631eb in roaraudio for roard/hwmixer.c


Ignore:
Timestamp:
09/14/10 22:16:53 (14 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

support reading volumes at startup

File:
1 edited

Legend:

Unmodified
Added
Removed
  • roard/hwmixer.c

    r4378 r4379  
    137137 streams_set_mixerstream(basestream, stream); 
    138138 
     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. 
    139142 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  } 
    141148 } 
    142149 
     
    162169 if ( mstream->hwmixer->set_vol != NULL ) 
    163170  return mstream->hwmixer->set_vol(mstream, ROAR_STREAM(ss)->info.channels, HWMIXER_MODE_SET, settings); 
     171 
     172 return 0; 
     173} 
     174 
     175int hwmixer_get_volume(int id, struct roar_stream_server * ss, struct hwmixer_stream * mstream, struct roar_mixer_settings * 
     176settings) { 
     177 if ( mstream->hwmixer->get_vol != NULL ) 
     178  return mstream->hwmixer->get_vol(mstream, ROAR_STREAM(ss)->info.channels, HWMIXER_MODE_ASK, settings); 
    164179 
    165180 return 0; 
Note: See TracChangeset for help on using the changeset viewer.