18 float rms = float(0.0);
25 auto numberSelectedTracks = range.
size();
27 if (numberSelectedTracks > 1)
30 XO(
"You can only measure one track at a time."),
34 if (numberSelectedTracks == 0)
37 XO(
"Please select an audio track."),
42 const auto first = *range.begin();
43 const auto channels = first->Channels();
46 mT0 = std::max(
mT0, first->GetStartTime());
48 for (
auto t : channels)
51 auto SelT0 = t->TimeToLongSamples(
mT0);
52 auto SelT1 = t->TimeToLongSamples(
mT1);
57 XO(
"Invalid audio selection.\nPlease ensure that audio is selected."),
65 XO(
"Nothing to measure.\nPlease select a section of a track."),
76 rms = (meanSq > 0.0) ?
sqrt(meanSq /
static_cast<double>(channels.size())) :
93 mT0 = selectedRegion.t0();
94 mT1 = selectedRegion.t1();
Toolkit-neutral facade for basic user interface services.
size_t size() const
How many attachment pointers are in the Site.
virtual AudacityProject & GetProject()=0
void SetStartAndEndTime()
static TrackList & Get(AudacityProject &project)
auto Selected() -> TrackIterRange< TrackType >
NotifyingSelectedRegion selectedRegion
static ViewInfo & Get(AudacityProject &project)
A Track that contains audio waveform data.
MessageBoxResult ShowMessageBox(const TranslatableString &message, MessageBoxOptions options={})
Show a modal message box with either Ok or Yes and No, and optionally Cancel.
WAVE_TRACK_API float GetRMS(const WaveChannel &channel, double t0, double t1, bool mayThrow=true)
__finl float_x4 __vecc sqrt(const float_x4 &a)
MessageBoxOptions && IconStyle(Icon style) &&