Skip to content

Commit e450d61

Browse files
committed
Add tempo track
1 parent 34511bf commit e450d61

21 files changed

+436
-33
lines changed

.github/actions/initialize-build-environment/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,5 @@ runs:
4545
uses: jurplel/install-qt-action@v4
4646
with:
4747
version: ${{ inputs.qt_version }}
48-
modules: qt5compat qtshadertools
48+
modules: qt5compat qtscxml qtshadertools
4949
cache: true

src/libs/3rdparty/scopicflow

Submodule scopicflow updated 30 files

src/libs/application/dspxmodel/src/selectionmodel/SelectionModel.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,12 @@ namespace dspx {
158158
return ST_None;
159159
}
160160

161-
void SelectionModel::select(QObject *item, SelectionCommand command) {
161+
void SelectionModel::select(QObject *item, SelectionCommand command, SelectionType emptySelectionType) {
162162
Q_D(SelectionModel);
163163
auto targetSelectionType = selectionTypeFromItem(item);
164+
if (targetSelectionType == ST_None) {
165+
targetSelectionType = emptySelectionType;
166+
}
164167
if (targetSelectionType != d->selectionType) {
165168
switch (d->selectionType) {
166169
case ST_AnchorNode:

src/libs/application/dspxmodel/src/selectionmodel/SelectionModel.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ namespace dspx {
7676
Q_DECLARE_FLAGS(SelectionCommand, SelectionCommandFlag)
7777

7878
Q_INVOKABLE static SelectionType selectionTypeFromItem(QObject *item);
79-
Q_INVOKABLE void select(QObject *item, SelectionCommand command);
79+
Q_INVOKABLE void select(QObject *item, SelectionCommand command, SelectionType emptySelectionType = {});
8080

8181
Q_SIGNALS:
8282
void selectionTypeChanged();

src/plugins/coreplugin/project/DspxDocument.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include <QUndoStack>
55

66
#include <dspxmodel/Model.h>
7+
#include <dspxmodel/SelectionModel.h>
78
#include <dspxmodel/UndoableModelStrategy.h>
89

910
#include <transactional/TransactionController.h>
@@ -42,6 +43,7 @@ namespace Core {
4243
auto modelStrategy = new dspx::UndoableModelStrategy; // TODO use substate in future
4344
d->model = new dspx::Model(modelStrategy, this);
4445
modelStrategy->setParent(d->model);
46+
d->selectionModel = new dspx::SelectionModel(d->model, this);
4547
auto transactionalStrategy = new TransactionalModelStrategy(modelStrategy);
4648
d->transactionController = new TransactionController(transactionalStrategy, this);
4749
transactionalStrategy->setParent(d->transactionController);
@@ -54,6 +56,11 @@ namespace Core {
5456
return d->model;
5557
}
5658

59+
dspx::SelectionModel *DspxDocument::selectionModel() const {
60+
Q_D(const DspxDocument);
61+
return d->selectionModel;
62+
}
63+
5764
TransactionController *DspxDocument::transactionController() const {
5865
Q_D(const DspxDocument);
5966
return d->transactionController;

src/plugins/coreplugin/project/DspxDocument.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
namespace dspx {
1010
class Model;
11+
class SelectionModel;
1112
}
1213

1314
namespace Core {
@@ -21,12 +22,14 @@ namespace Core {
2122
QML_ELEMENT
2223
Q_DECLARE_PRIVATE(DspxDocument)
2324
Q_PROPERTY(dspx::Model *model READ model CONSTANT)
25+
Q_PROPERTY(dspx::SelectionModel *selectionModel READ selectionModel CONSTANT)
2426
Q_PROPERTY(TransactionController *transactionController READ transactionController CONSTANT)
2527
public:
2628
explicit DspxDocument(QObject *parent = nullptr);
2729
~DspxDocument() override;
2830

2931
dspx::Model *model() const;
32+
dspx::SelectionModel *selectionModel() const;
3033
TransactionController *transactionController() const;
3134

3235
private:

src/plugins/coreplugin/project/DspxDocument_p.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ namespace Core {
99
public:
1010
DspxDocument *q_ptr;
1111
dspx::Model *model;
12+
dspx::SelectionModel *selectionModel;
1213
TransactionController *transactionController;
1314
};
1415
}

src/plugins/visualeditor/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ diffscope_add_builtin_plugin(${PROJECT_NAME}
1717
QuickControls2
1818
QuickTemplates2
1919
QuickDialogs2
20+
StateMachine
2021
QT_INCLUDE_PRIVATE
2122
Core
2223
Gui

src/plugins/visualeditor/core/ArrangementPanelInterface.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include <ScopicFlowCore/TimeLayoutViewModel.h>
1313
#include <ScopicFlowCore/TimeViewModel.h>
1414
#include <ScopicFlowCore/TimelineInteractionController.h>
15+
#include <ScopicFlowCore/LabelSequenceInteractionController.h>
1516

1617
#include <coreplugin/ProjectWindowInterface.h>
1718
#include <coreplugin/ProjectTimeline.h>
@@ -118,6 +119,7 @@ namespace VisualEditor {
118119
d->timeLayoutViewModel = new sflow::TimeLayoutViewModel(this);
119120
d->timelineInteractionController = new sflow::TimelineInteractionController(this);
120121
d->scrollBehaviorViewModel = new sflow::ScrollBehaviorViewModel(this);
122+
d->labelSequenceInteractionControllerOfTempo = ProjectViewModelContext::of(d->windowHandle)->createAndBindLabelSequenceInteractionControllerOfTempo();
121123

122124
d->positionAlignmentManipulator = new PositionAlignmentManipulator(this);
123125
d->positionAlignmentManipulator->setTimeLayoutViewModel(d->timeLayoutViewModel);
@@ -179,6 +181,10 @@ namespace VisualEditor {
179181
Q_D(const ArrangementPanelInterface);
180182
return d->timelineInteractionController;
181183
}
184+
sflow::LabelSequenceInteractionController *ArrangementPanelInterface::labelSequenceInteractionControllerOfTempo() const {
185+
Q_D(const ArrangementPanelInterface);
186+
return d->labelSequenceInteractionControllerOfTempo;
187+
}
182188

183189
PositionAlignmentManipulator *ArrangementPanelInterface::positionAlignmentManipulator() const {
184190
Q_D(const ArrangementPanelInterface);

src/plugins/visualeditor/core/ArrangementPanelInterface.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ namespace sflow {
1313
class TimeLayoutViewModel;
1414
class TimelineInteractionController;
1515
class ScrollBehaviorViewModel;
16+
class LabelSequenceInteractionController;
1617
}
1718

1819
namespace Core {
@@ -40,6 +41,7 @@ namespace VisualEditor {
4041
Q_PROPERTY(sflow::TimeLayoutViewModel *timeLayoutViewModel READ timeLayoutViewModel CONSTANT)
4142
Q_PROPERTY(sflow::ScrollBehaviorViewModel *scrollBehaviorViewModel READ scrollBehaviorViewModel CONSTANT)
4243
Q_PROPERTY(sflow::TimelineInteractionController *timelineInteractionController READ timelineInteractionController CONSTANT)
44+
Q_PROPERTY(sflow::LabelSequenceInteractionController *labelSequenceInteractionControllerOfTempo READ labelSequenceInteractionControllerOfTempo CONSTANT)
4345
Q_PROPERTY(PositionAlignmentManipulator *positionAlignmentManipulator READ positionAlignmentManipulator CONSTANT)
4446
Q_PROPERTY(AutoPageScrollingManipulator *autoPageScrollingManipulator READ autoPageScrollingManipulator CONSTANT)
4547
Q_PROPERTY(QQuickItem *arrangementView READ arrangementView CONSTANT)
@@ -57,6 +59,7 @@ namespace VisualEditor {
5759
sflow::TimeLayoutViewModel *timeLayoutViewModel() const;
5860
sflow::ScrollBehaviorViewModel *scrollBehaviorViewModel() const;
5961
sflow::TimelineInteractionController *timelineInteractionController() const;
62+
sflow::LabelSequenceInteractionController *labelSequenceInteractionControllerOfTempo() const;
6063

6164
PositionAlignmentManipulator *positionAlignmentManipulator() const;
6265
AutoPageScrollingManipulator *autoPageScrollingManipulator() const;

0 commit comments

Comments
 (0)