ConfigAudio.cpp 65 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439
  1. /*
  2. ==============================================================================
  3. This is an automatically generated GUI class created by the Introjucer!
  4. Be careful when adding custom code to these files, as only the code within
  5. the "//[xyz]" and "//[/xyz]" sections will be retained when the file is loaded
  6. and re-saved.
  7. Created with Introjucer version: 3.1.0
  8. ------------------------------------------------------------------------------
  9. The Introjucer is part of the JUCE library - "Jules' Utility Class Extensions"
  10. Copyright 2004-13 by Raw Material Software Ltd.
  11. ==============================================================================
  12. */
  13. //[Headers] You can add your own extra header files here...
  14. #include "LinJam.h"
  15. #include "Constants.h"
  16. #include "./Trace/TraceConfig.h"
  17. //[/Headers]
  18. #include "ConfigAudio.h"
  19. //[MiscUserDefs] You can add your own user definitions and misc code here...
  20. //[/MiscUserDefs]
  21. //==============================================================================
  22. ConfigAudio::ConfigAudio (ValueTree config_store)
  23. : configStore(config_store)
  24. {
  25. addAndMakeVisible (ioGroup = new GroupComponent ("ioGroup",
  26. TRANS("i/o")));
  27. ioGroup->setTextLabelPosition (Justification::centredLeft);
  28. ioGroup->setColour (GroupComponent::outlineColourId, Colours::grey);
  29. ioGroup->setColour (GroupComponent::textColourId, Colours::white);
  30. addAndMakeVisible (formatGroup = new GroupComponent ("formatGroup",
  31. TRANS("format")));
  32. formatGroup->setTextLabelPosition (Justification::centredLeft);
  33. formatGroup->setColour (GroupComponent::outlineColourId, Colours::grey);
  34. formatGroup->setColour (GroupComponent::textColourId, Colours::white);
  35. addAndMakeVisible (buffersGroup = new GroupComponent ("buffersGroup",
  36. TRANS("buffers (122.2ms)")));
  37. buffersGroup->setTextLabelPosition (Justification::centredLeft);
  38. buffersGroup->setColour (GroupComponent::outlineColourId, Colours::grey);
  39. buffersGroup->setColour (GroupComponent::textColourId, Colours::white);
  40. addAndMakeVisible (routingGroup = new GroupComponent ("routingGroup",
  41. TRANS("routing")));
  42. routingGroup->setTextLabelPosition (Justification::centredLeft);
  43. routingGroup->setColour (GroupComponent::outlineColourId, Colours::grey);
  44. routingGroup->setColour (GroupComponent::textColourId, Colours::white);
  45. addAndMakeVisible (defaultsButton = new TextButton ("defaultsButton"));
  46. defaultsButton->setButtonText (TRANS("defaults"));
  47. defaultsButton->addListener (this);
  48. addAndMakeVisible (asioButton = new TextButton ("asioButton"));
  49. asioButton->setButtonText (TRANS("asio config"));
  50. asioButton->addListener (this);
  51. addAndMakeVisible (modeLabel = new Label ("modeLabel",
  52. TRANS("interface:")));
  53. modeLabel->setFont (Font (15.00f, Font::plain));
  54. modeLabel->setJustificationType (Justification::centredLeft);
  55. modeLabel->setEditable (false, false, false);
  56. modeLabel->setColour (Label::textColourId, Colours::white);
  57. modeLabel->setColour (TextEditor::textColourId, Colours::black);
  58. modeLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000));
  59. addAndMakeVisible (modeComboBox = new ComboBox ("modeComboBox"));
  60. modeComboBox->setExplicitFocusOrder (1);
  61. modeComboBox->setEditableText (false);
  62. modeComboBox->setJustificationType (Justification::centredLeft);
  63. modeComboBox->setTextWhenNothingSelected (String::empty);
  64. modeComboBox->setTextWhenNoChoicesAvailable (TRANS("(no choices)"));
  65. modeComboBox->addListener (this);
  66. addAndMakeVisible (driverLabel = new Label ("driverLabel",
  67. TRANS("driver:")));
  68. driverLabel->setFont (Font (15.00f, Font::plain));
  69. driverLabel->setJustificationType (Justification::centredLeft);
  70. driverLabel->setEditable (false, false, false);
  71. driverLabel->setColour (Label::textColourId, Colours::white);
  72. driverLabel->setColour (TextEditor::textColourId, Colours::black);
  73. driverLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000));
  74. addAndMakeVisible (driverComboBox = new ComboBox ("driverComboBox"));
  75. driverComboBox->setExplicitFocusOrder (1);
  76. driverComboBox->setEditableText (false);
  77. driverComboBox->setJustificationType (Justification::centredLeft);
  78. driverComboBox->setTextWhenNothingSelected (String::empty);
  79. driverComboBox->setTextWhenNoChoicesAvailable (TRANS("(no choices)"));
  80. driverComboBox->addListener (this);
  81. addAndMakeVisible (sourceLabel = new Label ("sourceLabel",
  82. TRANS("input:")));
  83. sourceLabel->setFont (Font (15.00f, Font::plain));
  84. sourceLabel->setJustificationType (Justification::centredLeft);
  85. sourceLabel->setEditable (false, false, false);
  86. sourceLabel->setColour (Label::textColourId, Colours::white);
  87. sourceLabel->setColour (TextEditor::textColourId, Colours::black);
  88. sourceLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000));
  89. addAndMakeVisible (sourceComboBox = new ComboBox ("sourceComboBox"));
  90. sourceComboBox->setExplicitFocusOrder (2);
  91. sourceComboBox->setEditableText (false);
  92. sourceComboBox->setJustificationType (Justification::centredLeft);
  93. sourceComboBox->setTextWhenNothingSelected (String::empty);
  94. sourceComboBox->setTextWhenNoChoicesAvailable (TRANS("(no choices)"));
  95. sourceComboBox->addListener (this);
  96. addAndMakeVisible (sinkLabel = new Label ("sinkLabel",
  97. TRANS("output:")));
  98. sinkLabel->setFont (Font (15.00f, Font::plain));
  99. sinkLabel->setJustificationType (Justification::centredLeft);
  100. sinkLabel->setEditable (false, false, false);
  101. sinkLabel->setColour (Label::textColourId, Colours::white);
  102. sinkLabel->setColour (TextEditor::textColourId, Colours::black);
  103. sinkLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000));
  104. addAndMakeVisible (sinkComboBox = new ComboBox ("sinkComboBox"));
  105. sinkComboBox->setExplicitFocusOrder (3);
  106. sinkComboBox->setEditableText (false);
  107. sinkComboBox->setJustificationType (Justification::centredLeft);
  108. sinkComboBox->setTextWhenNothingSelected (String::empty);
  109. sinkComboBox->setTextWhenNoChoicesAvailable (TRANS("(no choices)"));
  110. sinkComboBox->addListener (this);
  111. addAndMakeVisible (bitdepthLabel = new Label ("bitdepthLabel",
  112. TRANS("bit depth:")));
  113. bitdepthLabel->setFont (Font (15.00f, Font::plain));
  114. bitdepthLabel->setJustificationType (Justification::centredLeft);
  115. bitdepthLabel->setEditable (false, false, false);
  116. bitdepthLabel->setColour (Label::textColourId, Colours::white);
  117. bitdepthLabel->setColour (TextEditor::textColourId, Colours::black);
  118. bitdepthLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000));
  119. addAndMakeVisible (bps16Button = new ToggleButton ("bps16Button"));
  120. bps16Button->setExplicitFocusOrder (4);
  121. bps16Button->setButtonText (TRANS("16bit"));
  122. bps16Button->setRadioGroupId (1);
  123. bps16Button->addListener (this);
  124. bps16Button->setToggleState (true, dontSendNotification);
  125. bps16Button->setColour (ToggleButton::textColourId, Colours::white);
  126. addAndMakeVisible (bps24Button = new ToggleButton ("bps24Button"));
  127. bps24Button->setExplicitFocusOrder (5);
  128. bps24Button->setButtonText (TRANS("24bit"));
  129. bps24Button->setRadioGroupId (1);
  130. bps24Button->addListener (this);
  131. bps24Button->setColour (ToggleButton::textColourId, Colours::white);
  132. addAndMakeVisible (bps32Button = new ToggleButton ("bps32Button"));
  133. bps32Button->setExplicitFocusOrder (6);
  134. bps32Button->setButtonText (TRANS("32bit"));
  135. bps32Button->setRadioGroupId (1);
  136. bps32Button->addListener (this);
  137. bps32Button->setColour (ToggleButton::textColourId, Colours::white);
  138. addAndMakeVisible (samplerateLabel = new Label ("samplerateLabel",
  139. TRANS("sample rate:")));
  140. samplerateLabel->setFont (Font (15.00f, Font::plain));
  141. samplerateLabel->setJustificationType (Justification::centredLeft);
  142. samplerateLabel->setEditable (false, false, false);
  143. samplerateLabel->setColour (Label::textColourId, Colours::white);
  144. samplerateLabel->setColour (TextEditor::textColourId, Colours::black);
  145. samplerateLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000));
  146. addAndMakeVisible (kHz44Button = new ToggleButton ("kHz44Button"));
  147. kHz44Button->setExplicitFocusOrder (7);
  148. kHz44Button->setButtonText (TRANS("44.1kHz"));
  149. kHz44Button->setRadioGroupId (2);
  150. kHz44Button->addListener (this);
  151. kHz44Button->setToggleState (true, dontSendNotification);
  152. kHz44Button->setColour (ToggleButton::textColourId, Colours::white);
  153. addAndMakeVisible (kHz48Button = new ToggleButton ("kHz48Button"));
  154. kHz48Button->setExplicitFocusOrder (8);
  155. kHz48Button->setButtonText (TRANS("48kHz"));
  156. kHz48Button->setRadioGroupId (2);
  157. kHz48Button->addListener (this);
  158. kHz48Button->setColour (ToggleButton::textColourId, Colours::white);
  159. addAndMakeVisible (kHz96Button = new ToggleButton ("kHz96Button"));
  160. kHz96Button->setExplicitFocusOrder (9);
  161. kHz96Button->setButtonText (TRANS("96kHz"));
  162. kHz96Button->setRadioGroupId (2);
  163. kHz96Button->addListener (this);
  164. kHz96Button->setColour (ToggleButton::textColourId, Colours::white);
  165. addAndMakeVisible (buffersLabel = new Label ("buffersLabel",
  166. TRANS("# of buffers")));
  167. buffersLabel->setFont (Font (15.00f, Font::plain));
  168. buffersLabel->setJustificationType (Justification::centredLeft);
  169. buffersLabel->setEditable (false, false, false);
  170. buffersLabel->setColour (Label::textColourId, Colours::white);
  171. buffersLabel->setColour (TextEditor::textColourId, Colours::black);
  172. buffersLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000));
  173. addAndMakeVisible (nBuffersSlider = new Slider ("nBuffersSlider"));
  174. nBuffersSlider->setExplicitFocusOrder (10);
  175. nBuffersSlider->setRange (0, 16, 1);
  176. nBuffersSlider->setSliderStyle (Slider::IncDecButtons);
  177. nBuffersSlider->setTextBoxStyle (Slider::TextBoxLeft, true, 80, 20);
  178. nBuffersSlider->addListener (this);
  179. addAndMakeVisible (xLabel = new Label ("xLabel",
  180. TRANS("x")));
  181. xLabel->setFont (Font (15.00f, Font::plain));
  182. xLabel->setJustificationType (Justification::centredLeft);
  183. xLabel->setEditable (false, false, false);
  184. xLabel->setColour (Label::textColourId, Colours::white);
  185. xLabel->setColour (TextEditor::textColourId, Colours::black);
  186. xLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000));
  187. addAndMakeVisible (bufferComboBox = new ComboBox ("bufferComboBox"));
  188. bufferComboBox->setExplicitFocusOrder (11);
  189. bufferComboBox->setEditableText (false);
  190. bufferComboBox->setJustificationType (Justification::centredLeft);
  191. bufferComboBox->setTextWhenNothingSelected (String::empty);
  192. bufferComboBox->setTextWhenNoChoicesAvailable (TRANS("(no choices)"));
  193. bufferComboBox->addListener (this);
  194. addAndMakeVisible (bytesLabel = new Label ("bytesLabel",
  195. TRANS("bytes")));
  196. bytesLabel->setFont (Font (15.00f, Font::plain));
  197. bytesLabel->setJustificationType (Justification::centredLeft);
  198. bytesLabel->setEditable (false, false, false);
  199. bytesLabel->setColour (Label::textColourId, Colours::white);
  200. bytesLabel->setColour (TextEditor::textColourId, Colours::black);
  201. bytesLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000));
  202. addAndMakeVisible (nixConfigLabel = new Label ("nixConfigLabel",
  203. TRANS("client name")));
  204. nixConfigLabel->setFont (Font (15.00f, Font::plain));
  205. nixConfigLabel->setJustificationType (Justification::centredLeft);
  206. nixConfigLabel->setEditable (false, false, false);
  207. nixConfigLabel->setColour (Label::textColourId, Colours::white);
  208. nixConfigLabel->setColour (TextEditor::textColourId, Colours::black);
  209. nixConfigLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000));
  210. addAndMakeVisible (nixConfigText = new TextEditor ("nixConfigText"));
  211. nixConfigText->setExplicitFocusOrder (12);
  212. nixConfigText->setMultiLine (false);
  213. nixConfigText->setReturnKeyStartsNewLine (false);
  214. nixConfigText->setReadOnly (false);
  215. nixConfigText->setScrollbarsShown (true);
  216. nixConfigText->setCaretVisible (true);
  217. nixConfigText->setPopupMenuEnabled (false);
  218. nixConfigText->setColour (TextEditor::textColourId, Colours::grey);
  219. nixConfigText->setColour (TextEditor::backgroundColourId, Colours::black);
  220. nixConfigText->setText (String::empty);
  221. addAndMakeVisible (nSourcesLabel = new Label ("nSourcesLabel",
  222. TRANS("# of sources")));
  223. nSourcesLabel->setFont (Font (15.00f, Font::plain));
  224. nSourcesLabel->setJustificationType (Justification::centredLeft);
  225. nSourcesLabel->setEditable (false, false, false);
  226. nSourcesLabel->setColour (Label::textColourId, Colours::white);
  227. nSourcesLabel->setColour (TextEditor::textColourId, Colours::black);
  228. nSourcesLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000));
  229. addAndMakeVisible (nSourcesSlider = new Slider ("nSourcesSlider"));
  230. nSourcesSlider->setExplicitFocusOrder (13);
  231. nSourcesSlider->setRange (0, 16, 1);
  232. nSourcesSlider->setSliderStyle (Slider::IncDecButtons);
  233. nSourcesSlider->setTextBoxStyle (Slider::TextBoxLeft, true, 80, 20);
  234. nSourcesSlider->addListener (this);
  235. addAndMakeVisible (nSinksLabel = new Label ("nSinksLabel",
  236. TRANS("# of sinks")));
  237. nSinksLabel->setFont (Font (15.00f, Font::plain));
  238. nSinksLabel->setJustificationType (Justification::centredLeft);
  239. nSinksLabel->setEditable (false, false, false);
  240. nSinksLabel->setColour (Label::textColourId, Colours::white);
  241. nSinksLabel->setColour (TextEditor::textColourId, Colours::black);
  242. nSinksLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000));
  243. addAndMakeVisible (nSinksSlider = new Slider ("nSinksSlider"));
  244. nSinksSlider->setExplicitFocusOrder (14);
  245. nSinksSlider->setRange (0, 16, 1);
  246. nSinksSlider->setSliderStyle (Slider::IncDecButtons);
  247. nSinksSlider->setTextBoxStyle (Slider::TextBoxLeft, true, 80, 20);
  248. nSinksSlider->addListener (this);
  249. //[UserPreSize]
  250. //[/UserPreSize]
  251. setSize (614, 434);
  252. //[Constructor] You can add your own custom stuff here..
  253. #ifdef _WIN32
  254. int win_interface_n = int(this->configStore[CONFIG::WIN_AUDIO_IF_ID]) ;
  255. this->modeComboBox->addItemList(CLIENT::WIN_AUDIO_IFS , 1) ;
  256. this->modeComboBox->setSelectedItemIndex(win_interface_n , juce::dontSendNotification) ;
  257. #else // _WIN32
  258. # ifndef _MAC
  259. int firstNixAudioIf = audioStreamer::NIX_AUDIO_JACK ;
  260. int nix_interface_n = int(this->configStore[CONFIG::NIX_AUDIO_IF_ID]) - firstNixAudioIf ;
  261. this->modeComboBox->addItemList(CLIENT::NIX_AUDIO_IFS , 1) ;
  262. this->modeComboBox->setSelectedItemIndex(nix_interface_n , juce::dontSendNotification) ;
  263. # endif // _MAC
  264. #endif // _WIN32
  265. this->nBuffersSlider->setRange(CLIENT::MIN_N_BUFFERS , CLIENT::MAX_N_BUFFERS , 1) ;
  266. this->nSourcesSlider->setRange(CLIENT::MIN_N_SOURCES , CLIENT::MAX_N_SOURCES , 1) ;
  267. this->nSinksSlider ->setRange(CLIENT::MIN_N_SINKS , CLIENT::MAX_N_SINKS , 1) ;
  268. //[/Constructor]
  269. }
  270. ConfigAudio::~ConfigAudio()
  271. {
  272. //[Destructor_pre]. You can add your own custom destruction code here..
  273. //[/Destructor_pre]
  274. ioGroup = nullptr;
  275. formatGroup = nullptr;
  276. buffersGroup = nullptr;
  277. routingGroup = nullptr;
  278. defaultsButton = nullptr;
  279. asioButton = nullptr;
  280. modeLabel = nullptr;
  281. modeComboBox = nullptr;
  282. driverLabel = nullptr;
  283. driverComboBox = nullptr;
  284. sourceLabel = nullptr;
  285. sourceComboBox = nullptr;
  286. sinkLabel = nullptr;
  287. sinkComboBox = nullptr;
  288. bitdepthLabel = nullptr;
  289. bps16Button = nullptr;
  290. bps24Button = nullptr;
  291. bps32Button = nullptr;
  292. samplerateLabel = nullptr;
  293. kHz44Button = nullptr;
  294. kHz48Button = nullptr;
  295. kHz96Button = nullptr;
  296. buffersLabel = nullptr;
  297. nBuffersSlider = nullptr;
  298. xLabel = nullptr;
  299. bufferComboBox = nullptr;
  300. bytesLabel = nullptr;
  301. nixConfigLabel = nullptr;
  302. nixConfigText = nullptr;
  303. nSourcesLabel = nullptr;
  304. nSourcesSlider = nullptr;
  305. nSinksLabel = nullptr;
  306. nSinksSlider = nullptr;
  307. //[Destructor]. You can add your own custom destruction code here..
  308. //[/Destructor]
  309. }
  310. //==============================================================================
  311. void ConfigAudio::paint (Graphics& g)
  312. {
  313. //[UserPrePaint] Add your own custom painting code here..
  314. //[/UserPrePaint]
  315. g.setColour (Colour (0xff002000));
  316. g.fillRoundedRectangle (0.0f, 0.0f, static_cast<float> (getWidth() - 0), static_cast<float> (getHeight() - 0), 10.000f);
  317. //[UserPaint] Add your own custom painting code here..
  318. //[/UserPaint]
  319. }
  320. void ConfigAudio::resized()
  321. {
  322. ioGroup->setBounds (132, 38, 350, 126);
  323. formatGroup->setBounds (132, 176, 350, 60);
  324. buffersGroup->setBounds (132, 250, 350, 48);
  325. routingGroup->setBounds (132, 312, 350, 74);
  326. defaultsButton->setBounds (getWidth() - 68, 4, 64, 24);
  327. asioButton->setBounds (getWidth() - 68, 4, 64, 24);
  328. modeLabel->setBounds (140, 56, 64, 18);
  329. modeComboBox->setBounds (212, 56, 256, 18);
  330. driverLabel->setBounds (140, 82, 64, 18);
  331. driverComboBox->setBounds (212, 82, 256, 18);
  332. sourceLabel->setBounds (140, 108, 64, 18);
  333. sourceComboBox->setBounds (212, 108, 256, 18);
  334. sinkLabel->setBounds (140, 134, 64, 16);
  335. sinkComboBox->setBounds (212, 134, 256, 18);
  336. bitdepthLabel->setBounds (140, 190, 64, 18);
  337. bps16Button->setBounds (212, 191, 64, 18);
  338. bps24Button->setBounds (288, 191, 64, 18);
  339. bps32Button->setBounds (364, 191, 64, 18);
  340. samplerateLabel->setBounds (140, 210, 72, 18);
  341. kHz44Button->setBounds (212, 211, 64, 18);
  342. kHz48Button->setBounds (288, 211, 64, 18);
  343. kHz96Button->setBounds (364, 211, 64, 18);
  344. buffersLabel->setBounds (140, 268, 64, 18);
  345. nBuffersSlider->setBounds (212, 268, 64, 18);
  346. xLabel->setBounds (275, 268, 16, 18);
  347. bufferComboBox->setBounds (292, 268, 52, 18);
  348. bytesLabel->setBounds (346, 268, 64, 18);
  349. nixConfigLabel->setBounds (140, 332, 64, 18);
  350. nixConfigText->setBounds (212, 332, 256, 18);
  351. nSourcesLabel->setBounds (140, 358, 64, 18);
  352. nSourcesSlider->setBounds (214, 358, 64, 18);
  353. nSinksLabel->setBounds (330, 358, 64, 18);
  354. nSinksSlider->setBounds (404, 358, 64, 18);
  355. //[UserResized] Add your own custom resize handling here..
  356. //[/UserResized]
  357. }
  358. void ConfigAudio::buttonClicked (Button* buttonThatWasClicked)
  359. {
  360. //[UserbuttonClicked_Pre]
  361. Identifier bit_depth_key = Identifier() ;
  362. Identifier sample_rate_key = Identifier() ;
  363. #if _WIN32
  364. int interface_n = int(this->configStore[CONFIG::WIN_AUDIO_IF_ID]) ;
  365. switch ((audioStreamer::Interface)interface_n)
  366. {
  367. case audioStreamer::WIN_AUDIO_KS:
  368. bit_depth_key = CONFIG::KS_BITDEPTH_ID ;
  369. sample_rate_key = CONFIG::KS_SAMPLERATE_ID ;
  370. break ;
  371. case audioStreamer::WIN_AUDIO_DS:
  372. bit_depth_key = CONFIG::DS_BITDEPTH_ID ;
  373. sample_rate_key = CONFIG::DS_SAMPLERATE_ID ;
  374. break ;
  375. case audioStreamer::WIN_AUDIO_WAVE:
  376. bit_depth_key = CONFIG::WAVE_BITDEPTH_ID ;
  377. sample_rate_key = CONFIG::WAVE_SAMPLERATE_ID ;
  378. break ;
  379. default: break ;
  380. }
  381. #else // _WIN32
  382. # ifndef _MAC
  383. bit_depth_key = CONFIG::MAC_BITDEPTH_ID;
  384. sample_rate_key = CONFIG::MAC_SAMPLERATE_ID ;
  385. # endif // _MAC
  386. #endif // _WIN32
  387. int bit_depth = (this->bps16Button->getToggleState())? CLIENT::BIT_DEPTH_16 :
  388. (this->bps24Button->getToggleState())? CLIENT::BIT_DEPTH_24 :
  389. (this->bps32Button->getToggleState())? CLIENT::BIT_DEPTH_32 : 0 ;
  390. int sample_rate = (this->kHz44Button->getToggleState())? CLIENT::SAMPLE_RATE_44100 :
  391. (this->kHz48Button->getToggleState())? CLIENT::SAMPLE_RATE_48000 :
  392. (this->kHz96Button->getToggleState())? CLIENT::SAMPLE_RATE_96000 : 0 ;
  393. Identifier config_key ;
  394. var value ;
  395. //[/UserbuttonClicked_Pre]
  396. if (buttonThatWasClicked == defaultsButton)
  397. {
  398. //[UserButtonCode_defaultsButton] -- add your button handler code here..
  399. restoreDefaults() ; loadParams() ; return ;
  400. //[/UserButtonCode_defaultsButton]
  401. }
  402. else if (buttonThatWasClicked == asioButton)
  403. {
  404. //[UserButtonCode_asioButton] -- add your button handler code here..
  405. //[/UserButtonCode_asioButton]
  406. }
  407. else if (buttonThatWasClicked == bps16Button)
  408. {
  409. //[UserButtonCode_bps16Button] -- add your button handler code here..
  410. config_key = bit_depth_key ;
  411. value = var(bit_depth) ;
  412. //[/UserButtonCode_bps16Button]
  413. }
  414. else if (buttonThatWasClicked == bps24Button)
  415. {
  416. //[UserButtonCode_bps24Button] -- add your button handler code here..
  417. config_key = bit_depth_key ;
  418. value = var(bit_depth) ;
  419. //[/UserButtonCode_bps24Button]
  420. }
  421. else if (buttonThatWasClicked == bps32Button)
  422. {
  423. //[UserButtonCode_bps32Button] -- add your button handler code here..
  424. config_key = bit_depth_key ;
  425. value = var(bit_depth) ;
  426. //[/UserButtonCode_bps32Button]
  427. }
  428. else if (buttonThatWasClicked == kHz44Button)
  429. {
  430. //[UserButtonCode_kHz44Button] -- add your button handler code here..
  431. config_key = sample_rate_key ;
  432. value = var(sample_rate) ;
  433. //[/UserButtonCode_kHz44Button]
  434. }
  435. else if (buttonThatWasClicked == kHz48Button)
  436. {
  437. //[UserButtonCode_kHz48Button] -- add your button handler code here..
  438. config_key = sample_rate_key ;
  439. value = var(sample_rate) ;
  440. //[/UserButtonCode_kHz48Button]
  441. }
  442. else if (buttonThatWasClicked == kHz96Button)
  443. {
  444. //[UserButtonCode_kHz96Button] -- add your button handler code here..
  445. config_key = sample_rate_key ;
  446. value = var(sample_rate) ;
  447. //[/UserButtonCode_kHz96Button]
  448. }
  449. //[UserbuttonClicked_Post]
  450. setConfig(config_key , value) ;
  451. //[/UserbuttonClicked_Post]
  452. }
  453. void ConfigAudio::comboBoxChanged (ComboBox* comboBoxThatHasChanged)
  454. {
  455. //[UsercomboBoxChanged_Pre]
  456. #if _WIN32
  457. int interface_n = int(this->configStore[CONFIG::WIN_AUDIO_IF_ID]) ;
  458. Identifier mode_config_key = CONFIG::WIN_AUDIO_IF_ID ;
  459. int default_mode = CONFIG::DEFAULT_WIN_AUDIO_IF ;
  460. #else // _WIN32
  461. # ifndef _MAC
  462. Identifier mode_config_key = CONFIG::NIX_AUDIO_IF_ID ;
  463. int default_mode = CONFIG::DEFAULT_NIX_AUDIO_IF ;
  464. # endif // _MAC
  465. #endif // _WIN32
  466. Identifier config_key ;
  467. var value ;
  468. int default_index ;
  469. //[/UsercomboBoxChanged_Pre]
  470. if (comboBoxThatHasChanged == modeComboBox)
  471. {
  472. //[UserComboBoxCode_modeComboBox] -- add your combo box handling code here..
  473. #ifndef _MAC
  474. int selected_mode = this->modeComboBox->getSelectedItemIndex() ;
  475. config_key = mode_config_key ;
  476. value = var((~selected_mode)? selected_mode : default_mode) ;
  477. #endif // _MAC
  478. //[/UserComboBoxCode_modeComboBox]
  479. }
  480. else if (comboBoxThatHasChanged == driverComboBox)
  481. {
  482. //[UserComboBoxCode_driverComboBox] -- add your combo box handling code here..
  483. int selected_index = this->driverComboBox->getSelectedItemIndex() ;
  484. #if _WIN32
  485. config_key = CONFIG::ASIO_DRIVER_ID ;
  486. #else // _WIN32
  487. # ifndef _MAC
  488. config_key = CONFIG::JACK_SERVER_ID ;
  489. # endif // _MAC
  490. #endif // _WIN32
  491. value = var((~selected_index)? selected_index : 0) ;
  492. //[/UserComboBoxCode_driverComboBox]
  493. }
  494. #if _WIN32
  495. else if (comboBoxThatHasChanged == sourceComboBox)
  496. {
  497. //[UserComboBoxCode_sourceComboBox] -- add your combo box handling code here..
  498. int selected_index = this->sourceComboBox->getSelectedItemIndex() ;
  499. switch ((audioStreamer::Interface)interface_n)
  500. {
  501. case audioStreamer::WIN_AUDIO_ASIO:
  502. config_key = CONFIG::ASIO_INPUT0_ID ;
  503. value = var((~selected_index)? selected_index - 1 :
  504. CONFIG::DEFAULT_ASIO_INPUT0) ; break ;
  505. case audioStreamer::WIN_AUDIO_KS:
  506. config_key = CONFIG::KS_INPUT_ID ;
  507. value = var((~selected_index)? selected_index - 1 :
  508. CONFIG::DEFAULT_KS_INPUT) ; break ;
  509. case audioStreamer::WIN_AUDIO_DS:
  510. config_key = CONFIG::DS_INPUT0_ID ;
  511. value = var((~selected_index)? selected_index :
  512. CONFIG::DEFAULT_DS_INPUT0) ; break ;
  513. case audioStreamer::WIN_AUDIO_WAVE:
  514. config_key = CONFIG::WAVE_INPUT_ID ;
  515. value = var((~selected_index)? selected_index - 1 :
  516. CONFIG::DEFAULT_WAVE_INPUT) ; break ;
  517. default: break ;
  518. }
  519. //[/UserComboBoxCode_sourceComboBox]
  520. }
  521. else if (comboBoxThatHasChanged == sinkComboBox)
  522. {
  523. //[UserComboBoxCode_sinkComboBox] -- add your combo box handling code here..
  524. switch ((audioStreamer::Interface)interface_n)
  525. {
  526. case audioStreamer::WIN_AUDIO_ASIO:
  527. config_key = CONFIG::ASIO_OUTPUT0_ID ;
  528. default_index = CONFIG::DEFAULT_ASIO_OUTPUT0 ; break ;
  529. case audioStreamer::WIN_AUDIO_KS:
  530. config_key = CONFIG::KS_OUTPUT_ID ;
  531. default_index = CONFIG::DEFAULT_KS_OUTPUT ; break ;
  532. case audioStreamer::WIN_AUDIO_DS:
  533. config_key = CONFIG::DS_OUTPUT0_ID ;
  534. default_index = CONFIG::DEFAULT_DS_OUTPUT0 ; break ;
  535. case audioStreamer::WIN_AUDIO_WAVE:
  536. config_key = CONFIG::WAVE_OUTPUT_ID ;
  537. default_index = CONFIG::DEFAULT_WAVE_OUTPUT ; break ;
  538. default: break ;
  539. }
  540. int selected_index = this->sourceComboBox->getSelectedItemIndex() ;
  541. value = var((~selected_index)? selected_index - 1 : default_index) ;
  542. //[/UserComboBoxCode_sinkComboBox]
  543. }
  544. else if (comboBoxThatHasChanged == bufferComboBox)
  545. {
  546. //[UserComboBoxCode_bufferComboBox] -- add your combo box handling code here..
  547. switch ((audioStreamer::Interface)interface_n)
  548. {
  549. case audioStreamer::WIN_AUDIO_KS: config_key = CONFIG::KS_BLOCKSIZE_ID ; break ;
  550. case audioStreamer::WIN_AUDIO_DS: config_key = CONFIG::DS_BLOCKSIZE_ID ; break ;
  551. case audioStreamer::WIN_AUDIO_WAVE: config_key = CONFIG::WAVE_BLOCKSIZE_ID ; break ;
  552. default: break ;
  553. }
  554. value = var(this->bufferComboBox->getText().getIntValue()) ;
  555. //[/UserComboBoxCode_bufferComboBox]
  556. }
  557. #endif // _WIN32
  558. //[UsercomboBoxChanged_Post]
  559. setConfig(config_key , value) ;
  560. if (comboBoxThatHasChanged == this->modeComboBox) loadParams() ;
  561. //[/UsercomboBoxChanged_Post]
  562. }
  563. void ConfigAudio::sliderValueChanged (Slider* sliderThatWasMoved)
  564. {
  565. //[UsersliderValueChanged_Pre]
  566. Identifier config_key ;
  567. var value = var((int)sliderThatWasMoved->getValue()) ;
  568. //[/UsersliderValueChanged_Pre]
  569. if (sliderThatWasMoved == nBuffersSlider)
  570. {
  571. //[UserSliderCode_nBuffersSlider] -- add your slider handling code here..
  572. #if _WIN32
  573. int interface_n = int(this->configStore[CONFIG::WIN_AUDIO_IF_ID]) ;
  574. switch ((audioStreamer::Interface)interface_n)
  575. {
  576. case audioStreamer::WIN_AUDIO_KS: config_key = CONFIG::KS_NBLOCKS_ID ; break ;
  577. case audioStreamer::WIN_AUDIO_DS: config_key = CONFIG::DS_NBLOCKS_ID ; break ;
  578. case audioStreamer::WIN_AUDIO_WAVE: config_key = CONFIG::WAVE_NBLOCKS_ID ; break ;
  579. default: break ;
  580. }
  581. #endif // _WIN32
  582. //[/UserSliderCode_nBuffersSlider]
  583. }
  584. else if (sliderThatWasMoved == nSourcesSlider)
  585. {
  586. //[UserSliderCode_nSourcesSlider] -- add your slider handling code here..
  587. #ifndef _WIN32
  588. # ifdef _MAC
  589. config_key = CONFIG::MAC_NINPUTS_KEY ;
  590. # else // _MAC
  591. config_key = CONFIG::JACK_NINPUTS_ID ;
  592. # endif // _MAC
  593. #endif // _WIN32
  594. //[/UserSliderCode_nSourcesSlider]
  595. }
  596. else if (sliderThatWasMoved == nSinksSlider)
  597. {
  598. //[UserSliderCode_nSinksSlider] -- add your slider handling code here..
  599. #ifndef _WIN32
  600. # ifndef _MAC
  601. config_key = CONFIG::JACK_NOUTPUTS_ID ;
  602. # endif // _MAC
  603. #endif // _WIN32
  604. //[/UserSliderCode_nSinksSlider]
  605. }
  606. //[UsersliderValueChanged_Post]
  607. setConfig(config_key , value) ;
  608. //[/UsersliderValueChanged_Post]
  609. }
  610. //[MiscUserCode] You can add your own definitions of your custom methods or any other code here...
  611. /* ConfigAudio class private instance methods */
  612. void ConfigAudio::broughtToFront() { loadParams() ; }
  613. void ConfigAudio::loadParams()
  614. {
  615. // load config
  616. int win_interface_n = int(this->configStore[CONFIG::WIN_AUDIO_IF_ID]) ;
  617. int asio_driver = int(this->configStore[CONFIG::ASIO_DRIVER_ID]) ;
  618. int asio_input0 = int(this->configStore[CONFIG::ASIO_INPUT0_ID]) ;
  619. int asio_input1 = int(this->configStore[CONFIG::ASIO_INPUT1_ID]) ;
  620. int asio_output0 = int(this->configStore[CONFIG::ASIO_OUTPUT0_ID]) ;
  621. int asio_output1 = int(this->configStore[CONFIG::ASIO_OUTPUT1_ID]) ;
  622. int ks_input = int(this->configStore[CONFIG::KS_INPUT_ID]) ;
  623. int ks_output = int(this->configStore[CONFIG::KS_OUTPUT_ID]) ;
  624. int ks_sample_rate = int(this->configStore[CONFIG::KS_SAMPLERATE_ID]) ;
  625. int ks_bit_depth = int(this->configStore[CONFIG::KS_BITDEPTH_ID]) ;
  626. int ks_buffer_size = int(this->configStore[CONFIG::KS_BLOCKSIZE_ID]) ;
  627. int ks_n_buffers = int(this->configStore[CONFIG::KS_NBLOCKS_ID]) ;
  628. int ds_input0 = int(this->configStore[CONFIG::DS_INPUT0_ID]) ;
  629. int ds_input1 = int(this->configStore[CONFIG::DS_INPUT1_ID]) ;
  630. int ds_input2 = int(this->configStore[CONFIG::DS_INPUT2_ID]) ;
  631. int ds_input3 = int(this->configStore[CONFIG::DS_INPUT3_ID]) ;
  632. int ds_output0 = int(this->configStore[CONFIG::DS_OUTPUT0_ID]) ;
  633. int ds_output1 = int(this->configStore[CONFIG::DS_OUTPUT1_ID]) ;
  634. int ds_output2 = int(this->configStore[CONFIG::DS_OUTPUT2_ID]) ;
  635. int ds_output3 = int(this->configStore[CONFIG::DS_OUTPUT3_ID]) ;
  636. int ds_sample_rate = int(this->configStore[CONFIG::DS_SAMPLERATE_ID]) ;
  637. int ds_bit_depth = int(this->configStore[CONFIG::DS_BITDEPTH_ID]) ;
  638. int ds_buffer_size = int(this->configStore[CONFIG::DS_BLOCKSIZE_ID]) ;
  639. int ds_n_buffers = int(this->configStore[CONFIG::DS_NBLOCKS_ID]) ;
  640. int wave_input = int(this->configStore[CONFIG::WAVE_INPUT_ID]) ;
  641. int wave_output = int(this->configStore[CONFIG::WAVE_OUTPUT_ID]) ;
  642. int wave_sample_rate = int(this->configStore[CONFIG::WAVE_SAMPLERATE_ID]) ;
  643. int wave_bit_depth = int(this->configStore[CONFIG::WAVE_BITDEPTH_ID]) ;
  644. int wave_buffer_size = int(this->configStore[CONFIG::WAVE_BLOCKSIZE_ID]) ;
  645. int wave_n_buffers = int(this->configStore[CONFIG::WAVE_NBLOCKS_ID]) ;
  646. String mac_device_name = this->configStore[CONFIG::MAC_DEVICE_ID].toString() ;
  647. int mac_n_inputs = int(this->configStore[CONFIG::MAC_NINPUTS_ID]) ;
  648. int mac_sample_rate = int(this->configStore[CONFIG::MAC_SAMPLERATE_ID]) ;
  649. int mac_bit_depth = int(this->configStore[CONFIG::MAC_BITDEPTH_ID]) ;
  650. int nix_interface_n = int(this->configStore[CONFIG::NIX_AUDIO_IF_ID]) ;
  651. int jack_server = int(this->configStore[CONFIG::JACK_SERVER_ID]) ;
  652. String jack_name = this->configStore[CONFIG::JACK_NAME_ID].toString() ;
  653. String alsa_config = this->configStore[CONFIG::ALSA_CONFIG_ID].toString() ;
  654. int jack_n_inputs = int(this->configStore[CONFIG::JACK_NINPUTS_ID]) ;
  655. int jack_n_outputs = int(this->configStore[CONFIG::JACK_NOUTPUTS_ID]) ;
  656. // disable components temporarily
  657. this->defaultsButton ->setVisible(false) ; this->asioButton ->setVisible(false) ;
  658. this->ioGroup ->setEnabled(false) ; this->modeLabel ->setEnabled(false) ;
  659. this->modeComboBox ->setEnabled(false) ; this->driverLabel ->setEnabled(false) ;
  660. this->driverComboBox ->setEnabled(false) ; this->sourceLabel ->setEnabled(false) ;
  661. this->sourceComboBox ->setEnabled(false) ; this->sinkLabel ->setEnabled(false) ;
  662. this->sinkComboBox ->setEnabled(false) ; this->formatGroup ->setEnabled(false) ;
  663. this->bitdepthLabel ->setEnabled(false) ; this->bps16Button ->setEnabled(false) ;
  664. this->bps24Button ->setEnabled(false) ; this->bps32Button ->setEnabled(false) ;
  665. this->samplerateLabel->setEnabled(false) ; this->kHz44Button ->setEnabled(false) ;
  666. this->kHz48Button ->setEnabled(false) ; this->kHz96Button ->setEnabled(false) ;
  667. this->buffersGroup ->setEnabled(false) ; this->buffersLabel ->setEnabled(false) ;
  668. this->nBuffersSlider ->setEnabled(false) ; this->xLabel ->setEnabled(false) ;
  669. this->bufferComboBox ->setEnabled(false) ; this->bytesLabel ->setEnabled(false) ;
  670. this->routingGroup ->setEnabled(false) ; this->nixConfigLabel->setEnabled(false) ;
  671. this->nixConfigText ->setEnabled(false) ; this->nSourcesLabel ->setEnabled(false) ;
  672. this->nSourcesSlider ->setEnabled(false) ; this->nSinksLabel ->setEnabled(false) ;
  673. this->nSinksSlider ->setEnabled(false) ;
  674. // clear select options temporarily
  675. this->driverComboBox->clear(juce::dontSendNotification) ;
  676. this->sourceComboBox->clear(juce::dontSendNotification) ;
  677. this->sinkComboBox ->clear(juce::dontSendNotification) ;
  678. this->bufferComboBox->clear(juce::dontSendNotification) ;
  679. // set interface-specific GUI state
  680. #ifdef _WIN32
  681. switch ((audioStreamer::Interface)win_interface_n)
  682. {
  683. case audioStreamer::WIN_AUDIO_ASIO:
  684. {
  685. /* TODO: no GUI
  686. asio_input1
  687. asio_output1
  688. */
  689. if (queryAsioDevices()) enableComponents() ;
  690. this->driverComboBox->setSelectedItemIndex(asio_driver) ;
  691. this->sourceComboBox->setSelectedItemIndex(asio_input0) ;
  692. this->sinkComboBox ->setSelectedItemIndex(asio_output0) ;
  693. break ;
  694. }
  695. case audioStreamer::WIN_AUDIO_KS:
  696. {
  697. if (queryKernelstreamingDevices()) enableComponents() ;
  698. bool is_16_bps = ks_bit_depth == CLIENT::BIT_DEPTH_16 ;
  699. bool is_24_bps = ks_bit_depth == CLIENT::BIT_DEPTH_24 ;
  700. bool is_32_bps = ks_bit_depth == CLIENT::BIT_DEPTH_32 ;
  701. bool is_44_khz = ks_sample_rate == CLIENT::SAMPLE_RATE_44100 ;
  702. bool is_48_khz = ks_sample_rate == CLIENT::SAMPLE_RATE_48000 ;
  703. bool is_96_khz = ks_sample_rate == CLIENT::SAMPLE_RATE_96000 ;
  704. int buffer_size_index = CLIENT::BUFFER_SIZES.indexOf(String(ks_buffer_size)) ;
  705. this->sourceComboBox->setSelectedItemIndex(ks_input + 1) ;
  706. this->sinkComboBox ->setSelectedItemIndex(ks_output + 1) ;
  707. this->bufferComboBox->setSelectedItemIndex(buffer_size_index) ;
  708. this->bps16Button ->setToggleState(is_16_bps , juce::dontSendNotification) ;
  709. this->bps24Button ->setToggleState(is_24_bps , juce::dontSendNotification) ;
  710. this->bps32Button ->setToggleState(is_32_bps , juce::dontSendNotification) ;
  711. this->kHz44Button ->setToggleState(is_44_khz , juce::dontSendNotification) ;
  712. this->kHz48Button ->setToggleState(is_48_khz , juce::dontSendNotification) ;
  713. this->kHz96Button ->setToggleState(is_96_khz , juce::dontSendNotification) ;
  714. this->nBuffersSlider->setValue(ks_n_buffers) ;
  715. break ;
  716. }
  717. case audioStreamer::WIN_AUDIO_DS:
  718. {
  719. /* TODO: no GUI
  720. ds_input1
  721. ds_input2
  722. ds_input3
  723. ds_output1
  724. ds_output2
  725. ds_output3
  726. */
  727. if (queryDirectsoundDevices()) enableComponents() ;
  728. bool is_16_bps = ds_bit_depth == CLIENT::BIT_DEPTH_16 ;
  729. bool is_24_bps = ds_bit_depth == CLIENT::BIT_DEPTH_24 ;
  730. bool is_32_bps = ds_bit_depth == CLIENT::BIT_DEPTH_32 ;
  731. bool is_44_khz = ds_sample_rate == CLIENT::SAMPLE_RATE_44100 ;
  732. bool is_48_khz = ds_sample_rate == CLIENT::SAMPLE_RATE_48000 ;
  733. bool is_96_khz = ds_sample_rate == CLIENT::SAMPLE_RATE_96000 ;
  734. int buffer_size_index = CLIENT::BUFFER_SIZES.indexOf(String(ds_buffer_size)) ;
  735. this->sourceComboBox->setSelectedItemIndex(ds_input0 + 1) ;
  736. this->sinkComboBox ->setSelectedItemIndex(ds_output0 + 1) ;
  737. this->bufferComboBox->setSelectedItemIndex(buffer_size_index) ;
  738. this->bps16Button ->setToggleState(is_16_bps , juce::dontSendNotification) ;
  739. this->bps24Button ->setToggleState(is_24_bps , juce::dontSendNotification) ;
  740. this->bps32Button ->setToggleState(is_32_bps , juce::dontSendNotification) ;
  741. this->kHz44Button ->setToggleState(is_44_khz , juce::dontSendNotification) ;
  742. this->kHz48Button ->setToggleState(is_48_khz , juce::dontSendNotification) ;
  743. this->kHz96Button ->setToggleState(is_96_khz , juce::dontSendNotification) ;
  744. this->nBuffersSlider->setValue(ds_n_buffers) ;
  745. break ;
  746. }
  747. case audioStreamer::WIN_AUDIO_WAVE:
  748. {
  749. if (queryWaveDevices()) enableComponents() ;
  750. bool is_16_bps = wave_bit_depth == CLIENT::BIT_DEPTH_16 ;
  751. bool is_24_bps = wave_bit_depth == CLIENT::BIT_DEPTH_24 ;
  752. bool is_32_bps = wave_bit_depth == CLIENT::BIT_DEPTH_32 ;
  753. bool is_44_khz = wave_sample_rate == CLIENT::SAMPLE_RATE_44100 ;
  754. bool is_48_khz = wave_sample_rate == CLIENT::SAMPLE_RATE_48000 ;
  755. bool is_96_khz = wave_sample_rate == CLIENT::SAMPLE_RATE_96000 ;
  756. int buffer_size_index = CLIENT::BUFFER_SIZES.indexOf(StringRef(String(wave_buffer_size))) ;
  757. this->sourceComboBox->setSelectedItemIndex(wave_input + 1) ;
  758. this->sinkComboBox ->setSelectedItemIndex(wave_output + 1) ;
  759. this->bufferComboBox->setSelectedItemIndex(buffer_size_index) ;
  760. this->bps16Button ->setToggleState(is_16_bps , juce::dontSendNotification) ;
  761. this->bps24Button ->setToggleState(is_24_bps , juce::dontSendNotification) ;
  762. this->bps32Button ->setToggleState(is_32_bps , juce::dontSendNotification) ;
  763. this->kHz44Button ->setToggleState(is_44_khz , juce::dontSendNotification) ;
  764. this->kHz48Button ->setToggleState(is_48_khz , juce::dontSendNotification) ;
  765. this->kHz96Button ->setToggleState(is_96_khz , juce::dontSendNotification) ;
  766. this->nBuffersSlider->setValue(wave_n_buffers) ;
  767. break ;
  768. }
  769. default: break ;
  770. }
  771. #else // _WIN32
  772. # ifdef _MAC
  773. if (queryCoreaudioDevices()) enableComponents() ;
  774. bool is_16_bps = mac_bit_depth == CONFIG::BIT_DEPTH_16 ;
  775. bool is_24_bps = mac_bit_depth == CONFIG::BIT_DEPTH_24 ;
  776. bool is_32_bps = mac_bit_depth == CONFIG::BIT_DEPTH_32 ;
  777. bool is_44_khz = mac_sample_rate == CONFIG::SAMPLE_RATE_44100 ;
  778. bool is_48_khz = mac_sample_rate == CONFIG::SAMPLE_RATE_48000 ;
  779. bool is_96_khz = mac_sample_rate == CONFIG::SAMPLE_RATE_96000 ;
  780. this->bps16Button ->setToggleState(is_16_bps , juce::dontSendNotification) ;
  781. this->bps24Button ->setToggleState(is_24_bps , juce::dontSendNotification) ;
  782. this->bps32Button ->setToggleState(is_32_bps , juce::dontSendNotification) ;
  783. this->kHz44Button ->setToggleState(is_44_khz , juce::dontSendNotification) ;
  784. this->kHz48Button ->setToggleState(is_48_khz , juce::dontSendNotification) ;
  785. this->kHz96Button ->setToggleState(is_96_khz , juce::dontSendNotification) ;
  786. this->nSourcesSlider->setValue(mac_n_inputs) ;
  787. # else // _MAC
  788. switch ((audioStreamer::Interface)nix_interface_n)
  789. {
  790. case audioStreamer::NIX_AUDIO_JACK:
  791. {
  792. if (queryJackServers()) enableComponents() ;
  793. this->driverComboBox->setSelectedItemIndex(jack_server) ;
  794. this->nixConfigLabel->setText(GUI::JACK_NAME_LABEL_TEXT , juce::dontSendNotification) ;
  795. this->nixConfigText ->setText(jack_name , juce::dontSendNotification) ;
  796. this->nSourcesSlider->setValue(jack_n_inputs) ;
  797. this->nSinksSlider ->setValue(jack_n_outputs) ;
  798. break ;
  799. }
  800. case audioStreamer::NIX_AUDIO_ALSA:
  801. {
  802. if (queryAlsaDevices()) enableComponents() ;
  803. this->nixConfigLabel->setText(GUI::ALSA_CONFIG_LABEL_TEXT , juce::dontSendNotification) ;
  804. this->nixConfigText ->setText(alsa_config , juce::dontSendNotification) ;
  805. break ;
  806. }
  807. default: break ;
  808. }
  809. # endif // _MAC
  810. #endif // _WIN32
  811. }
  812. void ConfigAudio::setConfig(Identifier a_key , var a_value)
  813. {
  814. this->configStore.setProperty(a_key , a_value , nullptr) ;
  815. }
  816. void ConfigAudio::restoreDefaults()
  817. {
  818. int win_interface_n = int(this->configStore[CONFIG::WIN_AUDIO_IF_ID]) ;
  819. int nix_interface_n = int(this->configStore[CONFIG::NIX_AUDIO_IF_ID]) ;
  820. #ifdef _WIN32
  821. switch ((audioStreamer::Interface)win_interface_n)
  822. {
  823. case audioStreamer::WIN_AUDIO_ASIO:
  824. {
  825. setConfig(CONFIG::ASIO_DRIVER_ID , CONFIG::DEFAULT_ASIO_DRIVER) ;
  826. setConfig(CONFIG::ASIO_INPUT0_ID , CONFIG::DEFAULT_ASIO_INPUT0) ;
  827. setConfig(CONFIG::ASIO_INPUT1_ID , CONFIG::DEFAULT_ASIO_INPUT1) ;
  828. setConfig(CONFIG::ASIO_OUTPUT0_ID , CONFIG::DEFAULT_ASIO_OUTPUT0) ;
  829. setConfig(CONFIG::ASIO_OUTPUT1_ID , CONFIG::DEFAULT_ASIO_OUTPUT1) ;
  830. break ;
  831. }
  832. case audioStreamer::WIN_AUDIO_KS:
  833. {
  834. setConfig(CONFIG::KS_INPUT_ID , CONFIG::DEFAULT_KS_INPUT) ;
  835. setConfig(CONFIG::KS_OUTPUT_ID , CONFIG::DEFAULT_KS_OUTPUT) ;
  836. setConfig(CONFIG::KS_SAMPLERATE_ID , CONFIG::DEFAULT_KS_SAMPLERATE) ;
  837. setConfig(CONFIG::KS_BITDEPTH_ID , CONFIG::DEFAULT_KS_BITDEPTH) ;
  838. setConfig(CONFIG::KS_BLOCKSIZE_ID , CONFIG::DEFAULT_KS_BLOCKSIZE) ;
  839. setConfig(CONFIG::KS_NBLOCKS_ID , CONFIG::DEFAULT_KS_N_BLOCKS) ;
  840. break ;
  841. }
  842. case audioStreamer::WIN_AUDIO_DS:
  843. {
  844. setConfig(CONFIG::DS_INPUT0_ID , CONFIG::DEFAULT_DS_INPUT0) ;
  845. setConfig(CONFIG::DS_INPUT1_ID , CONFIG::DEFAULT_DS_INPUT1) ;
  846. setConfig(CONFIG::DS_INPUT2_ID , CONFIG::DEFAULT_DS_INPUT2) ;
  847. setConfig(CONFIG::DS_INPUT3_ID , CONFIG::DEFAULT_DS_INPUT3) ;
  848. setConfig(CONFIG::DS_OUTPUT0_ID , CONFIG::DEFAULT_DS_OUTPUT0) ;
  849. setConfig(CONFIG::DS_OUTPUT1_ID , CONFIG::DEFAULT_DS_OUTPUT1) ;
  850. setConfig(CONFIG::DS_OUTPUT2_ID , CONFIG::DEFAULT_DS_OUTPUT2) ;
  851. setConfig(CONFIG::DS_OUTPUT3_ID , CONFIG::DEFAULT_DS_OUTPUT3) ;
  852. setConfig(CONFIG::DS_SAMPLERATE_ID , CONFIG::DEFAULT_DS_SAMPLERATE) ;
  853. setConfig(CONFIG::DS_BITDEPTH_ID , CONFIG::DEFAULT_DS_BITDEPTH) ;
  854. setConfig(CONFIG::DS_BLOCKSIZE_ID , CONFIG::DEFAULT_DS_BLOCKSIZE) ;
  855. setConfig(CONFIG::DS_NBLOCKS_ID , CONFIG::DEFAULT_DS_N_BLOCKS) ;
  856. break ;
  857. }
  858. case audioStreamer::WIN_AUDIO_WAVE:
  859. {
  860. setConfig(CONFIG::WAVE_INPUT_ID , CONFIG::DEFAULT_WAVE_INPUT) ;
  861. setConfig(CONFIG::WAVE_OUTPUT_ID , CONFIG::DEFAULT_WAVE_OUTPUT) ;
  862. setConfig(CONFIG::WAVE_SAMPLERATE_ID , CONFIG::DEFAULT_WAVE_SAMPLERATE) ;
  863. setConfig(CONFIG::WAVE_BITDEPTH_ID , CONFIG::DEFAULT_WAVE_BITDEPTH) ;
  864. setConfig(CONFIG::WAVE_BLOCKSIZE_ID , CONFIG::DEFAULT_WAVE_BLOCKSIZE) ;
  865. setConfig(CONFIG::WAVE_NBLOCKS_ID , CONFIG::DEFAULT_WAVE_N_BLOCKS) ;
  866. break ;
  867. }
  868. }
  869. #else // _WIN32
  870. # ifdef _MAC
  871. setConfig(CONFIG::MAC_DEVICE_ID , CONFIG::DEFAULT_MAC_DEVICE) ;
  872. setConfig(CONFIG::MAC_NINPUTS_ID , CONFIG::DEFAULT_N_INPUTS) ;
  873. setConfig(CONFIG::MAC_SAMPLERATE_ID , CONFIG::DEFAULT_MAC_SAMPLERATE) ;
  874. setConfig(CONFIG::MAC_BITDEPTH_ID , CONFIG::DEFAULT_MAC_BITDEPTH) ;
  875. # else // _MAC
  876. switch ((audioStreamer::Interface)nix_interface_n)
  877. {
  878. case audioStreamer::NIX_AUDIO_JACK:
  879. {
  880. setConfig(CONFIG::JACK_SERVER_ID , CONFIG::DEFAULT_JACK_SERVER) ;
  881. setConfig(CONFIG::JACK_NAME_ID , CONFIG::DEFAULT_JACK_NAME) ;
  882. setConfig(CONFIG::JACK_NINPUTS_ID , CONFIG::DEFAULT_N_INPUTS) ;
  883. setConfig(CONFIG::JACK_NOUTPUTS_ID , CONFIG::DEFAULT_N_OUTPUTS) ;
  884. break ;
  885. }
  886. case audioStreamer::NIX_AUDIO_ALSA:
  887. {
  888. setConfig(CONFIG::ALSA_CONFIG_ID , CONFIG::DEFAULT_ALSA_CONFIG) ;
  889. break ;
  890. }
  891. }
  892. # endif // _MAC
  893. #endif // _WIN32
  894. }
  895. void ConfigAudio::enableComponents()
  896. {
  897. bool is_asio , is_ks , is_ds , is_wave , is_ca , is_jack , is_alsa ;
  898. is_asio = is_ks = is_ds = is_wave = is_ca = is_jack = is_alsa = false ;
  899. #if _WIN32
  900. int interface_n = int(this->configStore[CONFIG::WIN_AUDIO_IF_ID]) ;
  901. is_asio = interface_n == (int)audioStreamer::WIN_AUDIO_ASIO ; // asio
  902. is_ks = interface_n == (int)audioStreamer::WIN_AUDIO_KS ; // kernel streaming
  903. is_ds = interface_n == (int)audioStreamer::WIN_AUDIO_DS ; // directsound
  904. is_wave = interface_n == (int)audioStreamer::WIN_AUDIO_WAVE ; // wave
  905. #else // _WIN32
  906. # ifdef _MAC
  907. is_ca = true ; // coreaudio
  908. # else // _MAC
  909. int interface_n = int(this->configStore[CONFIG::NIX_AUDIO_IF_ID]) ;
  910. is_jack = interface_n == (int)audioStreamer::NIX_AUDIO_JACK ; // jack
  911. is_alsa = interface_n == (int)audioStreamer::NIX_AUDIO_ALSA ; // alsa
  912. # endif // _MAC
  913. #endif // _WIN32
  914. // common
  915. this->defaultsButton ->setVisible(!is_asio ) ;
  916. this->asioButton ->setVisible( is_asio ) ;
  917. // io group
  918. this->ioGroup ->setEnabled(!is_ca ) ;
  919. this->modeLabel ->setEnabled(!is_ca ) ;
  920. this->modeComboBox ->setEnabled(!is_ca ) ;
  921. this->driverLabel ->setEnabled( is_jack || is_asio ) ;
  922. this->driverComboBox ->setEnabled( is_jack || is_asio ) ;
  923. this->sourceLabel ->setEnabled( is_ks || is_ds || is_wave || is_asio) ;
  924. this->sourceComboBox ->setEnabled( is_ks || is_ds || is_wave || is_asio) ;
  925. this->sinkLabel ->setEnabled( is_ks || is_ds || is_wave || is_asio) ;
  926. this->sinkComboBox ->setEnabled( is_ks || is_ds || is_wave || is_asio) ;
  927. // format group
  928. this->formatGroup ->setEnabled( is_ks || is_ds || is_wave || is_ca ) ;
  929. this->bitdepthLabel ->setEnabled( is_ks || is_ds || is_wave || is_ca ) ;
  930. this->bps16Button ->setEnabled( is_ks || is_ds || is_wave || is_ca ) ;
  931. this->bps24Button ->setEnabled( is_ks || is_ds || is_wave || is_ca ) ;
  932. this->bps32Button ->setEnabled( is_ks || is_ds || is_wave || is_ca ) ;
  933. this->samplerateLabel->setEnabled( is_ks || is_ds || is_wave || is_ca ) ;
  934. this->kHz44Button ->setEnabled( is_ks || is_ds || is_wave || is_ca ) ;
  935. this->kHz48Button ->setEnabled( is_ks || is_ds || is_wave || is_ca ) ;
  936. this->kHz96Button ->setEnabled( is_ks || is_ds || is_wave || is_ca ) ;
  937. // buffers group
  938. this->buffersGroup ->setEnabled( is_ks || is_ds || is_wave ) ;
  939. this->buffersLabel ->setEnabled( is_ks || is_ds || is_wave ) ;
  940. this->nBuffersSlider ->setEnabled( is_ks || is_ds || is_wave ) ;
  941. this->xLabel ->setEnabled( is_ks || is_ds || is_wave ) ;
  942. this->bufferComboBox ->setEnabled( is_ks || is_ds || is_wave ) ;
  943. this->bytesLabel ->setEnabled( is_ks || is_ds || is_wave ) ;
  944. // routing group
  945. this->routingGroup ->setEnabled( is_jack || is_alsa || is_ca ) ;
  946. this->nixConfigLabel ->setEnabled( is_jack || is_alsa ) ;
  947. this->nixConfigText ->setEnabled( is_jack || is_alsa ) ;
  948. this->nSourcesLabel ->setEnabled( is_jack || is_ca ) ;
  949. this->nSourcesSlider ->setEnabled( is_jack || is_ca ) ;
  950. this->nSinksLabel ->setEnabled( is_jack ) ;
  951. this->nSinksSlider ->setEnabled( is_jack ) ;
  952. DEBUG_TRACE_CONFIG_AUDIO_GUI_LOAD
  953. }
  954. #ifdef _WIN32
  955. bool ConfigAudio::queryAsioDevices()
  956. {
  957. // TODO: asio nyi
  958. // NOTE: see njasiodrv_if.h
  959. bool is_asio_available = njasiodrv_avail() ;
  960. if (is_asio_available)
  961. {
  962. this->driverComboBox->addItem("asio driver 0" , 1) ;
  963. this->sourceComboBox->addItem("asio device 0" , 1) ;
  964. this->sinkComboBox ->addItem("asio device 0" , 1) ;
  965. this->driverComboBox->addItem("asio driver 1" , 2) ;
  966. this->sourceComboBox->addItem("asio device 1" , 2) ;
  967. this->sinkComboBox ->addItem("asio device 1" , 2) ;
  968. }
  969. else
  970. {
  971. this->driverComboBox->addItem("asio not supported" , 1) ;
  972. this->sourceComboBox->addItem("(no asio devices found)" , 1) ;
  973. this->sinkComboBox ->addItem("(no asio devices found)" , 1) ;
  974. }
  975. return is_asio_available ;
  976. }
  977. bool ConfigAudio::queryKernelstreamingDevices()
  978. {
  979. bool is_ks_available = true ; // TODO:
  980. this->sourceComboBox->clear(juce::dontSendNotification) ;
  981. this->sinkComboBox ->clear(juce::dontSendNotification) ;
  982. if (is_ks_available)
  983. {
  984. this->sourceComboBox->addItem("default device" , 1) ;
  985. this->sinkComboBox ->addItem("default device" , 1) ;
  986. this->bufferComboBox->addItemList(CLIENT::BUFFER_SIZES , 1) ;
  987. }
  988. else
  989. {
  990. this->sourceComboBox->addItem("kernel streaming unavailable" , 1) ;
  991. this->sinkComboBox ->addItem("kernel streaming unavailable" , 1) ;
  992. }
  993. return is_ks_available ;
  994. }
  995. bool ConfigAudio::queryDirectsoundDevices()
  996. {
  997. // see dsound.h
  998. StringArray device_names ;
  999. LPDSENUMCALLBACK ds_enum_cb = (LPDSENUMCALLBACK)DSEnumProc ;
  1000. HRESULT result = DirectSoundEnumerate(ds_enum_cb , &device_names) ;
  1001. bool is_ds_available = !FAILED(result) ;
  1002. if (is_ds_available)
  1003. {
  1004. this->sourceComboBox->addItemList(device_names , 1) ;
  1005. this->sinkComboBox ->addItemList(device_names , 1) ;
  1006. this->bufferComboBox->addItemList(CLIENT::BUFFER_SIZES , 1) ;
  1007. }
  1008. else
  1009. {
  1010. this->sourceComboBox->addItem("(directsound unavaliable)" , 1) ;
  1011. this->sinkComboBox ->addItem("(directsound unavaliable)" , 1) ;
  1012. }
  1013. return is_ds_available ;
  1014. }
  1015. bool ConfigAudio::queryWaveDevices()
  1016. {
  1017. // NOTE: see MMsystem.h
  1018. WAVEOUTCAPS capabilities ;
  1019. StringArray device_names ;
  1020. UINT caps_size = sizeof(capabilities) ;
  1021. int n_devices = (int)waveOutGetNumDevs() ;
  1022. bool is_wave_available = !!n_devices ;
  1023. if (n_devices)
  1024. {
  1025. for (int device_n = -1 ; device_n < n_devices ; ++device_n)
  1026. {
  1027. UINT caps_result = waveOutGetDevCaps(device_n , &capabilities , caps_size) ;
  1028. device_names.add((caps_result == MMSYSERR_NOERROR)?
  1029. String(capabilities.szPname) :
  1030. String("(device error)") ) ;
  1031. }
  1032. this->sourceComboBox->addItemList(device_names , 1) ;
  1033. this->sinkComboBox ->addItemList(device_names , 1) ;
  1034. this->bufferComboBox->addItemList(CLIENT::BUFFER_SIZES , 1) ;
  1035. }
  1036. /*
  1037. if (n_devices)
  1038. {
  1039. for (int device_n = -1 ; device_n < n_devices ; ++device_n)
  1040. {
  1041. UINT caps_result = waveOutGetDevCaps(device_n , &capabilities , caps_size) ;
  1042. String device_name = (caps_result == MMSYSERR_NOERROR)?
  1043. String(capabilities.szPname) :
  1044. String("(device error)") ;
  1045. this->sourceComboBox->addItem(device_name , device_n + 2) ;
  1046. this->sinkComboBox ->addItem(device_name , device_n + 2) ;
  1047. }
  1048. this->bufferComboBox->addItemList(CLIENT::BUFFER_SIZES , 1) ;
  1049. }
  1050. */
  1051. else
  1052. {
  1053. this->sourceComboBox->addItem("(no wave devices found)" , 1) ;
  1054. this->sinkComboBox ->addItem("(no wave devices found)" , 1) ;
  1055. }
  1056. return is_wave_available ;
  1057. }
  1058. #else // _WIN32
  1059. # ifdef _MAC
  1060. bool ConfigAudio::queryCoreaudioDevices() { return true ; } // TODO: juce or ryo ?
  1061. # else // _MAC
  1062. bool ConfigAudio::queryJackServers() // TODO: juce or ryo ?
  1063. {
  1064. this->driverComboBox->addItem("default jack server" , 1) ;
  1065. return true ;
  1066. }
  1067. bool ConfigAudio::queryAlsaDevices() { enableComponents() ; } // TODO: juce or ryo ?
  1068. # endif // _MAC
  1069. #endif // _WIN32
  1070. /* ConfigAudio class private class methods */
  1071. #ifdef _WIN32
  1072. BOOL CALLBACK ConfigAudio::DSEnumProc(LPGUID lpGUID , LPCTSTR lpszDesc ,
  1073. LPCTSTR lpszDrvName , LPVOID device_names)
  1074. {
  1075. /* TODO: if we need guids
  1076. LPGUID guid = nullptr ;
  1077. if (lpGUID != nullptr) // NULL == "Primary Sound Driver" (always first)
  1078. {
  1079. if ((guid = (LPGUID)malloc(sizeof(GUID))) == nullptr) return TRUE ;
  1080. memcpy(guid , lpGUID , sizeof(GUID)) ;
  1081. }
  1082. // store guid -->
  1083. std::array<LPGUID> ???
  1084. return TRUE ;
  1085. // then eventually
  1086. free(guid) ;
  1087. */
  1088. ((StringArray*)device_names)->add((lpGUID == nullptr)? "Primary Sound Driver" :
  1089. String(lpszDesc) ) ;
  1090. return TRUE ;
  1091. }
  1092. #endif // _WIN32
  1093. //[/MiscUserCode]
  1094. //==============================================================================
  1095. #if 0
  1096. /* -- Introjucer information section --
  1097. This is where the Introjucer stores the metadata that describe this GUI layout, so
  1098. make changes in here at your peril!
  1099. BEGIN_JUCER_METADATA
  1100. <JUCER_COMPONENT documentType="Component" className="ConfigAudio" componentName=""
  1101. parentClasses="public Component" constructorParams="ValueTree config_store"
  1102. variableInitialisers="configStore(config_store)" snapPixels="8"
  1103. snapActive="1" snapShown="1" overlayOpacity="0.330" fixedSize="1"
  1104. initialWidth="614" initialHeight="434">
  1105. <BACKGROUND backgroundColour="0">
  1106. <ROUNDRECT pos="0 0 0M 0M" cornerSize="10" fill="solid: ff002000" hasStroke="0"/>
  1107. </BACKGROUND>
  1108. <GROUPCOMPONENT name="ioGroup" id="35b859a43662c4ca" memberName="ioGroup" virtualName=""
  1109. explicitFocusOrder="0" pos="132 38 350 126" outlinecol="ff808080"
  1110. textcol="ffffffff" title="i/o" textpos="33"/>
  1111. <GROUPCOMPONENT name="formatGroup" id="29fbf63c3d8d3e1b" memberName="formatGroup"
  1112. virtualName="" explicitFocusOrder="0" pos="132 176 350 60" outlinecol="ff808080"
  1113. textcol="ffffffff" title="format" textpos="33"/>
  1114. <GROUPCOMPONENT name="buffersGroup" id="76ccd33b9d1f605a" memberName="buffersGroup"
  1115. virtualName="" explicitFocusOrder="0" pos="132 250 350 48" outlinecol="ff808080"
  1116. textcol="ffffffff" title="buffers (122.2ms)" textpos="33"/>
  1117. <GROUPCOMPONENT name="routingGroup" id="65c871d13e6e8329" memberName="routingGroup"
  1118. virtualName="" explicitFocusOrder="0" pos="132 312 350 74" outlinecol="ff808080"
  1119. textcol="ffffffff" title="routing" textpos="33"/>
  1120. <TEXTBUTTON name="defaultsButton" id="f03cc2695d9642e1" memberName="defaultsButton"
  1121. virtualName="" explicitFocusOrder="0" pos="68R 4 64 24" buttonText="defaults"
  1122. connectedEdges="0" needsCallback="1" radioGroupId="0"/>
  1123. <TEXTBUTTON name="asioButton" id="130c484d97b7c34a" memberName="asioButton"
  1124. virtualName="" explicitFocusOrder="0" pos="68R 4 64 24" buttonText="asio config"
  1125. connectedEdges="0" needsCallback="1" radioGroupId="0"/>
  1126. <LABEL name="modeLabel" id="582ccc898eac60c0" memberName="modeLabel"
  1127. virtualName="" explicitFocusOrder="0" pos="140 56 64 18" textCol="ffffffff"
  1128. edTextCol="ff000000" edBkgCol="0" labelText="interface:" editableSingleClick="0"
  1129. editableDoubleClick="0" focusDiscardsChanges="0" fontname="Default font"
  1130. fontsize="15" bold="0" italic="0" justification="33"/>
  1131. <COMBOBOX name="modeComboBox" id="d9fdbc02138c7335" memberName="modeComboBox"
  1132. virtualName="" explicitFocusOrder="1" pos="212 56 256 18" editable="0"
  1133. layout="33" items="" textWhenNonSelected="" textWhenNoItems="(no choices)"/>
  1134. <LABEL name="driverLabel" id="5cb85d669129843" memberName="driverLabel"
  1135. virtualName="" explicitFocusOrder="0" pos="140 82 64 18" textCol="ffffffff"
  1136. edTextCol="ff000000" edBkgCol="0" labelText="driver:" editableSingleClick="0"
  1137. editableDoubleClick="0" focusDiscardsChanges="0" fontname="Default font"
  1138. fontsize="15" bold="0" italic="0" justification="33"/>
  1139. <COMBOBOX name="driverComboBox" id="bc523f21b8e70676" memberName="driverComboBox"
  1140. virtualName="" explicitFocusOrder="1" pos="212 82 256 18" editable="0"
  1141. layout="33" items="" textWhenNonSelected="" textWhenNoItems="(no choices)"/>
  1142. <LABEL name="sourceLabel" id="28e9c840504ea936" memberName="sourceLabel"
  1143. virtualName="" explicitFocusOrder="0" pos="140 108 64 18" textCol="ffffffff"
  1144. edTextCol="ff000000" edBkgCol="0" labelText="input:" editableSingleClick="0"
  1145. editableDoubleClick="0" focusDiscardsChanges="0" fontname="Default font"
  1146. fontsize="15" bold="0" italic="0" justification="33"/>
  1147. <COMBOBOX name="sourceComboBox" id="195d38c0dfa0b780" memberName="sourceComboBox"
  1148. virtualName="" explicitFocusOrder="2" pos="212 108 256 18" editable="0"
  1149. layout="33" items="" textWhenNonSelected="" textWhenNoItems="(no choices)"/>
  1150. <LABEL name="sinkLabel" id="a67b459c94aba72e" memberName="sinkLabel"
  1151. virtualName="" explicitFocusOrder="0" pos="140 134 64 16" textCol="ffffffff"
  1152. edTextCol="ff000000" edBkgCol="0" labelText="output:" editableSingleClick="0"
  1153. editableDoubleClick="0" focusDiscardsChanges="0" fontname="Default font"
  1154. fontsize="15" bold="0" italic="0" justification="33"/>
  1155. <COMBOBOX name="sinkComboBox" id="3b81e2ff4dec7469" memberName="sinkComboBox"
  1156. virtualName="" explicitFocusOrder="3" pos="212 134 256 18" editable="0"
  1157. layout="33" items="" textWhenNonSelected="" textWhenNoItems="(no choices)"/>
  1158. <LABEL name="bitdepthLabel" id="cca18f8e57581cc5" memberName="bitdepthLabel"
  1159. virtualName="" explicitFocusOrder="0" pos="140 190 64 18" textCol="ffffffff"
  1160. edTextCol="ff000000" edBkgCol="0" labelText="bit depth:" editableSingleClick="0"
  1161. editableDoubleClick="0" focusDiscardsChanges="0" fontname="Default font"
  1162. fontsize="15" bold="0" italic="0" justification="33"/>
  1163. <TOGGLEBUTTON name="bps16Button" id="ccb740c03ababc9f" memberName="bps16Button"
  1164. virtualName="" explicitFocusOrder="4" pos="212 191 64 18" txtcol="ffffffff"
  1165. buttonText="16bit" connectedEdges="0" needsCallback="1" radioGroupId="1"
  1166. state="1"/>
  1167. <TOGGLEBUTTON name="bps24Button" id="2bfc206fbb162f7f" memberName="bps24Button"
  1168. virtualName="" explicitFocusOrder="5" pos="288 191 64 18" txtcol="ffffffff"
  1169. buttonText="24bit" connectedEdges="0" needsCallback="1" radioGroupId="1"
  1170. state="0"/>
  1171. <TOGGLEBUTTON name="bps32Button" id="1cc075dc412ce404" memberName="bps32Button"
  1172. virtualName="" explicitFocusOrder="6" pos="364 191 64 18" txtcol="ffffffff"
  1173. buttonText="32bit" connectedEdges="0" needsCallback="1" radioGroupId="1"
  1174. state="0"/>
  1175. <LABEL name="samplerateLabel" id="e79ba6de77a4b042" memberName="samplerateLabel"
  1176. virtualName="" explicitFocusOrder="0" pos="140 210 72 18" textCol="ffffffff"
  1177. edTextCol="ff000000" edBkgCol="0" labelText="sample rate:" editableSingleClick="0"
  1178. editableDoubleClick="0" focusDiscardsChanges="0" fontname="Default font"
  1179. fontsize="15" bold="0" italic="0" justification="33"/>
  1180. <TOGGLEBUTTON name="kHz44Button" id="56ab804241495c7b" memberName="kHz44Button"
  1181. virtualName="" explicitFocusOrder="7" pos="212 211 64 18" txtcol="ffffffff"
  1182. buttonText="44.1kHz" connectedEdges="0" needsCallback="1" radioGroupId="2"
  1183. state="1"/>
  1184. <TOGGLEBUTTON name="kHz48Button" id="415b27279e48004f" memberName="kHz48Button"
  1185. virtualName="" explicitFocusOrder="8" pos="288 211 64 18" txtcol="ffffffff"
  1186. buttonText="48kHz" connectedEdges="0" needsCallback="1" radioGroupId="2"
  1187. state="0"/>
  1188. <TOGGLEBUTTON name="kHz96Button" id="4241809c486a0995" memberName="kHz96Button"
  1189. virtualName="" explicitFocusOrder="9" pos="364 211 64 18" txtcol="ffffffff"
  1190. buttonText="96kHz" connectedEdges="0" needsCallback="1" radioGroupId="2"
  1191. state="0"/>
  1192. <LABEL name="buffersLabel" id="78ac240fcc5eed16" memberName="buffersLabel"
  1193. virtualName="" explicitFocusOrder="0" pos="140 268 64 18" textCol="ffffffff"
  1194. edTextCol="ff000000" edBkgCol="0" labelText="# of buffers" editableSingleClick="0"
  1195. editableDoubleClick="0" focusDiscardsChanges="0" fontname="Default font"
  1196. fontsize="15" bold="0" italic="0" justification="33"/>
  1197. <SLIDER name="nBuffersSlider" id="76a832d1fac666e" memberName="nBuffersSlider"
  1198. virtualName="" explicitFocusOrder="10" pos="212 268 64 18" min="0"
  1199. max="16" int="1" style="IncDecButtons" textBoxPos="TextBoxLeft"
  1200. textBoxEditable="0" textBoxWidth="80" textBoxHeight="20" skewFactor="1"/>
  1201. <LABEL name="xLabel" id="5a9596c9eb8db178" memberName="xLabel" virtualName=""
  1202. explicitFocusOrder="0" pos="275 268 16 18" textCol="ffffffff"
  1203. edTextCol="ff000000" edBkgCol="0" labelText="x" editableSingleClick="0"
  1204. editableDoubleClick="0" focusDiscardsChanges="0" fontname="Default font"
  1205. fontsize="15" bold="0" italic="0" justification="33"/>
  1206. <COMBOBOX name="bufferComboBox" id="bef2196516ab5821" memberName="bufferComboBox"
  1207. virtualName="" explicitFocusOrder="11" pos="292 268 52 18" editable="0"
  1208. layout="33" items="" textWhenNonSelected="" textWhenNoItems="(no choices)"/>
  1209. <LABEL name="bytesLabel" id="f93456e3175d33d6" memberName="bytesLabel"
  1210. virtualName="" explicitFocusOrder="0" pos="346 268 64 18" textCol="ffffffff"
  1211. edTextCol="ff000000" edBkgCol="0" labelText="bytes" editableSingleClick="0"
  1212. editableDoubleClick="0" focusDiscardsChanges="0" fontname="Default font"
  1213. fontsize="15" bold="0" italic="0" justification="33"/>
  1214. <LABEL name="nixConfigLabel" id="78568b552c534b6d" memberName="nixConfigLabel"
  1215. virtualName="" explicitFocusOrder="0" pos="140 332 64 18" textCol="ffffffff"
  1216. edTextCol="ff000000" edBkgCol="0" labelText="client name" editableSingleClick="0"
  1217. editableDoubleClick="0" focusDiscardsChanges="0" fontname="Default font"
  1218. fontsize="15" bold="0" italic="0" justification="33"/>
  1219. <TEXTEDITOR name="nixConfigText" id="fdccbcd88a94d4bb" memberName="nixConfigText"
  1220. virtualName="" explicitFocusOrder="12" pos="212 332 256 18" textcol="ff808080"
  1221. bkgcol="ff000000" initialText="" multiline="0" retKeyStartsLine="0"
  1222. readonly="0" scrollbars="1" caret="1" popupmenu="0"/>
  1223. <LABEL name="nSourcesLabel" id="fa0df2e2a11e57d8" memberName="nSourcesLabel"
  1224. virtualName="" explicitFocusOrder="0" pos="140 358 64 18" textCol="ffffffff"
  1225. edTextCol="ff000000" edBkgCol="0" labelText="# of sources" editableSingleClick="0"
  1226. editableDoubleClick="0" focusDiscardsChanges="0" fontname="Default font"
  1227. fontsize="15" bold="0" italic="0" justification="33"/>
  1228. <SLIDER name="nSourcesSlider" id="3a13d77beb71d910" memberName="nSourcesSlider"
  1229. virtualName="" explicitFocusOrder="13" pos="214 358 64 18" min="0"
  1230. max="16" int="1" style="IncDecButtons" textBoxPos="TextBoxLeft"
  1231. textBoxEditable="0" textBoxWidth="80" textBoxHeight="20" skewFactor="1"/>
  1232. <LABEL name="nSinksLabel" id="2da0a2441a20f3b0" memberName="nSinksLabel"
  1233. virtualName="" explicitFocusOrder="0" pos="330 358 64 18" textCol="ffffffff"
  1234. edTextCol="ff000000" edBkgCol="0" labelText="# of sinks" editableSingleClick="0"
  1235. editableDoubleClick="0" focusDiscardsChanges="0" fontname="Default font"
  1236. fontsize="15" bold="0" italic="0" justification="33"/>
  1237. <SLIDER name="nSinksSlider" id="182ff4a5ae799417" memberName="nSinksSlider"
  1238. virtualName="" explicitFocusOrder="14" pos="404 358 64 18" min="0"
  1239. max="16" int="1" style="IncDecButtons" textBoxPos="TextBoxLeft"
  1240. textBoxEditable="0" textBoxWidth="80" textBoxHeight="20" skewFactor="1"/>
  1241. </JUCER_COMPONENT>
  1242. END_JUCER_METADATA
  1243. */
  1244. #endif
  1245. //[EndFile] You can add extra defines here...
  1246. //[/EndFile]