@@ -129,7 +129,7 @@ def key_events(stdscr, tree1, maxx):
129
129
if tree1 .currentmenu == "timer" :
130
130
tree1 .starttimer (tree1 .selectedtimer , stdscr , maxx )
131
131
else :
132
- tree1 .featureselect (tree1 .selectedtimer )
132
+ tree1 .featureselect (tree1 .selectedtimer , maxx , stdscr )
133
133
timerstart = vlc .MediaPlayer (str (RES_FOLDER / "timerstart.wav" ))
134
134
timerstart .play ()
135
135
tree1 .showtimer = False
@@ -156,6 +156,7 @@ def key_events(stdscr, tree1, maxx):
156
156
tree1 .currentmenu = "feature"
157
157
158
158
else :
159
+ tree1 .radiomode = False
159
160
tree1 .music_list_num += 1
160
161
if tree1 .music_list_num > len (tree1 .music_list ) - 1 :
161
162
tree1 .music_list_num = len (tree1 .music_list ) - 1
@@ -170,6 +171,7 @@ def key_events(stdscr, tree1, maxx):
170
171
tree1 .selectedtimer = 0
171
172
tree1 .currentmenu = "timer"
172
173
else :
174
+ tree1 .radiomode = False
173
175
tree1 .music_list_num -= 1
174
176
if tree1 .music_list_num < 0 :
175
177
tree1 .music_list_num = 0
@@ -270,7 +272,10 @@ def __init__(self, stdscr, age):
270
272
]
271
273
self .featurelist = [
272
274
" PLAY MUSIC FROM YOUTUBE " ,
273
- " LOFI RADIO "
275
+ " LOFI RADIO 1 " ,
276
+ " LOFI RADIO 2 " ,
277
+ " LOFI RADIO 3 " ,
278
+ " CUSTOM PLAYLIST "
274
279
]
275
280
self .currentmenu = "timer"
276
281
self .selectedtimer = 0
@@ -531,7 +536,7 @@ def starttimer(self, inputtime, stdscr, maxx):
531
536
532
537
self .workendtime = int (time .time ()) + self .worktime
533
538
534
- def featureselect (self , inputfeature ):
539
+ def featureselect (self , inputfeature , maxx , stdscr ):
535
540
self .radiomode = False
536
541
if inputfeature == 0 :
537
542
if hasattr (self , "media" ):
@@ -541,6 +546,37 @@ def featureselect(self, inputfeature):
541
546
self .playlist = Playlist ("https://www.youtube.com/playlist?list=PLOzDu-MXXLliO9fBNZOQTBDddoA3FzZUo" )
542
547
self .lofiradio ()
543
548
549
+ if inputfeature == 2 :
550
+ self .playlist = Playlist ("https://www.youtube.com/playlist?list=PL0ONFXpPDe_mtm3ciwL-v7EE-7yLHDlP8" )
551
+ self .lofiradio ()
552
+
553
+ if inputfeature == 3 :
554
+ self .playlist = Playlist ("https://www.youtube.com/playlist?list=PLKYTmz7SemaqVDF6XJ15bv_8-j7ckkNgb" )
555
+ self .lofiradio ()
556
+
557
+ if inputfeature == 4 :
558
+ curses .textpad .rectangle (stdscr , 0 ,0 ,2 , maxx - 1 )
559
+ stdscr .addstr (1 ,1 , "ENTER PLAyLIST LINK : " )
560
+ stdscr .refresh ()
561
+
562
+ curses .echo ()
563
+ curses .nocbreak ()
564
+ stdscr .nodelay (False )
565
+ stdscr .keypad (False )
566
+ curses .curs_set (1 )
567
+
568
+ templink = stdscr .getstr ()
569
+ templink = str (templink )[1 :][:- 1 ]
570
+ self .playlist = Playlist (str (templink ))
571
+
572
+ curses .noecho ()
573
+ curses .cbreak ()
574
+ stdscr .nodelay (True )
575
+ stdscr .keypad (True )
576
+ curses .curs_set (0 )
577
+
578
+ self .lofiradio ()
579
+
544
580
def loading (self , stdscr , maxx ):
545
581
spinner = [
546
582
"[ ]" ,
@@ -802,8 +838,13 @@ def main():
802
838
803
839
tree1 .timer ()
804
840
805
- if not tree1 .isloading and tree1 .radiomode and round (tree1 .media .get_position ()* 100 ) == 100 :
806
- tree1 .lofiradio ()
841
+ if not tree1 .isloading and round (tree1 .media .get_position ()* 100 ) == 100 :
842
+ if tree1 .radiomode :
843
+ tree1 .lofiradio ()
844
+ else :
845
+ tree1 .media .stop ()
846
+ tree1 .media = vlc .MediaPlayer (tree1 .music_list [tree1 .music_list_num ])
847
+ tree1 .media .play ()
807
848
808
849
if tree1 .isloading :
809
850
tree1 .loading (stdscr , maxx )
0 commit comments