diff --git a/music_folder/.tmp/cover.png b/music_folder/.tmp/cover.png index 76ec7f7..1b1c8d6 100644 Binary files a/music_folder/.tmp/cover.png and b/music_folder/.tmp/cover.png differ diff --git a/music_folder/RADWIMPS - Is there still anything that love can do? (English Version).lrc b/music_folder/RADWIMPS - Is there still anything that love can do? (English Version).lrc new file mode 100644 index 0000000..06095b8 --- /dev/null +++ b/music_folder/RADWIMPS - Is there still anything that love can do? (English Version).lrc @@ -0,0 +1,77 @@ +[00:00.000] 作曲 : 野田洋次郎 +[00:00.721] 作词 : 野田洋次郎 +[00:04.067]Born with nothing in my hands +[00:07.026]I stumbled upon this place +[00:10.513]Falling through a crack in time +[00:13.895]I was writhing in pain +[00:17.217]When those who make it in this age +[00:20.564]Are only those who’ve learned how to take +[00:23.799]And everyone whose given up +[00:27.220]Where do we all take a breath? +[00:44.568]Governors and gods alike +[00:47.575]Try to turn the other cheek +[00:50.923]But even if you look away +[00:54.351]The truth is always facing you +[00:57.818]Courage and the strength of hope +[01:01.058]the magical bond we share +[01:04.452]We grow up only to forget +[01:07.834]How we ever use them here +[01:11.255]But same as you were on that day +[01:14.617]I see you still standing there +[01:17.955]Glowing in your innocence +[01:21.356]You were always standing there +[01:24.935]When the world turned its back on you +[01:28.091]You found a way to stand and fight +[01:31.501]Ready to face it all +[01:34.735]I see you here shining bright +[01:38.353]I need to know if there’s still anything that love can do +[01:44.766]I need to know if there’s still anything that I can do +[01:57.797]You are the one who found my courage and I knew +[02:04.265]I wanna pay it back and spend it all on you +[02:11.046]You gave me love we shared it’s all because of you +[02:17.605]You are the reason, let me share this love with you +[02:23.681]I need to know if there’s still anything that love can do +[02:30.439]I need to know if there’s still anything that I can do +[02:56.400]What if our destiny +[02:59.464]Was just a roll of the dice +[03:02.902]Or if it’s up to the Gods +[03:06.071]And if they feel like playing nice +[03:09.582]A mission that we didn’t choose +[03:12.891]Like armor that we can’t remove +[03:16.294]Or maybe it’s a distant wish +[03:19.554]Something that we can’t refuse +[03:23.256]Prayers that are never heard +[03:26.485]Reunions that never occur +[03:29.767]Arguments that never clear +[03:33.168]Hate that doesn’t disappear +[03:36.851]I hear the voices that forgive +[03:39.903]I see them standing hand in hand +[03:43.390]But with it’s arm open wide +[03:46.583]The Earth embraces all it can +[03:50.117]I need to know if there’s still anything that love can do +[03:56.618]I need to know if there’s still anything that I can do +[04:09.592]You are the one who found my courage and I knew +[04:16.096]I wanna pay it back and spend it all on you +[04:22.764]This love we raise together shaped by me and you +[04:29.568]You are the reason, let me live this love with you +[04:35.622]I need to know if there’s still anything that love can do +[04:42.259]I need to know if there’s still anything that I can do +[04:49.976]So insignificant just you and me, +[04:52.577]So why were we given this dream +[04:56.432]And if this life is just going to end +[04:59.105]Tell me why were we allowed to feel hope +[05:03.034]If it’s just gonna slip out of my hands +[05:05.909]Then why even give it to me +[05:10.046]Isn’t it sad how we try to hold on +[05:12.431]Knowing one day it’ll all be gone +[05:15.850]Or maybe it’s beautiful +[05:20.974]Answer me +[05:47.217]All these love songs we hear +[05:50.294]Already (yeah) they’ve been sung to death +[05:53.612]All the movies that we’ve seen +[05:56.777]They’ve said everything they can +[06:00.311]But somehow you and me +[06:03.599]Fell into this wilderness +[06:07.002]But still I need to know +[06:13.681]I need to know if there’s still anything that love can do +[06:20.275]I need to know if there’s still anything that I can do \ No newline at end of file diff --git a/music_folder/RADWIMPS - Is there still anything that love can do? (English Version).mp3 b/music_folder/RADWIMPS - Is there still anything that love can do? (English Version).mp3 new file mode 100644 index 0000000..f3d519c Binary files /dev/null and b/music_folder/RADWIMPS - Is there still anything that love can do? (English Version).mp3 differ diff --git a/music_folder/RADWIMPS - 愛にできることはまだあるかい.lrc b/music_folder/RADWIMPS - 愛にできることはまだあるかい.lrc new file mode 100644 index 0000000..942a9df --- /dev/null +++ b/music_folder/RADWIMPS - 愛にできることはまだあるかい.lrc @@ -0,0 +1,45 @@ +[00:00.000] 作曲 : 野田洋次郎 +[00:00.013] 作词 : 野田洋次郎 +[00:01.00]愛にできることはまだあるかい +[00:11.60]何も持たずに 生まれ堕ちた僕 +[00:18.43]永遠の隙間で のたうち回ってる +[00:25.32]諦めた者と 賢い者だけが +[00:31.73]勝者の時代に どこで息を吸う +[00:52.09]支配者も神も どこか他人顔 +[00:58.88]だけど本当は 分かっているはず +[01:05.73]勇気や希望や 絆とかの魔法 +[01:12.32]使い道もなく オトナは眼を背ける +[01:19.17]それでもあの日の 君が今もまだ +[01:25.84]僕の全正義の ど真ん中にいる +[01:32.67]世界が背中を 向けてもまだなお +[01:39.34]立ち向かう君が 今もここにいる +[01:45.97]愛にできることはまだあるかい +[01:52.62]僕にできることはまだあるかい +[02:05.39]君がくれた勇気だから 君のために使いたいんだ +[02:18.82]君と分け合った愛だから 君とじゃなきゃ意味がないんだ +[02:31.70]愛にできることはまだあるかい +[02:38.20]僕にできることは まだあるかい +[03:04.02]運命(サダメ)とはつまり サイコロの出た目? +[03:10.58]はたまた神の いつもの気まぐれ +[03:17.46]選び選ばれた 脱げられぬ鎧 +[03:24.10]もしくは遥かな 揺らぐことない意志 +[03:30.78]果たさぬ願いと 叶わぬ再会と +[03:37.60]ほどけぬ誤解と 降り積もる憎悪と +[03:44.40]許し合う声と 握りしめ合う手を +[03:51.11]この星は今日も 抱えて生きてる  +[03:57.77]愛にできることはまだあるかい? +[04:04.36]僕にできることはまだあるかい +[04:17.20]君がくれた勇気だから 君のために使いたいんだ +[04:30.61]君と育てた愛だから 君とじゃなきゃ意味がないんだ +[04:43.92]愛にできることはまだあるかい +[04:50.06]僕にできることは まだあるかい +[04:57.77]何もない僕たちに なぜ夢を見させたか +[05:04.38]終わりある人生に なぜ希望を持たせたか +[05:11.17]なぜこの手をすり抜ける ものばかり与えたか +[05:17.89]それでもなおしがみつく 僕らは醜いかい +[05:23.67]それとも、きれいかい   +[05:28.39]答えてよ +[05:55.03]愛の歌も 歌われ尽くした 数多の映画で 語られ尽くした +[06:08.25]そんな荒野に 生まれ落ちた僕、君 それでも +[06:21.38]愛にできることはまだあるよ +[06:28.19]僕にできることはまだあるよ diff --git a/music_folder/RADWIMPS - 愛にできることはまだあるかい.mp3 b/music_folder/RADWIMPS - 愛にできることはまだあるかい.mp3 new file mode 100644 index 0000000..a19aca3 Binary files /dev/null and b/music_folder/RADWIMPS - 愛にできることはまだあるかい.mp3 differ diff --git a/musicplayer.py b/musicplayer.py index 25a9682..5b5c76e 100644 --- a/musicplayer.py +++ b/musicplayer.py @@ -210,14 +210,13 @@ class MainFrame(wx.Frame): self.down_button.Bind(wx.EVT_LEFT_DOWN, self.download_music)''' def draw_music_cover_panel(self): - self.music_cover_panel = wx.Panel(self, id=-1, pos=(0, self.height - 150), size=(150, 150)) + self.music_cover_panel = wx.Panel(self, id=-1, pos=(0, 480), size=(200, 200)) + self.music_cover_panel.Refresh() def redraw_music_cover_panel(self,filepath): self.music_cover_panel = wx.Panel(self, id=-1, pos=(0, 480), size=(200, 200)) path = filepath.split('\\')[0] +'\.tmp\cover.png' - #print(path) music_cover = wx.Image(path, wx.BITMAP_TYPE_ANY).Rescale(200, 200).ConvertToBitmap() - #print(music_cover) music_cover_panel = wx.StaticBitmap(self.music_cover_panel, -1, music_cover, pos=(0, 0), size=(200, 200)) music_cover_panel.Refresh() @@ -244,6 +243,8 @@ class MainFrame(wx.Frame): if self.current_music_name.split('.')[-1] == 'mp3': self.get_music_cover(current_music_path) self.redraw_music_cover_panel(current_music_path) + else: + self.draw_music_cover_panel() # step3:开启新线程,追踪歌词 self.display_lyric() self.current_music_state = 1 @@ -344,11 +345,25 @@ class MainFrame(wx.Frame): def parse_lyrics(self): current_lyric_path = self.get_lyric_path() if current_lyric_path is None or not os.path.exists(current_lyric_path): - content_list = ["[00:00.00]暂无歌词"] + content_list = ["[00:00.00]纯音乐或暂无歌词"] else: # 读文件内容 with open(current_lyric_path, 'r', encoding="utf-8") as file_pointer: content_list = file_pointer.readlines() + #标准化处理 + for i in range(len(content_list)): + content_list[i] = content_list[i].replace('\n', '') + if content_list[i].index(']') == 6: + templist = content_list[i].split(']') + templist[0] = templist[0][:6] + '.00' + content_list[i] = ']'.join(templist) + elif content_list[i].index(']') == 10: + templist = content_list[i].split(']') + templist[0] = templist[0][:9] + content_list[i] = ']'.join(templist) + else: + continue + print(content_list) lyrics_list = [] for content in content_list: if re.match(LYRIC_ROW_REG, content): @@ -370,16 +385,19 @@ class MainFrame(wx.Frame): current_time = float(self.music.get_pos() / 1000) for lyric_index, lyrics_time_dict in enumerate(lyrics_time_dict_list): lyric_time = list(lyrics_time_dict.keys())[0] - if math.fabs(lyric_time - current_time) < 0.7: + if math.fabs(lyric_time - current_time) < 0.8: # 当歌词已经超过底部了,则刷新歌词面板,展示第二页的歌词 if lyric_index > 0 and lyric_index % MAX_LYRIC_ROW == 0: relative_start_index = lyric_index self.redraw_music_lyric_panel(start_index=relative_start_index) self.lyrcis_static_text[lyric_index - relative_start_index].SetOwnForegroundColour((227, 62, 51)) self.lyrcis_static_text[lyric_index - relative_start_index].Refresh() - if (lyric_index - relative_start_index - 1) != -1: + if (lyric_index - relative_start_index - 1) != -1 : self.lyrcis_static_text[lyric_index - relative_start_index - 1].SetOwnForegroundColour((41, 36, 33)) self.lyrcis_static_text[lyric_index - relative_start_index - 1].Refresh() + else: + self.lyrcis_static_text[0].SetOwnForegroundColour((41, 36, 33)) + self.lyrcis_static_text[0].Refresh() break time.sleep(1)