-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
QML: Library Improvements #4567
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
339da28
600bc47
2e20cb2
5f49f76
ffa8995
a60a886
73d6c72
77c2879
0bc7711
62158fc
3df180d
1ed44fe
7712dd3
a0f982b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| import Mixxx 0.1 as Mixxx | ||
|
|
||
| Mixxx.ControlProxy { | ||
|
|
||
| enum WidgetKind { | ||
| None, | ||
| Searchbar, | ||
| Sidebar, | ||
| LibraryView | ||
| } | ||
|
|
||
| group: "[Library]" | ||
| key: "focused_widget" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,156 @@ | ||
| import Mixxx 0.1 as Mixxx | ||
| import QtQuick 2.12 | ||
|
|
||
| Item { | ||
| id: root | ||
|
|
||
| property alias focusWidget: focusedWidgetControl.value | ||
|
|
||
| signal moveVertical(int offset) | ||
| signal loadSelectedTrack(string group, bool play) | ||
| signal loadSelectedTrackIntoNextAvailableDeck(bool play) | ||
|
|
||
| FocusedWidgetControl { | ||
| id: focusedWidgetControl | ||
|
|
||
| Component.onCompleted: this.value = FocusedWidgetControl.WidgetKind.LibraryView | ||
| } | ||
|
|
||
| Mixxx.ControlProxy { | ||
| group: "[Library]" | ||
| key: "GoToItem" | ||
| onValueChanged: { | ||
| if (value != 0 && root.focusWidget == FocusedWidgetControl.WidgetKind.LibraryView) | ||
| root.loadSelectedTrackIntoNextAvailableDeck(false); | ||
|
|
||
| } | ||
| } | ||
|
|
||
| Mixxx.ControlProxy { | ||
| group: "[Playlist]" | ||
| key: "LoadSelectedIntoFirstStopped" | ||
| onValueChanged: { | ||
| if (value != 0 && root.focusWidget == FocusedWidgetControl.WidgetKind.LibraryView) | ||
| root.loadSelectedTrackIntoNextAvailableDeck(false); | ||
|
|
||
| } | ||
| } | ||
|
|
||
| Mixxx.ControlProxy { | ||
| group: "[Playlist]" | ||
| key: "SelectTrackKnob" | ||
| onValueChanged: { | ||
| if (value != 0) { | ||
| root.focusWidget = FocusedWidgetControl.WidgetKind.LibraryView; | ||
| root.moveVertical(value); | ||
| } | ||
| } | ||
| } | ||
|
|
||
| Mixxx.ControlProxy { | ||
| group: "[Playlist]" | ||
| key: "SelectPrevTrack" | ||
| onValueChanged: { | ||
| if (value != 0) { | ||
| root.focusWidget = FocusedWidgetControl.WidgetKind.LibraryView; | ||
| root.moveVertical(-1); | ||
| } | ||
| } | ||
| } | ||
|
|
||
| Mixxx.ControlProxy { | ||
| group: "[Playlist]" | ||
| key: "SelectNextTrack" | ||
| onValueChanged: { | ||
| if (value != 0) { | ||
| root.focusWidget = FocusedWidgetControl.WidgetKind.LibraryView; | ||
| root.moveVertical(1); | ||
| } | ||
| } | ||
| } | ||
|
|
||
| Mixxx.ControlProxy { | ||
| group: "[Library]" | ||
| key: "MoveVertical" | ||
| onValueChanged: { | ||
| if (value != 0 && root.focusWidget == FocusedWidgetControl.WidgetKind.LibraryView) | ||
| root.moveVertical(value); | ||
|
|
||
| } | ||
| } | ||
|
|
||
| Mixxx.ControlProxy { | ||
| group: "[Library]" | ||
| key: "MoveUp" | ||
| onValueChanged: { | ||
| if (value != 0 && root.focusWidget == FocusedWidgetControl.WidgetKind.LibraryView) | ||
| root.moveVertical(-1); | ||
|
|
||
| } | ||
| } | ||
|
|
||
| Mixxx.ControlProxy { | ||
| group: "[Library]" | ||
| key: "MoveDown" | ||
| onValueChanged: { | ||
| if (value != 0 && root.focusWidget == FocusedWidgetControl.WidgetKind.LibraryView) | ||
| root.moveVertical(1); | ||
|
|
||
| } | ||
| } | ||
|
|
||
| Mixxx.ControlProxy { | ||
| id: numDecksControl | ||
|
|
||
| group: "[Master]" | ||
| key: "num_decks" | ||
| } | ||
|
|
||
| Instantiator { | ||
| model: numDecksControl.value | ||
|
|
||
| delegate: LibraryControlLoadSelectedTrackHandler { | ||
| group: "[Channel" + (index + 1) + "]" | ||
| enabled: root.focusWidget == FocusedWidgetControl.WidgetKind.LibraryView | ||
| onLoadTrackRequested: root.loadSelectedTrack(group, play) | ||
| } | ||
|
|
||
| } | ||
|
|
||
| Mixxx.ControlProxy { | ||
| id: numPreviewDecksControl | ||
|
|
||
| group: "[Master]" | ||
| key: "num_preview_decks" | ||
| } | ||
|
|
||
| Instantiator { | ||
| model: numPreviewDecksControl.value | ||
|
|
||
| delegate: LibraryControlLoadSelectedTrackHandler { | ||
| group: "[PreviewDeck" + (index + 1) + "]" | ||
| enabled: root.focusWidget == FocusedWidgetControl.WidgetKind.LibraryView | ||
| onLoadTrackRequested: root.loadSelectedTrack(group, play) | ||
| } | ||
|
|
||
| } | ||
|
|
||
| Mixxx.ControlProxy { | ||
| id: numSamplersControl | ||
|
|
||
| group: "[Master]" | ||
| key: "num_samplers" | ||
| } | ||
|
|
||
| Instantiator { | ||
| model: numSamplersControl.value | ||
|
|
||
| delegate: LibraryControlLoadSelectedTrackHandler { | ||
| group: "[Sampler" + (index + 1) + "]" | ||
| enabled: root.focusWidget == FocusedWidgetControl.WidgetKind.LibraryView | ||
| onLoadTrackRequested: root.loadSelectedTrack(group, play) | ||
| } | ||
|
|
||
| } | ||
|
|
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| import Mixxx 0.1 as Mixxx | ||
| import QtQuick 2.12 | ||
|
|
||
| /// Usually, this component shouldn't be an (visual) `Item` and use something | ||
| /// like `QtObject` instead. However, for some reason using `QtObject` here | ||
| /// makes Mixxx crash on load (using Qt 5.15.2+kde+r43-1). We can check if this | ||
| /// is fixed upstream once we switch to Qt 6. | ||
| Item { | ||
| id: root | ||
|
|
||
| property string group // required | ||
| property bool enabled: true | ||
|
|
||
| signal loadTrackRequested(bool play) | ||
|
|
||
| Mixxx.ControlProxy { | ||
| group: root.group | ||
| key: "LoadSelectedTrack" | ||
| onValueChanged: { | ||
| if (value == 0 || !root.enabled) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also if removing the
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Sorry, I missed that, still
Yes, of course. The crash is still a bug, though I thought I might have found the issue thats triggering the bug and we could work around it, but I was wrong. |
||
| return ; | ||
|
|
||
| root.loadTrackRequested(false); | ||
| } | ||
| } | ||
|
|
||
| Mixxx.ControlProxy { | ||
| group: root.group | ||
| key: "LoadSelectedTrackAndPlay" | ||
| onValueChanged: { | ||
| if (value == 0 || !root.enabled) | ||
| return ; | ||
|
|
||
| root.loadTrackRequested(true); | ||
| } | ||
| } | ||
|
|
||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.