Skip to content

Commit

Permalink
fix intro/outro marker and zoom reset
Browse files Browse the repository at this point in the history
  • Loading branch information
acolombier committed Nov 9, 2024
1 parent 8d650e9 commit 3d9deed
Show file tree
Hide file tree
Showing 4 changed files with 95 additions and 9 deletions.
48 changes: 48 additions & 0 deletions res/qml/Deck.qml
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,54 @@ Item {
activeColor: Theme.deckActiveColor
}

Row {
anchors.left: playButton.right
anchors.leftMargin: 10
anchors.bottom: playButton.bottom
anchors.topMargin: 5
spacing: -1

Skin.IntroOutroButton {
keyPrefix: "intro_start"
group: root.group

text: "Intro\nStart"

width: playButton.height * 2 - 1
height: playButton.height
}

Skin.IntroOutroButton {
keyPrefix: "intro_end"
group: root.group

text: "Intro\nEnd"

width: playButton.height * 2 - 1
height: playButton.height
}

Skin.IntroOutroButton {
keyPrefix: "outro_start"
group: root.group

text: "Outro\nStart"

width: playButton.height * 2 - 1
height: playButton.height
}

Skin.IntroOutroButton {
keyPrefix: "outro_end"
group: root.group

text: "Outro\nEnd"

width: playButton.height * 2 - 1
height: playButton.height
}
}

Row {
anchors.left: cueButton.right
anchors.top: parent.top
Expand Down
45 changes: 45 additions & 0 deletions res/qml/IntroOutroButton.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import "." as Skin
import Mixxx 1.0 as Mixxx
import QtQuick 2.12

import "Theme"

Skin.Button {
id: root

required property string keyPrefix
required property string group

activeColor: Theme.deckActiveColor
highlight: enabledControl.value

Mixxx.ControlProxy {
id: control

group: root.group
key: `${root.keyPrefix}_activate`
value: root.down
}

Mixxx.ControlProxy {
id: enabledControl

group: root.group
key: `${root.keyPrefix}_enabled`
}

Mixxx.ControlProxy {
id: cleanControl

group: root.group
key: `${root.keyPrefix}_clear`
value: mousearea.pressed && enabledControl.value
}

MouseArea {
id: mousearea

anchors.fill: parent
acceptedButtons: Qt.RightButton
}
}
3 changes: 2 additions & 1 deletion res/qml/WaveformDisplay.qml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ Item {
}
Mixxx.WaveformMark {
control: "intro_start_position"
text: ''
align: 'top|right'
color: 'blue'
textColor: '#FFFFFF'
Expand All @@ -130,6 +131,7 @@ Item {
}
Mixxx.WaveformMark {
control: "outro_end_position"
text: ''
align: 'top|left'
color: 'blue'
textColor: '#FFFFFF'
Expand Down Expand Up @@ -171,7 +173,6 @@ Item {
group: root.group
key: "waveform_zoom"
}
readonly property real effectiveZoomFactor: (1 / rateRatioControl.value) * (100 / zoomControl.value)

MouseArea {
property int mouseStatus: WaveformDisplay.MouseStatus.Normal
Expand Down
8 changes: 0 additions & 8 deletions src/waveform/renderers/waveformwidgetrenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,6 @@ WaveformWidgetRenderer::~WaveformWidgetRenderer() {
}

bool WaveformWidgetRenderer::init() {
m_trackPixelCount = 0.0;
m_zoomFactor = 1.0;
m_visualSamplePerPixel = 1.0;
m_audioSamplePerPixel = 1.0;
m_totalVSamples = 0;
m_gain = 1.0;
m_trackSamples = 0.0;

for (int type = ::WaveformRendererAbstract::Play;
type <= ::WaveformRendererAbstract::Slip;
type++) {
Expand Down

0 comments on commit 3d9deed

Please sign in to comment.