Skip to content

Commit

Permalink
Merge remote-tracking branch 'mixxx/2.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
ronso0 committed Mar 9, 2024
2 parents 3c1a619 + 1b63888 commit de0be22
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 1 deletion.
12 changes: 12 additions & 0 deletions res/controllers/Hercules_DJControl_Inpulse_200.midi.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1107,6 +1107,18 @@
<script-binding />
</options>
</control>
<!-- CC's MIDI Channel 4 (0xB3 SHIFT mode)-->
<!--Browser encoder-->
<control>
<group>[Library]</group>
<key>ScrollVertical</key>
<description>Scroll Vertical (SHIFT + Browser Knob)</description>
<status>0xB3</status>
<midino>0x01</midino>
<options>
<selectknob />
</options>
</control>
<!-- CC's MIDI Channel 5 (0xB4 Deck B - SHIFT mode)-->
<!--Jog wheel-->
<control>
Expand Down
11 changes: 11 additions & 0 deletions src/library/trackset/crate/cratetablemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,17 @@ int CrateTableModel::addTracks(
return trackIds.size();
}

bool CrateTableModel::isLocked() {
Crate crate;
if (!m_pTrackCollectionManager->internalCollection()
->crates()
.readCrateById(m_selectedCrate, &crate)) {
qWarning() << "Failed to read create" << m_selectedCrate;
return false;
}
return crate.isLocked();
}

void CrateTableModel::removeTracks(const QModelIndexList& indices) {
VERIFY_OR_DEBUG_ASSERT(m_selectedCrate.isValid()) {
return;
Expand Down
1 change: 1 addition & 0 deletions src/library/trackset/crate/cratetablemodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class CrateTableModel final : public TrackSetTableModel {
void removeTracks(const QModelIndexList& indices) final;
/// Returns the number of unsuccessful additions.
int addTracks(const QModelIndex& index, const QList<QString>& locations) final;
bool isLocked() final;

Capabilities getCapabilities() const final;
QString modelKey(bool noSearch) const override;
Expand Down
6 changes: 5 additions & 1 deletion src/widget/wtracktableview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -904,9 +904,13 @@ void WTrackTableView::hideOrRemoveSelectedTracks() {
}

TrackModel::Capability cap;
// Hide is the primary action if allowed. Else we test for remove capability
if (pTrackModel->hasCapabilities(TrackModel::Capability::Hide)) {
cap = TrackModel::Capability::Hide;
} else if (pTrackModel->hasCapabilities(TrackModel::Capability::Remove)) {
} else if (pTrackModel->isLocked()) { // Locked playlists and crates
return;
}
if (pTrackModel->hasCapabilities(TrackModel::Capability::Remove)) {
cap = TrackModel::Capability::Remove;
} else if (pTrackModel->hasCapabilities(TrackModel::Capability::RemoveCrate)) {
cap = TrackModel::Capability::RemoveCrate;
Expand Down

0 comments on commit de0be22

Please sign in to comment.