src/ProjectAudioManager.cpp
// GetSelectedProperties collects information about 
// currently selected audio tracks
GetSelectedProperties collects information about
currently selected audio tracks
GetSelectedProperties collects information about currently selected audio tracks
PropertiesOfSelected
GetPropertiesOfSelected(const AudacityProject &proj)
{
   double rateOfSelection{ RATE_NOT_SELECTED };
   PropertiesOfSelected result;
   result.allSameRate = true;
   const auto selectedTracks{ 
      TrackList::Get(proj).Selected< const WaveTrack >() };
   for (const auto & track : selectedTracks) 
   {
      if (rateOfSelection != RATE_NOT_SELECTED &&
         track->GetRate() != rateOfSelection)
         result.allSameRate = false;
      else if (rateOfSelection == RATE_NOT_SELECTED)
         rateOfSelection = track->GetRate();
   }
   result.numberOfSelected = selectedTracks.size();
   result.rateOfSelected = rateOfSelection;
   return  result;
}
PropertiesOfSelected GetPropertiesOfSelected ( const AudacityProject & proj ) { double rateOfSelection { RATE_NOT_SELECTED } ; PropertiesOfSelected result ; result . allSameRate = true ; const auto selectedTracks { TrackList :: Get ( proj ) . Selected < const WaveTrack > ( ) } ; for ( const auto & track : selectedTracks ) { if ( rateOfSelection != RATE_NOT_SELECTED && track -> GetRate ( ) != rateOfSelection ) result . allSameRate = false ; else if ( rateOfSelection == RATE_NOT_SELECTED ) rateOfSelection = track -> GetRate ( ) ; } result . numberOfSelected = selectedTracks . size ( ) ; result . rateOfSelected = rateOfSelection ; return result ; }
GetSelectedProperties collects information about
currently selected audio tracks
GetSelectedProperties collects information about currently selected audio tracks