The JUCE cross-platform C++ framework, with DISTRHO/KXStudio specific changes
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

62 lines
1.6KB

  1. <HTML><HEAD><TITLE>Juce Plugin Test</TITLE></HEAD>
  2. <BODY>
  3. <center>
  4. <script>
  5. function printmessage(arg)
  6. {
  7. document.getElementById ("result").innerHTML += "<p>" + arg + "</p>";
  8. }
  9. function getPlugin()
  10. {
  11. return document.getElementById ("plugin");
  12. }
  13. function showAMessage()
  14. {
  15. var response = getPlugin().printText ("This is a message sent from the website's javascript...");
  16. printmessage (response);
  17. }
  18. function popUpMessageBox()
  19. {
  20. // fetch a couple of properties from the plugin and tell the plugin to show them in a pop-up box..
  21. getPlugin().popUpMessageBox ("property1 = " + getPlugin().property1
  22. + "\nproperty2 = " + getPlugin().property2);
  23. }
  24. // callbacks from plugin...
  25. function WebpageCallbacks()
  26. {
  27. this.printmessage = printmessage;
  28. }
  29. function sendCallbackObjectToPlugin()
  30. {
  31. // This gives the plugin an object containing methods that it can call, so that it
  32. // can trigger events in the webpage..
  33. getPlugin().registerCallbackObject (new WebpageCallbacks());
  34. }
  35. </script>
  36. <object id="plugin"
  37. type="application/npjucedemo-plugin"
  38. classid="CLSID:F683B990-3ADF-11DE-BDFE-F9CB55D89593"
  39. width="80%" height="400">
  40. <embed src="" type="application/npjucedemo-plugin" width="80%" height="400"></embed>
  41. </object>
  42. <br>
  43. <form name="formname">
  44. <input type=button value="Tell the plugin to show a message" onclick='showAMessage()'>
  45. <input type=button value="Tell the plugin to show a pop-up" onclick='popUpMessageBox()'>
  46. <input type=button value="Pass a callback object to the plugin" onclick='sendCallbackObjectToPlugin()'>
  47. </form>
  48. <div id="result"></div>
  49. </center>
  50. </BODY></HTML>