PatternEditor.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. /*
  2. * PatternEditor.h - basic main-window for editing patterns
  3. *
  4. * Copyright (c) 2004-2014 Tobias Doerffel <tobydox/at/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. #ifndef PATTERN_EDITOR_H
  25. #define PATTERN_EDITOR_H
  26. #include "Editor.h"
  27. #include "TrackContainerView.h"
  28. class PatternStore;
  29. class ComboBox;
  30. class PatternEditor : public TrackContainerView
  31. {
  32. Q_OBJECT
  33. public:
  34. PatternEditor(PatternStore* ps);
  35. bool fixedClips() const override
  36. {
  37. return true;
  38. }
  39. void removeViewsForPattern(int pattern);
  40. void saveSettings(QDomDocument& doc, QDomElement& element) override;
  41. void loadSettings(const QDomElement& element) override;
  42. public slots:
  43. void addSteps();
  44. void cloneSteps();
  45. void removeSteps();
  46. void addSampleTrack();
  47. void addAutomationTrack();
  48. void cloneClip();
  49. protected slots:
  50. void dropEvent(QDropEvent * de ) override;
  51. void updatePosition();
  52. private:
  53. PatternStore* m_ps;
  54. void makeSteps( bool clone );
  55. };
  56. class PatternEditorWindow : public Editor
  57. {
  58. Q_OBJECT
  59. public:
  60. PatternEditorWindow(PatternStore* ps);
  61. ~PatternEditorWindow();
  62. QSize sizeHint() const override;
  63. PatternEditor* m_editor;
  64. public slots:
  65. void play() override;
  66. void stop() override;
  67. private:
  68. ComboBox* m_patternComboBox;
  69. };
  70. #endif