Пример #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
Пример #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()