lmms
Cross-platform music production software
Toggle main menu visibility
Loading...
Searching...
No Matches
include
Editor.h
Go to the documentation of this file.
1
/*
2
* Editor.h - declaration of Editor class
3
*
4
* Copyright (c) 2014 Lukas W <lukaswhl/at/gmail.com>
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
25
#ifndef LMMS_GUI_EDITOR_H
26
#define LMMS_GUI_EDITOR_H
27
28
#include <QMainWindow>
29
#include <QToolBar>
30
31
class
QAction;
32
33
namespace
lmms::gui
34
{
35
36
static
const
int
Quantizations
[] = {
37
1, 2, 4, 8, 16, 32, 64,
38
3, 6, 12, 24, 48, 96, 192
39
};
40
41
42
class
DropToolBar;
43
48
class
Editor
:
public
QMainWindow
49
{
50
Q_OBJECT
51
public
:
52
void
setPauseIcon
(
bool
displayPauseIcon=
true
);
53
QAction *
playAction
()
const
;
54
static
Editor
*
lastPlayedEditor
() {
return
s_lastPlayedEditor
; }
55
protected
:
56
DropToolBar
*
addDropToolBarToTop
(QString
const
& windowTitle);
57
DropToolBar
*
addDropToolBar
(Qt::ToolBarArea whereToAdd, QString
const
& windowTitle);
58
DropToolBar
*
addDropToolBar
(QWidget * parent, Qt::ToolBarArea whereToAdd, QString
const
& windowTitle);
59
60
void
keyPressEvent
(QKeyEvent* ke)
override
;
61
62
public
slots:
64
void
togglePlayStop
();
66
void
togglePause
();
67
68
protected
slots:
69
virtual
void
play
() {}
70
virtual
void
record
() {}
71
virtual
void
recordAccompany
() {}
72
virtual
void
toggleStepRecording
() {}
73
virtual
void
stop
() {}
74
75
private
slots:
76
void
toggleMaximize
();
77
private
:
78
inline
static
Editor
*
s_lastPlayedEditor
=
nullptr
;
79
80
signals:
81
82
protected
:
87
Editor
(
bool
record
=
false
,
bool
stepRecord =
false
);
88
~Editor
()
override
=
default
;
89
90
91
DropToolBar
*
m_toolBar
;
92
93
QAction*
m_playAction
;
94
QAction*
m_recordAction
;
95
QAction*
m_recordAccompanyAction
;
96
QAction*
m_toggleStepRecordingAction
;
97
QAction*
m_stopAction
;
98
};
99
100
102
class
DropToolBar
:
public
QToolBar
103
{
104
Q_OBJECT
105
public
:
106
DropToolBar
(QWidget* parent=0);
107
108
signals:
109
void
dragEntered
(QDragEnterEvent* event);
110
void
dropped
(QDropEvent* event);
111
112
protected
:
113
void
dragEnterEvent
(QDragEnterEvent* event)
override
;
114
void
dropEvent
(QDropEvent* event)
override
;
115
};
116
117
118
}
// namespace lmms::gui
119
120
#endif
// LMMS_GUI_EDITOR_H
lmms::gui::DropToolBar
Small helper class: A QToolBar that accepts and exposes drop events as signals.
Definition
Editor.h:103
lmms::gui::DropToolBar::dropped
void dropped(QDropEvent *event)
lmms::gui::DropToolBar::dropEvent
void dropEvent(QDropEvent *event) override
Definition
Editor.cpp:169
lmms::gui::DropToolBar::dragEnterEvent
void dragEnterEvent(QDragEnterEvent *event) override
Definition
Editor.cpp:164
lmms::gui::DropToolBar::DropToolBar
DropToolBar(QWidget *parent=0)
Definition
Editor.cpp:159
lmms::gui::DropToolBar::dragEntered
void dragEntered(QDragEnterEvent *event)
lmms::gui::Editor::s_lastPlayedEditor
static Editor * s_lastPlayedEditor
Definition
Editor.h:78
lmms::gui::Editor::recordAccompany
virtual void recordAccompany()
Definition
Editor.h:71
lmms::gui::Editor::m_stopAction
QAction * m_stopAction
Definition
Editor.h:97
lmms::gui::Editor::lastPlayedEditor
static Editor * lastPlayedEditor()
Definition
Editor.h:54
lmms::gui::Editor::addDropToolBarToTop
DropToolBar * addDropToolBarToTop(QString const &windowTitle)
Definition
Editor.cpp:49
lmms::gui::Editor::m_toggleStepRecordingAction
QAction * m_toggleStepRecordingAction
Definition
Editor.h:96
lmms::gui::Editor::setPauseIcon
void setPauseIcon(bool displayPauseIcon=true)
Definition
Editor.cpp:40
lmms::gui::Editor::toggleMaximize
void toggleMaximize()
Definition
Editor.cpp:86
lmms::gui::Editor::playAction
QAction * playAction() const
Definition
Editor.cpp:137
lmms::gui::Editor::~Editor
~Editor() override=default
lmms::gui::Editor::addDropToolBar
DropToolBar * addDropToolBar(Qt::ToolBarArea whereToAdd, QString const &windowTitle)
Definition
Editor.cpp:54
lmms::gui::Editor::m_recordAction
QAction * m_recordAction
Definition
Editor.h:94
lmms::gui::Editor::m_recordAccompanyAction
QAction * m_recordAccompanyAction
Definition
Editor.h:95
lmms::gui::Editor::m_toolBar
DropToolBar * m_toolBar
Definition
Editor.h:91
lmms::gui::Editor::togglePlayStop
void togglePlayStop()
Called by pressing the space key. Plays or stops.
Definition
Editor.cpp:71
lmms::gui::Editor::record
virtual void record()
Definition
Editor.h:70
lmms::gui::Editor::Editor
Editor(bool record=false, bool stepRecord=false)
Definition
Editor.cpp:91
lmms::gui::Editor::play
virtual void play()
Definition
Editor.h:69
lmms::gui::Editor::keyPressEvent
void keyPressEvent(QKeyEvent *ke) override
Definition
Editor.cpp:142
lmms::gui::Editor::m_playAction
QAction * m_playAction
Definition
Editor.h:93
lmms::gui::Editor::stop
virtual void stop()
Definition
Editor.h:73
lmms::gui::Editor::togglePause
void togglePause()
Called by pressing shift+space. Toggles pause state.
Definition
Editor.cpp:80
lmms::gui::Editor::toggleStepRecording
virtual void toggleStepRecording()
Definition
Editor.h:72
lmms::gui
Definition
AudioPortAudio.cpp:209
lmms::gui::Quantizations
static const int Quantizations[]
Definition
Editor.h:36
Generated on
for lmms by
1.18.0