Lv2FxControlDialog.cpp 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /*
  2. * Lv2FxControlDialog.cpp - Lv2FxControlDialog implementation
  3. *
  4. * Copyright (c) 2018-2020 Johannes Lorenz <jlsf2013$users.sourceforge.net, $=@>
  5. *
  6. * This file is part of LMMS - https://lmms.io
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public
  10. * License as published by the Free Software Foundation; either
  11. * version 2 of the License, or (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. * General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public
  19. * License along with this program (see COPYING); if not, write to the
  20. * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  21. * Boston, MA 02110-1301 USA.
  22. *
  23. */
  24. #include "Lv2FxControlDialog.h"
  25. #include <QDebug>
  26. #include <QPushButton>
  27. #include <lv2.h>
  28. #include "Lv2Effect.h"
  29. #include "Lv2FxControls.h"
  30. Lv2FxControlDialog::Lv2FxControlDialog(Lv2FxControls *controls) :
  31. EffectControlDialog(controls),
  32. Lv2ViewBase(this, controls)
  33. {
  34. if (m_reloadPluginButton) {
  35. connect(m_reloadPluginButton, &QPushButton::clicked,
  36. this, [this](){ lv2Controls()->reloadPlugin(); });
  37. }
  38. if (m_toggleUIButton) {
  39. connect(m_toggleUIButton, &QPushButton::toggled,
  40. this, [this](){ toggleUI(); });
  41. }
  42. if (m_helpButton) {
  43. connect(m_helpButton, &QPushButton::toggled,
  44. this, [this](bool visible){ toggleHelp(visible); });
  45. }
  46. // for Effects, modelChanged only goes to the top EffectView
  47. // we need to call it manually
  48. modelChanged();
  49. }
  50. Lv2FxControls *Lv2FxControlDialog::lv2Controls()
  51. {
  52. return static_cast<Lv2FxControls *>(m_effectControls);
  53. }
  54. void Lv2FxControlDialog::modelChanged()
  55. {
  56. Lv2ViewBase::modelChanged(lv2Controls());
  57. }