![]() |
Audacity 3.2.0
|
A class to profile TrackPanel painting. More...
#include <FrameStatistics.h>
Classes | |
| class | Section |
| Profiling section data. More... | |
| class | Stopwatch |
| RAII wrapper used to measure a section time. More... | |
| struct | UpdatePublisher |
| A helper that notifies the view that a specific section has changed. More... | |
Public Types | |
| enum class | SectionID { TrackPanel , WaveformView , WaveDataCache , WaveBitmapCachePreprocess , WaveBitmapCache , Count } |
| ID of the profiling section. More... | |
| using | Clock = std::chrono::high_resolution_clock |
| using | Duration = Clock::duration |
| using | Timepoint = Clock::time_point |
Static Public Member Functions | |
| static Stopwatch | CreateStopwatch (SectionID section) noexcept |
| Create a Stopwatch for the section specified. More... | |
| static const Section & | GetSection (SectionID section) noexcept |
| Get the section data. More... | |
| static Observer::Subscription | Subscribe (UpdatePublisher::Callback callback) |
| Subscribe to sections update. More... | |
Private Member Functions | |
| void | AddEvent (SectionID section, Duration duration) |
Private Attributes | |
| Section | mSections [size_t(SectionID::Count)] |
| UpdatePublisher | mUpdatePublisher |
A class to profile TrackPanel painting.
Audacity: A Digital Audio Editor
Dmitry Vedenko
Object of this class is a global singleton. If there are multiple opened projects, the statistics will be merged.
Definition at line 25 of file FrameStatistics.h.
| using FrameStatistics::Clock = std::chrono::high_resolution_clock |
Definition at line 28 of file FrameStatistics.h.
| using FrameStatistics::Duration = Clock::duration |
Definition at line 29 of file FrameStatistics.h.
| using FrameStatistics::Timepoint = Clock::time_point |
Definition at line 30 of file FrameStatistics.h.
|
strong |
ID of the profiling section.
| Enumerator | |
|---|---|
| TrackPanel | Full repaint time of the TrackPanel. |
| WaveformView | Time required to draw a single clip. |
| WaveDataCache | Time required to access the data cache. |
| WaveBitmapCachePreprocess | Time required to build the structures required for the bitmap cache population. |
| WaveBitmapCache | Time required to access the wave bitmaps cache. |
| Count | Number of the sections. |
Definition at line 33 of file FrameStatistics.h.
Definition at line 121 of file FrameStatistics.cpp.
References FrameStatistics::Section::AddEvent(), Count, anonymous_namespace{FrameStatistics.cpp}::GetInstance(), FrameStatistics::UpdatePublisher::Invoke(), mSections, and mUpdatePublisher.
Referenced by FrameStatistics::Stopwatch::~Stopwatch().
|
staticnoexcept |
Create a Stopwatch for the section specified.
Definition at line 89 of file FrameStatistics.cpp.
References anonymous_namespace{FrameStatistics.cpp}::GetInstance(), TrackPanel, WaveBitmapCache, WaveBitmapCachePreprocess, WaveDataCache, and WaveformView.
Referenced by anonymous_namespace{WaveformView.cpp}::DrawClipWaveform(), WaveBitmapCache::InitializeElement(), WaveDataCache::InitializeElement(), TrackPanel::OnPaint(), and WaveBitmapCache::LookupHelper::PerformLookup().
|
staticnoexcept |
Get the section data.
Definition at line 106 of file FrameStatistics.cpp.
References Count, anonymous_namespace{FrameStatistics.cpp}::GetInstance(), and mSections.
Referenced by anonymous_namespace{FrameStatisticsDialog.cpp}::Dialog::SectionUpdated().
|
static |
Subscribe to sections update.
Definition at line 116 of file FrameStatistics.cpp.
References anonymous_namespace{FrameStatistics.cpp}::GetInstance(), mUpdatePublisher, and Observer::Publisher< Message, NotifyAll >::Subscribe().
Referenced by anonymous_namespace{FrameStatisticsDialog.cpp}::Dialog::Dialog().
|
private |
Definition at line 112 of file FrameStatistics.h.
Referenced by AddEvent(), and GetSection().
|
private |
Definition at line 114 of file FrameStatistics.h.
Referenced by AddEvent(), and Subscribe().