Skip to content

Commit

Permalink
Function : 'ESC' (return) , 'S' (seek)
Browse files Browse the repository at this point in the history
  • Loading branch information
fluffy-melli committed Nov 23, 2024
1 parent 037246c commit 05cbba9
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 12 deletions.
8 changes: 5 additions & 3 deletions README.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ start.sh --nogui --play [URL1] [URL2]...

| Key | Function |
| --- | ----------------- |
| `S` | Seek video |
| `R` | Restart video |
| `P` | Play/Pause |
| `M` | Mute/Unmute |
Expand All @@ -95,9 +96,10 @@ start.sh --nogui --play [URL1] [URL2]...

### Function

| Key | Function |
| ----- | ---------- |
| `f11` | Fullscreen |
| Key | Function |
| ----- | ----------------------- |
| `esc` | Return to search screen |
| `f11` | Fullscreen |


## 🔍 Search Interface
Expand Down
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ start.sh --play [URL1] [URL2]...

|| 기능 |
| --- | ------------------ |
| `S` | 비디오 스킵 |
| `R` | 비디오 재시작 |
| `P` | 재생/일시정지 |
| `M` | 음소거/음소거 해제 |
Expand All @@ -95,9 +96,10 @@ start.sh --play [URL1] [URL2]...

### 기능

|| 기능 |
| ----- | ------- |
| `f11` | 전체화면 |
|| 기능 |
| ----- | ------------------- |
| `esc` | 검색화면으로 돌아가기 |
| `f11` | 전체화면 |

## 🔍 검색 인터페이스

Expand Down
19 changes: 15 additions & 4 deletions src/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,12 @@ def handle_key_event(key: str) -> None:
"""
if not key:
return

if key == "r":
if key == "s":
src.win.screen.vid.seek(src.win.screen.vid.duration - src.win.screen.vid.get_pos())
elif key == "escape":
src.win.setting.video_list = []
src.win.screen.vid.seek(src.win.screen.vid.duration - src.win.screen.vid.get_pos())
elif key == "r":
src.win.screen.vid.restart()
state.msg_text = "Restarted"
elif key == "p":
Expand Down Expand Up @@ -282,9 +286,13 @@ def wait():
if event.type == pygame.QUIT:
pygame.display.quit()
pygame.quit()
return
return
elif event.type == pygame.KEYDOWN:
if event.key == pygame.K_BACKSPACE:
if event.key == pygame.K_ESCAPE:
src.discord.client.RPC.close()
pygame.quit()
exit(0)
elif event.key == pygame.K_BACKSPACE:
state.search = state.search[:-1]
elif event.key == pygame.K_RETURN:
key = "return"
Expand Down Expand Up @@ -354,6 +362,9 @@ def wait():
choice += 1
else:
choice = 0
elif key == "escape":
src.win.setting.video_list = []
break
src.win.screen.win.fill((0,0,0))
for i, video in enumerate(videos):
if i == choice:
Expand Down
4 changes: 2 additions & 2 deletions src/nogui.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
from moviepy.editor import AudioFileClip
import pygame
from src.utils import download
from src.utils import download,user_setting
import os

def run(url:str):
pygame.init()
pygame.mixer.init()
download.clear("./src/down/storage/")
download.clear(user_setting.file_save_dir)
fn = download.install_nogui(url)
mp3_path = fn + ".mp3"
wav_path = fn + ".wav"
Expand Down

0 comments on commit 05cbba9

Please sign in to comment.