Skip to content

Commit 6bdcd41

Browse files
committed
Add parameter transform tools to editor panels
1 parent 6aacd79 commit 6bdcd41

9 files changed

Lines changed: 92 additions & 8 deletions

‎src/plugins/visualeditor/core/PianoRollPanelInterface.cpp‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,8 @@ namespace VisualEditor {
184184
return sflow::ParameterEditorInteractionController::Line;
185185
case PianoRollPanelInterface::PitchBrushTool:
186186
return sflow::ParameterEditorInteractionController::Brush;
187+
case PianoRollPanelInterface::PitchTransformTool:
188+
return sflow::ParameterEditorInteractionController::Transform;
187189
case PianoRollPanelInterface::PitchEraserTool:
188190
return sflow::ParameterEditorInteractionController::Eraser;
189191
case PianoRollPanelInterface::PitchRangeSelectTool:
@@ -209,6 +211,8 @@ namespace VisualEditor {
209211
return sflow::ParameterEditorInteractionController::Eraser;
210212
case sflow::ParameterEditorInteractionController::Eraser:
211213
return sflow::ParameterEditorInteractionController::Pencil;
214+
case sflow::ParameterEditorInteractionController::FreeRangeSelect:
215+
return sflow::ParameterEditorInteractionController::Transform;
212216
case sflow::ParameterEditorInteractionController::Pointer:
213217
case sflow::ParameterEditorInteractionController::Pen:
214218
return sflow::ParameterEditorInteractionController::ConvertAnchor;
@@ -222,6 +226,7 @@ namespace VisualEditor {
222226
case sflow::ParameterEditorInteractionController::Pencil:
223227
case sflow::ParameterEditorInteractionController::Line:
224228
case sflow::ParameterEditorInteractionController::Brush:
229+
case sflow::ParameterEditorInteractionController::Transform:
225230
case sflow::ParameterEditorInteractionController::Eraser:
226231
case sflow::ParameterEditorInteractionController::FreeRangeSelect:
227232
ProjectViewModelContext::of(windowHandle)->parameterEditorContext()
@@ -231,7 +236,10 @@ namespace VisualEditor {
231236
pitchController->setPrimarySelectInteraction(sflow::ParameterEditorInteractionController::FreeRangeSelect);
232237
pitchController->setSecondaryItemInteraction(alternateInteraction);
233238
pitchController->setSecondarySceneInteraction(alternateInteraction);
234-
pitchController->setSecondarySelectInteraction(sflow::ParameterEditorInteractionController::FreeRangeSelect);
239+
pitchController->setSecondarySelectInteraction(
240+
interaction == sflow::ParameterEditorInteractionController::Transform
241+
? sflow::ParameterEditorInteractionController::FreeRangeSelect
242+
: sflow::ParameterEditorInteractionController::Transform);
235243
break;
236244
case sflow::ParameterEditorInteractionController::Pointer:
237245
case sflow::ParameterEditorInteractionController::Pen:

‎src/plugins/visualeditor/core/PianoRollPanelInterface.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ namespace VisualEditor {
111111
PitchPencilTool,
112112
PitchLineTool,
113113
PitchBrushTool,
114+
PitchTransformTool,
114115
PitchEraserTool,
115116
PitchRangeSelectTool,
116117
PitchPointerTool,

‎src/plugins/visualeditor/qml/actions/PianoRollAddOnActions.qml‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,13 @@ ActionCollection {
8989
}
9090
}
9191

92+
ActionItem {
93+
actionId: "org.diffscope.visualeditor.pianoRollPanel.pitchTransformTool"
94+
ToolAction {
95+
tool: PianoRollPanelInterface.PitchTransformTool
96+
}
97+
}
98+
9299
ActionItem {
93100
actionId: "org.diffscope.visualeditor.pianoRollPanel.pitchEraserTool"
94101
ToolAction {

‎src/plugins/visualeditor/qml/additionaltracks/ParameterTrack.qml‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,8 @@ QtObject {
181181
return ParameterEditorInteractionController.Eraser
182182
case ParameterEditorInteractionController.Eraser:
183183
return ParameterEditorInteractionController.Pencil
184+
case ParameterEditorInteractionController.FreeRangeSelect:
185+
return ParameterEditorInteractionController.Transform
184186
case ParameterEditorInteractionController.Pointer:
185187
case ParameterEditorInteractionController.Pen:
186188
return ParameterEditorInteractionController.ConvertAnchor
@@ -197,6 +199,7 @@ QtObject {
197199
case ParameterEditorInteractionController.Pencil:
198200
case ParameterEditorInteractionController.Line:
199201
case ParameterEditorInteractionController.Brush:
202+
case ParameterEditorInteractionController.Transform:
200203
case ParameterEditorInteractionController.Eraser:
201204
case ParameterEditorInteractionController.FreeRangeSelect:
202205
if (transformEditing)
@@ -230,14 +233,16 @@ QtObject {
230233
case ParameterEditorInteractionController.Pencil:
231234
case ParameterEditorInteractionController.Line:
232235
case ParameterEditorInteractionController.Brush:
236+
case ParameterEditorInteractionController.Transform:
233237
case ParameterEditorInteractionController.Eraser:
234238
case ParameterEditorInteractionController.FreeRangeSelect:
235239
controller.primaryItemInteraction = tool
236240
controller.primarySceneInteraction = tool
237241
controller.primarySelectInteraction = ParameterEditorInteractionController.FreeRangeSelect
238242
controller.secondaryItemInteraction = alternate
239243
controller.secondarySceneInteraction = alternate
240-
controller.secondarySelectInteraction = ParameterEditorInteractionController.FreeRangeSelect
244+
controller.secondarySelectInteraction = tool === ParameterEditorInteractionController.Transform
245+
? ParameterEditorInteractionController.FreeRangeSelect : ParameterEditorInteractionController.Transform
241246
break
242247
case ParameterEditorInteractionController.Pointer:
243248
case ParameterEditorInteractionController.Pen:
@@ -414,6 +419,7 @@ QtObject {
414419
{ text: qsTr("Pencil"), icon: "edit", tool: ParameterEditorInteractionController.Pencil },
415420
{ text: qsTr("Line"), icon: "line", tool: ParameterEditorInteractionController.Line },
416421
{ text: qsTr("Fixing"), icon: "paint_brush_arrow_down", tool: ParameterEditorInteractionController.Brush },
422+
{ text: qsTr("Transform Tool"), icon: "pitch_transform", tool: ParameterEditorInteractionController.Transform },
417423
{ text: qsTr("Eraser"), icon: "eraser", tool: ParameterEditorInteractionController.Eraser },
418424
{ text: qsTr("Range Select"), icon: "cursor_text", tool: ParameterEditorInteractionController.FreeRangeSelect },
419425
{ text: qsTr("Pointer"), icon: "cursor", tool: ParameterEditorInteractionController.Pointer },

‎src/plugins/visualeditor/res/org.diffscope.visualeditor_actions.xml‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,13 @@ SPDX-License-Identifier: LGPL-3.0-or-later
5959
<action id="org.diffscope.visualeditor.pianoRollPanel.pitchPencilTool" category="Piano Roll Panel" icon="pitch_pencil" shortcut="1" description="Draw pitch changes freehand." />
6060
<action id="org.diffscope.visualeditor.pianoRollPanel.pitchLineTool" category="Piano Roll Panel" icon="line" shortcut="2" description="Drag to draw a straight segment of the pitch curve." />
6161
<action id="org.diffscope.visualeditor.pianoRollPanel.pitchFixingTool" category="Piano Roll Panel" icon="paint_brush_arrow_down" shortcut="3" description="Freeze the original pitch over the dragged time range." />
62-
<action id="org.diffscope.visualeditor.pianoRollPanel.pitchEraserTool" category="Piano Roll Panel" icon="pitch_erase" shortcut="4" description="Erase drawn pitch edits over the dragged time range." />
63-
<action id="org.diffscope.visualeditor.pianoRollPanel.pitchRangeSelectTool" category="Piano Roll Panel" icon="pitch_cursor_text" shortcut="5" description="Select a time range of the drawn pitch curve." />
64-
<action id="org.diffscope.visualeditor.pianoRollPanel.pitchPointerTool" category="Piano Roll Panel" icon="pitch_cursor" shortcut="6" description="Select and move pitch anchors." />
65-
<action id="org.diffscope.visualeditor.pianoRollPanel.pitchPenTool" category="Piano Roll Panel" icon="calligraphy_pen" shortcut="7" description="Add, move, or delete pitch anchors." />
66-
<action id="org.diffscope.visualeditor.pianoRollPanel.pitchConvertTool" category="Piano Roll Panel" icon="arrow_bidirectional_left_right" shortcut="8" description="Change how the curve connects neighboring pitch anchors." />
67-
<action id="org.diffscope.visualeditor.pianoRollPanel.pitchAnchorSelectTool" category="Piano Roll Panel" icon="pitch_rectangle_landscape_dash" shortcut="9" description="Select pitch anchors by area or time range." />
62+
<action id="org.diffscope.visualeditor.pianoRollPanel.pitchTransformTool" category="Piano Roll Panel" text="Pitch Transform Tool" icon="pitch_transform" shortcut="4" description="Drag vertically to shift the pitch curve; drag horizontally to scale the pitch curve." />
63+
<action id="org.diffscope.visualeditor.pianoRollPanel.pitchEraserTool" category="Piano Roll Panel" icon="pitch_erase" shortcut="5" description="Erase drawn pitch edits over the dragged time range." />
64+
<action id="org.diffscope.visualeditor.pianoRollPanel.pitchRangeSelectTool" category="Piano Roll Panel" icon="pitch_cursor_text" shortcut="6" description="Select a time range of the drawn pitch curve." />
65+
<action id="org.diffscope.visualeditor.pianoRollPanel.pitchPointerTool" category="Piano Roll Panel" icon="pitch_cursor" shortcut="7" description="Select and move pitch anchors." />
66+
<action id="org.diffscope.visualeditor.pianoRollPanel.pitchPenTool" category="Piano Roll Panel" icon="calligraphy_pen" shortcut="8" description="Add, move, or delete pitch anchors." />
67+
<action id="org.diffscope.visualeditor.pianoRollPanel.pitchConvertTool" category="Piano Roll Panel" icon="arrow_bidirectional_left_right" shortcut="9" description="Change how the curve connects neighboring pitch anchors." />
68+
<action id="org.diffscope.visualeditor.pianoRollPanel.pitchAnchorSelectTool" category="Piano Roll Panel" icon="pitch_rectangle_landscape_dash" shortcut="0" description="Select pitch anchors by area or time range." />
6869
<action id="org.diffscope.visualeditor.pianoRollPanel.additionalTracks" category="Piano Roll Panel" icon="more_vertical" triggerable="false" diffscope:componentType="menu" description="Choose which additional lanes to display in the piano roll." />
6970
<action id="org.diffscope.visualeditor.pianoRollPanel.bottomAdditionalTracks" category="Piano Roll Panel" text="Bottom Panels" icon="layout_row_two_focus_bottom" triggerable="false" diffscope:componentType="menu" description="Choose which editing panels to display below the piano roll." />
7071
<action id="org.diffscope.visualeditor.arrangementPanel.snap" category="Arrangement Panel" triggerable="false" diffscope:componentType="widget" />
@@ -189,6 +190,7 @@ SPDX-License-Identifier: LGPL-3.0-or-later
189190
<action id="org.diffscope.visualeditor.pianoRollPanel.pitchPencilTool" />
190191
<action id="org.diffscope.visualeditor.pianoRollPanel.pitchLineTool" />
191192
<action id="org.diffscope.visualeditor.pianoRollPanel.pitchFixingTool" />
193+
<action id="org.diffscope.visualeditor.pianoRollPanel.pitchTransformTool" />
192194
<action id="org.diffscope.visualeditor.pianoRollPanel.pitchEraserTool" />
193195
<action id="org.diffscope.visualeditor.pianoRollPanel.pitchRangeSelectTool" />
194196
<action id="org.diffscope.visualeditor.pianoRollPanel.pitchPointerTool" />

‎src/plugins/visualeditor/res/translations/org.diffscope.visualeditor_en_US.ts‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,11 @@
7878
</context>
7979
<context>
8080
<name>Application::ActionDescription</name>
81+
<message>
82+
<location filename="../org.diffscope.visualeditor_actions.xml" line="62"/>
83+
<source>Drag vertically to shift the pitch curve; drag horizontally to scale the pitch curve.</source>
84+
<translation type="unfinished"></translation>
85+
</message>
8186
<message>
8287
<location filename="../../../../../cmake-build-relwithdebinfo/src/plugins/visualeditor/res/qak_org.diffscope.visualeditor_actions.cpp" line="4065"/>
8388
<source>Select, move, or resize clips.</source>
@@ -231,6 +236,11 @@
231236
</context>
232237
<context>
233238
<name>Application::ActionText</name>
239+
<message>
240+
<location filename="../org.diffscope.visualeditor_actions.xml" line="62"/>
241+
<source>Pitch Transform Tool</source>
242+
<translation type="unfinished"></translation>
243+
</message>
234244
<message>
235245
<location filename="../../../../../cmake-build-relwithdebinfo/src/plugins/visualeditor/res/qak_org.diffscope.visualeditor_actions.cpp" line="3996"/>
236246
<source>Pointer Tool</source>
@@ -1100,6 +1110,11 @@
11001110
</context>
11011111
<context>
11021112
<name>ParameterTrack</name>
1113+
<message>
1114+
<location filename="../../qml/additionaltracks/ParameterTrack.qml" line="422"/>
1115+
<source>Transform Tool</source>
1116+
<translation type="unfinished"></translation>
1117+
</message>
11031118
<message>
11041119
<location filename="../../qml/additionaltracks/ParameterTrack.qml" line="267"/>
11051120
<location filename="../../qml/additionaltracks/ParameterTrack.qml" line="268"/>

‎src/plugins/visualeditor/res/translations/org.diffscope.visualeditor_ja_JP.ts‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,11 @@
7878
</context>
7979
<context>
8080
<name>Application::ActionDescription</name>
81+
<message>
82+
<location filename="../org.diffscope.visualeditor_actions.xml" line="62"/>
83+
<source>Drag vertically to shift the pitch curve; drag horizontally to scale the pitch curve.</source>
84+
<translation type="unfinished"></translation>
85+
</message>
8186
<message>
8287
<location filename="../../../../../cmake-build-relwithdebinfo/src/plugins/visualeditor/res/qak_org.diffscope.visualeditor_actions.cpp" line="4065"/>
8388
<source>Select, move, or resize clips.</source>
@@ -231,6 +236,11 @@
231236
</context>
232237
<context>
233238
<name>Application::ActionText</name>
239+
<message>
240+
<location filename="../org.diffscope.visualeditor_actions.xml" line="62"/>
241+
<source>Pitch Transform Tool</source>
242+
<translation type="unfinished"></translation>
243+
</message>
234244
<message>
235245
<location filename="../../../../../cmake-build-relwithdebinfo/src/plugins/visualeditor/res/qak_org.diffscope.visualeditor_actions.cpp" line="3996"/>
236246
<source>Pointer Tool</source>
@@ -1111,6 +1121,11 @@
11111121
</context>
11121122
<context>
11131123
<name>ParameterTrack</name>
1124+
<message>
1125+
<location filename="../../qml/additionaltracks/ParameterTrack.qml" line="422"/>
1126+
<source>Transform Tool</source>
1127+
<translation type="unfinished"></translation>
1128+
</message>
11141129
<message>
11151130
<location filename="../../qml/additionaltracks/ParameterTrack.qml" line="267"/>
11161131
<location filename="../../qml/additionaltracks/ParameterTrack.qml" line="268"/>

‎src/plugins/visualeditor/res/translations/org.diffscope.visualeditor_zh_CN.ts‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,11 @@
8282
</context>
8383
<context>
8484
<name>Application::ActionDescription</name>
85+
<message>
86+
<location filename="../org.diffscope.visualeditor_actions.xml" line="62"/>
87+
<source>Drag vertically to shift the pitch curve; drag horizontally to scale the pitch curve.</source>
88+
<translation type="unfinished"></translation>
89+
</message>
8590
<message>
8691
<location filename="../../../../../cmake-build-relwithdebinfo/src/plugins/visualeditor/res/qak_org.diffscope.visualeditor_actions.cpp" line="4065"/>
8792
<source>Select, move, or resize clips.</source>
@@ -235,6 +240,11 @@
235240
</context>
236241
<context>
237242
<name>Application::ActionText</name>
243+
<message>
244+
<location filename="../org.diffscope.visualeditor_actions.xml" line="62"/>
245+
<source>Pitch Transform Tool</source>
246+
<translation type="unfinished"></translation>
247+
</message>
238248
<message>
239249
<location filename="../../../../../cmake-build-relwithdebinfo/src/plugins/visualeditor/res/qak_org.diffscope.visualeditor_actions.cpp" line="3996"/>
240250
<source>Pointer Tool</source>
@@ -1150,6 +1160,11 @@
11501160
</context>
11511161
<context>
11521162
<name>ParameterTrack</name>
1163+
<message>
1164+
<location filename="../../qml/additionaltracks/ParameterTrack.qml" line="422"/>
1165+
<source>Transform Tool</source>
1166+
<translation type="unfinished"></translation>
1167+
</message>
11531168
<message>
11541169
<location filename="../../qml/additionaltracks/ParameterTrack.qml" line="267"/>
11551170
<location filename="../../qml/additionaltracks/ParameterTrack.qml" line="268"/>

‎src/plugins/visualeditor/res/translations/org.diffscope.visualeditor_zh_TW.ts‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,11 @@
7878
</context>
7979
<context>
8080
<name>Application::ActionDescription</name>
81+
<message>
82+
<location filename="../org.diffscope.visualeditor_actions.xml" line="62"/>
83+
<source>Drag vertically to shift the pitch curve; drag horizontally to scale the pitch curve.</source>
84+
<translation type="unfinished"></translation>
85+
</message>
8186
<message>
8287
<location filename="../../../../../cmake-build-relwithdebinfo/src/plugins/visualeditor/res/qak_org.diffscope.visualeditor_actions.cpp" line="4065"/>
8388
<source>Select, move, or resize clips.</source>
@@ -231,6 +236,11 @@
231236
</context>
232237
<context>
233238
<name>Application::ActionText</name>
239+
<message>
240+
<location filename="../org.diffscope.visualeditor_actions.xml" line="62"/>
241+
<source>Pitch Transform Tool</source>
242+
<translation type="unfinished"></translation>
243+
</message>
234244
<message>
235245
<location filename="../../../../../cmake-build-relwithdebinfo/src/plugins/visualeditor/res/qak_org.diffscope.visualeditor_actions.cpp" line="3996"/>
236246
<source>Pointer Tool</source>
@@ -1111,6 +1121,11 @@
11111121
</context>
11121122
<context>
11131123
<name>ParameterTrack</name>
1124+
<message>
1125+
<location filename="../../qml/additionaltracks/ParameterTrack.qml" line="422"/>
1126+
<source>Transform Tool</source>
1127+
<translation type="unfinished"></translation>
1128+
</message>
11141129
<message>
11151130
<location filename="../../qml/additionaltracks/ParameterTrack.qml" line="267"/>
11161131
<location filename="../../qml/additionaltracks/ParameterTrack.qml" line="268"/>

0 commit comments

Comments
 (0)