1 #ifndef _IPLUGAPP_APP_MAIN_H_
2 #define _IPLUGAPP_APP_MAIN_H_
4 #include "IPlugOSDetect.h"
8 Standalone osx/win app wrapper for iPlug, using SWELL
13 App settings are stored in a .ini file. The location is as follows:
15 Windows7: C:\Users\USERNAME\AppData\Local\IPlugConvoEngine\settings.ini
16 Windows XP/Vista: C:\Documents and Settings\USERNAME\Local Settings\Application Data\IPlugConvoEngine\settings.ini
17 OSX: /Users/USERNAME/Library/Application\ Support/IPlugConvoEngine/settings.ini
25 #define DEFAULT_INPUT_DEV "Default Device"
26 #define DEFAULT_OUTPUT_DEV "Default Device"
30 #else if defined OS_OSX
32 #define SLEEP( milliseconds ) usleep( (unsigned long) (milliseconds * 1000.0) )
34 #define DEFAULT_INPUT_DEV "Built-in Input"
35 #define DEFAULT_OUTPUT_DEV "Built-in Output"
37 #define DAC_COREAUDIO 0
47 #include "../IPlugConvoEngine.h" // change this to match your iplug plugin .h file
49 typedef unsigned short UInt16
;
53 // on osx core audio 0 or jack 1
54 // on windows DS 0 or ASIO 1
55 UInt16 mAudioDriverType
;
58 char mAudioInDev
[100];
59 char mAudioOutDev
[100];
62 char mAudioSigVS
[100];
66 UInt16 mAudioOutChanL
;
67 UInt16 mAudioOutChanR
;
68 UInt16 mAudioInIsMono
;
70 // strings containing the names of the midi devices
72 char mMidiOutDev
[100];
78 mAudioDriverType(0), // DS / CoreAudio by default
86 strcpy(mAudioInDev
, DEFAULT_INPUT_DEV
);
87 strcpy(mAudioOutDev
, DEFAULT_OUTPUT_DEV
);
88 strcpy(mAudioSR
, "44100");
89 strcpy(mAudioIOVS
, "512");
90 strcpy(mAudioSigVS
, "32");
92 strcpy(mMidiInDev
, "off");
93 strcpy(mMidiOutDev
, "off");
97 extern WDL_DLGRET
MainDlgProc(HWND hwndDlg
, UINT uMsg
, WPARAM wParam
, LPARAM lParam
);
98 extern WDL_DLGRET
PreferencesDlgProc(HWND hwndDlg
, UINT uMsg
, WPARAM wParam
, LPARAM lParam
);
99 extern HINSTANCE gHINST
;
101 extern UINT gScrollMessage
;
102 extern IPlug
* gPluginInstance
; // The iplug plugin instance
104 extern std::string
GetAudioDeviceName(int idx
);
105 extern int GetAudioDeviceID(char* deviceNameToTest
);
107 extern void ProbeAudioIO();
108 extern bool InitialiseAudio(unsigned int inId
,
113 unsigned int inChanL
,
114 unsigned int outChanL
117 extern bool AudioSettingsInStateAreEqual(AppState
* os
, AppState
* ns
);
118 extern bool MIDISettingsInStateAreEqual(AppState
* os
, AppState
* ns
);
120 extern bool TryToChangeAudioDriverType();
121 extern bool TryToChangeAudio();
122 extern bool ChooseMidiInput(const char* pPortName
);
123 extern bool ChooseMidiOutput(const char* pPortName
);
125 extern bool AttachGUI();
127 extern RtAudio
* gDAC
;
128 extern RtMidiIn
*gMidiIn
;
129 extern RtMidiOut
*gMidiOut
;
131 extern AppState
*gState
;
132 extern AppState
*gTempState
; // The state is copied here when the pref dialog is opened, and restored if cancel is pressed
133 extern AppState
*gActiveState
; // When the audio driver is started the current state is copied here so that if OK is pressed after APPLY nothing is changed
135 extern unsigned int gSigVS
;
136 extern unsigned int gBufIndex
; // index for signal vector, loops from 0 to gSigVS
138 extern char *gINIPath
; // path of ini file
139 extern void UpdateINI();
141 extern std::vector
<unsigned int> gAudioInputDevs
;
142 extern std::vector
<unsigned int> gAudioOutputDevs
;
143 extern std::vector
<std::string
> gMIDIInputDevNames
;
144 extern std::vector
<std::string
> gMIDIOutputDevNames
;
146 #endif //_IPLUGAPP_APP_MAIN_H_