crossfade.m 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #include <lib/std.mi>
  2. Global Group frameGroup;
  3. Global Slider slidercb;
  4. Global Text fadertext;
  5. Global Button CFIncrease, CFDecrease;
  6. Global ToggleButton Crossfade;
  7. Global Layer DisplayOverlay;
  8. System.onScriptLoaded() {
  9. frameGroup = getScriptGroup();
  10. slidercb = frameGroup.findObject("sCrossfade");
  11. fadertext = frameGroup.findObject("CFDisplay");
  12. CFIncrease = frameGroup.findObject("CrossfadeIncrease");
  13. CFDecrease = frameGroup.findObject("CrossfadeDecrease");
  14. Crossfade = frameGroup.findObject("Crossfade");
  15. DisplayOverlay = frameGroup.findObject("crossfade.display.overlay");
  16. slidercb.onSetPosition(slidercb.getPosition());
  17. Crossfade.onToggle(Crossfade.getActivated());
  18. }
  19. slidercb.onSetPosition(int val) {
  20. String s = IntegerToString(val);
  21. fadertext.setText(s);
  22. }
  23. CFIncrease.onLeftClick() {
  24. slidercb.SetPosition(slidercb.getPosition()+1);
  25. }
  26. CFDecrease.onLeftClick() {
  27. slidercb.SetPosition(slidercb.getPosition()-1);
  28. }
  29. Crossfade.onToggle(boolean on) {
  30. if (!on)
  31. {
  32. fadertext.setAlpha(150);
  33. CFIncrease.setAlpha(150);
  34. CFDecrease.setXmlParam("ghost" , "1");
  35. CFDecrease.setAlpha(150);
  36. CFIncrease.setXmlParam("ghost" , "1");
  37. DisplayOverlay.show();
  38. }
  39. else
  40. {
  41. fadertext.setAlpha(255);
  42. CFIncrease.setAlpha(255);
  43. CFDecrease.setAlpha(255);
  44. CFIncrease.setXmlParam("ghost" , "0");
  45. CFDecrease.setXmlParam("ghost" , "0");
  46. DisplayOverlay.hide();
  47. }
  48. }