-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Expand file tree
/
Copy pathApplicationMenuCommands.qml
More file actions
107 lines (91 loc) · 3.09 KB
/
Copy pathApplicationMenuCommands.qml
File metadata and controls
107 lines (91 loc) · 3.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
import Mixxx 1.0 as Mixxx
import QtQuick
import QtQuick.Controls
import QtQuick.Dialogs
import QtQuick.Window
Item {
id: root
required property ApplicationWindow applicationWindow
readonly property bool fullScreen: applicationWindow.visibility === Window.FullScreen
property int pendingDeck: 1
signal showDeveloperToolsRequested
function loadTrackToDeck(deck) {
pendingDeck = deck;
const playControl = [deck1PlayControl, deck2PlayControl, deck3PlayControl, deck4PlayControl][deck - 1];
if (playControl && playControl.value > 0) {
confirmLoadDialog.text = qsTr("Deck %1 is currently playing a track.\nAre you sure you want to load a new track?").arg(deck);
confirmLoadDialog.open();
} else {
openTrackFileDialog();
}
}
function openTrackFileDialog() {
trackFileDialog.title = qsTr("Load track to Deck %1").arg(pendingDeck);
trackFileDialog.currentFolder = Mixxx.PlayerManager.initialTrackDirectoryUrl;
Qt.callLater(function() {
trackFileDialog.open();
});
}
function toggleFullScreen() {
applicationWindow.visibility = applicationWindow.visibility === Window.FullScreen ? Window.Windowed : Window.FullScreen;
}
function showAbout() {
aboutDialog.open();
}
function showKeywheel() {
keywheelDialog.open();
}
FileDialog {
id: trackFileDialog
fileMode: FileDialog.OpenFile
nameFilters: Mixxx.PlayerManager.supportedAudioFileNameFilters
onAccepted: Mixxx.PlayerManager.loadLocationUrlToDeck(selectedFile, root.pendingDeck)
}
MessageDialog {
id: confirmLoadDialog
buttons: MessageDialog.Yes | MessageDialog.No
title: Mixxx.Application.applicationName
onAccepted: root.openTrackFileDialog()
}
MessageDialog {
id: aboutDialog
buttons: MessageDialog.Ok
informativeText: qsTr("%1\n%2").arg(Mixxx.Application.platform).arg("https://mixxx.org")
text: qsTr("%1 %2").arg(Mixxx.Application.applicationName).arg(Mixxx.Application.version)
title: qsTr("About %1").arg(Mixxx.Application.applicationName)
}
Dialog {
id: keywheelDialog
height: Math.min(620, root.applicationWindow.height - 80)
modal: false
standardButtons: Dialog.Close
title: qsTr("Keywheel")
width: height
x: Math.round((root.applicationWindow.width - width) / 2)
y: Math.round((root.applicationWindow.height - height) / 2)
contentItem: Image {
fillMode: Image.PreserveAspectFit
source: "../images/keywheel/keywheel.svg"
}
}
Mixxx.ControlProxy {
id: deck1PlayControl
group: "[Channel1]"
key: "play"
}
Mixxx.ControlProxy {
id: deck2PlayControl
group: "[Channel2]"
key: "play"
}
Mixxx.ControlProxy {
id: deck3PlayControl
group: "[Channel3]"
key: "play"
}
Mixxx.ControlProxy {
id: deck4PlayControl
group: "[Channel4]"
key: "play"
}
}