def open_output_folder(sender, data): core.select_directory_dialog(callback=set_output_path)
def __select_output_directory(self, sender, data): dpg.select_directory_dialog(self.__set_output_directory)
def __init__(self): self.__last = -1 self.__targetFPS = 30 # playhead position self.__head = 0. # playback stopped self.__direction = 0. # looping on self.__loop = True # thread that is "streaming" the video self.__thread = None self.__frameCount = self.__width = self.__height = 0 self.__root = path.dirname(path.realpath(__file__)) core.set_style_item_spacing(1, 1) core.set_style_frame_padding(0, 0) core.get_style_window_padding(0, 0) width = 740 height = 680 core.set_main_window_size(width, height) with simple.window("MainWindow"): core.add_drawing("Canvas", width=width, height=height) w = 50 h = 20 with simple.window("Media Bar", autosize=True, no_collapse=True, no_close=True, no_scrollbar=True): with simple.group("Browser"): core.add_listbox("Listing", label='', items=[], callback=self.__itemChange) with simple.group("Shuttle"): core.add_button("Shuttle#Browse", width=w, height=h, label="...", callback=lambda: core.select_directory_dialog( callback=self.__browser)) core.add_button("Shuttle#Front", width=w, height=h, label='|<', callback=lambda: self.__seek(0)) core.add_same_line() core.add_button("Shuttle#Backwards", width=w, height=h, label='<-', callback=lambda: self.__play(-1)) core.add_same_line() core.add_button("Shuttle#Forwards", width=w, height=h, label='->', callback=lambda: self.__play(1)) core.add_same_line() core.add_button("Shuttle#End", width=w, height=h, label='>|', callback=lambda: self.__seek(-1)) core.add_same_line() core.add_color_button("Shuttle#Loop", [50, 50, 227, 255], width=w, height=h, callback=self.__loopToggle) core.add_same_line() core.add_text("ShuttleFPS") core.add_drag_float("MediabarHead", label="", width=w * 5 + 5, callback=self.__cbSeek) core.set_render_callback(self.__render) core.set_mouse_wheel_callback(self.__mouseWheel) core.set_exit_callback(self.__close) self.__scanDir()