cellMusic: make selection context valid when setting a playlist

This commit is contained in:
Megamouse 2025-02-03 23:39:46 +01:00
parent 22a1f41ecb
commit b5dbafb3e2
5 changed files with 9 additions and 7 deletions

View file

@ -556,7 +556,7 @@ error_code cellMusicSetPlaybackCommand2(s32 command, vm::ptr<void> param)
auto& music = g_fxo->get<music_state>();
if (!music.func)
return CELL_MUSIC2_ERROR_GENERIC;
return { CELL_MUSIC2_ERROR_GENERIC, "Not initialized" };
error_code result = CELL_OK;
@ -585,7 +585,7 @@ error_code cellMusicSetPlaybackCommand(s32 command, vm::ptr<void> param)
auto& music = g_fxo->get<music_state>();
if (!music.func)
return CELL_MUSIC_ERROR_GENERIC;
return { CELL_MUSIC_ERROR_GENERIC, "Not initialized" };
error_code result = CELL_OK;

View file

@ -109,6 +109,8 @@ void music_selection_context::set_playlist(const std::string& path)
content_type = CELL_SEARCH_CONTENTTYPE_MUSIC;
playlist.push_back(dir_path + path.substr(vfs_dir_path.length()));
}
valid = true;
}
void music_selection_context::create_playlist(const std::string& new_hash)

View file

@ -78,7 +78,7 @@ error_code cellRtcGetCurrentTick(ppu_thread& ppu, vm::ptr<CellRtcTick> pTick)
error_code cellRtcGetCurrentClock(ppu_thread& ppu, vm::ptr<CellRtcDateTime> pClock, s32 iTimeZone)
{
cellRtc.notice("cellRtcGetCurrentClock(pClock=*0x%x, iTimeZone=%d)", pClock, iTimeZone);
cellRtc.trace("cellRtcGetCurrentClock(pClock=*0x%x, iTimeZone=%d)", pClock, iTimeZone);
const vm::var<sys_page_attr_t> page_attr;
@ -1505,7 +1505,7 @@ error_code cellRtcGetSystemTime(ppu_thread& ppu, vm::cptr<CellRtcDateTime> pDate
error_code cellRtcGetTime_t(ppu_thread& ppu, vm::cptr<CellRtcDateTime> pDateTime, vm::ptr<s64> piTime)
{
cellRtc.notice("cellRtcGetTime_t(pDateTime=*0x%x, piTime=*0x%x)", pDateTime, piTime);
cellRtc.trace("cellRtcGetTime_t(pDateTime=*0x%x, piTime=*0x%x)", pDateTime, piTime);
const vm::var<sys_page_attr_t> page_attr;

View file

@ -67,7 +67,7 @@ qt_music_handler::qt_music_handler()
{
music_log.notice("Constructing Qt music handler...");
m_media_player = std::make_shared<QMediaPlayer>();
m_media_player = std::make_unique<QMediaPlayer>();
m_media_player->setAudioOutput(new QAudioOutput());
connect(m_media_player.get(), &QMediaPlayer::mediaStatusChanged, this, &qt_music_handler::handle_media_status);
@ -164,7 +164,7 @@ void qt_music_handler::fast_reverse(const std::string& path)
}
music_log.notice("Fast-reversing music...");
m_media_player->setPlaybackRate(-2.0);
m_media_player->setPlaybackRate(-2.0); // NOTE: This doesn't work on the current Qt version
m_media_player->play();
});

View file

@ -29,6 +29,6 @@ private Q_SLOTS:
private:
mutable std::mutex m_mutex;
std::shared_ptr<QMediaPlayer> m_media_player;
std::unique_ptr<QMediaPlayer> m_media_player;
std::string m_path;
};