Beispiel #1
0
 def ProcessApplicationCommand( self, command: CAC.ApplicationCommand ):
     
     command_processed = True
     
     if command.IsSimpleCommand():
         
         action = command.GetSimpleAction()
         
         if action == CAC.SIMPLE_PAUSE_MEDIA:
             
             self.Pause()
             
         elif action == CAC.SIMPLE_PAUSE_PLAY_MEDIA:
             
             self.PausePlay()
             
         elif action == CAC.SIMPLE_MEDIA_SEEK_DELTA:
             
             ( direction, duration_ms ) = command.GetSimpleData()
             
             self.SeekDelta( direction, duration_ms )
             
         elif action == CAC.SIMPLE_OPEN_FILE_IN_EXTERNAL_PROGRAM:
             
             if self._media is not None:
                 
                 ClientGUIMedia.OpenExternally( self._media )
                 
             
         elif action == CAC.SIMPLE_CLOSE_MEDIA_VIEWER and self._canvas_type in CC.CANVAS_MEDIA_VIEWER_TYPES:
             
             self.window().close()
             
         elif action == CAC.SIMPLE_LAUNCH_MEDIA_VIEWER and self._canvas_type == CC.CANVAS_PREVIEW:
             
             self.launchMediaViewer.emit()
             
         else:
             
             command_processed = False
             
         
     else:
         
         command_processed = False
         
     
     return command_processed
Beispiel #2
0
    def SetValue(self, command: CAC.ApplicationCommand):

        action = command.GetSimpleAction()

        self._simple_actions.SetValue(action)

        if action == CAC.SIMPLE_MEDIA_SEEK_DELTA:

            (direction, ms) = command.GetSimpleData()

            self._seek_direction.SetValue(direction)

            s = ms // 1000

            ms = ms % 1000

            self._seek_duration_s.setValue(s)
            self._seek_duration_ms.setValue(ms)

        self._UpdateControls()
    def ProcessApplicationCommand(self, command: CAC.ApplicationCommand):

        command_processed = True

        if command.IsSimpleCommand():

            action = command.GetSimpleAction()

            if action in self._ok_on_these_commands:

                self._OKParent()

            else:

                command_processed = False

        else:

            command_processed = False

        return command_processed
Beispiel #4
0
 def ProcessApplicationCommand( self, command: CAC.ApplicationCommand ):
     
     command_processed = True
     
     if command.IsSimpleCommand():
         
         action = command.GetSimpleAction()
         
         if action == CAC.SIMPLE_MANAGE_FILE_RATINGS:
             
             self.EventOK()
             
         else:
             
             command_processed = False
             
         
     else:
         
         command_processed = False
         
     
     return command_processed
    def ProcessApplicationCommand(self, command: CAC.ApplicationCommand):

        command_processed = True

        if command.IsSimpleCommand():

            action = command.GetSimpleAction()

            if action == CAC.SIMPLE_EXIT_APPLICATION:

                HG.client_controller.gui.TryToExit()

            elif action == CAC.SIMPLE_EXIT_APPLICATION_FORCE_MAINTENANCE:

                HG.client_controller.gui.TryToExit(
                    force_shutdown_maintenance=True)

            elif action == CAC.SIMPLE_RESTART_APPLICATION:

                HG.client_controller.gui.TryToExit(restart=True)

            elif action == CAC.SIMPLE_HIDE_TO_SYSTEM_TRAY:

                HG.client_controller.gui.HideToSystemTray()

            elif action == CAC.SIMPLE_CLOSE_MEDIA_VIEWER:

                self.close()

            elif action == CAC.SIMPLE_SWITCH_BETWEEN_FULLSCREEN_BORDERLESS_AND_REGULAR_FRAMED_WINDOW:

                self.FullscreenSwitch()

            elif action == CAC.SIMPLE_FLIP_DARKMODE:

                HG.client_controller.gui.FlipDarkmode()

            elif action == CAC.SIMPLE_GLOBAL_AUDIO_MUTE:

                ClientGUIMediaControls.SetMute(
                    ClientGUIMediaControls.AUDIO_GLOBAL, True)

            elif action == CAC.SIMPLE_GLOBAL_AUDIO_UNMUTE:

                ClientGUIMediaControls.SetMute(
                    ClientGUIMediaControls.AUDIO_GLOBAL, False)

            elif action == CAC.SIMPLE_GLOBAL_AUDIO_MUTE_FLIP:

                ClientGUIMediaControls.FlipMute(
                    ClientGUIMediaControls.AUDIO_GLOBAL)

            elif action == CAC.SIMPLE_GLOBAL_PROFILE_MODE_FLIP:

                HG.client_controller.FlipProfileMode()

            elif action == CAC.SIMPLE_GLOBAL_FORCE_ANIMATION_SCANBAR_SHOW:

                HG.client_controller.new_options.FlipBoolean(
                    'force_animation_scanbar_show')

            else:

                command_processed = False

        else:

            command_processed = False

        return command_processed