HalfSwing.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #ifndef HALFSWING_H
  2. #define HALFSWING_H
  3. #include <QObject>
  4. #include "AutomatableSlider.h"
  5. #include "Groove.h"
  6. #include "lmms_basics.h"
  7. #include "MidiTime.h"
  8. #include "Note.h"
  9. #include "Pattern.h"
  10. /**
  11. * A groove thatjust latter half of the HydrogenSwing algo.
  12. */
  13. class HalfSwing : public Groove
  14. {
  15. Q_OBJECT
  16. public:
  17. HalfSwing(QObject *parent = NULL);
  18. virtual ~HalfSwing();
  19. void init();
  20. int isInTick(MidiTime * curStart, const fpp_t frames, const f_cnt_t offset, Note * n, Pattern * p);
  21. inline virtual QString nodeName() const
  22. {
  23. return "half";
  24. }
  25. QWidget * instantiateView(QWidget * parent);
  26. public slots:
  27. // valid values are from 0 - 127
  28. void update();
  29. private:
  30. int m_framesPerTick;
  31. } ;
  32. class HalfSwingView : public QWidget
  33. {
  34. Q_OBJECT
  35. public:
  36. HalfSwingView(HalfSwing * halfSwing, QWidget * parent = NULL);
  37. ~HalfSwingView();
  38. public slots:
  39. void valueChanged();
  40. void modelChanged();
  41. private:
  42. HalfSwing * m_swing;
  43. IntModel * m_sliderModel;
  44. AutomatableSlider * m_slider;
  45. } ;
  46. #endif // HALFSWING_H