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 115 of file ShareAudioDialog.cpp.

Member Typedef Documentation

◆ Clock

Definition at line 167 of file ShareAudioDialog.cpp.

Constructor & Destructor Documentation

◆ ExportProgressHelper()

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

Definition at line 118 of file ShareAudioDialog.cpp.

119 : mParent(parent)
120 {
121 }

Member Function Documentation

◆ Cancel()

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

Definition at line 123 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 133 of file ShareAudioDialog.cpp.

136 {
137 mParent.UpdateProgress(numerator, denominator);
138
139 const auto now = Clock::now();
140
141 // Exporter polls in the main thread. To make the dialog responsive
142 // periodic yielding is required
143 if ((now - mLastYield > std::chrono::milliseconds(50)) || (numerator == denominator))
144 {
146 mLastYield = now;
147 }
148
151 }
void UpdateProgress(uint64_t current, uint64_t total)
void Yield()
Dispatch waiting events, including actions enqueued by CallAfter.
Definition: BasicUI.cpp:217

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 161 of file ShareAudioDialog.cpp.

162 {
163 }

◆ SetDialogTitle()

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

Change the dialog's title.

Implements BasicUI::ProgressDialog.

Definition at line 157 of file ShareAudioDialog.cpp.

158 {
159 }

◆ SetMessage()

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

Change an existing dialog's message.

Implements BasicUI::ProgressDialog.

Definition at line 153 of file ShareAudioDialog.cpp.

154 {
155 }

◆ WasCancelled()

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

Definition at line 128 of file ShareAudioDialog.cpp.

129 {
130 return mCancelled;
131 }

References mCancelled.

Member Data Documentation

◆ mCancelled

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

Definition at line 170 of file ShareAudioDialog.cpp.

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

◆ mLastYield

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

Definition at line 168 of file ShareAudioDialog.cpp.

Referenced by Poll().

◆ mParent

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

Definition at line 165 of file ShareAudioDialog.cpp.

Referenced by Poll().


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