From 1cdb85eadda55f673bff1f3a205cdd439294dbe9 Mon Sep 17 00:00:00 2001 From: mjbudd77 Date: Sat, 16 Oct 2021 06:34:11 -0400 Subject: [PATCH] Qt TAS editor window layout in work. --- src/drivers/Qt/TasEditor/TasEditorWindow.cpp | 71 ++++++++++++++++++++ src/drivers/Qt/TasEditor/TasEditorWindow.h | 22 ++++++ 2 files changed, 93 insertions(+) diff --git a/src/drivers/Qt/TasEditor/TasEditorWindow.cpp b/src/drivers/Qt/TasEditor/TasEditorWindow.cpp index 51b19573..97eaeddd 100644 --- a/src/drivers/Qt/TasEditor/TasEditorWindow.cpp +++ b/src/drivers/Qt/TasEditor/TasEditorWindow.cpp @@ -50,8 +50,10 @@ TasEditorWindow::TasEditorWindow(QWidget *parent) mainHBox = new QSplitter( Qt::Horizontal ); buildPianoRollDisplay(); + buildSideControlPanel(); mainHBox->addWidget( pianoRollContainerWidget ); + mainHBox->addWidget( controlPanelContainerWidget ); mainLayout->addWidget(mainHBox); menuBar = buildMenuBar(); @@ -229,6 +231,75 @@ void TasEditorWindow::buildPianoRollDisplay(void) pianoRollContainerWidget->setLayout( vbox ); } //---------------------------------------------------------------------------- +void TasEditorWindow::buildSideControlPanel(void) +{ + QVBoxLayout *vbox; + QHBoxLayout *hbox; + + ctlPanelMainVbox = new QVBoxLayout(); + + playbackGBox = new QGroupBox( tr("Playback") ); + recorderGBox = new QGroupBox( tr("Recorder") ); + splicerGBox = new QGroupBox( tr("Splicer") ); + luaGBox = new QGroupBox( tr("Lua") ); + bookmarksGBox = new QGroupBox( tr("BookMarks/Branches") ); + historyGBox = new QGroupBox( tr("History") ); + + rewindMkrBtn = new QPushButton(); + rewindFrmBtn = new QPushButton(); + playPauseBtn = new QPushButton(); + advFrmBtn = new QPushButton(); + advMkrBtn = new QPushButton(); + + rewindMkrBtn->setIcon( style()->standardIcon( QStyle::SP_MediaSkipBackward ) ); + rewindFrmBtn->setIcon( style()->standardIcon( QStyle::SP_MediaSeekBackward ) ); + playPauseBtn->setIcon( style()->standardIcon( QStyle::SP_MediaPause ) ); + advFrmBtn->setIcon( style()->standardIcon( QStyle::SP_MediaSeekForward ) ); + advMkrBtn->setIcon( style()->standardIcon( QStyle::SP_MediaSkipForward ) ); + + followCursorCbox = new QCheckBox( tr("Follow Cursor") ); + turboSeekCbox = new QCheckBox( tr("Turbo Seek") ); + autoRestoreCbox = new QCheckBox( tr("Auto-Restore Last Position") ); + + runLuaBtn = new QPushButton( tr("Run Function") ); + autoLuaCBox = new QCheckBox( tr("Auto Function") ); + runLuaBtn->setEnabled(false); + autoLuaCBox->setChecked(true); + + vbox = new QVBoxLayout(); + hbox = new QHBoxLayout(); + vbox->addLayout( hbox ); + hbox->addWidget( rewindMkrBtn ); + hbox->addWidget( rewindFrmBtn ); + hbox->addWidget( playPauseBtn ); + hbox->addWidget( advFrmBtn ); + hbox->addWidget( advMkrBtn ); + + hbox = new QHBoxLayout(); + vbox->addLayout( hbox ); + hbox->addWidget( followCursorCbox ); + hbox->addWidget( turboSeekCbox ); + + vbox->addWidget( autoRestoreCbox ); + + playbackGBox->setLayout( vbox ); + + hbox = new QHBoxLayout(); + hbox->addWidget( runLuaBtn ); + hbox->addWidget( autoLuaCBox ); + luaGBox->setLayout( hbox ); + + ctlPanelMainVbox->addWidget( playbackGBox ); + ctlPanelMainVbox->addWidget( recorderGBox ); + ctlPanelMainVbox->addWidget( splicerGBox ); + ctlPanelMainVbox->addWidget( luaGBox ); + ctlPanelMainVbox->addWidget( bookmarksGBox ); + ctlPanelMainVbox->addWidget( historyGBox ); + + controlPanelContainerWidget = new QWidget(); + controlPanelContainerWidget->setLayout( ctlPanelMainVbox ); +} +//---------------------------------------------------------------------------- //---- TAS Piano Roll Widget //---------------------------------------------------------------------------- QPianoRoll::QPianoRoll(QWidget *parent) diff --git a/src/drivers/Qt/TasEditor/TasEditorWindow.h b/src/drivers/Qt/TasEditor/TasEditorWindow.h index 54c82a4a..4e7984c8 100644 --- a/src/drivers/Qt/TasEditor/TasEditorWindow.h +++ b/src/drivers/Qt/TasEditor/TasEditorWindow.h @@ -77,17 +77,39 @@ class TasEditorWindow : public QDialog QMenuBar *buildMenuBar(void); void buildPianoRollDisplay(void); + void buildSideControlPanel(void); QMenu *recentMenu; QSplitter *mainHBox; QWidget *pianoRollContainerWidget; + QWidget *controlPanelContainerWidget; QScrollBar *pianoRollHBar; QScrollBar *pianoRollVBar; QLabel *upperMarkerLabel; QLabel *lowerMarkerLabel; QLineEdit *upperMarkerName; QLineEdit *lowerMarkerName; + + QVBoxLayout *ctlPanelMainVbox; + QGroupBox *playbackGBox; + QGroupBox *recorderGBox; + QGroupBox *splicerGBox; + QGroupBox *luaGBox; + QGroupBox *bookmarksGBox; + QGroupBox *historyGBox; + + QPushButton *rewindMkrBtn; + QPushButton *rewindFrmBtn; + QPushButton *playPauseBtn; + QPushButton *advFrmBtn; + QPushButton *advMkrBtn; + QCheckBox *followCursorCbox; + QCheckBox *turboSeekCbox; + QCheckBox *autoRestoreCbox; + + QPushButton *runLuaBtn; + QCheckBox *autoLuaCBox; private: public slots: