Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions include/AutomationEditor.h
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,8 @@ class AutomationEditorWindow : public Editor

QSize sizeHint() const override;

bool hasValidClip();

public slots:
void clearCurrentClip();

Expand Down
1 change: 1 addition & 0 deletions include/PianoRoll.h
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,7 @@ class PianoRollWindow : public Editor, SerializingObject

QSize sizeHint() const override;
bool hasFocus() const;
bool hasValidMidiClip();

signals:
void currentMidiClipChanged();
Expand Down
8 changes: 6 additions & 2 deletions src/gui/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include <QMessageBox>
#include <QShortcut>
#include <QSplitter>
#include <qtoolbutton.h>

#include "AboutDialog.h"
#include "AutomationEditor.h"
Expand Down Expand Up @@ -438,10 +439,15 @@ void MainWindow::finalize()
auto piano_roll_window = new ToolButton(
embed::getIconPixmap("piano"), tr("Piano Roll") + " (Ctrl+3)", this, SLOT(togglePianoRollWin()), m_toolBar);
piano_roll_window->setShortcut(keySequence(Qt::CTRL, Qt::Key_3));
piano_roll_window->setEnabled(false);
connect(getGUI()->pianoRoll(), &PianoRollWindow::currentMidiClipChanged, this, [piano_roll_window](){ piano_roll_window->setEnabled(getGUI()->pianoRoll()->hasValidMidiClip()); });

auto automation_editor_window = new ToolButton(embed::getIconPixmap("automation"),
tr("Automation Editor") + " (Ctrl+4)", this, SLOT(toggleAutomationEditorWin()), m_toolBar);
automation_editor_window->setShortcut(keySequence(Qt::CTRL, Qt::Key_4));
automation_editor_window->setEnabled(false);
connect(getGUI()->automationEditor(), &AutomationEditorWindow::currentClipChanged, this, [automation_editor_window](){ automation_editor_window->setEnabled(getGUI()->automationEditor()->hasValidClip()); });
connect(getGUI()->automationEditor()->m_editor, &AutomationEditor::currentClipChanged, this, [automation_editor_window](){ automation_editor_window->setEnabled(getGUI()->automationEditor()->m_editor->validClip()); });

auto mixer_window = new ToolButton(
embed::getIconPixmap("mixer"), tr("Mixer") + " (Ctrl+5)", this, SLOT(toggleMixerWin()), m_toolBar);
Expand Down Expand Up @@ -1044,8 +1050,6 @@ void MainWindow::toggleMicrotunerWin()
}




void MainWindow::updateViewMenu()
{
m_viewMenu->clear();
Expand Down
6 changes: 6 additions & 0 deletions src/gui/editors/AutomationEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2167,6 +2167,7 @@ void AutomationEditorWindow::setCurrentClip(AutomationClip* clip)

m_editor->setCurrentClip(clip);


// Set our window's title
if (clip == nullptr)
{
Expand Down Expand Up @@ -2308,4 +2309,9 @@ void AutomationEditorWindow::updateEditTanButton()
if (!m_editTanAction->isEnabled() && m_editTanAction->isChecked()) { m_drawAction->trigger(); }
}

bool AutomationEditorWindow::hasValidClip()
{
return m_editor->validClip();
}

} // namespace lmms::gui
4 changes: 4 additions & 0 deletions src/gui/editors/PianoRoll.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5856,6 +5856,10 @@ void PianoRollWindow::updateStepRecordingIcon()
}
}

bool PianoRollWindow::hasValidMidiClip()
{
return m_editor->hasValidMidiClip();
}

} // namespace gui

Expand Down
Loading