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.

56 lines
1.4KB

  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. getPlugin().printText ("This is a message sent from the website's javascript...");
  16. }
  17. function popUpMessageBox()
  18. {
  19. // fetch a couple of properties from the plugin and tell the plugin to show them in a pop-up box..
  20. getPlugin().popUpMessageBox ("property1 = " + getPlugin().property1
  21. + "\nproperty2 = " + getPlugin().property2);
  22. }
  23. // callbacks from plugin...
  24. function WebpageCallbacks()
  25. {
  26. this.printmessage = printmessage;
  27. }
  28. function sendCallbackObjectToPlugin()
  29. {
  30. // This gives the plugin an object containing methods that it can call, so that it
  31. // can trigger events in the webpage..
  32. getPlugin().registerCallbackObject (new WebpageCallbacks());
  33. }
  34. </script>
  35. <embed id="plugin" type="application/npjucedemo-plugin" width=80% height=400>
  36. <br>
  37. <form name="formname">
  38. <input type=button value="Tell the plugin to show a message" onclick='showAMessage()'>
  39. <input type=button value="Tell the plugin to show a pop-up" onclick='popUpMessageBox()'>
  40. <input type=button value="Pass a callback object to the plugin" onclick='sendCallbackObjectToPlugin()'>
  41. </form>
  42. <div id="result"></div>
  43. </center>
  44. </BODY></HTML>