1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-12-14 16:46:28 +01:00

Fewer C-style pointer casts of tracks; comments justify static_cast

This commit is contained in:
Paul Licameli
2016-09-15 09:54:38 -04:00
parent 837173e9ad
commit 88611a4530
18 changed files with 223 additions and 164 deletions

View File

@@ -1036,7 +1036,9 @@ void MixerBoard::UpdateTrackClusters()
#else
mMixerTrackClusters[nClusterIndex]->mLeftTrack = (WaveTrack*)pLeftTrack;
#endif
mMixerTrackClusters[nClusterIndex]->mRightTrack = (WaveTrack*)pRightTrack;
// Assume linked track is wave or null
mMixerTrackClusters[nClusterIndex]->mRightTrack =
static_cast<WaveTrack*>(pRightTrack);
mMixerTrackClusters[nClusterIndex]->UpdateForStateChange();
}
else
@@ -1051,7 +1053,9 @@ void MixerBoard::UpdateTrackClusters()
wxSize clusterSize(kMixerTrackClusterWidth, nClusterHeight);
pMixerTrackCluster =
safenew MixerTrackCluster(mScrolledWindow, this, mProject,
(WaveTrack*)pLeftTrack, (WaveTrack*)pRightTrack,
static_cast<WaveTrack*>(pLeftTrack),
// Assume linked track is wave or null
static_cast<WaveTrack*>(pRightTrack),
clusterPos, clusterSize);
if (pMixerTrackCluster)
mMixerTrackClusters.Add(pMixerTrackCluster);