Fix not being able to get the title of the playing audio file, due to using an obsolete way to get it in the playback class
This commit is contained in:
parent
16995b71b3
commit
84b324e01c
1 changed files with 6 additions and 8 deletions
14
playback.cpp
14
playback.cpp
|
@ -468,16 +468,14 @@ PlaybackInstance::PlaybackInstance() {
|
||||||
|
|
||||||
}
|
}
|
||||||
std::optional<std::string> PlaybackInstance::get_current_file() {
|
std::optional<std::string> PlaybackInstance::get_current_file() {
|
||||||
current_file_mutex.lock();
|
if (process == nullptr) return {};
|
||||||
std::optional<std::string> output = current_file;
|
if (!process->process_running()) return {};
|
||||||
current_file_mutex.unlock();
|
return process->get_file_path();
|
||||||
return output;
|
|
||||||
}
|
}
|
||||||
std::optional<std::string> PlaybackInstance::get_current_title() {
|
std::optional<std::string> PlaybackInstance::get_current_title() {
|
||||||
current_file_mutex.lock();
|
if (process == nullptr) return {};
|
||||||
std::optional<std::string> output = current_title;
|
if (!process->process_running()) return {};
|
||||||
current_file_mutex.unlock();
|
return process->get_title();
|
||||||
return output;
|
|
||||||
}
|
}
|
||||||
PlaybackInstance::~PlaybackInstance() {
|
PlaybackInstance::~PlaybackInstance() {
|
||||||
Stop();
|
Stop();
|
||||||
|
|
Loading…
Reference in a new issue