Ardour  9.0-pre0-822-g12e3bc5c20
LuaDialog::ProgressWindow Class Reference

#include <luadialog.h>

Inheritance diagram for LuaDialog::ProgressWindow:
[legend]

Public Member Functions

 ProgressWindow (std::string const &title, bool allow_cancel)
 
bool progress (float prog, std::string const &text="")
 
bool canceled () const
 
void done ()
 
- Public Member Functions inherited from ArdourDialog
 ArdourDialog (const std::string &title, bool modal=false, bool use_separator=false)
 
 ArdourDialog (Gtk::Window &parent, const std::string &title, bool modal=false, bool use_separator=false)
 
 ~ArdourDialog ()
 
bool on_focus_in_event (GdkEventFocus *)
 
bool on_focus_out_event (GdkEventFocus *)
 
bool on_delete_event (GdkEventAny *)
 
void on_unmap ()
 
void on_show ()
 
virtual void on_response (int)
 
void set_ui_sensitive (bool)
 
void disallow_idle ()
 
- Public Member Functions inherited from ARDOUR::SessionHandlePtr
 SessionHandlePtr (ARDOUR::Session *s)
 
 SessionHandlePtr ()
 
virtual ~SessionHandlePtr ()
 
virtual void set_session (ARDOUR::Session *)
 
virtual ARDOUR::Sessionsession () const
 

Private Member Functions

void cancel_clicked ()
 

Private Attributes

Gtk::ProgressBar _bar
 
bool _canceled
 

Additional Inherited Members

- Protected Member Functions inherited from ArdourDialog
void pop_splash ()
 
void close_self ()
 
- Protected Member Functions inherited from ARDOUR::SessionHandlePtr
virtual void session_going_away ()
 
- Protected Attributes inherited from ArdourDialog
bool _sensitive
 
- Protected Attributes inherited from ARDOUR::SessionHandlePtr
ARDOUR::Session_session
 
PBD::ScopedConnectionList _session_connections
 

Detailed Description

Synchronous GUI-thread Progress dialog

This shows a modal progress dialog with an optional "Cancel" button. Since it runs in the UI thread the script needs to regularly call progress(), as well as close the dialog, as needed.

Definition at line 112 of file luadialog.h.

Constructor & Destructor Documentation

◆ ProgressWindow()

LuaDialog::ProgressWindow::ProgressWindow ( std::string const &  title,
bool  allow_cancel 
)

Create a new progress window.

Parameters
titleWindow title
allow_cancelinclude a "Cancel" option

Member Function Documentation

◆ cancel_clicked()

void LuaDialog::ProgressWindow::cancel_clicked ( )
inlineprivate

Definition at line 140 of file luadialog.h.

◆ canceled()

bool LuaDialog::ProgressWindow::canceled ( ) const
inline

Definition at line 128 of file luadialog.h.

◆ done()

void LuaDialog::ProgressWindow::done ( )

Close and hide the dialog.

This is required to be at the end, since the dialog is modal and prevents other UI operations while visible.

◆ progress()

bool LuaDialog::ProgressWindow::progress ( float  prog,
std::string const &  text = "" 
)

Report progress and update GUI.

Parameters
progprogress in range 0..1 show a bar, values outside this range show a pulsing dialog.
textoptional text to show on the progress-bar
Returns
true if cancel was clicked, false otherwise

Member Data Documentation

◆ _bar

Gtk::ProgressBar LuaDialog::ProgressWindow::_bar
private

Definition at line 144 of file luadialog.h.

◆ _canceled

bool LuaDialog::ProgressWindow::_canceled
private

Definition at line 145 of file luadialog.h.


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