File tree Expand file tree Collapse file tree 1 file changed +6
-12
lines changed
Expand file tree Collapse file tree 1 file changed +6
-12
lines changed Original file line number Diff line number Diff line change @@ -1335,22 +1335,16 @@ void CAudioMixerBoard::ApplyNewConClientList ( CVector<CChannelInfo>& vecChanInf
13351335
13361336void CAudioMixerBoard::SetFaderLevel ( const int iChannelIdx, const int iValue )
13371337{
1338- // only apply new fader level if channel index is valid and the fader is visible
1339- if ( ( iChannelIdx >= 0 ) && ( iChannelIdx < MAX_NUM_CHANNELS ) )
1340- {
1341- if ( vecpChanFader[static_cast <size_t > ( iChannelIdx )]->IsVisible () )
1342- {
1343- vecpChanFader[static_cast <size_t > ( iChannelIdx )]->SetFaderLevel ( iValue );
1344- }
1345- }
13461338 // Proposed change: if iChannelIdx is -1 and our own channel ID is a valid index
13471339 // then we adjust our own fader level:
1348- if ((iChannelIdx == -1 ) && iMyChannelID != INVALID_INDEX)
1340+ const int iTheChannelIdx = ( iChannelIdx == INVALID_INDEX ) ? iMyChannelID : iChannelIdx;
1341+
1342+ // only apply new fader level if channel index is valid and the fader is visible
1343+ if ( ( iTheChannelIdx >= 0 ) && ( iTheChannelIdx < MAX_NUM_CHANNELS ) )
13491344 {
1350- if ( vecpChanFader[static_cast <size_t > ( iMyChannelID )]->IsVisible () )
1345+ if ( vecpChanFader[static_cast <size_t > ( iTheChannelIdx )]->IsVisible () )
13511346 {
1352- // printf("debug: set our own fader(%d) level to %d\n", iMyChannelID, iValue);
1353- vecpChanFader[static_cast <size_t > ( iMyChannelID )]->SetFaderLevel ( iValue );
1347+ vecpChanFader[static_cast <size_t > ( iTheChannelIdx )]->SetFaderLevel ( iValue );
13541348 }
13551349 }
13561350}
You can’t perform that action at this time.
0 commit comments