void OnGUI() { try { if (window == null) { Init(); } if (LogInfo == null) { LogInfo = new BuilderInfo(); } float startx = 5; float starty = 7; if (styleRowListNormal == null) { styleRowListNormal = new GUIStyle("box"); } if (styleRowListSelected == null) { styleRowListSelected = new GUIStyle("box"); styleRowListSelected.normal.background = ToolsEditor.SetColor(new Texture2D(2, 2), new Color(.6f, .8f, .6f, 1f)); } GUIContent content = new GUIContent() { text = "Setup SoundFont in your application - Version " + ToolsEditor.version, tooltip = "" }; EditorGUI.LabelField(new Rect(startx, starty, 500, itemHeight), content, styleBold); GUI.color = ToolsEditor.ButtonColor; content = new GUIContent() { text = "Help & Contact", tooltip = "Get some help" }; // Set position of the button Rect rect = new Rect(window.position.size.x - buttonLargeWidth - 5, starty, buttonLargeWidth, buttonHeight); if (GUI.Button(rect, content)) { PopupWindow.Show(rect, new AboutMPTK()); } starty += buttonHeight + espace; widthRight = window.position.size.x - widthLeft - 2 * espace - startx; //widthRight = window.position.size.x / 2f - espace; //widthLeft = window.position.size.x / 2f - espace; heightLeftBottom = window.position.size.y - heightLeftTop - 3 * espace - starty; heightRightBottom = window.position.size.y - heightRightTop - 3 * espace - starty; // Display list of soundfont already loaded ShowListSoundFonts(startx, starty, widthLeft, heightLeftTop); ShowListBanks(startx + widthLeft + espace, starty, widthRight, heightRightTop); ShowExtractOptim(startx + widthLeft + espace, starty + heightRightTop + espace, widthRight, heightRightBottom + espace); ShowLogOptim(startx, starty + espace + heightLeftTop, widthLeft, heightLeftBottom + espace); } catch (ExitGUIException) { } catch (Exception ex) { MidiPlayerGlobal.ErrorDetail(ex); } }
void OnGUI() { try { if (window == null) { Init(); } if (LogInfo == null) { LogInfo = new BuilderInfo(); } float startx = 5; float starty = 7; if (styleRowListNormal == null) { styleRowListNormal = new GUIStyle("box"); } if (styleRowListSelected == null) { styleRowListSelected = new GUIStyle("box"); styleRowListSelected.normal.background = ToolsEditor.SetColor(new Texture2D(2, 2), new Color(.6f, .8f, .6f, 1f)); } GUIContent content = new GUIContent() { text = "Setup SoundFont - Version " + ToolsEditor.version, tooltip = "" }; EditorGUI.LabelField(new Rect(startx, starty, 500, itemHeight), content, styleBold); if (GUI.Button(new Rect(startx + 370, starty - 5, 25, 25), buttonIconHelp)) { //CreateWave createwave = new CreateWave(); //string path = System.IO.Path.Combine(MidiPlayerGlobal.MPTK_PathToResources, "unitySample") + ".wav"; ////string path = "unitySample.wav"; //HiSample sample = new HiSample(); ////sample.LoopStart = sample.LoopEnd = 0; //byte[] data = new byte[10000]; //for (int i = 0; i < data.Length; i++) data[i] = (byte)255; //sample.SampleRate = 44100; //sample.End = (uint)data.Length/2; //createwave.Build(path, sample, data); Application.OpenURL("https://paxstellar.fr/setup-mptk-add-soundfonts-v2/"); } GUI.color = ToolsEditor.ButtonColor; content = new GUIContent() { text = "Help & Contact", tooltip = "Get some help" }; // Set position of the button Rect rect = new Rect(window.position.size.x - buttonLargeWidth - 5, starty, buttonLargeWidth, buttonHeight); if (GUI.Button(rect, content)) { PopupWindow.Show(rect, new AboutMPTK()); } starty += buttonHeight + espace; widthRight = window.position.size.x - widthLeft - 2 * espace - startx; //widthRight = window.position.size.x / 2f - espace; //widthLeft = window.position.size.x / 2f - espace; heightLeftBottom = window.position.size.y - heightLeftTop - 3 * espace - starty; heightRightBottom = window.position.size.y - heightRightTop - 3 * espace - starty; // Display list of soundfont already loaded ShowListSoundFonts(startx, starty, widthLeft, heightLeftTop); ShowListBanks(startx + widthLeft + espace, starty, widthRight, heightRightTop); ShowExtractOptim(startx + widthLeft + espace, starty + heightRightTop + espace, widthRight, heightRightBottom + espace); ShowLogOptim(startx, starty + espace + heightLeftTop, widthLeft, heightLeftBottom + espace); } catch (ExitGUIException) { } catch (Exception ex) { MidiPlayerGlobal.ErrorDetail(ex); } }