From c58ff7c8122c0f44a5bcf5c63a579b86a59720a5 Mon Sep 17 00:00:00 2001 From: mairon <3043462073@qq.com> Date: Sat, 3 Aug 2024 20:21:29 +0800 Subject: [PATCH] Modified for 2024 exemption --- README.md | 2 +- src/ViewModel/LikedSongViewModel.cpp | 2 +- src/ViewModel/NextUpViewModel.h | 2 +- src/ViewModel/PlayingSongViewModel.cpp | 2 +- src/ViewModel/PlayingSongViewModel.h | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 23d60dc..8307b9a 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ ## Clone ```bash -git clone --recursive https://github.com/NJUPT-SAST/sast-evento.git +git clone --recursive https://github.com/NJUPT-SAST-Cpp/sast-music.git ``` 注意:本项目使用了子模块,所以请确保使用 `--recursive` 参数来克隆仓库,或者在克隆后执行以下命令: diff --git a/src/ViewModel/LikedSongViewModel.cpp b/src/ViewModel/LikedSongViewModel.cpp index ff9d9d6..5c43e1e 100644 --- a/src/ViewModel/LikedSongViewModel.cpp +++ b/src/ViewModel/LikedSongViewModel.cpp @@ -82,7 +82,7 @@ void LikedSongViewModel::loadAllLikedSongs() { } void LikedSongViewModel::playSongByIndex(int index) { - auto song = model[index]; + auto song = allLikedSongs[index]; NextUpViewModel::getInstance()->appendModel(song); } diff --git a/src/ViewModel/NextUpViewModel.h b/src/ViewModel/NextUpViewModel.h index 9214c2c..16dc069 100644 --- a/src/ViewModel/NextUpViewModel.h +++ b/src/ViewModel/NextUpViewModel.h @@ -69,7 +69,7 @@ class NextUpViewModel : public QAbstractListModel { private: explicit NextUpViewModel(QObject* parent = nullptr); - QList model; + QList model; // model for "Play Queue" Song playingSong; QHash songUrls; PlayMode playMode = PlayMode::ListRepeat; diff --git a/src/ViewModel/PlayingSongViewModel.cpp b/src/ViewModel/PlayingSongViewModel.cpp index e0f339b..2572ddc 100644 --- a/src/ViewModel/PlayingSongViewModel.cpp +++ b/src/ViewModel/PlayingSongViewModel.cpp @@ -74,7 +74,7 @@ void PlayingSongViewModel::onMusicPositionChanged(qint64 position) { emit timeStampChanged(); } -void PlayingSongViewModel::onPlayStateChanged(QMediaPlayer::PlaybackState status) { +void PlayingSongViewModel::onPlaybackStateChanged(QMediaPlayer::PlaybackState status) { if (status == QMediaPlayer::PlayingState) { setPlaying(true); } else { diff --git a/src/ViewModel/PlayingSongViewModel.h b/src/ViewModel/PlayingSongViewModel.h index 7b55c69..1b71abc 100644 --- a/src/ViewModel/PlayingSongViewModel.h +++ b/src/ViewModel/PlayingSongViewModel.h @@ -69,7 +69,7 @@ class PlayingSongViewModel : public QObject { private slots: void onMediaStatusChanged(QMediaPlayer::MediaStatus status); void onMusicPositionChanged(qint64 position); - void onPlayStateChanged(QMediaPlayer::PlaybackState status); + void onPlaybackStateChanged(QMediaPlayer::PlaybackState status); void playSong(); void setPlayingSong(const Song& song);