-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
69 lines (53 loc) · 2.38 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
import os
import tkinter as tk
from tkinter import filedialog, messagebox, ttk, Scale, simpledialog
from ttkthemes import ThemedTk
from video_operations import VideoOperations
from audio_operations import AudioOperations
from gui_components import GUIComponents
from utils import Utils
class KorivashAMVManagerTool:
def __init__(self, root):
self.root = root
self.root.title("Korivash AMV Manager Tool")
self.root.geometry("1200x800")
self.root.configure(bg="#2E3440")
self.gui = GUIComponents(root, self)
self.gui.setup_components()
self.video_operations = VideoOperations(self)
self.audio_operations = AudioOperations(self)
self.clip_list = []
self.clip_files = []
self.audio_file = None
self.text_overlays = []
def add_clip(self):
self.video_operations.add_clip()
def trim_clip(self):
self.video_operations.trim_clip()
def add_audio(self):
self.audio_operations.add_audio()
def trim_audio(self):
self.audio_operations.trim_audio()
def add_text_overlay(self):
text = simpledialog.askstring("Add Text Overlay", "Enter the text to overlay:")
start_time_str = simpledialog.askstring("Text Start Time", "Enter start time (MM:SS or HH:MM:SS):")
duration_str = simpledialog.askstring("Text Duration", "Enter duration in seconds:")
start_time = Utils.convert_time_to_seconds(start_time_str)
duration = float(duration_str) if duration_str else None
if text and start_time is not None and duration is not None:
try:
text_clip = TextClip(text, fontsize=24, color='white').set_position('center').set_start(start_time).set_duration(duration)
self.text_overlays.append(text_clip)
messagebox.showinfo("Success", f"Text overlay added: '{text}' from {start_time_str} for {duration_str}s")
except Exception as e:
messagebox.showerror("Error", f"Failed to add text overlay: {e}")
def reorder_clips(self):
self.video_operations.reorder_clips()
def delete_clip(self):
self.video_operations.delete_clip()
def export_amv(self):
self.video_operations.export_amv()
if __name__ == "__main__":
root = ThemedTk(theme="equilux")
amv_manager = KorivashAMVManagerTool(root)
root.mainloop()