Skip to content

Removed the first recording button from SongEditor as it has no use #7899

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 12 commits into
base: feature/recording-stage-one
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 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: 1 addition & 1 deletion include/Editor.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ private slots:
///
/// \param record If set true, the editor's toolbar will contain record
/// buttons in addition to the play and stop buttons.
Editor(bool record = false, bool record_step = false);
Editor(bool record = false, bool recordAccompany = true, bool record_step = false);
~Editor() override = default;


Expand Down
1 change: 0 additions & 1 deletion include/Song.h
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,6 @@ class LMMS_EXPORT Song : public TrackContainer

public slots:
void playSong();
void record();
void playAndRecord();
void playPattern();
void playMidiClip( const lmms::MidiClip * midiClipToPlay, bool loop = true );
Expand Down
1 change: 0 additions & 1 deletion include/SongEditor.h
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,6 @@ class SongEditorWindow : public Editor

protected slots:
void play() override;
void record() override;
void recordAccompany() override;
void stop() override;

Expand Down
8 changes: 0 additions & 8 deletions src/core/Song.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -506,14 +506,6 @@ void Song::playSong()



void Song::record()
{
m_recording = true;
// TODO: Implement
}




void Song::playAndRecord()
{
Expand Down
58 changes: 33 additions & 25 deletions src/gui/editors/Editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ void Editor::toggleMaximize()
isMaximized() ? showNormal() : showMaximized();
}

Editor::Editor(bool record, bool stepRecord) :
Editor::Editor(bool record, bool recordAccompany, bool stepRecord) :
m_toolBar(new DropToolBar(this)),
m_playAction(nullptr),
m_recordAction(nullptr),
Expand All @@ -104,36 +104,44 @@ Editor::Editor(bool record, bool stepRecord) :
m_toolBar->widgetForAction(action)->setObjectName(objectName);
};

// Set up play and record actions
m_playAction = new QAction(embed::getIconPixmap("play"), tr("Play (Space)"), this);
m_stopAction = new QAction(embed::getIconPixmap("stop"), tr("Stop (Space)"), this);
// Play action setup
m_playAction = new QAction(embed::getIconPixmap("play"), tr("Play (Space)"), this); //setup play action
connect(m_playAction, SIGNAL(triggered()), this, SLOT(play())); // Set up connection for play action
addButton(m_playAction, "playButton"); // Add actions to toolbar for play action

m_recordAction = new QAction(embed::getIconPixmap("record"), tr("Record"), this);
m_recordAccompanyAction = new QAction(embed::getIconPixmap("record_accompany"), tr("Record while playing"), this);
m_toggleStepRecordingAction = new QAction(embed::getIconPixmap("record_step_off"), tr("Toggle Step Recording"), this);

// Set up connections
connect(m_playAction, SIGNAL(triggered()), this, SLOT(play()));
connect(m_recordAction, SIGNAL(triggered()), this, SLOT(record()));
connect(m_recordAccompanyAction, SIGNAL(triggered()), this, SLOT(recordAccompany()));
connect(m_toggleStepRecordingAction, SIGNAL(triggered()), this, SLOT(toggleStepRecording()));
connect(m_stopAction, SIGNAL(triggered()), this, SLOT(stop()));
new QShortcut(Qt::Key_Space, this, SLOT(togglePlayStop()));
new QShortcut(QKeySequence(combine(Qt::SHIFT, Qt::Key_Space)), this, SLOT(togglePause()));
new QShortcut(QKeySequence(combine(Qt::SHIFT, Qt::Key_F11)), this, SLOT(toggleMaximize()));

// Add actions to toolbar
addButton(m_playAction, "playButton");
// Record action setup
if (record)
{
addButton(m_recordAction, "recordButton");
addButton(m_recordAccompanyAction, "recordAccompanyButton");
m_recordAction = new QAction(embed::getIconPixmap("record"), tr("Record"), this); //setup record action
connect(m_recordAction, SIGNAL(triggered()), this, SLOT(record())); // Set up connection for record action
addButton(m_recordAction, "recordButton"); // Add actions to toolbar for record action
}

// RecordAccompany action setup
if (recordAccompany)
{
m_recordAccompanyAction = new QAction(embed::getIconPixmap("record_accompany"), tr("Record while playing"), this); //setup recordAccompany action
connect(m_recordAccompanyAction, SIGNAL(triggered()), this, SLOT(recordAccompany())); // Set up connection for recordAccompany action
addButton(m_recordAccompanyAction, "recordAccompanyButton"); // Add actions to toolbar for recordAccompany action
}
if(stepRecord)

// StepRecord action setup
if (stepRecord)
{
addButton(m_toggleStepRecordingAction, "stepRecordButton");
m_toggleStepRecordingAction = new QAction(embed::getIconPixmap("record_step_off"), tr("Toggle Step Recording"), this); //setup stepRecord action
connect(m_toggleStepRecordingAction, SIGNAL(triggered()), this, SLOT(toggleStepRecording())); // Set up connection for stepRecord action
addButton(m_toggleStepRecordingAction, "stepRecordButton"); // Add actions to toolbar for stepRecord action
}
addButton(m_stopAction, "stopButton");

// Stop action setup
m_stopAction = new QAction(embed::getIconPixmap("stop"), tr("Stop (Space)"), this); //setup stop action
connect(m_stopAction, SIGNAL(triggered()), this, SLOT(stop())); // Set up connection for stop action
addButton(m_stopAction, "stopButton"); // Add actions to toolbar for stop action

// Set up shortcuts for actions
new QShortcut(Qt::Key_Space, this, SLOT(togglePlayStop()));
new QShortcut(QKeySequence(combine(Qt::SHIFT, Qt::Key_Space)), this, SLOT(togglePause()));
new QShortcut(QKeySequence(combine(Qt::SHIFT, Qt::Key_F11)), this, SLOT(toggleMaximize()));
}

QAction *Editor::playAction() const
Expand Down
2 changes: 1 addition & 1 deletion src/gui/editors/PianoRoll.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4728,7 +4728,7 @@ void PianoRoll::changeSnapMode()
}

PianoRollWindow::PianoRollWindow() :
Editor(true, true),
Editor(true, true, true),
m_editor(new PianoRoll())
{
setCentralWidget( m_editor );
Expand Down
15 changes: 2 additions & 13 deletions src/gui/editors/SongEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -911,7 +911,7 @@ ComboBoxModel *SongEditor::snappingModel() const


SongEditorWindow::SongEditorWindow(Song* song) :
Editor(true, false),
Editor(false, true, false),
m_editor(new SongEditor(song)),
m_crtlAction( nullptr ),
m_snapSizeLabel( new QLabel( m_toolBar ) )
Expand All @@ -927,7 +927,6 @@ SongEditorWindow::SongEditorWindow(Song* song) :

// Set up buttons
m_playAction->setToolTip(tr("Play song (Space)"));
m_recordAction->setToolTip(tr("Record samples from Audio-device"));
m_recordAccompanyAction->setToolTip(tr("Record samples from Audio-device while playing song or pattern track"));
m_stopAction->setToolTip(tr( "Stop song (Space)" ));

Expand Down Expand Up @@ -1033,11 +1032,7 @@ SongEditorWindow::SongEditorWindow(Song* song) :
// disable the record buttons.
if (!Engine::audioEngine()->captureDeviceAvailable())
{
for (auto &recordAction : {m_recordAccompanyAction, m_recordAction})
{
recordAction->setEnabled(false);
recordAction->setToolTip(tr("Recording is unavailable: try connecting an input device or switching backend"));
}
m_recordAccompanyAction->setToolTip(tr("Recording is unavailable: try connecting an input device or switching backend"));
}
}

Expand Down Expand Up @@ -1099,12 +1094,6 @@ void SongEditorWindow::play()
}


void SongEditorWindow::record()
{
m_editor->m_song->record();
}




void SongEditorWindow::recordAccompany()
Expand Down
Loading