LMMS
Loading...
Searching...
No Matches
StepRecorderWidget.h
Go to the documentation of this file.
1/*
2 * StepRecorderWidget.h - widget that provide gui markers for step recording
3 *
4 * This file is part of LMMS - https://lmms.io
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of"the GNU General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public
17 * License along with this program (see COPYING); if not, write to the
18 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 * Boston, MA 02110-1301 USA.
20 *
21 */
22
23#ifndef LMMS_GUI_STEP_RECOREDER_WIDGET_H
24#define LMMS_GUI_STEP_RECOREDER_WIDGET_H
25
26#include <QWidget>
27#include <QColor>
28
29#include "TimePos.h"
30
31namespace lmms::gui
32{
33
34class StepRecorderWidget : public QWidget
35{
36 Q_OBJECT
37
38public:
40 QWidget * parent,
41 const int ppb,
42 const int marginTop,
43 const int marginBottom,
44 const int marginLeft,
45 const int marginRight);
46
47 //API used by PianoRoll
48 void setPixelsPerBar(int ppb);
49 void setCurrentPosition(TimePos currentPosition);
50 void setMargins(const QMargins &qm);
51 void setBottomMargin(const int marginBottom);
52 QMargins margins();
53
54 //API used by StepRecorder
55 void setStepsLength(TimePos stepsLength);
56 void setStartPosition(TimePos pos);
57 void setEndPosition(TimePos pos);
58
59 void showHint();
60
61private:
62 void paintEvent(QPaintEvent * pe) override;
63
64 int xCoordOfTick(int tick);
65
66 void drawVerLine(QPainter* painter, int x, const QColor& color, int top, int bottom);
67 void drawVerLine(QPainter* painter, const TimePos& pos, const QColor& color, int top, int bottom);
68
69 void updateBoundaries();
70
74
75 int m_ppb; // pixels per bar
76 TimePos m_currentPosition; // current position showed by on PianoRoll
77
80
81 // boundaries within piano roll window
82 int m_top;
84 int m_left;
86
87 const int m_marginTop;
88 int m_marginBottom; // not const since can change on resize of edit-note area
89 const int m_marginLeft;
90 const int m_marginRight;
91
92signals:
94} ;
95
96} // namespace lmms::gui
97
98#endif // LMMS_GUI_STEP_RECOREDER_WIDGET_H
Definition TimePos.h:68
QColor m_colorLineEnd
Definition StepRecorderWidget.h:79
const int m_marginRight
Definition StepRecorderWidget.h:90
int m_right
Definition StepRecorderWidget.h:85
void setPixelsPerBar(int ppb)
Definition StepRecorderWidget.cpp:56
void updateBoundaries()
Definition StepRecorderWidget.cpp:164
QMargins margins()
Definition StepRecorderWidget.cpp:74
const int m_marginTop
Definition StepRecorderWidget.h:87
int m_left
Definition StepRecorderWidget.h:84
TimePos m_stepsLength
Definition StepRecorderWidget.h:71
void setStepsLength(TimePos stepsLength)
Definition StepRecorderWidget.cpp:101
StepRecorderWidget(QWidget *parent, const int ppb, const int marginTop, const int marginBottom, const int marginLeft, const int marginRight)
Definition StepRecorderWidget.cpp:32
const int m_marginLeft
Definition StepRecorderWidget.h:89
void setMargins(const QMargins &qm)
Definition StepRecorderWidget.cpp:66
void paintEvent(QPaintEvent *pe) override
Definition StepRecorderWidget.cpp:106
void setBottomMargin(const int marginBottom)
Definition StepRecorderWidget.cpp:79
QColor m_colorLineStart
Definition StepRecorderWidget.h:78
void drawVerLine(QPainter *painter, int x, const QColor &color, int top, int bottom)
Definition StepRecorderWidget.cpp:150
TimePos m_currentPosition
Definition StepRecorderWidget.h:76
int m_bottom
Definition StepRecorderWidget.h:83
int m_top
Definition StepRecorderWidget.h:82
int xCoordOfTick(int tick)
Definition StepRecorderWidget.cpp:144
TimePos m_curStepEndPos
Definition StepRecorderWidget.h:73
int m_ppb
Definition StepRecorderWidget.h:75
void setCurrentPosition(TimePos currentPosition)
Definition StepRecorderWidget.cpp:61
void showHint()
Definition StepRecorderWidget.cpp:95
int m_marginBottom
Definition StepRecorderWidget.h:88
void positionChanged(const lmms::TimePos &t)
TimePos m_curStepStartPos
Definition StepRecorderWidget.h:72
void setStartPosition(TimePos pos)
Definition StepRecorderWidget.cpp:84
void setEndPosition(TimePos pos)
Definition StepRecorderWidget.cpp:89
struct huft * t
Definition inflate.c:943
unsigned x[BMAX+1]
Definition inflate.c:1586
static uintptr_t parent
Definition pugl.h:1644
Definition AudioPortAudio.cpp:223