Hooked up TAS playback button functionality for Qt GUI.

This commit is contained in:
mjbudd77 2021-11-01 23:48:51 -04:00
parent 09d2204d9c
commit ffe8aacdc1
2 changed files with 70 additions and 0 deletions

View File

@ -490,6 +490,7 @@ void TasEditorWindow::buildPianoRollDisplay(void)
//----------------------------------------------------------------------------
void TasEditorWindow::buildSideControlPanel(void)
{
QShortcut *shortcut;
QVBoxLayout *vbox;
QHBoxLayout *hbox;
QGridLayout *grid;
@ -627,6 +628,28 @@ void TasEditorWindow::buildSideControlPanel(void)
connect( rec2PBtn , &QRadioButton::clicked, [ this ] { recordInputChanged( MULTITRACK_RECORDING_2P ); } );
connect( rec3PBtn , &QRadioButton::clicked, [ this ] { recordInputChanged( MULTITRACK_RECORDING_3P ); } );
connect( rec4PBtn , &QRadioButton::clicked, [ this ] { recordInputChanged( MULTITRACK_RECORDING_4P ); } );
connect( rewindMkrBtn, SIGNAL(clicked(void)), this, SLOT(playbackFrameRewindFull(void)) );
connect( rewindFrmBtn, SIGNAL(clicked(void)), this, SLOT(playbackFrameRewind(void)) );
connect( playPauseBtn, SIGNAL(clicked(void)), this, SLOT(playbackPauseCB(void)) );
connect( advFrmBtn , SIGNAL(clicked(void)), this, SLOT(playbackFrameForward(void)) );
connect( advMkrBtn , SIGNAL(clicked(void)), this, SLOT(playbackFrameForwardFull(void)));
shortcut = new QShortcut( QKeySequence("Pause"), this);
connect( shortcut, SIGNAL(activated(void)), this, SLOT(playbackPauseCB(void)) );
shortcut = new QShortcut( QKeySequence("Shift+Up"), this);
connect( shortcut, SIGNAL(activated(void)), this, SLOT(playbackFrameRewind(void)) );
shortcut = new QShortcut( QKeySequence("Shift+Down"), this);
connect( shortcut, SIGNAL(activated(void)), this, SLOT(playbackFrameForward(void)) );
shortcut = new QShortcut( QKeySequence("Shift+PgUp"), this);
connect( shortcut, SIGNAL(activated(void)), this, SLOT(playbackFrameRewindFull(void)) );
shortcut = new QShortcut( QKeySequence("Shift+PgDown"), this);
connect( shortcut, SIGNAL(activated(void)), this, SLOT(playbackFrameForwardFull(void)) );
}
//----------------------------------------------------------------------------
int TasEditorWindow::initModules(void)
@ -1090,6 +1113,46 @@ void TasEditorWindow::recordInputChanged(int input)
recorder.multitrackRecordingJoypadNumber = input;
}
//----------------------------------------------------------------------------
void TasEditorWindow::playbackPauseCB(void)
{
fceuWrapperLock();
playback.toggleEmulationPause();
pianoRoll->update();
fceuWrapperUnLock();
}
//----------------------------------------------------------------------------
void TasEditorWindow::playbackFrameRewind(void)
{
fceuWrapperLock();
playback.handleRewindFrame();
pianoRoll->update();
fceuWrapperUnLock();
}
//----------------------------------------------------------------------------
void TasEditorWindow::playbackFrameForward(void)
{
fceuWrapperLock();
playback.handleForwardFrame();
pianoRoll->update();
fceuWrapperUnLock();
}
//----------------------------------------------------------------------------
void TasEditorWindow::playbackFrameRewindFull(void)
{
fceuWrapperLock();
playback.handleRewindFull();
pianoRoll->update();
fceuWrapperUnLock();
}
//----------------------------------------------------------------------------
void TasEditorWindow::playbackFrameForwardFull(void)
{
fceuWrapperLock();
playback.handleForwardFull();
pianoRoll->update();
fceuWrapperUnLock();
}
//----------------------------------------------------------------------------
//----------------------------------------------------------------------------
//---- TAS Piano Roll Widget
//----------------------------------------------------------------------------

View File

@ -30,6 +30,7 @@
#include <QAction>
#include <QFont>
#include <QPainter>
#include <QShortcut>
#include "Qt/TasEditor/taseditor_config.h"
#include "Qt/TasEditor/taseditor_project.h"
@ -197,6 +198,7 @@ class TasEditorWindow : public QDialog
QPushButton *nextMkrBtn;
QPushButton *similarBtn;
QPushButton *moreBtn;
private:
int initModules(void);
@ -218,6 +220,11 @@ class TasEditorWindow : public QDialog
void recordInputChanged(int);
void superImposedChanged(int);
void usePatternChanged(int);
void playbackPauseCB(void);
void playbackFrameRewind(void);
void playbackFrameForward(void);
void playbackFrameRewindFull(void);
void playbackFrameForwardFull(void);
friend class RECORDER;
};