Skip to content

Commit bd2e88d

Browse files
committed
WIP
1 parent 91f03e2 commit bd2e88d

File tree

12 files changed

+904
-22
lines changed

12 files changed

+904
-22
lines changed

res/qml/Settings.qml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ Popup {
8787
focus: true
8888
model: sectionProperties
8989
visible: !searchSetting.active
90+
currentIndex: 1
9091

9192
delegate: Rectangle {
9293
required property int index

res/qml/Settings/Interface.qml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2399,8 +2399,8 @@ Category {
23992399
disableScreensaverInput.selected = disableScreensaverInput.options[Mixxx.Config.libraryInhibitScreensaver]
24002400
startFullscreenInput.selected = Mixxx.Config.configStartInFullscreenKey ? "on" : "off"
24012401
autoHideMenuBarInput.selected = Mixxx.Config.libraryHideMenuBar ? "on" : "off"
2402-
searchCompletionInput.selected = Mixxx.Config.libraryEnableSearchCompletions ? "on" : "off"
2403-
searchHistoryKeyboardInput.selected = Mixxx.Config.libraryEnableSearchHistoryShortcuts ? "on" : "off"
2402+
searchCompletionInput.selected = Mixxx.Config.librarySearchCompletionsEnable ? "on" : "off"
2403+
searchHistoryKeyboardInput.selected = Mixxx.Config.librarySearchHistoryShortcutsEnable ? "on" : "off"
24042404
bpmPrecisionInput.value = Mixxx.Config.libraryBpmColumnPrecision
24052405
libraryRowHeightInput.value = Mixxx.Config.libraryRowHeight
24062406
trackPaletteComboBox.currentIndex = trackPaletteComboBox.model.indexOf(Mixxx.Config.configTrackColorPalette)

res/qml/Settings/Library.qml

Lines changed: 716 additions & 6 deletions
Large diffs are not rendered by default.

res/qml/main.qml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,22 @@ ApplicationWindow {
2121
visible: true
2222
width: 1920
2323

24+
Mixxx.ControlProxy {
25+
group: "[App]"
26+
key: "num_decks"
27+
onInitializedChanged: {
28+
value = 4
29+
}
30+
}
31+
32+
Mixxx.ControlProxy {
33+
group: "[App]"
34+
key: "num_samplers"
35+
onInitializedChanged: {
36+
value = 16
37+
}
38+
}
39+
2440
Column {
2541
id: content
2642
anchors.fill: parent
@@ -462,6 +478,9 @@ ApplicationWindow {
462478
x: Math.round((parent.width - width) / 2)
463479
y: Math.round((parent.height - height) / 2)
464480

481+
visible: true
482+
activeCategoryIndex: 1
483+
465484
Overlay.modal: Rectangle {
466485
id: overlayModal
467486
property real radius: 12

src/library/dao/directorydao.cpp

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,26 +49,36 @@ QList<mixxx::FileInfo> DirectoryDAO::loadAllDirectories(
4949
return allDirs;
5050
}
5151

52-
QStringList DirectoryDAO::getRootDirStrings() const {
52+
QList<DirectoryDAO::RootDirectory> DirectoryDAO::getRootDirectories() const {
5353
DEBUG_ASSERT(m_database.isOpen());
54-
const auto statement =
55-
QStringLiteral("SELECT %1 FROM %2")
56-
.arg(
57-
kLocationColumn,
58-
kTable);
54+
const auto statement = QStringLiteral(
55+
"SELECT d.%1, COUNT(t.directory) AS total_track, SUM(l.duration) "
56+
"AS total_runtime FROM %2 d LEFT JOIN track_locations t ON d.%3 = "
57+
"t.directory LEFT JOIN library l ON t.id = l.id GROUP BY d.%4;")
58+
.arg(kLocationColumn,
59+
kTable,
60+
kLocationColumn,
61+
kLocationColumn);
5962
FwdSqlQuery query(
6063
m_database,
6164
statement);
6265
VERIFY_OR_DEBUG_ASSERT(query.execPrepared()) {
6366
return {};
6467
}
6568

66-
QStringList allDirs;
69+
QList<DirectoryDAO::RootDirectory> allDirs;
6770
const auto locationIndex = query.fieldIndex(kLocationColumn);
71+
const auto totalTrackIndex = query.fieldIndex("total_track");
72+
const auto totalRuntimeIndex = query.fieldIndex("total_runtime");
6873
while (query.next()) {
6974
const auto locationValue =
7075
query.fieldValue(locationIndex).toString();
71-
allDirs.append(locationValue);
76+
const auto totalTrackValue =
77+
query.fieldValue(totalTrackIndex).toUInt();
78+
const auto totalRuntimeValue =
79+
query.fieldValue(totalRuntimeIndex).toUInt();
80+
allDirs.append(DirectoryDAO::RootDirectory{
81+
locationValue, totalTrackValue, totalRuntimeValue});
7282
}
7383
return allDirs;
7484
}

src/library/dao/directorydao.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,19 @@
88

99
class DirectoryDAO : public DAO {
1010
public:
11+
struct RootDirectory {
12+
QString path;
13+
uint trackCount;
14+
uint totalSecond;
15+
};
16+
1117
~DirectoryDAO() override = default;
1218

1319
QList<mixxx::FileInfo> loadAllDirectories(
1420
bool skipInvalidOrMissing = false) const;
1521
/// Same as loadAllDirectories() just with paths as QString.
1622
/// See DlgPrefLibrary::populateDirList() for info.
17-
QStringList getRootDirStrings() const;
23+
QList<RootDirectory> getRootDirectories() const;
1824

1925
enum class AddResult {
2026
Ok,

src/library/trackcollection.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,15 @@ QList<mixxx::FileInfo> TrackCollection::loadRootDirs(bool skipInvalidOrMissing)
141141
}
142142

143143
QStringList TrackCollection::getRootDirStrings() const {
144-
return m_directoryDao.getRootDirStrings();
144+
QStringList rootDirStrings;
145+
for (auto& rootDirectory : m_directoryDao.getRootDirectories()) {
146+
rootDirStrings.append(rootDirectory.path);
147+
}
148+
return rootDirStrings;
149+
}
150+
151+
QList<DirectoryDAO::RootDirectory> TrackCollection::getRootDirectories() const {
152+
return m_directoryDao.getRootDirectories();
145153
}
146154

147155
DirectoryDAO::AddResult TrackCollection::addDirectory(const mixxx::FileInfo& rootDir) {

src/library/trackcollection.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ class TrackCollection : public QObject,
4646
QList<mixxx::FileInfo> loadRootDirs(
4747
bool skipInvalidOrMissing = false) const;
4848
QStringList getRootDirStrings() const;
49+
QList<DirectoryDAO::RootDirectory> getRootDirectories() const;
4950

5051
const CrateStorage& crates() const {
5152
DEBUG_ASSERT_QOBJECT_THREAD_AFFINITY(this);

src/qml/qmlconfigproxy.cpp

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,14 @@ const QString kWaveformOptionsKey = QStringLiteral("waveform_options");
6969
const QString kTooltipsKey = QStringLiteral("Tooltips");
7070
const QString kInhibitScreensaverKey = QStringLiteral("InhibitScreensaver");
7171
const QString kHideMenuBarKey = QStringLiteral("hide_menubar");
72+
const QString kSearchBpmFuzzyRange = QStringLiteral("search_bpm_fuzzy_range");
73+
const QString kSearchDebouncingTimeout = QStringLiteral("SearchDebouncingTimeoutMillis");
74+
const QString kRhythmboxEnabled = QStringLiteral("ShowRhythmboxLibrary");
75+
const QString kBansheeEnabled = QStringLiteral("ShowBansheeLibrary");
76+
const QString kITunesEnabled = QStringLiteral("ShowITunesLibrary");
77+
const QString kTraktorEnabled = QStringLiteral("ShowTraktorLibrary");
78+
const QString kRekordboxEnabled = QStringLiteral("ShowRekordboxLibrary");
79+
const QString kSeratoEnabled = QStringLiteral("ShowSeratoLibrary");
7280
const QString kEnableSearchCompletionsKey = QStringLiteral("EnableSearchCompletions");
7381
const QString kEnableSearchHistoryShortcutsKey = QStringLiteral("EnableSearchHistoryShortcuts");
7482
const QString kBpmColumnPrecisionKey = QStringLiteral("BpmColumnPrecision");
@@ -248,16 +256,25 @@ PROPERTY_IMPL(kLibraryGroup,
248256
libraryInhibitScreensaver,
249257
mixxx::preferences::ScreenSaver::On);
250258
PROPERTY_IMPL(kLibraryGroup, kHideMenuBarKey, bool, libraryHideMenuBar, false);
259+
PROPERTY_IMPL(kLibraryGroup, kSearchBpmFuzzyRange, double, librarySearchBpmFuzzyRange, 0.06);
260+
PROPERTY_IMPL(kLibraryGroup, kSearchDebouncingTimeout, int, librarySearchDebouncingTimeout, 300);
251261
PROPERTY_IMPL(kLibraryGroup,
252262
kEnableSearchCompletionsKey,
253263
bool,
254-
libraryEnableSearchCompletions,
264+
librarySearchCompletionsEnable,
255265
true);
256266
PROPERTY_IMPL(kLibraryGroup,
257267
kEnableSearchHistoryShortcutsKey,
258268
bool,
259-
libraryEnableSearchHistoryShortcuts,
269+
librarySearchHistoryShortcutsEnable,
260270
true);
271+
272+
PROPERTY_IMPL(kLibraryGroup, kRhythmboxEnabled, bool, libraryRhythmboxEnabled, false);
273+
PROPERTY_IMPL(kLibraryGroup, kBansheeEnabled, bool, libraryBansheeEnabled, false);
274+
PROPERTY_IMPL(kLibraryGroup, kITunesEnabled, bool, libraryITunesEnabled, false);
275+
PROPERTY_IMPL(kLibraryGroup, kTraktorEnabled, bool, libraryTraktorEnabled, false);
276+
PROPERTY_IMPL(kLibraryGroup, kRekordboxEnabled, bool, libraryRekordboxEnabled, false);
277+
PROPERTY_IMPL(kLibraryGroup, kSeratoEnabled, bool, librarySeratoEnabled, false);
261278
PROPERTY_IMPL(kLibraryGroup,
262279
kBpmColumnPrecisionKey,
263280
int,

src/qml/qmlconfigproxy.h

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,23 @@ class QmlConfigProxy : public QObject {
9494
PROPERTY_DECL(mixxx::preferences::Tooltips, libraryTooltips);
9595
PROPERTY_DECL(mixxx::preferences::ScreenSaver, libraryInhibitScreensaver);
9696
PROPERTY_DECL(bool, libraryHideMenuBar);
97-
PROPERTY_DECL(bool, libraryEnableSearchCompletions);
98-
PROPERTY_DECL(bool, libraryEnableSearchHistoryShortcuts);
97+
// Percent, 0..1.0
98+
PROPERTY_DECL(double, librarySearchBpmFuzzyRange);
99+
// Duration (ms), 100..9999
100+
PROPERTY_DECL(int, librarySearchDebouncingTimeout);
101+
PROPERTY_DECL(bool, librarySearchCompletionsEnable);
102+
PROPERTY_DECL(bool, librarySearchHistoryShortcutsEnable);
99103
// Decimal count, 0..10
100104
PROPERTY_DECL(int, libraryBpmColumnPrecision);
101105
// Pixels
102106
PROPERTY_DECL(double, libraryRowHeight);
107+
// Integration
108+
PROPERTY_DECL(bool, libraryRhythmboxEnabled);
109+
PROPERTY_DECL(bool, libraryBansheeEnabled);
110+
PROPERTY_DECL(bool, libraryITunesEnabled);
111+
PROPERTY_DECL(bool, libraryTraktorEnabled);
112+
PROPERTY_DECL(bool, libraryRekordboxEnabled);
113+
PROPERTY_DECL(bool, librarySeratoEnabled);
103114

104115
// Controls group
105116
// [0..activePaletteColorCount-1]

0 commit comments

Comments
 (0)