Skip to content

Commit

Permalink
Tracks: select track row when clicking the preview button
Browse files Browse the repository at this point in the history
  • Loading branch information
ronso0 committed Feb 11, 2024
1 parent 40be3fe commit bca0165
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/library/previewbuttondelegate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,10 @@ void PreviewButtonDelegate::buttonClicked() {

TrackPointer pOldTrack = PlayerInfo::instance().getTrackInfo(kPreviewDeckGroup);

bool startedPlaying = false;
TrackPointer pTrack = pTrackModel->getTrack(m_currentEditedCellIndex);
if (pTrack && pTrack != pOldTrack) {
// Load to preview deck and start playing
emit loadTrackToPlayer(pTrack, kPreviewDeckGroup, true);
} else if (pTrack == pOldTrack && !isPreviewDeckPlaying()) {
// Since the Preview deck might be hidden
Expand All @@ -227,6 +229,10 @@ void PreviewButtonDelegate::buttonClicked() {
} else {
m_pPreviewDeckPlay->set(0.0);
}
// If we start previewing also select the track (the table view didn't receive the click)
if (startedPlaying) {
m_pTableView->selectRow(m_currentEditedCellIndex.row());
}
}

void PreviewButtonDelegate::previewDeckPlayChanged(double v) {
Expand Down

0 comments on commit bca0165

Please sign in to comment.