# Changeset 2090

- Timestamp:
- 03/28/12 01:11:56 (11 years ago)
- Files:

### Legend:

- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved

## trunk/libffado/src/libavc/audiosubunit/avc_function_block.cpp

r1568 r2090 184 184 : IBusData() 185 185 , m_controlSelector( FunctionBlockProcessing::eCSE_Processing_EnhancedMixer ) 186 , m_statusSelector( eSS_ ~~ProgramableState~~)186 , m_statusSelector( eSS_Level ) 187 187 , m_controlDataLength( 0 ) 188 188 { … … 212 212 switch (m_statusSelector) { 213 213 case eSS_ProgramableState: 214 ~~m_controlDataLength=m_LevelData.size()~~;214 m_controlDataLength=m_ProgramableStateData.size()/8; 215 215 data_length_hi=(m_controlDataLength >> 8); 216 216 data_length_lo=(m_controlDataLength & 0xFF); … … 218 218 bStatus &= se.write( data_length_lo, "FunctionBlockProcessingEnhancedMixer controlDataLengthLo" ); 219 219 220 for (int i=0;i<m_controlDataLength ~~/8~~;i++) {220 for (int i=0;i<m_controlDataLength;i++) { 221 221 byte_t value=0; 222 222 … … 228 228 bStatus &= se.write( value, "FunctionBlockProcessingEnhancedMixer data" ); 229 229 } 230 231 ~~todo=m_controlDataLength%8;~~232 ~~done=m_controlDataLength-todo;~~233 ~~if (todo) {~~234 ~~byte_t value=0;~~235 ~~for (int j=0;j<todo;j++) {~~236 ~~control_data_ext_length_t bit_value=m_ProgramableStateData.at(done*8+j);~~237 ~~value |= bit_value << (7-j);~~238 ~~}~~239 ~~bStatus &= se.write( value, "FunctionBlockProcessingEnhancedMixer data" );~~240 ~~}~~241 230 break; 242 231 case eSS_Level: 243 m_controlDataLength=m_LevelData.size() ~~/~~2;232 m_controlDataLength=m_LevelData.size()*2; 244 233 data_length_hi=(m_controlDataLength >> 8); 245 234 data_length_lo=(m_controlDataLength & 0xFF); … … 286 275 case eSS_ProgramableState: 287 276 m_ProgramableStateData.clear(); 288 for (int i=0;i<m_controlDataLength ~~/8~~;i++) {277 for (int i=0;i<m_controlDataLength;i++) { 289 278 byte_t value; 290 279 bStatus &= de.read( &value); 291 280 292 281 for (int j=7;j>=0;j--) { 293 ~~byte_t bit_value;~~294 ~~bit_value=(((1<<j) & value) ? 1 : 0);~~295 ~~m_ProgramableStateData.push_back(bit_value);~~296 ~~}~~297 ~~}~~298 299 ~~todo=m_controlDataLength%8;~~300 ~~if (todo) {~~301 ~~byte_t value;~~302 ~~bStatus &= de.read( &value);~~303 304 ~~for (int j=7;j>7-todo;j--) {~~305 282 byte_t bit_value; 306 283 bit_value=(((1<<j) & value) ? 1 : 0);