@@ -0,0 +1,65 @@
import QtQuick 2.0
import CSI 1.0
import './../Widgets' as Widgets
import './../Definitions' as Definitions

//----------------------------------------------------------------------------------------------------------------------
// STEP SEQUENCER
//----------------------------------------------------------------------------------------------------------------------

Item
{
id: step_sequencer
property var playerPropertyPath: ""
property var activeSamplePath: ""
property var remixDeckPropertyPath: ""

property int numberOfEditableSteps: 8
property bool selected: false

AppProperty { id: current_step; path: playerPropertyPath + ".sequencer.current_step" }
AppProperty { id: pattern_length; path: playerPropertyPath + ".sequencer.pattern_length" }
AppProperty { id: color_id; path: activeSamplePath + ".color_id" }
MappingProperty { id: sequencer_page; path: propertiesPath + deck_position + ".sequencer_deck_page" }

Grid
{
anchors.left: parent.left
anchors.leftMargin: 6
anchors.top: parent.top
anchors.topMargin: 1
columns: 4
spacing: 4
Repeater
{
model: pattern_length.value
Rectangle
{
AppProperty { id: step; path: playerPropertyPath + ".sequencer.steps." + (index + 1) }

radius: 2
width: 22
height: 22
color: ( current_step.value === index ) ? colors.colorWhite85 : calculate_base_color()

function calculate_base_color()
{
if ( current_step.value === index ) return "white"

if ( step_sequencer.selected ) // the current column is selected for editing
{
if ( ( index >= (sequencer_page.value - 1)*numberOfEditableSteps && index < sequencer_page.value*numberOfEditableSteps ) )
{
return step.value ? colors.palette(1.0, color_id.value) : colors.colorWhite19
}
else
{
return step.value ? colors.palette(0.5, color_id.value) : colors.colorGrey24
}
}
return step.value ? colors.palette(1.0, color_id.value) : colors.colorWhite19
}
}
}
}
}
@@ -16,7 +16,6 @@ Rectangle {
property int focusDeckId: 0 // deckId of the deck currently focused on screen
property int fxUnit: 0
property string propertiesPath: ""
property bool showPerformanceFooter: true
property bool isRemixDeck: false
property bool isStemDeck: false
property bool hasDeckControls: isRemixDeck || isStemDeck
@@ -30,6 +29,7 @@ Rectangle {
readonly property int smallStateHeight: (showPerformanceFooter || isInEditMode || isStemDeck) ? 27 : 0
readonly property int bigStateHeight : 81

readonly property bool showPerformanceFooter: (screen.flavor != ScreenFlavor.S5)
readonly property bool hasContent: fxUnitsEnabled.value || hasDeckControls || useMIDIControls.value

visible: (showPerformanceFooter || isInEditMode || isStemDeck)
@@ -48,6 +48,44 @@ Rectangle {
//--------------------------------------------------------------------------------------------------------------------

Behavior on height { NumberAnimation { duration: durations.overlayTransition } }

function getColumnIndex(state, columnIdx)
{
/* #ifdef ENABLE_STEP_SEQUENCER */
if (state == "SLOT 1")
return 0;
if (state == "SLOT 2")
return 1;
if (state == "SLOT 3")
return 2;
if (state == "SLOT 4")
return 3;
/* #endif */

return columnIdx;
}

function getColumnState(state, columnIdx)
{
/* #ifdef ENABLE_STEP_SEQUENCER */
if (state == "SLOT 1" || state == "SLOT 2" || state == "SLOT 3" || state == "SLOT 4")
{
switch (columnIdx)
{
case 0:
return "SAMPLE";
case 1:
return "FILTER";
case 2:
return "PITCH";
case 3:
return "FX SEND";
}
}
/* #endif */

return state;
}

// Row containing the progress bars + info texts
Row {
@@ -71,12 +109,16 @@ Rectangle {
midiId: bottomInfoPanel.midiId + (index + 1)
markActive: stemSelected

column: index
column: getColumnIndex(bottomInfoPanel.contentState, index)
levelColor: bottomInfoPanel.levelColor
bgColor: (index==0 && contentState == "FX" && sizeState == "large") ? colors.colorFxHeaderLightBg : bottomInfoPanel.color

sliderHeight: bottomPanelRow.sliderHeight
state: bottomInfoPanel.contentState
/* #ifdef ENABLE_STEP_SEQUENCER */
showSampleName: !(bottomInfoPanel.contentState == "SLOT 1" || bottomInfoPanel.contentState == "SLOT 2" ||
bottomInfoPanel.contentState == "SLOT 3" || bottomInfoPanel.contentState == "SLOT 4")
/* #endif */
state: getColumnState(bottomInfoPanel.contentState, index)

// If in stem deck on an S5, check if the current stem is selected (usually via the pads)
MappingProperty { id: stemSelectorMode; path: propertiesPath + ".stem_selector_mode." + (index + 1) }
@@ -93,7 +135,7 @@ Rectangle {
anchors.top: parent.top
anchors.topMargin: 2
visible: bottomInfoPanel.hasContent
opacity: bottomInfoPanel.hasContent
opacity: bottomInfoPanel.hasContent ? 1.0 : 0.0
color: bottomInfoPanel.headlineColor
font.pixelSize: fonts.scale(11)
}

Large diffs are not rendered by default.

@@ -0,0 +1,43 @@
import QtQuick 2.0
import CSI 1.0

import './../../Definitions/' as Definitions


// dimensions are set in CenterOverlay.qml

CenterOverlay {
id: swingAdjust

Definitions.Margins { id: customMargins }
property int deckId: 0


//--------------------------------------------------------------------------------------------------------------------

AppProperty { id: swing; path: "app.traktor.decks." + (deckId+1) + ".remix.sequencer.swing"; }

//--------------------------------------------------------------------------------------------------------------------

// headline
Text {
anchors.top: parent.top
anchors.horizontalCenter: parent.horizontalCenter
anchors.topMargin: customMargins.topMarginCenterOverlayHeadline
font.pixelSize: fonts.largeFontSize
color: colors.colorCenterOverlayHeadline
text: "SWING"
}

// value
Text {
anchors.top: parent.top
anchors.horizontalCenter: parent.horizontalCenter
anchors.topMargin: 47
font.pixelSize: fonts.superLargeValueFontSize
font.family: "Pragmatica"
color: colors.colorWhite
text: swing.description
}

}
@@ -54,6 +54,13 @@ Item {
deckId: overlay.deckId
}

/* #ifdef ENABLE_STEP_SEQUENCER */
CenterOverlays.SwingAdjust {
id: swing
deckId: overlay.deckId
}
/* #endif */

CenterOverlays.SliceSize {
id: sliceSize
deckId: overlay.deckId
@@ -93,6 +100,9 @@ Item {
tempo.visible = false;
keylock.visible = false;
quantize.visible = false;
/* #ifdef ENABLE_STEP_SEQUENCER */
swing.visible = false;
/* #endif */
fxSelect.visible = false;
sliceSize.visible = false;
browserSorting.visible = false;
@@ -127,6 +137,13 @@ Item {
PropertyChanges { target: overlay; visible: true; }
PropertyChanges { target: quantize; visible: true; }
},
/* #ifdef ENABLE_STEP_SEQUENCER */
State {
name: Overlay.states[Overlay.swing]
PropertyChanges { target: overlay; visible: true; }
PropertyChanges { target: swing; visible: true; }
},
/* #endif */
State {
name: Overlay.states[Overlay.slice]
PropertyChanges { target: overlay; visible: true; }
@@ -24,7 +24,7 @@ Item {
property bool bottomInfoShown: false
property string settingsPath: ""
property string propertiesPath: ""
property var surface
property var flavor

property alias buttonArea1State: buttonArea1.showHideState
property alias buttonArea2State: buttonArea2.showHideState
@@ -63,6 +63,11 @@ Item {
MappingProperty { id: beatgridEditMode; path: propertiesPath + ".edit_mode"; onValueChanged: { updateButtonArea(); } }
AppProperty { id: isTrackLocked; path: "app.traktor.decks." + (focusDeckId+1) + ".track.grid.lock_bpm" }
AppProperty { id: isTrackTick; path: "app.traktor.decks." + (focusDeckId+1) + ".track.grid.enable_tick" }
/* #ifdef ENABLE_STEP_SEQUENCER */
AppProperty { id: isSequencerOn; path: "app.traktor.decks." + (focusDeckId+1) + ".remix.sequencer.on" }
readonly property bool showStepSequencer: isSequencerOn.value && (screen.flavor != ScreenFlavor.S5)
onShowStepSequencerChanged: { updateButtonArea(); }
/* #endif */

//--------------------------------------------------------------------------------------------------------------------

@@ -157,8 +162,6 @@ Item {
isInEditMode: beatgridEditMode.value == 3
sizeState: (bottomInfoShown) ? "large" : "small"

showPerformanceFooter: (screen.surface != S5Screen.S5)

isRemixDeck: ( ( deckView.upperDeckState == "Remix Deck" ) || (deckView.lowerDeckState == "Remix Deck") ) && ( screen.focusDeckContentState != "Stem Deck" )
isStemDeck: ( ( deckView.upperDeckState == "Stem Deck" ) || (deckView.lowerDeckState == "Stem Deck" ) ) && ( screen.focusDeckContentState != "Remix Deck" )
}
@@ -206,12 +209,6 @@ Item {
}

//--------------------------------------------------------------------------------------------------------------------
/* #ifdef ENABLE_STEP_SEQUENCER
property bool load_focus_text: (screen.focusDeckContentState == "Sequencer")
#endif */
/* #ifndef ENABLE_STEP_SEQUENCER */
property bool load_focus_text: false
/* #endif */

// left overlay
SideOverlays.ButtonArea {
@@ -223,8 +220,13 @@ Item {
anchors.left: parent.left
anchors.leftMargin: -6 //hides left glow & border
scrollPosition: (deckView.isUpperDeck) ? upperRemixDeckRowShift - 1 : lowerRemixDeckRowShift - 1
topButtonText: load_focus_text ? "LOAD" : (beatgridEditMode.value) ? "LOCK" : "BPM"
bottomButtonText: load_focus_text ? "LOAD" : (beatgridEditMode.value) ? "TICK" : ((focusDeckContentState == "Remix Deck") ? "QUANTIZE" : "KEY")
topButtonText: beatgridEditMode.value ? "LOCK" : "BPM"
/* #ifdef ENABLE_STEP_SEQUENCER */
bottomButtonText: beatgridEditMode.value ? "TICK" : (focusDeckContentState == "Remix Deck" ? (showStepSequencer ? "SWING" : "QUANTIZE") : "KEY")
/* #endif */
/* #ifndef ENABLE_STEP_SEQUENCER
bottomButtonText: beatgridEditMode.value ? "TICK" : (focusDeckContentState == "Remix Deck" ? "QUANTIZE" : "KEY")
#endif */
isTopHighlighted: (beatgridEditMode.value && isTrackLocked.value)
isBottomHighlighted: (beatgridEditMode.value && isTrackTick.value)
}
@@ -234,8 +236,14 @@ Item {
id: buttonArea2
state: "hide"
showHideState: showButtonArea.value ? "show" : "hide"
topButtonText: load_focus_text ? "FOCUS +" :(screenState.state == "BrowserView") ? "PREP +" : ((beatgridEditMode.value) ? "TAP" : "VIEW")
bottomButtonText: load_focus_text ? "FOCUS -" :(screenState.state == "BrowserView") ? "TO PREP" : ((beatgridEditMode.value) ? "RST" : "ZOOM")
/* #ifdef ENABLE_STEP_SEQUENCER */
topButtonText: screenState.state == "BrowserView" ? "PREP +" : (beatgridEditMode.value ? "TAP" : (focusDeckContentState == "Remix Deck" && showStepSequencer ? "1-8" : "VIEW"))
bottomButtonText: screenState.state == "BrowserView" ? "TO PREP" : (beatgridEditMode.value ? "RST" : (focusDeckContentState == "Remix Deck" && showStepSequencer ? "9-16" : "ZOOM"))
/* #endif */
/* #ifndef ENABLE_STEP_SEQUENCER
topButtonText: screenState.state == "BrowserView" ? "PREP +" : (beatgridEditMode.value ? "TAP" : "VIEW")
bottomButtonText: screenState.state == "BrowserView" ? "TO PREP" : (beatgridEditMode.value ? "RST" : "ZOOM")
#endif */
textAngle: 90
anchors.right: parent.right
anchors.rightMargin: -6 // hides right glow & border
@@ -263,13 +271,12 @@ Item {

buttonArea1.visible = true
buttonArea1.contentState = "TextArea"
/* #ifdef ENABLE_STEP_SEQUENCER */
buttonArea2.contentState = showStepSequencer ? "TextArea" : "ScrollBar"
/* #endif */
/* #ifndef ENABLE_STEP_SEQUENCER
buttonArea2.contentState = "ScrollBar"
}
else if (load_focus_text)
{
buttonArea1.visible = true
buttonArea1.contentState = "TextArea"
buttonArea2.contentState = "TextArea"
#endif */
}
} else if (screenState.state == "BrowserView") {
buttonArea1.visible = false
@@ -281,14 +288,14 @@ Item {
{
if (screen.focusDeckContentState == "Remix Deck") {
buttonArea1.contentState = "TextArea"
/* #ifdef ENABLE_STEP_SEQUENCER */
buttonArea2.contentState = showStepSequencer ? "TextArea" : "ScrollBar"
/* #endif */
/* #ifndef ENABLE_STEP_SEQUENCER
buttonArea2.contentState = "ScrollBar"
#endif */
deckView.remixUpperDeckRowShift = 1 + ((upperRemixDeckRowShift - 1) * 2)
deckView.remixLowerDeckRowShift = 1 + ((lowerRemixDeckRowShift - 1) * 2)
}
else if (load_focus_text)
{
buttonArea1.contentState = "TextArea"
buttonArea2.contentState = "TextArea"
}
}
}