feat: Zeitanzeige für WAV-Datei hinzufügen
Co-authored-by: aider (ollama/qwen2.5-coder:32b) <aider@aider.chat>
This commit is contained in:
1 parent
f4e48a4a96
commit
e0e9cf8d73
1 file changed
+14
-1
@@ -1,5 +1,10 @@
|
||||
import sys
|
||||
from PyQt6.QtWidgets import QApplication, QMainWindow, QMenuBar, QMenu, QWidget, QVBoxLayout, QPushButton, QHBoxLayout, QGraphicsView, QGraphicsScene, QGraphicsLineItem, QFileDialog
|
||||
from PyQt6.QtWidgets import QApplication, QMainWindow, QMenuBar, QMenu, QWidget, QVBoxLayout, QPushButton, QHBoxLayout, QGraphicsView, QGraphicsScene, QGraphicsLineItem, QFileDialog, QLabel
|
||||
from PyQt6.QtCore import Qt, QTimer
|
||||
import sounddevice as sd
|
||||
import soundfile as sf
|
||||
import numpy as np
|
||||
import time
|
||||
from PyQt6.QtGui import QAction, QPen
|
||||
from PyQt6.QtCore import Qt, QTimer
|
||||
import sounddevice as sd
|
||||
@@ -52,6 +57,11 @@ class MainWindow(QMainWindow):
|
||||
button_layout.addWidget(self.pause_button)
|
||||
self.pause_button.clicked.connect(self.pause)
|
||||
|
||||
# Zeitanzeige hinzufügen
|
||||
self.time_label = QLabel("00:00 / 00:00", self)
|
||||
self.time_label.setStyleSheet("color: white;")
|
||||
button_layout.addWidget(self.time_label)
|
||||
|
||||
# Arbeitsbereich für Audio-Spuren
|
||||
self.track_area = QGraphicsView(self)
|
||||
self.track_area.setStyleSheet("background-color: #222222; border: 1px solid #333333;")
|
||||
@@ -95,6 +105,7 @@ class MainWindow(QMainWindow):
|
||||
self.playhead.setX(self.current_x)
|
||||
self.draw_waveform()
|
||||
self.scene.addItem(self.playhead) # Playhead nach der Waveform hinzufügen
|
||||
self.update_time_label()
|
||||
except Exception as e:
|
||||
print(f"Fehler beim Laden der WAV-Datei: {e}")
|
||||
self.audio_data = None
|
||||
@@ -180,6 +191,8 @@ class MainWindow(QMainWindow):
|
||||
self.playhead.setX(self.current_x)
|
||||
self.playback_pos = 0
|
||||
|
||||
self.update_time_label()
|
||||
|
||||
def audio_callback(self, outdata, frames, time, status):
|
||||
if status:
|
||||
print(status)
|
||||
|
||||
Reference in new issue
Block a user