Lv2FxControls.cpp 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. /*
  2. * Lv2FxControls.cpp - Lv2FxControls 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 "Lv2FxControls.h"
  25. #include <QDomElement>
  26. #include "Engine.h"
  27. #include "Lv2Effect.h"
  28. #include "Lv2FxControlDialog.h"
  29. #include "Lv2Proc.h"
  30. Lv2FxControls::Lv2FxControls(class Lv2Effect *effect, const QString& uri) :
  31. EffectControls(effect),
  32. Lv2ControlBase(this, uri)
  33. {
  34. if (isValid())
  35. {
  36. connect(Engine::mixer(), &Mixer::sampleRateChanged,
  37. this, [this](){Lv2ControlBase::reloadPlugin();});
  38. }
  39. }
  40. void Lv2FxControls::saveSettings(QDomDocument &doc, QDomElement &that)
  41. {
  42. Lv2ControlBase::saveSettings(doc, that);
  43. }
  44. void Lv2FxControls::loadSettings(const QDomElement &that)
  45. {
  46. Lv2ControlBase::loadSettings(that);
  47. }
  48. int Lv2FxControls::controlCount()
  49. {
  50. return static_cast<int>(Lv2ControlBase::controlCount());
  51. }
  52. EffectControlDialog *Lv2FxControls::createView()
  53. {
  54. return new Lv2FxControlDialog(this);
  55. }
  56. void Lv2FxControls::changeControl() // TODO: what is that?
  57. {
  58. // engine::getSong()->setModified();
  59. }
  60. DataFile::Types Lv2FxControls::settingsType()
  61. {
  62. return DataFile::EffectSettings;
  63. }
  64. void Lv2FxControls::setNameFromFile(const QString &name)
  65. {
  66. effect()->setDisplayName(name);
  67. }