SampleTrackWindow.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. /*
  2. * SampleTrackWindow.h
  3. *
  4. * Copyright (c) 2005-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 SAMPLE_TRACK_WINDOW_H
  25. #define SAMPLE_TRACK_WINDOW_H
  26. #include "MixerLineLcdSpinBox.h"
  27. #include <QLineEdit>
  28. #include "EffectRackView.h"
  29. #include "SampleTrack.h"
  30. class SampleTrackWindow : public QWidget, public ModelView, public SerializingObjectHook
  31. {
  32. Q_OBJECT
  33. public:
  34. SampleTrackWindow(SampleTrackView * tv);
  35. virtual ~SampleTrackWindow();
  36. SampleTrack * model()
  37. {
  38. return castModel<SampleTrack>();
  39. }
  40. const SampleTrack * model() const
  41. {
  42. return castModel<SampleTrack>();
  43. }
  44. void setSampleTrackView(SampleTrackView * tv);
  45. SampleTrackView *sampleTrackView()
  46. {
  47. return m_stv;
  48. }
  49. public slots:
  50. void textChanged(const QString & new_name);
  51. void toggleVisibility(bool on);
  52. void updateName();
  53. protected:
  54. // capture close-events for toggling sample-track-button
  55. void closeEvent(QCloseEvent * ce) override;
  56. void saveSettings(QDomDocument & doc, QDomElement & element) override;
  57. void loadSettings(const QDomElement & element) override;
  58. private:
  59. void modelChanged() override;
  60. SampleTrack * m_track;
  61. SampleTrackView * m_stv;
  62. // widgets on the top of an sample-track-window
  63. QLineEdit * m_nameLineEdit;
  64. Knob * m_volumeKnob;
  65. Knob * m_panningKnob;
  66. MixerLineLcdSpinBox * m_mixerChannelNumber;
  67. EffectRackView * m_effectRack;
  68. } ;
  69. #endif