seqpreamp.cpp 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #include <precomp.h>
  2. #include "seqpreamp.h"
  3. #include <api/core/api_core.h>
  4. const wchar_t eqPreAmpXuiStr[] = L"EQPreAmp"; // This is the xml tag
  5. char eqPreAmpXuiSvcName[] = "EQPreAmp xui object"; // this is the name of the xuiservice
  6. SEQPreamp::SEQPreamp() {
  7. setDrawOnBorders(TRUE);
  8. setEnable(TRUE);
  9. setHotPosition(0);
  10. setLimits(-127,127);
  11. discard_next_event = 0;
  12. }
  13. SEQPreamp::~SEQPreamp() {
  14. WASABI_API_MEDIACORE->core_delCallback(0, this);
  15. }
  16. int SEQPreamp::onInit() {
  17. SEQPREAMP_PARENT::onInit();
  18. corecb_onEQPreampChange(WASABI_API_MEDIACORE->core_getEqPreamp(0));
  19. WASABI_API_MEDIACORE->core_addCallback(0, this);
  20. return 1;
  21. }
  22. int SEQPreamp::onSetPosition() {
  23. setHotPosition((Std::keyDown(VK_SHIFT) ? -1 : 0));
  24. SEQPREAMP_PARENT::onSetPosition();
  25. int pos = getSliderPosition(); // get slider pos
  26. discard_next_event = 1;
  27. WASABI_API_MEDIACORE->core_setEqPreamp(0,pos);
  28. discard_next_event = 0;
  29. return 1;
  30. }
  31. int SEQPreamp::corecb_onEQPreampChange(int newval) {
  32. if (discard_next_event) return 0;
  33. setPosition(newval,0);
  34. return 0;
  35. }