iPlug2 - C++ Audio Plug-in Framework
Loading...
Searching...
No Matches
Classes | Public Member Functions | Static Public Member Functions | Static Public Attributes | Friends | List of all members
IPlugAPPHost Class Reference

A class that hosts an IPlug as a standalone app and provides Audio/Midi I/O. More...

#include <IPlugAPP_host.h>

Classes

struct  AppState
 Used to manage changes to app I/O. More...
 

Public Member Functions

void SetScreenshotPath (const char *path)
 Set screenshot path for CLI screenshot mode. More...
 
const char * GetScreenshotPath () const
 Get screenshot path (empty if not in screenshot mode) More...
 
bool IsScreenshotMode () const
 Check if in screenshot mode. More...
 
void SetNoIO (bool noIO)
 Set no-I/O mode (disables audio and MIDI initialization) More...
 
bool IsNoIO () const
 Check if I/O is disabled. More...
 
void PopulateSampleRateList (HWND hwndDlg, RtAudio::DeviceInfo *pInputDevInfo, RtAudio::DeviceInfo *pOutputDevInfo)
 
void PopulateAudioInputList (HWND hwndDlg, RtAudio::DeviceInfo *pInfo)
 
void PopulateAudioOutputList (HWND hwndDlg, RtAudio::DeviceInfo *pInfo)
 
void PopulateDriverSpecificControls (HWND hwndDlg)
 
void PopulateAudioDialogs (HWND hwndDlg)
 
bool PopulateMidiDialogs (HWND hwndDlg)
 
void PopulatePreferencesDialog (HWND hwndDlg)
 
bool OpenWindow (HWND pParent)
 
void CloseWindow ()
 
bool Init ()
 
bool InitState ()
 
void UpdateINI ()
 
std::string GetAudioDeviceName (uint32_t deviceID) const
 Returns the name of the audio device with a given RTAudio device ID. More...
 
std::optional< uint32_t > GetAudioDeviceID (const char *name) const
 Returns the a validated audio device ID linked to a particular name. More...
 
int GetMIDIPortNumber (ERoute direction, const char *name) const
 
void ProbeAudioIO ()
 
void ProbeMidiIO ()
 
bool InitMidi ()
 
void CloseAudio ()
 
bool InitAudio (uint32_t inId, uint32_t outId, uint32_t sr, uint32_t iovs)
 
bool AudioSettingsInStateAreEqual (AppState &os, AppState &ns)
 
bool MIDISettingsInStateAreEqual (AppState &os, AppState &ns)
 
bool TryToChangeAudioDriverType ()
 
bool TryToChangeAudio ()
 
bool SelectMIDIDevice (ERoute direction, const char *portName)
 
IPlugAPPGetPlug ()
 

Static Public Member Functions

static IPlugAPPHostCreate ()
 
static int AudioCallback (void *pOutputBuffer, void *pInputBuffer, uint32_t nFrames, double streamTime, RtAudioStreamStatus status, void *pUserData)
 
static void MIDICallback (double deltatime, std::vector< uint8_t > *pMsg, void *pUserData)
 
static void ErrorCallback (RtAudioErrorType type, const std::string &errorText)
 
static WDL_DLGRET PreferencesDlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static WDL_DLGRET MainDlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 

Static Public Attributes

static std::unique_ptr< IPlugAPPHostsInstance
 

Friends

class IPlugAPP
 

Detailed Description

A class that hosts an IPlug as a standalone app and provides Audio/Midi I/O.

Definition at line 82 of file IPlugAPP_host.h.

Constructor & Destructor Documentation

◆ IPlugAPPHost()

IPlugAPPHost::IPlugAPPHost ( )

Definition at line 31 of file IPlugAPP_host.cpp.

◆ ~IPlugAPPHost()

IPlugAPPHost::~IPlugAPPHost ( )

Definition at line 36 of file IPlugAPP_host.cpp.

Member Function Documentation

◆ AudioCallback()

int IPlugAPPHost::AudioCallback ( void *  pOutputBuffer,
void *  pInputBuffer,
uint32_t  nFrames,
double  streamTime,
RtAudioStreamStatus  status,
void *  pUserData 
)
static

Definition at line 701 of file IPlugAPP_host.cpp.

◆ AudioSettingsInStateAreEqual()

bool IPlugAPPHost::AudioSettingsInStateAreEqual ( AppState os,
AppState ns 
)

Definition at line 351 of file IPlugAPP_host.cpp.

◆ CloseAudio()

void IPlugAPPHost::CloseAudio ( )

Definition at line 567 of file IPlugAPP_host.cpp.

◆ CloseWindow()

void IPlugAPPHost::CloseWindow ( )

Definition at line 81 of file IPlugAPP_host.cpp.

◆ Create()

IPlugAPPHost * IPlugAPPHost::Create ( )
static

Definition at line 50 of file IPlugAPP_host.cpp.

◆ ErrorCallback()

void IPlugAPPHost::ErrorCallback ( RtAudioErrorType  type,
const std::string &  errorText 
)
static

Definition at line 797 of file IPlugAPP_host.cpp.

◆ GetAudioDeviceID()

std::optional< uint32_t > IPlugAPPHost::GetAudioDeviceID ( const char *  name) const

Returns the a validated audio device ID linked to a particular name.

Parameters
nameThe name of the audio device to test
Returns
The ID RTAudio has given the audio device if found

Definition at line 219 of file IPlugAPP_host.cpp.

References GetAudioDeviceName().

◆ GetAudioDeviceName()

std::string IPlugAPPHost::GetAudioDeviceName ( uint32_t  deviceID) const

Returns the name of the audio device with a given RTAudio device ID.

Parameters
deviceIDThe ID RTAudio has given the audio device
Returns
The device name. Core Audio device names are truncated.

Definition at line 203 of file IPlugAPP_host.cpp.

Referenced by GetAudioDeviceID().

◆ GetMIDIPortNumber()

int IPlugAPPHost::GetMIDIPortNumber ( ERoute  direction,
const char *  name 
) const
Parameters
directionEither kInput or kOutput
nameThe name of the midi device
Returns
An integer specifying the output port number, where 0 means any

Definition at line 236 of file IPlugAPP_host.cpp.

◆ GetPlug()

IPlugAPP * IPlugAPPHost::GetPlug ( )
inline

Definition at line 234 of file IPlugAPP_host.h.

◆ GetScreenshotPath()

const char * IPlugAPPHost::GetScreenshotPath ( ) const
inline

Get screenshot path (empty if not in screenshot mode)

Returns
The screenshot path or empty string

Definition at line 168 of file IPlugAPP_host.h.

◆ Init()

bool IPlugAPPHost::Init ( )

Definition at line 56 of file IPlugAPP_host.cpp.

◆ InitAudio()

bool IPlugAPPHost::InitAudio ( uint32_t  inId,
uint32_t  outId,
uint32_t  sr,
uint32_t  iovs 
)

Definition at line 585 of file IPlugAPP_host.cpp.

◆ InitMidi()

bool IPlugAPPHost::InitMidi ( )

Definition at line 647 of file IPlugAPP_host.cpp.

◆ InitState()

bool IPlugAPPHost::InitState ( )

Definition at line 86 of file IPlugAPP_host.cpp.

◆ IsNoIO()

bool IPlugAPPHost::IsNoIO ( ) const
inline

Check if I/O is disabled.

Returns
true if audio and MIDI I/O is disabled

Definition at line 180 of file IPlugAPP_host.h.

◆ IsScreenshotMode()

bool IPlugAPPHost::IsScreenshotMode ( ) const
inline

Check if in screenshot mode.

Returns
true if a screenshot should be taken and app should exit

Definition at line 172 of file IPlugAPP_host.h.

◆ MainDlgProc()

WDL_DLGRET IPlugAPPHost::MainDlgProc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 548 of file IPlugAPP_dialog.cpp.

◆ MIDICallback()

void IPlugAPPHost::MIDICallback ( double  deltatime,
std::vector< uint8_t > *  pMsg,
void *  pUserData 
)
static

Definition at line 765 of file IPlugAPP_host.cpp.

◆ MIDISettingsInStateAreEqual()

bool IPlugAPPHost::MIDISettingsInStateAreEqual ( AppState os,
AppState ns 
)

Definition at line 367 of file IPlugAPP_host.cpp.

◆ OpenWindow()

bool IPlugAPPHost::OpenWindow ( HWND  pParent)

Definition at line 76 of file IPlugAPP_host.cpp.

◆ PopulateAudioDialogs()

void IPlugAPPHost::PopulateAudioDialogs ( HWND  hwndDlg)

Definition at line 184 of file IPlugAPP_dialog.cpp.

◆ PopulateAudioInputList()

void IPlugAPPHost::PopulateAudioInputList ( HWND  hwndDlg,
RtAudio::DeviceInfo *  pInfo 
)

Definition at line 70 of file IPlugAPP_dialog.cpp.

◆ PopulateAudioOutputList()

void IPlugAPPHost::PopulateAudioOutputList ( HWND  hwndDlg,
RtAudio::DeviceInfo *  pInfo 
)

Definition at line 94 of file IPlugAPP_dialog.cpp.

◆ PopulateDriverSpecificControls()

void IPlugAPPHost::PopulateDriverSpecificControls ( HWND  hwndDlg)

Definition at line 119 of file IPlugAPP_dialog.cpp.

◆ PopulateMidiDialogs()

bool IPlugAPPHost::PopulateMidiDialogs ( HWND  hwndDlg)

Definition at line 210 of file IPlugAPP_dialog.cpp.

◆ PopulateSampleRateList()

void IPlugAPPHost::PopulateSampleRateList ( HWND  hwndDlg,
RtAudio::DeviceInfo *  pInputDevInfo,
RtAudio::DeviceInfo *  pOutputDevInfo 
)

Definition at line 39 of file IPlugAPP_dialog.cpp.

◆ PreferencesDlgProc()

WDL_DLGRET IPlugAPPHost::PreferencesDlgProc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 296 of file IPlugAPP_dialog.cpp.

◆ ProbeAudioIO()

void IPlugAPPHost::ProbeAudioIO ( )

Definition at line 276 of file IPlugAPP_host.cpp.

◆ ProbeMidiIO()

void IPlugAPPHost::ProbeMidiIO ( )

Definition at line 316 of file IPlugAPP_host.cpp.

◆ SelectMIDIDevice()

bool IPlugAPPHost::SelectMIDIDevice ( ERoute  direction,
const char *  portName 
)

Definition at line 477 of file IPlugAPP_host.cpp.

◆ SetNoIO()

void IPlugAPPHost::SetNoIO ( bool  noIO)
inline

Set no-I/O mode (disables audio and MIDI initialization)

Parameters
noIOtrue to disable I/O

Definition at line 176 of file IPlugAPP_host.h.

◆ SetScreenshotPath()

void IPlugAPPHost::SetScreenshotPath ( const char *  path)
inline

Set screenshot path for CLI screenshot mode.

Parameters
pathPath to save the screenshot to (empty to disable)

Definition at line 164 of file IPlugAPP_host.h.

◆ TryToChangeAudio()

bool IPlugAPPHost::TryToChangeAudio ( )

Definition at line 413 of file IPlugAPP_host.cpp.

◆ TryToChangeAudioDriverType()

bool IPlugAPPHost::TryToChangeAudioDriverType ( )

Definition at line 377 of file IPlugAPP_host.cpp.

◆ UpdateINI()

void IPlugAPPHost::UpdateINI ( )

Definition at line 165 of file IPlugAPP_host.cpp.

Friends And Related Function Documentation

◆ IPlugAPP

friend class IPlugAPP
friend

Definition at line 275 of file IPlugAPP_host.h.

Member Data Documentation

◆ sInstance

std::unique_ptr< IPlugAPPHost > IPlugAPPHost::sInstance
static

Definition at line 160 of file IPlugAPP_host.h.


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