mediaInfoSama/main_window.py
cuissedemouche 7cc07c2657 Basic and advanced tab
First commit of the app
Basic and advanced tab can be generated via code to the QPlainTextEdit
2022-12-13 14:51:50 +00:00

53 lines
1.6 KiB
Python

from PySide6.QtWidgets import QWidget
from ui_main_window import Ui_MainWindow
from file_cmds import FileCmds
class MainWindow(QWidget, Ui_MainWindow):
def __init__(self):
super().__init__()
self.setupUi(self)
self.setWindowTitle("mediainfoSama")
self.setAcceptDrops(True)
self.setupConnections()
def setupConnections(self):
pass
def dragEnterEvent(self, event):
event.accept()
def dragMoveEvent(self, event):
event.accept()
def dropEvent(self, event):
self.filePath = event.mimeData().urls()[0].toLocalFile()
self.fileCmds = FileCmds(self.filePath)
self.fileCmds.file_exist()
if self.fileCmds.file_exist() == False:
return
self.populate()
print("YEAH")
# videoTrack = self.mkv_infos.get_video_track()
# if videoTrack == None:
# return
def populate(self, path = ''):
self.media_tracks_list_widget.clear()
informGeneral = r"General;G: %Format%, %FileSize_String%, %Duration_String%, %BitRate_String%\n"
informVideo = r"Video;V: %Format%, %Format_Profile%, %StreamSize_String%, %Width%x%Height%, %FrameRate% FPS, %BitRate_String%\n"
informAudio = r"Audio;A: %Language_String%, %Format%, %StreamSize_String%, %BitRate_String%, %Channel(s)_String%, %SamplingRate_String%\n"
informText = r"Text;T: %Language_String%, %Format%\n"
text = self.fileCmds.generate_basic()
self.media_detail_plain_text_edit.setPlainText(text)
print(self.fileCmds.tracksCount())