예제 #1
0
    def initLoginUI(self):
        # Load UI file.
        main_ui_file = ui.get_ui_file("summus_login.ui", self.get_current_folder())
        self.ui = ui.loadUiWidget(main_ui_file, parent=self)

        # Layout.
        self.setLayout(QtGui.QVBoxLayout())
        self.layout().addWidget(self.ui)
        self.layout().setSpacing(0)
        self.layout().setContentsMargins(2, 2, 2, 2)

        # Store ui elements for use later in signals or functions.
        self.lb_image_logo = ui.get_child(self.ui, "lb_image_logo")
        self.lb_image_wave = ui.get_child(self.ui, "lb_image_wave")
        self.le_user = ui.get_child(self.ui, "le_user")
        self.le_pass = ui.get_child(self.ui, "le_pass")
        self.lb_info = ui.get_child(self.ui, "lb_info")
        self.pb_login = ui.get_child(self.ui, "pb_login")

        # Set the ui images.
        image_logo_file = image.get_image_file("summus_logo.png", self.get_current_folder())
        # image_wave_file = image.get_image_file("login_logo_wave.png", self.get_current_folder())
        self.lb_image_logo.setPixmap(image.create_pixmap(image_logo_file))
        # self.lb_image_wave.setPixmap(image.create_pixmap(image_wave_file))

        # Connect signals
        self.pb_login.clicked.connect(self.check_login)
예제 #2
0
    def initUI(self):
        # Load UI file
        current_file = self.get_current_file()
        current_folder = os.path.dirname(current_file)
        main_ui_file = ui.get_ui_file("summus_main.ui", current_folder)
        self.ui = ui.loadUiWidget(main_ui_file, parent=self)

        # Layout
        self.setLayout(QtGui.QVBoxLayout())
        self.layout().addWidget(self.ui)
        self.layout().setSpacing(0)
        self.layout().setContentsMargins(2, 2, 2, 2)

        # test_video_link = "http://www.db.insideanim.com/media/campus/tmp/creatures01_lsn01_sbt01_the_basis_of_animal_behavior.flv"
        test_video_link = "http://www.db.insideanim.com/media/campus/tmp/cosmos_laundromat.mp4"
        # test_video_link = "http://www.db.insideanim.com/media/campus/tmp/creatures01_lsn01_sbt02_animal_anatomy_vs_human_anatomy.flv"
        # test_video_link = "http://www.db.insideanim.com/media/campus/tmp/creatures01_lsn01_sbt03_morphology_of_limbs.flv"

        self.wg_test_video = ui.get_child(self.ui, "wg_test_video")
        self.video_player = video_player.video_player_widget()
        self.wg_test_video.layout().addWidget(self.video_player)
        self.video_player.set_step_options(mode="frame", size=1, pause_on_step=True)
        self.video_player.set_controls_visibility(["pb_track_prev", "pb_track_next", "pb_loop", "pb_random"], False)
        self.video_player.set_url(test_video_link)
        theme.apply_style(self.wg_test_video, "inside_anim_video_player.qss")
예제 #3
0
    def initUI(self):
        # Load UI file
        current_file = self.get_current_file()
        current_folder = os.path.dirname(current_file)
        main_ui_file = ui.get_ui_file("templateToolStdUI.ui", current_folder)
        self.ui = ui.loadUiWidget(main_ui_file, parent=self)

        # Layout
        # self.setMinimumSize(200, 100)

        self.setLayout(QtGui.QVBoxLayout())
        self.layout().addWidget(self.ui)
        self.layout().setSpacing(0)
        self.layout().setContentsMargins(2, 2, 2, 2)

        # Store ui elements for use later in signals or functions

        self.sld_cartoon_level = ui.get_child(self.ui, "sld_cartoon_level")
        self.rb_drama = ui.get_child(self.ui, "rb_drama")
        self.rb_comedy = ui.get_child(self.ui, "rb_comedy")
        self.rb_mistery = ui.get_child(self.ui, "rb_mistery")
        self.pb_apply = ui.get_child(self.ui, "pb_apply")
        self.pb_unapply = ui.get_child(self.ui, "pb_unapply")
        self.pb_para_final = ui.get_child(self.ui, "pb_para_final")

        # Connect signals

        self.pb_para_final.clicked.connect(self.make_film)
        self.pb_apply.clicked.connect(self.make_film)
        self.pb_unapply.clicked.connect(self.make_film)
예제 #4
0
    def initUI(self):
        # Load UI file
        main_ui_file = ui.get_ui_file("main.ui", ui_utils.get_folder())
        self.ui = ui.loadUiWidget(main_ui_file, parent=self)

        # Layout
        self.setLayout(QtGui.QVBoxLayout())
        self.layout().addWidget(self.ui)
        self.layout().setSpacing(0)
        self.layout().setContentsMargins(2, 2, 2, 2)

        # test_video_link = "P:/insideAnim/educ/masters/animation/05_creatures/01_creatures_workshop/video/creatures01_lsn01_sbt01_the_basis_of_animal_behavior.mp4"
        # test_video_link = "http://www.db.insideanim.com/media/campus/tmp/creatures01_lsn01_sbt01_the_basis_of_animal_behavior_quarter.mp4"
        # test_video_link = "http://www.db.insideanim.com/media/campus/tmp/creatures01_lsn01_sbt01_the_basis_of_animal_behavior.flv"
        # test_video_link = "http://www.db.insideanim.com/media/campus/tmp/creatures01_lsn01_sbt02_animal_anatomy_vs_human_anatomy.flv"
        # test_video_link = "http://www.db.insideanim.com/media/campus/tmp/creatures01_lsn01_sbt03_morphology_of_limbs.flv"

        self.wg_test_video = ui.get_child(self.ui, "wg_test_video")
        self.video_player = video_player.video_player_widget()
        self.wg_test_video.layout().addWidget(self.video_player)
        self.video_player.set_step_options(mode="frame", size=1, pause_on_step=True)
        self.video_player.set_controls_visibility(
            ["pb_track_prev", "pb_track_next", "pb_loop", "pb_random", "pb_seek_random"], False
        )
        self.video_player.set_time_mode("frames")
        theme.apply_style(self.wg_test_video, "inside_anim_video_player.qss")

        video_0 = "http://www.db.insideanim.com/media/campus/tmp/creatures01_lsn01_sbt01_the_basis_of_animal_behavior_quarter.mp4"
        video_1 = "http://www.db.insideanim.com/media/campus/tmp/creatures01_lsn01_sbt01_the_basis_of_animal_behavior_third.mp4"
        video_2 = "http://www.db.insideanim.com/media/campus/tmp/creatures01_lsn01_sbt01_the_basis_of_animal_behavior_half.mp4"
        video_3 = "http://www.db.insideanim.com/media/campus/tmp/creatures01_lsn01_sbt01_the_basis_of_animal_behavior_twothirds.mp4"
        video_4 = "http://www.db.insideanim.com/media/campus/tmp/creatures01_lsn01_sbt01_the_basis_of_animal_behavior_threequarters.mp4"
        video_5 = "http://www.db.insideanim.com/media/campus/tmp/creatures01_lsn01_sbt01_the_basis_of_animal_behavior_full.mp4"

        self.video_player.add_url(video_0)
        # self.video_player.add_url(video_1)
        self.video_player.add_url(video_2)
        # self.video_player.add_url(video_3)
        # self.video_player.add_url(video_4)
        self.video_player.add_url(video_5)

        self.video_player.set_current_url(1)
예제 #5
0
    def initUI(self):
        # Load UI file
        current_file = self.get_current_file()
        current_folder = os.path.dirname(current_file)
        main_ui_file = ui.get_ui_file("esa_player.ui", current_folder)
        self.ui = ui.loadUiWidget(main_ui_file, parent=self)

        # Layout
        self.setLayout(QtGui.QVBoxLayout())
        self.layout().addWidget(self.ui)
        self.layout().setSpacing(0)
        self.layout().setContentsMargins(2, 2, 2, 2)

        # Store ui elements for use later in signals or functions.
        self.le_folder = ui.get_child(self.ui, "le_folder")
        self.pb_folder = ui.get_child(self.ui, "pb_folder")
        self.cbx_categories = ui.get_child(self.ui, "cbx_categories")
        self.le_filter = ui.get_child(self.ui, "le_filter")
        self.pb_filter = ui.get_child(self.ui, "pb_filter")
        self.pb_clear = ui.get_child(self.ui, "pb_clear")
        self.lw_video = ui.get_child(self.ui, "lw_video")
        self.lb_playing_name = ui.get_child(self.ui, "lb_playing_name")
        # self.pb_crazy_random = ui.get_child(self.ui, "pb_crazy_random")
        # self.sb_crazy_random_seconds = ui.get_child(self.ui, "sb_crazy_random_seconds")
        # self.sb_crazy_random_seconds.setVisible(False)

        self.wg_video_player = ui.get_child(self.ui, "wg_video_player")
        self.video_player = video_player.video_player_widget()
        self.video_player.set_controls_visibility(["pb_size"], False)
        self.wg_video_player.layout().addWidget(self.video_player)
        theme.apply_style(self.wg_video_player, "video_player.qss")
        self.video_player.set_step_options(mode="percent", size=0.01, pause_on_step=False)
        self.set_video_player_state(False)

        self.pb_track_prev = ui.get_child(self.ui, "pb_track_prev")
        self.pb_track_next = ui.get_child(self.ui, "pb_track_next")
        self.pb_loop = ui.get_child(self.ui, "pb_loop")
        self.pb_random = ui.get_child(self.ui, "pb_random")
        self.pb_seek_random = ui.get_child(self.ui, "pb_seek_random")
        self.sb_seek_random_seconds = ui.get_child(self.ui, "sb_seek_random_seconds")

        # Set the ui images.
        self.pb_folder.setIcon(image.create_pixmap(image.get_image_file("folder.png", self.get_current_folder())))
        self.pb_filter.setIcon(image.create_pixmap(image.get_image_file("search.png", self.get_current_folder())))
        self.pb_clear.setIcon(image.create_pixmap(image.get_image_file("eraser.png", self.get_current_folder())))

        # self.pb_loop.setIcon(image.create_pixmap(image.get_image_file("loop.png", self.get_current_folder())))
        # self.pb_random.setIcon(image.create_pixmap(image.get_image_file("random.png", self.get_current_folder())))
        # self.pb_crazy_random.setIcon(image.create_pixmap(image.get_image_file("crazy_random.png", self.get_current_folder())))

        # Signals
        self.pb_folder.released.connect(self.choose_folder)
        self.cbx_categories.currentIndexChanged.connect(self.fill_video_list)
        self.le_filter.returnPressed.connect(self.fill_video_list)
        self.pb_filter.clicked.connect(self.fill_video_list)
        self.pb_clear.clicked.connect(self.clear_filters)
        self.lw_video.itemSelectionChanged.connect(self.play_video)
        self.pb_track_prev.clicked.connect(self.play_prev)
        self.pb_track_next.clicked.connect(self.play_next)
        self.pb_seek_random.clicked.connect(self.toggle_crazy_random)
        self.tmr_crazy_random.timeout.connect(self.crazy_random_process)
예제 #6
0
    def initUI(self):
        self.setObjectName("VideoPlayer")

        # Applies the theme for the widget
        theme.apply_style(self, "video_player.qss")

        # Allows full screen
        self.setWindowFlags(self.windowFlags() | QtCore.Qt.FramelessWindowHint)

        # Inserts the .ui content
        video_player_ui_file = ui.get_ui_file("video_player.ui", self.get_current_folder())
        self.ui = ui.loadUiWidget(video_player_ui_file, parent=self)

        # Layout.
        self.setLayout(QtGui.QVBoxLayout())
        self.layout().addWidget(self.ui)
        self.layout().setSpacing(0)
        self.layout().setContentsMargins(0, 0, 0, 0)

        # Phonon components to manage a video.

        # Video Player
        self.video_player = CustomVideoPlayer()
        self.video_player_size_policy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)
        self.video_player_size_policy.setHorizontalStretch(0)
        self.video_player_size_policy.setVerticalStretch(0)
        self.video_player_size_policy.setHeightForWidth(self.video_player.sizePolicy().hasHeightForWidth())
        self.video_player.setSizePolicy(self.video_player_size_policy)
        self.video_player.setVisible(False)
        self.video_player.setObjectName("video_player")

        # Seek Slider - timeline
        self.seek_slider = CustomSeekSlider()
        self.seek_slider.setMaximumSize(QtCore.QSize(16777215, 20))
        self.seek_slider.setSingleStep(0)
        self.seek_slider.setObjectName("seek_slider")

        # Volume Slider.
        self.volume_slider = CustomVolumeSlider()
        self.volume_slider.setMaximumSize(QtCore.QSize(150, 20))
        self.volume_slider.setMuteVisible(False)
        self.volume_slider.setSingleStep(0)
        self.volume_slider.setObjectName("volume_slider")

        # Inserts the phonon components in the widget containers prepared for them.
        ui.insert_widget(self, "wg_video", self.video_player, None)
        ui.insert_widget(self, "wg_seek", self.seek_slider, None)
        ui.insert_widget(self, "wg_volume", self.volume_slider, None)

        # Stores controls to use with signals and/or to get values in process.
        self.wg_controls_bar = ui.get_child(self, "wg_controls_bar")

        self.pb_time = ui.get_child(self, "pb_time")
        self.pb_time_total = ui.get_child(self, "pb_time_total")
        self.pb_time.setStyleSheet("QPushButton {text-align: right;}")
        self.pb_time_total.setStyleSheet("QPushButton {text-align: left;}")

        self.pb_refresh = ui.get_child(self, "pb_refresh")
        self.pb_track_prev = ui.get_child(self, "pb_track_prev")
        self.pb_step_prev = ui.get_child(self, "pb_step_prev")
        self.pb_play = ui.get_child(self, "pb_play")
        self.pb_step_next = ui.get_child(self, "pb_step_next")
        self.pb_track_next = ui.get_child(self, "pb_track_next")
        self.lb_loading = ui.get_child(self, "lb_loading")
        self.lb_state = ui.get_child(self, "lb_state")
        self.pb_volume_down = ui.get_child(self, "pb_volume_down")
        self.pb_volume_up = ui.get_child(self, "pb_volume_up")
        self.pb_volume_on = ui.get_child(self, "pb_volume_on")
        self.pb_loop = ui.get_child(self.ui, "pb_loop")
        self.pb_random = ui.get_child(self.ui, "pb_random")
        self.pb_seek_random = ui.get_child(self.ui, "pb_seek_random")
        self.sb_seek_random_seconds = ui.get_child(self.ui, "sb_seek_random_seconds")
        self.sb_seek_random_seconds.setVisible(False)
        self.pb_size = ui.get_child(self.ui, "pb_size")
        self.pb_expand = ui.get_child(self, "pb_expand")

        # Load the ui icons.
        self.refresh_icon = image.get_image_file("refresh.png", self.get_current_folder())
        self.track_prev_icon = image.get_image_file("track_prev.png", self.get_current_folder())
        self.step_prev_icon = image.get_image_file("step_prev.png", self.get_current_folder())
        self.play_icon = image.get_image_file("play.png", self.get_current_folder())
        self.pause_icon = image.get_image_file("pause.png", self.get_current_folder())
        self.step_next_icon = image.get_image_file("step_next.png", self.get_current_folder())
        self.track_next_icon = image.get_image_file("track_next.png", self.get_current_folder())
        self.loading_icon = image.get_image_file("squares_002.gif", self.get_current_folder())
        self.volume_up_icon = image.get_image_file("volume_up.png", self.get_current_folder())
        self.volume_down_icon = image.get_image_file("volume_down.png", self.get_current_folder())
        self.volume_on_icon = image.get_image_file("volume_on.png", self.get_current_folder())
        self.volume_off_icon = image.get_image_file("volume_off.png", self.get_current_folder())
        self.loop_icon = image.get_image_file("loop.png", self.get_current_folder())
        self.loop_icon_checked = image.get_image_file("loop_checked.png", self.get_current_folder())
        self.random_icon = image.get_image_file("random.png", self.get_current_folder())
        self.random_icon_checked = image.get_image_file("random_checked.png", self.get_current_folder())
        self.seek_random_icon = image.get_image_file("seek_random.png", self.get_current_folder())
        self.seek_random_icon_checked = image.get_image_file("seek_random_checked.png", self.get_current_folder())
        self.expand_icon = image.get_image_file("expand.png", self.get_current_folder())
        self.size_icon = image.get_image_file("sizes.png", self.get_current_folder())
        self.reduce_icon = image.get_image_file("reduce.png", self.get_current_folder())

        # Applies the icons.
        self.pb_refresh.setIcon(image.create_pixmap(self.refresh_icon))
        self.pb_track_prev.setIcon(image.create_pixmap(self.track_prev_icon))
        self.pb_step_prev.setIcon(image.create_pixmap(self.step_prev_icon))
        self.pb_play.setIcon(image.create_pixmap(self.play_icon))
        self.pb_step_next.setIcon(image.create_pixmap(self.step_next_icon))
        self.pb_track_next.setIcon(image.create_pixmap(self.track_next_icon))
        self.pb_volume_down.setIcon(image.create_pixmap(self.volume_down_icon))
        self.pb_volume_up.setIcon(image.create_pixmap(self.volume_up_icon))
        self.pb_volume_on.setIcon(image.create_pixmap(self.volume_on_icon))
        self.pb_loop.setIcon(image.create_pixmap(self.loop_icon))
        self.pb_random.setIcon(image.create_pixmap(self.random_icon))
        self.pb_seek_random.setIcon(image.create_pixmap(self.seek_random_icon))
        self.pb_size.setIcon(image.create_pixmap(self.size_icon))
        self.pb_expand.setIcon(image.create_pixmap(self.expand_icon))

        # Special config for the ui elements dedicated to show the buffering process.
        self.lb_state.setMovie(image.create_movie(self.loading_icon))
        self.lb_state.movie().setScaledSize(QtCore.QSize(18,18))
        self.lb_state.movie().start()
        self.update_buffering_ui(force=True, force_state=False)

        # Config the timer to hide the controls
        self.timer_hide_controls_ticks_count = 0
        self.timer_hide_controls.setInterval(1000)

        # Creates the signals
        self.pb_refresh.clicked.connect(self.refresh)
        self.pb_step_prev.clicked.connect(self.step_prev)
        self.pb_play.clicked.connect(self.toggle_play)
        self.pb_step_next.clicked.connect(self.step_next)
        self.pb_time.clicked.connect(self.toggle_time_display_mode)
        self.pb_volume_down.clicked.connect(self.volume_down)
        self.pb_volume_up.clicked.connect(self.volume_up)
        self.pb_volume_on.clicked.connect(self.toggle_volume)
        self.pb_loop.toggled.connect(self.update_icons)
        self.pb_random.toggled.connect(self.update_icons)
        self.pb_seek_random.toggled.connect(self.update_icons)
        # self.pb_size.clicked.connect(self.show_sizes)
        self.pb_expand.clicked.connect(self.toggle_full_screen)
        self.timer.timeout.connect(self.update_buffering_ui)
        self.timer_hide_controls.timeout.connect(self.update_controls_visibility)