Audacity 3.2.0
Public Types | Public Member Functions | Public Attributes | List of all members
cloud::audiocom::ShareAudioDialog::ExportProgressHelper Struct Referencefinal
Inheritance diagram for cloud::audiocom::ShareAudioDialog::ExportProgressHelper:
[legend]
Collaboration diagram for cloud::audiocom::ShareAudioDialog::ExportProgressHelper:
[legend]

Public Types

using Clock = std::chrono::steady_clock
 

Public Member Functions

 ExportProgressHelper (ShareAudioDialog &parent)
 
void Cancel ()
 
bool WasCancelled ()
 
BasicUI::ProgressResult Poll (unsigned long long numerator, unsigned long long denominator, const TranslatableString &) override
 Update the bar and poll for clicks. Call only on the main thread. More...
 
void SetMessage (const TranslatableString &) override
 Change an existing dialog's message. More...
 
void SetDialogTitle (const TranslatableString &) override
 Change the dialog's title. More...
 
void Reinit () override
 Reset the dialog state. More...
 
- Public Member Functions inherited from BasicUI::ProgressDialog
virtual ~ProgressDialog ()
 
virtual ProgressResult Poll (unsigned long long numerator, unsigned long long denominator, const TranslatableString &message={})=0
 Update the bar and poll for clicks. Call only on the main thread. More...
 
virtual void SetMessage (const TranslatableString &message)=0
 Change an existing dialog's message. More...
 
virtual void SetDialogTitle (const TranslatableString &title)=0
 Change the dialog's title. More...
 
virtual void Reinit ()=0
 Reset the dialog state. More...
 

Public Attributes

ShareAudioDialogmParent
 
Clock::time_point mLastYield
 
bool mCancelled { false }
 

Detailed Description

Definition at line 109 of file ShareAudioDialog.cpp.

Member Typedef Documentation

◆ Clock

Definition at line 161 of file ShareAudioDialog.cpp.

Constructor & Destructor Documentation

◆ ExportProgressHelper()

cloud::audiocom::ShareAudioDialog::ExportProgressHelper::ExportProgressHelper ( ShareAudioDialog parent)
inlineexplicit

Definition at line 112 of file ShareAudioDialog.cpp.

113 : mParent(parent)
114 {
115 }

Member Function Documentation

◆ Cancel()

void cloud::audiocom::ShareAudioDialog::ExportProgressHelper::Cancel ( )
inline

Definition at line 117 of file ShareAudioDialog.cpp.

References mCancelled.

Referenced by cloud::audiocom::ShareAudioDialog::OnCancel().

Here is the caller graph for this function:

◆ Poll()

BasicUI::ProgressResult cloud::audiocom::ShareAudioDialog::ExportProgressHelper::Poll ( unsigned long long  numerator,
unsigned long long  denominator,
const TranslatableString message 
)
inlineoverridevirtual

Update the bar and poll for clicks. Call only on the main thread.

Implements BasicUI::ProgressDialog.

Definition at line 127 of file ShareAudioDialog.cpp.

130 {
131 mParent.UpdateProgress(numerator, denominator);
132
133 const auto now = Clock::now();
134
135 // Exporter polls in the main thread. To make the dialog responsive
136 // periodic yielding is required
137 if ((now - mLastYield > std::chrono::milliseconds(50)) || (numerator == denominator))
138 {
140 mLastYield = now;
141 }
142
145 }
void UpdateProgress(uint64_t current, uint64_t total)
void Yield()
Dispatch waiting events, including actions enqueued by CallAfter.
Definition: BasicUI.cpp:219

References BasicUI::Cancelled, mCancelled, mLastYield, mParent, BasicUI::Success, cloud::audiocom::ShareAudioDialog::UpdateProgress(), and BasicUI::Yield().

Here is the call graph for this function:

◆ Reinit()

void cloud::audiocom::ShareAudioDialog::ExportProgressHelper::Reinit ( )
inlineoverridevirtual

Reset the dialog state.

Implements BasicUI::ProgressDialog.

Definition at line 155 of file ShareAudioDialog.cpp.

156 {
157 }

◆ SetDialogTitle()

void cloud::audiocom::ShareAudioDialog::ExportProgressHelper::SetDialogTitle ( const TranslatableString title)
inlineoverridevirtual

Change the dialog's title.

Implements BasicUI::ProgressDialog.

Definition at line 151 of file ShareAudioDialog.cpp.

152 {
153 }

◆ SetMessage()

void cloud::audiocom::ShareAudioDialog::ExportProgressHelper::SetMessage ( const TranslatableString message)
inlineoverridevirtual

Change an existing dialog's message.

Implements BasicUI::ProgressDialog.

Definition at line 147 of file ShareAudioDialog.cpp.

148 {
149 }

◆ WasCancelled()

bool cloud::audiocom::ShareAudioDialog::ExportProgressHelper::WasCancelled ( )
inline

Definition at line 122 of file ShareAudioDialog.cpp.

123 {
124 return mCancelled;
125 }

References mCancelled.

Member Data Documentation

◆ mCancelled

bool cloud::audiocom::ShareAudioDialog::ExportProgressHelper::mCancelled { false }

Definition at line 164 of file ShareAudioDialog.cpp.

Referenced by Cancel(), Poll(), and WasCancelled().

◆ mLastYield

Clock::time_point cloud::audiocom::ShareAudioDialog::ExportProgressHelper::mLastYield

Definition at line 162 of file ShareAudioDialog.cpp.

Referenced by Poll().

◆ mParent

ShareAudioDialog& cloud::audiocom::ShareAudioDialog::ExportProgressHelper::mParent

Definition at line 159 of file ShareAudioDialog.cpp.

Referenced by Poll().


The documentation for this struct was generated from the following file: