| 308 | } |
| 309 | |
| 310 | void Tr2BindingPoint::SetValue( float value ) const |
| 311 | { |
| 312 | if( !IsValid() ) |
| 313 | { |
| 314 | return; |
| 315 | } |
| 316 | switch( m_entry->mType ) |
| 317 | { |
| 318 | case Be::FLOAT: |
| 319 | *reinterpret_cast<float*>( m_destination ) = value; |
| 320 | break; |
| 321 | case Be::DOUBLE: |
| 322 | *reinterpret_cast<double*>( m_destination ) = value; |
| 323 | break; |
| 324 | case Be::BOOL: |
| 325 | *reinterpret_cast<bool*>( m_destination ) = value != 0; |
| 326 | break; |
| 327 | case Be::FLOATARRAY: |
| 328 | if( m_entryOffset == -1 ) |
| 329 | { |
| 330 | for( int32_t i = 0; i < m_arraySize; ++i ) |
| 331 | { |
| 332 | reinterpret_cast<float*>( m_destination )[i] = value; |
| 333 | } |
| 334 | } |
| 335 | else |
| 336 | { |
| 337 | reinterpret_cast<float*>( m_destination )[m_entryOffset] = value; |
| 338 | } |
| 339 | break; |
| 340 | case Be::DOUBLEARRAY: |
| 341 | if( m_entryOffset == -1 ) |
| 342 | { |
| 343 | for( int32_t i = 0; i < m_arraySize; ++i ) |
| 344 | { |
| 345 | reinterpret_cast<double*>( m_destination )[i] = value; |
| 346 | } |
| 347 | } |
| 348 | else |
| 349 | { |
| 350 | reinterpret_cast<double*>( m_destination )[m_entryOffset] = value; |
| 351 | } |
| 352 | break; |
| 353 | default: |
| 354 | return; |
| 355 | } |
| 356 | if( !!m_notifyPtr ) |
| 357 | { |
| 358 | m_notifyPtr->OnModified( m_destination ); |
| 359 | } |
| 360 | } |
| 361 | |
| 362 | bool Tr2BindingPoint::GetValue( float& value ) const |
| 363 | { |
no test coverage detected