DISTRHO Plugin Framework
Public Member Functions | Friends | List of all members
Application Class Reference

#include <Application.hpp>

Public Member Functions

 Application (bool isStandalone=true)
 
virtual ~Application ()
 
void idle ()
 
void exec (uint idleTimeInMs=10)
 
void quit ()
 
bool isQuiting () const noexcept
 
void addIdleCallback (IdleCallback *callback)
 
void removeIdleCallback (IdleCallback *callback)
 

Friends

class Window
 

Detailed Description

Base DGL Application class.

One application instance is required for creating a window. There's no single/global application instance in DGL, and multiple windows can share the same app instance.

In standalone mode an application will automatically quit its event-loop when all its windows are closed.

Constructor & Destructor Documentation

◆ Application()

Application::Application ( bool  isStandalone = true)

Constructor.

◆ ~Application()

virtual Application::~Application ( )
virtual

Destructor.

Member Function Documentation

◆ idle()

void Application::idle ( )

Idle function. This runs the application event-loop once.

◆ exec()

void Application::exec ( uint  idleTimeInMs = 10)

Run the application event-loop until all Windows are closed. idle() is called at regular intervals.

Note
This function is meant for standalones only, never call this from plugins.

◆ quit()

void Application::quit ( )

Quit the application. This stops the event-loop and closes all Windows.

Note
This function is meant for standalones only, never call this from plugins.

◆ isQuiting()

bool Application::isQuiting ( ) const
noexcept

Check if the application is about to quit. Returning true means there's no event-loop running at the moment (or it's just about to stop).

◆ addIdleCallback()

void Application::addIdleCallback ( IdleCallback callback)

Add a callback function to be triggered on every idle cycle. You can add more than one, and remove them at anytime with removeIdleCallback(). Idle callbacks trigger right after OS event handling and Window idle events (within the same cycle). There are no guarantees in terms of timing.

◆ removeIdleCallback()

void Application::removeIdleCallback ( IdleCallback callback)

Remove an idle callback previously added via addIdleCallback().


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