| 1 |
/* |
| 2 |
* Audacity: A Digital Audio Editor |
| 3 |
*/ |
| 4 |
import QtQuick 2.15 |
| 5 |
import QtQuick.Controls 2.15 |
| 6 |
import QtQuick.Layouts 1.15 |
| 7 |
|
| 8 |
import Muse.Ui 1.0 |
| 9 |
import Muse.UiComponents 1.0 |
| 10 |
|
| 11 |
import Audacity.Playback 1.0 |
| 12 |
|
| 13 |
import "../components" |
| 14 |
|
| 15 |
RowLayout { |
| 16 |
id: root |
| 17 |
|
| 18 |
property alias value: bpmModel.value |
| 19 |
|
| 20 |
signal valueChangeRequested(var newValue) |
| 21 |
|
| 22 |
height: 28 |
| 23 |
|
| 24 |
BPMModel { |
| 25 |
id: bpmModel |
| 26 |
|
| 27 |
visualItem: root |
| 28 |
|
| 29 |
onValueChanged: { |
| 30 |
root.valueChangeRequested(value) |
| 31 |
} |
| 32 |
} |
| 33 |
|
| 34 |
spacing: 1 |
| 35 |
|
| 36 |
RoundedRectangle { |
| 37 |
Layout.preferredWidth: childrenRect.width |
| 38 |
Layout.preferredHeight: root.height |
| 39 |
|
| 40 |
topLeftRadius: 3 |
| 41 |
bottomLeftRadius: 3 |
| 42 |
|
| 43 |
color: ui.theme.backgroundQuarternaryColor |
| 44 |
|
| 45 |
Item { |
| 46 |
property int margin: 6 |
| 47 |
|
| 48 |
width: row.width + margin * 2 |
| 49 |
height: row.height |
| 50 |
|
| 51 |
Row { |
| 52 |
id: row |
| 53 |
|
| 54 |
anchors.left: parent.left |
| 55 |
anchors.leftMargin: parent.margin |
| 56 |
anchors.verticalCenter: parent.verticalCenter |
| 57 |
|
| 58 |
spacing: 0 |
| 59 |
|
| 60 |
Repeater { |
| 61 |
model: bpmModel |
| 62 |
|
| 63 |
delegate: TimecodeField { |
| 64 |
value: symbol |
| 65 |
|
| 66 |
isSelected: model.index === bpmModel.currentEditedFieldIndex |
| 67 |
isEditable: editable |
| 68 |
|
| 69 |
onClicked: { |
| 70 |
bpmModel.currentEditedFieldIndex = model.index |
| 71 |
} |
| 72 |
} |
| 73 |
} |
| 74 |
} |
| 75 |
} |
| 76 |
} |
| 77 |
|
| 78 |
ColumnLayout { |
| 79 |
Layout.preferredWidth: 16 |
| 80 |
Layout.preferredHeight: root.height |
| 81 |
|
| 82 |
spacing: 1 |
| 83 |
|
| 84 |
ArrowButton { |
| 85 |
Layout.fillWidth: true |
| 86 |
Layout.fillHeight: true |
| 87 |
|
| 88 |
isDown: false |
| 89 |
bottomRightRadius: 0 |
| 90 |
|
| 91 |
onClicked: function(mouse) { |
| 92 |
bpmModel.upValue() |
| 93 |
} |
| 94 |
} |
| 95 |
|
| 96 |
ArrowButton { |
| 97 |
Layout.fillWidth: true |
| 98 |
Layout.fillHeight: true |
| 99 |
Layout.alignment: Qt.AlignBottom |
| 100 |
|
| 101 |
isDown: true |
| 102 |
topRightRadius: 0 |
| 103 |
|
| 104 |
onClicked: function(mouse) { |
| 105 |
bpmModel.downValue() |
| 106 |
} |
| 107 |
} |
| 108 |
} |
| 109 |
} |