Qt TAS Editor bookmarks/branches view in work.
This commit is contained in:
parent
9cea7f1551
commit
b59ad1bf3b
|
@ -270,7 +270,7 @@ void applyMovieInputConfig(void)
|
||||||
}
|
}
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
TasEditorWindow::TasEditorWindow(QWidget *parent)
|
TasEditorWindow::TasEditorWindow(QWidget *parent)
|
||||||
: QDialog( parent, Qt::Window )
|
: QDialog( parent, Qt::Window ), bookmarks(this), branches(this)
|
||||||
{
|
{
|
||||||
QSettings settings;
|
QSettings settings;
|
||||||
QVBoxLayout *mainLayout;
|
QVBoxLayout *mainLayout;
|
||||||
|
@ -1054,8 +1054,10 @@ void TasEditorWindow::buildSideControlPanel(void)
|
||||||
recorderGBox = new QGroupBox( tr("Recorder") );
|
recorderGBox = new QGroupBox( tr("Recorder") );
|
||||||
splicerGBox = new QGroupBox( tr("Splicer") );
|
splicerGBox = new QGroupBox( tr("Splicer") );
|
||||||
luaGBox = new QGroupBox( tr("Lua") );
|
luaGBox = new QGroupBox( tr("Lua") );
|
||||||
bookmarksGBox = new QGroupBox( tr("BookMarks/Branches") );
|
|
||||||
historyGBox = new QGroupBox( tr("History") );
|
historyGBox = new QGroupBox( tr("History") );
|
||||||
|
bbFrame = new QFrame();
|
||||||
|
|
||||||
|
bbFrame->setFrameShape( QFrame::StyledPanel );
|
||||||
|
|
||||||
rewindMkrBtn = new QPushButton();
|
rewindMkrBtn = new QPushButton();
|
||||||
rewindFrmBtn = new QPushButton();
|
rewindFrmBtn = new QPushButton();
|
||||||
|
@ -1090,7 +1092,6 @@ void TasEditorWindow::buildSideControlPanel(void)
|
||||||
runLuaBtn->setEnabled(false);
|
runLuaBtn->setEnabled(false);
|
||||||
autoLuaCBox->setChecked(true);
|
autoLuaCBox->setChecked(true);
|
||||||
|
|
||||||
bkbrTree = new QTreeWidget();
|
|
||||||
histTree = new QTreeWidget();
|
histTree = new QTreeWidget();
|
||||||
|
|
||||||
histTree->setColumnCount(1);
|
histTree->setColumnCount(1);
|
||||||
|
@ -1151,9 +1152,13 @@ void TasEditorWindow::buildSideControlPanel(void)
|
||||||
hbox->addWidget( autoLuaCBox );
|
hbox->addWidget( autoLuaCBox );
|
||||||
luaGBox->setLayout( hbox );
|
luaGBox->setLayout( hbox );
|
||||||
|
|
||||||
|
bkmkBrnchStack = new QTabWidget();
|
||||||
|
bkmkBrnchStack->addTab( &bookmarks, tr("Bookmarks") );
|
||||||
|
bkmkBrnchStack->addTab( &branches , tr("Branches") );
|
||||||
|
|
||||||
vbox = new QVBoxLayout();
|
vbox = new QVBoxLayout();
|
||||||
vbox->addWidget( bkbrTree );
|
vbox->addWidget( bkmkBrnchStack );
|
||||||
bookmarksGBox->setLayout( vbox );
|
bbFrame->setLayout( vbox );
|
||||||
|
|
||||||
vbox = new QVBoxLayout();
|
vbox = new QVBoxLayout();
|
||||||
vbox->addWidget( histTree );
|
vbox->addWidget( histTree );
|
||||||
|
@ -1163,7 +1168,7 @@ void TasEditorWindow::buildSideControlPanel(void)
|
||||||
ctlPanelMainVbox->addWidget( recorderGBox );
|
ctlPanelMainVbox->addWidget( recorderGBox );
|
||||||
ctlPanelMainVbox->addWidget( splicerGBox );
|
ctlPanelMainVbox->addWidget( splicerGBox );
|
||||||
ctlPanelMainVbox->addWidget( luaGBox );
|
ctlPanelMainVbox->addWidget( luaGBox );
|
||||||
ctlPanelMainVbox->addWidget( bookmarksGBox );
|
ctlPanelMainVbox->addWidget( bbFrame );
|
||||||
ctlPanelMainVbox->addWidget( historyGBox );
|
ctlPanelMainVbox->addWidget( historyGBox );
|
||||||
|
|
||||||
hbox = new QHBoxLayout();
|
hbox = new QHBoxLayout();
|
||||||
|
|
|
@ -31,6 +31,8 @@
|
||||||
#include <QFont>
|
#include <QFont>
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
#include <QShortcut>
|
#include <QShortcut>
|
||||||
|
#include <QTabWidget>
|
||||||
|
#include <QStackedWidget>
|
||||||
#include <QClipboard>
|
#include <QClipboard>
|
||||||
|
|
||||||
#include "Qt/TasEditor/taseditor_config.h"
|
#include "Qt/TasEditor/taseditor_config.h"
|
||||||
|
@ -221,14 +223,15 @@ class TasEditorWindow : public QDialog
|
||||||
QLabel *lowerMarkerLabel;
|
QLabel *lowerMarkerLabel;
|
||||||
QLineEdit *upperMarkerNote;
|
QLineEdit *upperMarkerNote;
|
||||||
QLineEdit *lowerMarkerNote;
|
QLineEdit *lowerMarkerNote;
|
||||||
|
QTabWidget *bkmkBrnchStack;
|
||||||
|
|
||||||
QVBoxLayout *ctlPanelMainVbox;
|
QVBoxLayout *ctlPanelMainVbox;
|
||||||
QGroupBox *playbackGBox;
|
QGroupBox *playbackGBox;
|
||||||
QGroupBox *recorderGBox;
|
QGroupBox *recorderGBox;
|
||||||
QGroupBox *splicerGBox;
|
QGroupBox *splicerGBox;
|
||||||
QGroupBox *luaGBox;
|
QGroupBox *luaGBox;
|
||||||
QGroupBox *bookmarksGBox;
|
|
||||||
QGroupBox *historyGBox;
|
QGroupBox *historyGBox;
|
||||||
|
QFrame *bbFrame;
|
||||||
|
|
||||||
QPushButton *rewindMkrBtn;
|
QPushButton *rewindMkrBtn;
|
||||||
QPushButton *rewindFrmBtn;
|
QPushButton *rewindFrmBtn;
|
||||||
|
@ -254,7 +257,6 @@ class TasEditorWindow : public QDialog
|
||||||
QPushButton *runLuaBtn;
|
QPushButton *runLuaBtn;
|
||||||
QCheckBox *autoLuaCBox;
|
QCheckBox *autoLuaCBox;
|
||||||
|
|
||||||
QTreeWidget *bkbrTree;
|
|
||||||
QTreeWidget *histTree;
|
QTreeWidget *histTree;
|
||||||
|
|
||||||
QPushButton *prevMkrBtn;
|
QPushButton *prevMkrBtn;
|
||||||
|
|
|
@ -56,7 +56,8 @@ char bookmarksCaption[3][23] = { " Bookmarks ", " Bookmarks / Branches ", " Bran
|
||||||
// // deploy
|
// // deploy
|
||||||
// 0x43171d, 0x541d21, 0x652325, 0x762929, 0x872f2c, 0x983530, 0xa93b34, 0xba4137, 0xcb463b, 0xdc4c3f, 0xed5243, 0xff5947 };
|
// 0x43171d, 0x541d21, 0x652325, 0x762929, 0x872f2c, 0x983530, 0xa93b34, 0xba4137, 0xcb463b, 0xdc4c3f, 0xed5243, 0xff5947 };
|
||||||
|
|
||||||
BOOKMARKS::BOOKMARKS()
|
BOOKMARKS::BOOKMARKS(QWidget *parent)
|
||||||
|
: QWidget(parent)
|
||||||
{
|
{
|
||||||
// fill TrackMouseEvent struct
|
// fill TrackMouseEvent struct
|
||||||
//tme.cbSize = sizeof(tme);
|
//tme.cbSize = sizeof(tme);
|
||||||
|
@ -67,6 +68,10 @@ BOOKMARKS::BOOKMARKS()
|
||||||
//tmeList.hwndTrack = NULL;
|
//tmeList.hwndTrack = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BOOKMARKS::~BOOKMARKS(void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
void BOOKMARKS::init()
|
void BOOKMARKS::init()
|
||||||
{
|
{
|
||||||
free();
|
free();
|
||||||
|
@ -592,6 +597,32 @@ void BOOKMARKS::redrawBookmarksListRow(int rowIndex)
|
||||||
//ListView_RedrawItems(hwndBookmarksList, rowIndex, rowIndex);
|
//ListView_RedrawItems(hwndBookmarksList, rowIndex, rowIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void BOOKMARKS::resizeEvent(QResizeEvent *event)
|
||||||
|
{
|
||||||
|
viewWidth = event->size().width();
|
||||||
|
viewHeight = event->size().height();
|
||||||
|
}
|
||||||
|
|
||||||
|
void BOOKMARKS::paintEvent(QPaintEvent *event)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void BOOKMARKS::mousePressEvent(QMouseEvent * event)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void BOOKMARKS::mouseReleaseEvent(QMouseEvent * event)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void BOOKMARKS::mouseMoveEvent(QMouseEvent * event)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
void BOOKMARKS::handleMouseMove(int newX, int newY)
|
void BOOKMARKS::handleMouseMove(int newX, int newY)
|
||||||
{
|
{
|
||||||
mouseX = newX;
|
mouseX = newX;
|
||||||
|
|
|
@ -2,6 +2,8 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
#include <QWidget>
|
||||||
|
|
||||||
#include "fceu.h"
|
#include "fceu.h"
|
||||||
#include "Qt/TasEditor/bookmark.h"
|
#include "Qt/TasEditor/bookmark.h"
|
||||||
|
|
||||||
|
@ -51,10 +53,13 @@ enum
|
||||||
|
|
||||||
#define DEFAULT_SLOT 1
|
#define DEFAULT_SLOT 1
|
||||||
|
|
||||||
class BOOKMARKS
|
class BOOKMARKS : public QWidget
|
||||||
{
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
BOOKMARKS();
|
BOOKMARKS(QWidget *parent = 0);
|
||||||
|
~BOOKMARKS(void);
|
||||||
void init();
|
void init();
|
||||||
void free();
|
void free();
|
||||||
void reset();
|
void reset();
|
||||||
|
@ -100,6 +105,13 @@ public:
|
||||||
|
|
||||||
//HWND hwndBookmarksList, hwndBranchesBitmap, hwndBookmarks;
|
//HWND hwndBookmarksList, hwndBranchesBitmap, hwndBookmarks;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void resizeEvent(QResizeEvent *event);
|
||||||
|
void paintEvent(QPaintEvent *event);
|
||||||
|
void mousePressEvent(QMouseEvent * event);
|
||||||
|
void mouseReleaseEvent(QMouseEvent * event);
|
||||||
|
void mouseMoveEvent(QMouseEvent * event);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void set(int slot);
|
void set(int slot);
|
||||||
void jump(int slot);
|
void jump(int slot);
|
||||||
|
@ -114,5 +126,7 @@ private:
|
||||||
// GDI stuff
|
// GDI stuff
|
||||||
//HFONT hBookmarksFont;
|
//HFONT hBookmarksFont;
|
||||||
//HIMAGELIST hImgList;
|
//HIMAGELIST hImgList;
|
||||||
|
int viewWidth;
|
||||||
|
int viewHeight;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -48,7 +48,17 @@ Branches - Manager of Branches
|
||||||
// corners cursor animation
|
// corners cursor animation
|
||||||
int corners_cursor_shift[BRANCHES_ANIMATION_FRAMES] = {0, 0, 1, 1, 2, 2, 2, 2, 1, 1, 0, 0 };
|
int corners_cursor_shift[BRANCHES_ANIMATION_FRAMES] = {0, 0, 1, 1, 2, 2, 2, 2, 1, 1, 0, 0 };
|
||||||
|
|
||||||
BRANCHES::BRANCHES()
|
BRANCHES::BRANCHES(QWidget *parent)
|
||||||
|
: QWidget(parent)
|
||||||
|
{
|
||||||
|
//this->parent = qobject_cast <TasEditorWindow*>( parent );
|
||||||
|
this->setFocusPolicy(Qt::StrongFocus);
|
||||||
|
this->setMouseTracking(true);
|
||||||
|
this->setMinimumWidth(256);
|
||||||
|
this->setMinimumHeight(128);
|
||||||
|
}
|
||||||
|
|
||||||
|
BRANCHES::~BRANCHES(void)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -461,32 +471,50 @@ error:
|
||||||
// ----------------------------------------------------------
|
// ----------------------------------------------------------
|
||||||
void BRANCHES::redrawBranchesBitmap()
|
void BRANCHES::redrawBranchesBitmap()
|
||||||
{
|
{
|
||||||
|
QWidget::update();
|
||||||
|
}
|
||||||
|
|
||||||
|
void BRANCHES::paintEvent(QPaintEvent *event)
|
||||||
|
{
|
||||||
|
QPainter painter(this);
|
||||||
|
|
||||||
|
viewWidth = event->rect().width();
|
||||||
|
viewHeight = event->rect().height();
|
||||||
|
|
||||||
// // draw background
|
// // draw background
|
||||||
// GradientFill(hBitmapDC, vertex, 2, &gRect, 1, GRADIENT_FILL_RECT_H);
|
QLinearGradient linearGrad(QPointF(0, 0), QPointF(viewWidth, viewHeight));
|
||||||
|
linearGrad.setColorAt(0, QColor(0xBF,0xE2,0xEF));
|
||||||
|
linearGrad.setColorAt(1, QColor(0xE5,0xFB,0xFF));
|
||||||
|
|
||||||
|
painter.fillRect( 0, 0, viewWidth, viewHeight, linearGrad );
|
||||||
|
|
||||||
// // lines
|
// // lines
|
||||||
// int branch, tempBranchX, tempBranchY, parentX, parentY, childID;
|
int branch, tempBranchX, tempBranchY, parentX, parentY, childID;
|
||||||
//SelectObject(hBitmapDC, normalPen);
|
//SelectObject(hBitmapDC, normalPen);
|
||||||
// for (int t = children.size() - 1; t >= 0; t--)
|
painter.setPen( QColor( 0, 0, 0 ) );
|
||||||
// {
|
|
||||||
// if (t > 0)
|
for (int t = children.size() - 1; t >= 0; t--)
|
||||||
// {
|
{
|
||||||
// parentX = branchCurrentX[t-1];
|
if (t > 0)
|
||||||
// parentY = branchCurrentY[t-1];
|
{
|
||||||
// } else
|
parentX = branchCurrentX[t-1];
|
||||||
// {
|
parentY = branchCurrentY[t-1];
|
||||||
// parentX = cloudCurrentX;
|
} else
|
||||||
// parentY = BRANCHES_CLOUD_Y;
|
{
|
||||||
// }
|
parentX = cloudCurrentX;
|
||||||
// for (int i = children[t].size() - 1; i >= 0; i--)
|
parentY = BRANCHES_CLOUD_Y;
|
||||||
// {
|
}
|
||||||
// childID = children[t][i];
|
for (int i = children[t].size() - 1; i >= 0; i--)
|
||||||
// if (childID < TOTAL_BOOKMARKS)
|
{
|
||||||
// {
|
childID = children[t][i];
|
||||||
|
if (childID < TOTAL_BOOKMARKS)
|
||||||
|
{
|
||||||
//MoveToEx(hBitmapDC, parentX, parentY, 0);
|
//MoveToEx(hBitmapDC, parentX, parentY, 0);
|
||||||
//LineTo(hBitmapDC, branchCurrentX[childID], branchCurrentY[childID]);
|
//LineTo(hBitmapDC, branchCurrentX[childID], branchCurrentY[childID]);
|
||||||
// }
|
painter.drawLine( parentX, parentY, branchCurrentX[childID], branchCurrentY[childID] );
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
|
}
|
||||||
// // lines for current timeline
|
// // lines for current timeline
|
||||||
// if (currentBranch != ITEM_UNDER_MOUSE_CLOUD)
|
// if (currentBranch != ITEM_UNDER_MOUSE_CLOUD)
|
||||||
// {
|
// {
|
||||||
|
|
|
@ -3,6 +3,8 @@
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
#include <QWidget>
|
||||||
|
|
||||||
#define BRANCHES_ANIMATION_TICK 40 // animate at 25FPS
|
#define BRANCHES_ANIMATION_TICK 40 // animate at 25FPS
|
||||||
#define BRANCHES_TRANSITION_MAX 12
|
#define BRANCHES_TRANSITION_MAX 12
|
||||||
#define CURSOR_MIN_DISTANCE 1.0
|
#define CURSOR_MIN_DISTANCE 1.0
|
||||||
|
@ -96,10 +98,13 @@
|
||||||
|
|
||||||
#define FIRST_DIFFERENCE_UNKNOWN -2
|
#define FIRST_DIFFERENCE_UNKNOWN -2
|
||||||
|
|
||||||
class BRANCHES
|
class BRANCHES : public QWidget
|
||||||
{
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
BRANCHES();
|
BRANCHES(QWidget *parent = 0);
|
||||||
|
~BRANCHES(void);
|
||||||
void init();
|
void init();
|
||||||
void free();
|
void free();
|
||||||
void reset();
|
void reset();
|
||||||
|
@ -133,6 +138,9 @@ public:
|
||||||
bool mustRecalculateBranchesTree;
|
bool mustRecalculateBranchesTree;
|
||||||
int branchRightclicked;
|
int branchRightclicked;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void paintEvent(QPaintEvent *event);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void setCurrentPosTimestamp();
|
void setCurrentPosTimestamp();
|
||||||
|
|
||||||
|
@ -178,10 +186,12 @@ private:
|
||||||
//GRADIENT_RECT gRect;
|
//GRADIENT_RECT gRect;
|
||||||
//RECT branchesBitmapRect;
|
//RECT branchesBitmapRect;
|
||||||
|
|
||||||
|
int viewWidth;
|
||||||
|
int viewHeight;
|
||||||
|
|
||||||
// temps
|
// temps
|
||||||
std::vector<int> gridX; // measured in grid units, not in pixels
|
std::vector<int> gridX; // measured in grid units, not in pixels
|
||||||
std::vector<int> gridY;
|
std::vector<int> gridY;
|
||||||
std::vector<int> gridHeight;
|
std::vector<int> gridHeight;
|
||||||
std::vector<std::vector<uint8_t>> children;
|
std::vector<std::vector<uint8_t>> children;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue