MCPcopy Create free account
hub / github.com/audacity/audacity / GetPropertiesOfSelected

Function GetPropertiesOfSelected

src/ProjectAudioManager.cpp:1337–1360  ·  view source on GitHub ↗

GetSelectedProperties collects information about currently selected audio tracks

Source from the content-addressed store, hash-verified

1335// GetSelectedProperties collects information about
1336// currently selected audio tracks
1337PropertiesOfSelected
1338GetPropertiesOfSelected(const AudacityProject &proj)
1339{
1340 double rateOfSelection{ RATE_NOT_SELECTED };
1341
1342 PropertiesOfSelected result;
1343 result.allSameRate = true;
1344
1345 const auto selectedTracks{
1346 TrackList::Get(proj).Selected<const WaveTrack>() };
1347
1348 for (const auto & track : selectedTracks) {
1349 if (rateOfSelection != RATE_NOT_SELECTED &&
1350 track->GetRate() != rateOfSelection)
1351 result.allSameRate = false;
1352 else if (rateOfSelection == RATE_NOT_SELECTED)
1353 rateOfSelection = track->GetRate();
1354 }
1355
1356 result.anySelected = !selectedTracks.empty();
1357 result.rateOfSelected = rateOfSelection;
1358
1359 return result;
1360}

Callers 3

OnRecordMethod · 0.70
OnTimerRecordFunction · 0.70
OnPunchAndRollFunction · 0.50

Calls 3

GetFunction · 0.85
GetRateMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected