Permalink
Browse files

qmlui: preliminary Cue List widget side fader support

  • Loading branch information...
mcallegari committed Dec 16, 2018
1 parent 3c59ec7 commit 577d5406e566e4a0fe721c25dc230a6a819d8955
@@ -48,6 +48,7 @@ Rectangle
property int indexInList: -1
property int highlightIndex: -1
property int highlightEditTime: -1
property int nextIndex: -1

property int col1Width: 25
property int col2Width: UISettings.bigItemHeight * 1.5
@@ -160,6 +161,7 @@ Rectangle
{
width: col1Width
height: parent.height
color: nextIndex === indexInList ? "orange" : "transparent"
label: indexInList + 1
labelColor: stepDelegate.labelColor
fontSize: labelFontSize
@@ -31,6 +31,7 @@ Column
property bool isSequence: false
property alias model: cStepsList.model
property alias playbackIndex: cStepsList.currentIndex
property int nextIndex: -1
property alias speedType: timeEditTool.speedType
property int tempoType: QLCFunction.Time
property bool isRunning: false
@@ -470,6 +471,7 @@ Column
indexInList: index
highlightIndex: cStepsList.dragInsertIndex
highlightEditTime: editStepIndex === index ? editStepType : -1
nextIndex: widgetRoot.nextIndex

Drag.active: delegateRoot.drag.active
Drag.source: csDelegate
@@ -28,6 +28,7 @@ VCWidgetItem
property VCCueList cueListObj: null
property int buttonsLayout: cueListObj ? cueListObj.playbackLayout : VCCueList.PlayPauseStop
property int playbackStatus: cueListObj ? cueListObj.playbackStatus : VCCueList.Stopped
property int sideFaderMode: cueListObj ? cueListObj.sideFaderMode : VCCueList.None

clip: true

@@ -65,17 +66,125 @@ VCWidgetItem

ColumnLayout
{
anchors.fill: parent
id: sideFaderLayout
visible: sideFaderMode === VCCueList.None ? false : true
height: parent.height
width: UISettings.iconSizeDefault * 1.2

property string labelSuffix: sideFaderMode === VCCueList.Crossfade ? "%" : ""
property int playbackIndex: cueListObj ? cueListObj.playbackIndex : -1
property int nextStepIndex: cueListObj ? cueListObj.nextStepIndex : -1
property bool primaryTop: cueListObj ? cueListObj.primaryTop : true

onNextStepIndexChanged: updateLabels()
onPrimaryTopChanged: updateLabels()

function updateLabels()
{
if (playbackIndex == -1)
{
topLabelBox.color = "transparent"
topLabel.label = ""
bottomLabelBox.color = "transparent"
bottomLabel.label = ""
}
else
{
if (sideFaderMode == VCCueList.Steps)
{
bottomLabelBox.color = UISettings.highlight
bottomLabel.label = "#" + (playbackIndex + 1)
}
else
{
topLabelBox.color = primaryTop ? UISettings.highlight : "orange"
topLabel.label = "#" + ((primaryTop ? playbackIndex : nextStepIndex) + 1)
bottomLabelBox.color = primaryTop ? "orange" : UISettings.highlight
bottomLabel.label = "#" + ((primaryTop ? nextStepIndex : playbackIndex) + 1)
}
}
}

RobotoText
{
height: UISettings.listItemHeight
width: parent.width
textHAlign: Text.AlignHCenter
label: "" + sideFader.value + sideFaderLayout.labelSuffix
}

Rectangle
{
id: topLabelBox
visible: sideFaderMode === VCCueList.Crossfade
Layout.alignment: Qt.AlignHCenter
height: UISettings.listItemHeight
width: UISettings.iconSizeDefault
color: "transparent"
border.width: 1
border.color: UISettings.fgMain

RobotoText
{
id: topLabel
anchors.centerIn: parent
}
}

QLCPlusFader
{
id: sideFader
Layout.fillHeight: true
Layout.alignment: Qt.AlignHCenter
from: 0
to: sideFaderMode === VCCueList.Crossfade ? 100 : 255
value: cueListObj ? cueListObj.sideFaderLevel : 0
onMoved: if (cueListObj) cueListObj.sideFaderLevel = value
}

Rectangle
{
id: bottomLabelBox
height: UISettings.listItemHeight
width: UISettings.iconSizeDefault
Layout.alignment: Qt.AlignHCenter
color: "transparent" // TODO
border.width: 1
border.color: UISettings.fgMain

RobotoText
{
id: bottomLabel
anchors.centerIn: parent
}
}

RobotoText
{
visible: sideFaderMode === VCCueList.Crossfade
height: UISettings.listItemHeight
width: parent.width
textHAlign: Text.AlignHCenter
label: "" + (sideFader.to - sideFader.value) + sideFaderLayout.labelSuffix
}
}

ColumnLayout
{
width: parent.width - (sideFaderLayout.visible ? sideFaderLayout.width : 0)
height: parent.height
x: sideFaderLayout.visible ? sideFaderLayout.width : 0
spacing: 2

ChaserWidget
{
id: chWidget
//isSequence: ceContainer.isSequence
Layout.fillWidth: true
height: cueListRoot.height - controlsRow.height
Layout.fillHeight: true
model: cueListObj ? cueListObj.stepsList : null
playbackIndex: cueListObj ? cueListObj.playbackIndex : -1
nextIndex: sideFaderMode === VCCueList.Crossfade ? sideFaderLayout.nextStepIndex : -1
//tempoType: chaserEditor.tempoType
//isRunning: chaserEditor.previewEnabled

@@ -84,7 +193,6 @@ VCWidgetItem
onAddFunctions: if (cueListObj) cueListObj.addFunctions(list, index)

onDragEntered: virtualConsole.setDropTarget(item, true)

onDragExited: virtualConsole.setDropTarget(item, false)

states: [
@@ -143,5 +143,72 @@ Rectangle
}
} // GridLayout
} // SectionBox

SectionBox
{
sectionLabel: qsTr("Side fader")

sectionContents:
GridLayout
{
width: parent.width
columns: 7
columnSpacing: 5
rowSpacing: 3

// row 1
RobotoText
{
height: gridItemsHeight
Layout.fillWidth: true
label: qsTr("Mode")
}

CustomCheckBox
{
implicitWidth: UISettings.iconSizeMedium
implicitHeight: implicitWidth
checked: widgetRef ? widgetRef.sideFaderMode === VCCueList.None : false
onClicked: if (checked && widgetRef) widgetRef.sideFaderMode = VCCueList.None
}

RobotoText
{
height: gridItemsHeight
Layout.fillWidth: true
label: qsTr("None")
}

CustomCheckBox
{
implicitWidth: UISettings.iconSizeMedium
implicitHeight: implicitWidth
checked: widgetRef ? widgetRef.sideFaderMode === VCCueList.Crossfade : false
onClicked: if (checked && widgetRef) widgetRef.sideFaderMode = VCCueList.Crossfade
}

RobotoText
{
height: gridItemsHeight
Layout.fillWidth: true
label: qsTr("Crossfade")
}

CustomCheckBox
{
implicitWidth: UISettings.iconSizeMedium
implicitHeight: implicitWidth
checked: widgetRef ? widgetRef.sideFaderMode === VCCueList.Steps : false
onClicked: if (checked && widgetRef) widgetRef.sideFaderMode = VCCueList.Steps
}

RobotoText
{
height: gridItemsHeight
Layout.fillWidth: true
label: qsTr("Steps")
}
}
}
} // Column
}
Oops, something went wrong.

0 comments on commit 577d540

Please sign in to comment.