mirror of
https://github.com/clangen/musikcube.git
synced 2025-03-14 04:18:36 +00:00
Small bug fix for HotSwap behavior, version bump, release notes.
This commit is contained in:
parent
28806c4f77
commit
2a2688f1bf
@ -1,3 +1,16 @@
|
||||
0.20.0
|
||||
|
||||
* added play queue "hot-swap". you can now swap a different list of tracks
|
||||
into an active play queue without disrupting playback. if the hot-swap
|
||||
action finds the playing track in the new list, it'll be automatically
|
||||
selected as the active track
|
||||
* fixed a bug that was causing extended track metadata to be parsed incorrectly
|
||||
examples include bitrate, channels, lyrics, etc.
|
||||
* fixed a bug where the category list view may jump around a bit during the
|
||||
indexing process
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
0.19.2
|
||||
|
||||
* start the metadata indexer immediately after adding or removing paths from
|
||||
|
@ -7,8 +7,8 @@ cmake_minimum_required(VERSION 3.0)
|
||||
|
||||
project(musikbox)
|
||||
set (musikbox_VERSION_MAJOR 0)
|
||||
set (musikbox_VERSION_MINOR 19)
|
||||
set (musikbox_VERSION_PATCH 2)
|
||||
set (musikbox_VERSION_MINOR 20)
|
||||
set (musikbox_VERSION_PATCH 0)
|
||||
set (musikbox_VERSION "${musikbox_VERSION_MAJOR}.${musikbox_VERSION_MINOR}.${musikbox_VERSION_PATCH}")
|
||||
|
||||
include(CMakeToolsHelpers OPTIONAL)
|
||||
|
@ -467,12 +467,15 @@ PlaybackState PlaybackService::GetPlaybackState() {
|
||||
}
|
||||
|
||||
bool PlaybackService::HotSwap(const TrackList& tracks, size_t index) {
|
||||
bool swap = false;
|
||||
|
||||
if (&tracks == &playlist) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!tracks.Count()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool found = false;
|
||||
auto playingTrack = this->GetPlaying();
|
||||
if (playingTrack && tracks.Count() > index) {
|
||||
auto supplantTrack = tracks.Get(index);
|
||||
@ -485,7 +488,7 @@ bool PlaybackService::HotSwap(const TrackList& tracks, size_t index) {
|
||||
/* look at the index hint, see if we can find a matching track without
|
||||
iteration. */
|
||||
if (supplantId == playingId && supplantLibrary == playingLibrary) {
|
||||
swap = true;
|
||||
found = true;
|
||||
}
|
||||
/* otherwise search the input */
|
||||
else {
|
||||
@ -496,30 +499,29 @@ bool PlaybackService::HotSwap(const TrackList& tracks, size_t index) {
|
||||
|
||||
if (supplantId == playingId && supplantLibrary == playingLibrary) {
|
||||
index = i;
|
||||
swap = true;
|
||||
found = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (swap) {
|
||||
{
|
||||
std::unique_lock<std::recursive_mutex> lock(this->playlistMutex);
|
||||
TrackList temp(this->library);
|
||||
temp.CopyFrom(tracks);
|
||||
this->playlist.Swap(temp);
|
||||
this->unshuffled.Clear();
|
||||
this->index = index;
|
||||
this->nextIndex = NO_POSITION;
|
||||
}
|
||||
|
||||
POST(this, MESSAGE_PREPARE_NEXT_TRACK, this->index, 0);
|
||||
POST(this, MESSAGE_NOTIFY_EDITED, NO_POSITION, 0);
|
||||
|
||||
return true;
|
||||
{
|
||||
std::unique_lock<std::recursive_mutex> lock(this->playlistMutex);
|
||||
TrackList temp(this->library);
|
||||
temp.CopyFrom(tracks);
|
||||
this->playlist.Swap(temp);
|
||||
this->unshuffled.Clear();
|
||||
this->index = found ? index : NO_POSITION;
|
||||
this->nextIndex = NO_POSITION;
|
||||
}
|
||||
|
||||
return false;
|
||||
if (found) {
|
||||
POST(this, MESSAGE_PREPARE_NEXT_TRACK, this->index, 0);
|
||||
}
|
||||
|
||||
POST(this, MESSAGE_NOTIFY_EDITED, NO_POSITION, 0);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void PlaybackService::Play(const TrackList& tracks, size_t index) {
|
||||
@ -842,7 +844,8 @@ PlaybackService::Editor::~Editor() {
|
||||
if (this->edited) {
|
||||
/* we've been tracking the playback index through edit operations. let's
|
||||
update it here. */
|
||||
/* make sure the play index we're requesting is in bounds */
|
||||
|
||||
/* make sure the play index we're requesting is in bounds */
|
||||
if (this->playIndex != this->playback.GetIndex() || this->nextTrackInvalidated) {
|
||||
if (this->playback.Count() > 0 && this->playIndex != NO_POSITION) {
|
||||
this->playIndex = std::min(this->playback.Count() - 1, this->playIndex);
|
||||
|
@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#define VERSION_MAJOR 0
|
||||
#define VERSION_MINOR 19
|
||||
#define VERSION_PATCH 2
|
||||
#define VERSION "0.19.2"
|
||||
#define VERSION_MINOR 20
|
||||
#define VERSION_PATCH 0
|
||||
#define VERSION "0.20.0"
|
||||
|
Loading…
x
Reference in New Issue
Block a user