cutted 0.1.2__py3-none-any.whl → 0.2.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
cutted/app.py CHANGED
@@ -16,6 +16,7 @@ class CuttedApp:
16
16
  self.cursor_line = None
17
17
  self.last_slider_update = 0
18
18
  self.is_playing = False
19
+ self.last_states = []
19
20
  self.setup_ui()
20
21
 
21
22
  def setup_ui(self):
@@ -37,6 +38,12 @@ class CuttedApp:
37
38
 
38
39
  button = customtkinter.CTkButton(self.root, text="Load audio", command=self.select_file)
39
40
  button.place(relx=0.5, rely=1.0, anchor="s", y=-30)
41
+
42
+ export_button = customtkinter.CTkButton(self.root, text="Export", command=self.export_audio, width=70)
43
+ export_button.place(relx=0.9, rely=1.0, anchor="s", y=-30)
44
+
45
+ undo_button = customtkinter.CTkButton(self.root, text="Undo", command=self.undo_last, width=70)
46
+ undo_button.place(relx=0.1, rely=1.0, anchor="s", y=-30)
40
47
 
41
48
  self.play_button = customtkinter.CTkButton(self.root, text="Play", command=self.play_audio, width=50)
42
49
  self.play_button.place(relx=0.3, rely=1.0, anchor="s", y=-30)
@@ -124,9 +131,34 @@ class CuttedApp:
124
131
  def stop_audio(self):
125
132
  self.AudioProcessor.stop_audio()
126
133
  self.is_playing = False
127
- self.play_button.configure(text="Play")
134
+
135
+ def export_audio(self):
136
+ if not hasattr(self.AudioProcessor, "audio") or self.AudioProcessor.audio is None:
137
+ print_fail("No audio loaded.")
138
+ return
139
+
140
+ save_path = customtkinter.filedialog.asksaveasfilename(
141
+ defaultextension=".mp3",
142
+ filetypes=[
143
+ ("MP3 files", "*.mp3"),
144
+ ("WAV files", "*.wav"),
145
+ ]
146
+ )
147
+
148
+ if save_path:
149
+ if save_path.lower().endswith(".wav"):
150
+ format = "wav"
151
+ elif save_path.lower().endswith(".mp3"):
152
+ format = "mp3"
153
+ else:
154
+ format = "mp3"
155
+
156
+ self.AudioProcessor.export_audio(save_path, format)
157
+ print_success(f"Audio exported to {save_path}")
128
158
 
129
159
  def send_prompt(self):
160
+ self.save_state()
161
+
130
162
  if not hasattr(self.AudioProcessor, "audio") or self.AudioProcessor.audio is None:
131
163
  print_fail("No audio loaded.")
132
164
  return
@@ -152,6 +184,22 @@ class CuttedApp:
152
184
  else:
153
185
  print_fail("Gemini returned no data")
154
186
 
187
+ def save_state(self):
188
+ if hasattr(self.AudioProcessor, "audio") and self.AudioProcessor.audio is not None:
189
+ self.last_states.append(self.AudioProcessor.audio._spawn(self.AudioProcessor.audio.raw_data))
190
+ if len(self.last_states) > 10:
191
+ self.last_states.pop(0)
192
+
193
+ def undo_last(self):
194
+ if len(self.last_states) == 0:
195
+ print_warn("No previous states to undo")
196
+ messagebox.showwarning("Warning", "No previous states to undo")
197
+ return
198
+
199
+ self.AudioProcessor.audio = self.last_states.pop()
200
+ self.update_plot()
201
+ print_info("Undid last action")
202
+
155
203
  def run(self):
156
204
  self.root.mainloop()
157
205
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cutted
3
- Version: 0.1.2
3
+ Version: 0.2.1
4
4
  Summary: AI-powered audio editor controllable via natural language.
5
5
  Author-email: simon0302010 <simon0302010@gmail.com>
6
6
  License-Expression: GPL-3.0
@@ -1,12 +1,12 @@
1
1
  cutted/__init__.py,sha256=CP0x3JIScNbFVSOoF3eIQTKD5gDRfWXcCFE46rlZCio,49
2
2
  cutted/__main__.py,sha256=lYGLgtIZ_vGZIJmWG6ZQoqOdyOJnaWEA4NBn5Rc7Q8E,61
3
- cutted/app.py,sha256=xGnPZXkHfPOID91joER5Z6hTbsnjlMj_V_JlDvDOqpM,5849
3
+ cutted/app.py,sha256=vJZ_HZtUffUw36tJFBJCAhBbdluQgaOWIPqM5dNZXgU,7706
4
4
  cutted/core/audio_processor.py,sha256=7-XCuPPTlozeuaD2LqyzwRGinu0NvowTLbAh2X4XJ98,5182
5
5
  cutted/core/gemini.py,sha256=Ts_EbC1-rO9jIsdSlzKcmjLVS1o663GmfTdzmix12kE,2872
6
6
  cutted/core/logger.py,sha256=AjqrgW2LV9HdPkPQ8oOmyd9lWzVSIg46r74ILR7mVHo,585
7
7
  cutted/core/transcribe.py,sha256=cm6ziM3_grXKpUCFHiAU7-6lFK_SVsf7-6n14vMYQng,992
8
- cutted-0.1.2.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
9
- cutted-0.1.2.dist-info/METADATA,sha256=dhNLoSMQ1aov1tLCxJBWMibPoUSpGhxN8TtIOzAUUpQ,1122
10
- cutted-0.1.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
11
- cutted-0.1.2.dist-info/top_level.txt,sha256=PL6glZvzRyKWCDn5aoYI9uH8HlEA5Qd_XFJowJKARYI,7
12
- cutted-0.1.2.dist-info/RECORD,,
8
+ cutted-0.2.1.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
9
+ cutted-0.2.1.dist-info/METADATA,sha256=KKJ3auz3E5piy_1uEa9fWlkgZ72RmpHFMohbrqUmUbk,1122
10
+ cutted-0.2.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
11
+ cutted-0.2.1.dist-info/top_level.txt,sha256=PL6glZvzRyKWCDn5aoYI9uH8HlEA5Qd_XFJowJKARYI,7
12
+ cutted-0.2.1.dist-info/RECORD,,
File without changes