Skip to content

Commit 1a5bc28

Browse files
committed
DEBUG 'LoadSelectedTrack' control, triggered via keyboard
1 parent af08fd1 commit 1a5bc28

5 files changed

Lines changed: 41 additions & 5 deletions

File tree

src/controllers/keyboard/keyboardeventfilter.cpp

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,21 @@ bool KeyboardEventFilter::eventFilter(QObject*, QEvent* e) {
4141
}
4242

4343
QKeySequence ks = getKeySeq(ke);
44+
qWarning() << " > keySeq:" << ks.toString();
4445
if (!ks.isEmpty()) {
46+
qWarning() << " > lookup control";
4547
ConfigValueKbd ksv(ks);
4648
// Check if a shortcut is defined
4749
bool result = false;
4850
// using const_iterator here is faster than QMultiHash::values()
4951
for (auto it = m_keySequenceToControlHash.constFind(ksv);
5052
it != m_keySequenceToControlHash.constEnd() && it.key() == ksv; ++it) {
5153
const ConfigKey& configKey = it.value();
54+
qWarning() << " > found CfgKey:" << configKey.group << configKey.item;
5255
if (configKey.group != "[KeyboardShortcuts]") {
5356
ControlObject* control = ControlObject::getControl(configKey);
5457
if (control) {
58+
qWarning() << " > found control, set to 1";
5559
//qDebug() << configKey << "MidiOpCode::NoteOn" << 1;
5660
// Add key to active key list
5761
m_qActiveKeyList.append(KeyDownInformation(
@@ -67,6 +71,9 @@ bool KeyboardEventFilter::eventFilter(QObject*, QEvent* e) {
6771
}
6872
}
6973
}
74+
if (result == false) {
75+
qWarning() << " ! no CfgKey found";
76+
}
7077
return result;
7178
}
7279
} else if (e->type() == QEvent::KeyRelease) {
@@ -163,6 +170,18 @@ void KeyboardEventFilter::setKeyboardConfig(ConfigObject<ConfigValueKbd>* pKbdCo
163170
// Mixxx.
164171
m_keySequenceToControlHash = pKbdConfigObject->transpose();
165172
m_pKbdConfigObject = pKbdConfigObject;
173+
174+
qWarning() << " m_keySequenceToControlHash:";
175+
QHashIterator<ConfigValueKbd, ConfigKey> it(m_keySequenceToControlHash);
176+
while (it.hasNext()) {
177+
it.next();
178+
const QKeySequence ks = it.key().value;
179+
const QString kss = ks.toString();
180+
if (kss.startsWith("Shift")) {
181+
qWarning().noquote() << " " << ks.toString() << " "
182+
<< it.value().group << it.value().item;
183+
}
184+
}
166185
}
167186

168187
ConfigObject<ConfigValueKbd>* KeyboardEventFilter::getKeyboardConfig() {

src/library/librarycontrol.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ LoadToGroupController::LoadToGroupController(LibraryControl* pParent, const QStr
4646
LoadToGroupController::~LoadToGroupController() = default;
4747

4848
void LoadToGroupController::slotLoadToGroup(double v) {
49+
qWarning() << "LoadToGroupController::slotLoadToGroup" << m_group << "v:" << v;
4950
if (v > 0) {
5051
emit loadToGroup(m_group, false);
5152
}
@@ -536,12 +537,15 @@ void LibraryControl::slotUpdateTrackMenuControl(bool visible) {
536537
}
537538

538539
void LibraryControl::slotLoadSelectedTrackToGroup(const QString& group, bool play) {
540+
qWarning() << "LibraryControl::slotLoadSelectedTrackToGroup:" << group << play;
539541
if (!m_pLibraryWidget) {
542+
qWarning() << " ! no WLibrary widget";
540543
return;
541544
}
542545

543546
LibraryView* pActiveView = m_pLibraryWidget->getActiveView();
544547
if (!pActiveView) {
548+
qWarning() << " ! no active view";
545549
return;
546550
}
547551
pActiveView->loadSelectedTrackToGroup(group, play);

src/mixer/basetrackplayer.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,8 +286,10 @@ void BaseTrackPlayerImpl::loadTrack(TrackPointer pTrack) {
286286
m_pLoadedTrack = std::move(pTrack);
287287
if (!m_pLoadedTrack) {
288288
// nothing to
289+
qWarning() << " ! no track to load";
289290
return;
290291
}
292+
qWarning() << " >> load track";
291293

292294
// Clear loop
293295
// It seems that the trick is to first clear the loop out point, and then
@@ -489,6 +491,7 @@ void BaseTrackPlayerImpl::slotLoadTrack(TrackPointer pNewTrack, bool bPlay) {
489491
auto fileInfo = pNewTrack->getFileInfo();
490492
if (!Sandbox::askForAccess(&fileInfo)) {
491493
// We don't have access.
494+
qWarning() << " ! can't read" << fileInfo.location();
492495
return;
493496
}
494497
}

src/preferences/configobject.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ template <class ValueType> bool ConfigObject<ValueType>::parse() {
187187
qDebug() << "ConfigObject: Could not read" << m_filename;
188188
return false;
189189
} else {
190-
//qDebug() << "ConfigObject: Parse" << m_filename;
190+
qDebug() << "ConfigObject: Parse" << m_filename;
191191
// Parse the file
192192
int group = 0;
193193
QString groupStr, line;
@@ -210,7 +210,7 @@ template <class ValueType> bool ConfigObject<ValueType>::parse() {
210210
QTextStream(&line) >> key;
211211
QString val = line.right(line.length() - key.length()); // finds the value string
212212
val = val.trimmed();
213-
//qDebug() << "control:" << key << "value:" << val;
213+
qWarning().noquote() << "control:" << groupStr << key << " " << val;
214214
ConfigKey k(groupStr, key);
215215
ValueType m(val);
216216
set(k, m);

src/widget/wtracktableview.cpp

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1005,8 +1005,10 @@ void WTrackTableView::activateSelectedTrack() {
10051005
}
10061006

10071007
void WTrackTableView::loadSelectedTrackToGroup(const QString& group, bool play) {
1008+
qDebug() << "WTrackTableView::loadSelectedTrackToGroup:" << group << play;
10081009
auto indices = selectionModel()->selectedRows();
10091010
if (indices.isEmpty()) {
1011+
qWarning() << " ! indices empty";
10101012
return;
10111013
}
10121014
bool allowLoadTrackIntoPlayingDeck = false;
@@ -1032,15 +1034,23 @@ void WTrackTableView::loadSelectedTrackToGroup(const QString& group, bool play)
10321034
// TODO(XXX): Check for other than just the first preview deck.
10331035
if (group != "[PreviewDeck1]" &&
10341036
ControlObject::get(ConfigKey(group, "play")) > 0.0) {
1037+
qWarning() << " ! not allowed to load to this deck, might be playing";
10351038
return;
10361039
}
10371040
}
10381041
auto index = indices.at(0);
10391042
auto* trackModel = getTrackModel();
10401043
TrackPointer pTrack;
1041-
if (trackModel &&
1042-
(pTrack = trackModel->getTrack(index))) {
1043-
emit loadTrackToPlayer(pTrack, group, play);
1044+
if (trackModel) {
1045+
pTrack = trackModel->getTrack(index);
1046+
if (pTrack) {
1047+
qWarning() << " > emit loadTrackToPlayer, deck:" << group;
1048+
emit loadTrackToPlayer(pTrack, group, play);
1049+
} else {
1050+
qWarning() << " ! track is nullptr";
1051+
}
1052+
} else {
1053+
qWarning() << " ! no track model";
10441054
}
10451055
}
10461056

0 commit comments

Comments
 (0)