Exemplo n.º 1
0
/**
  * @brief  Close full screen
  * @param  None
  * @retval None
  */
static uint8_t _CloseFullScreen(void) 
{
  WM_HWIN hItem;    
  int XPos, YPos, XSize, YSize, nx, ny, n;
  
  __GetWindowRect(&XPos, &YPos, &XSize, &YSize);
  
  nx = (XSize * 1000) / Video_Info.xSize;
  ny = (YSize * 1000) / Video_Info.ySize; 
  
  if (nx < ny) {
    n = nx;
  } else {
    n = ny;
  }
  
  XPos = XPos + (XSize - ((Video_Info.xSize * n) / 1000)) / 2;
  YPos = YPos + (YSize - ((Video_Info.ySize * n) / 1000)) / 2;

  GUI_MOVIE_ShowScaled(hMovie, XPos, YPos, n, 1000, 0);
  hItem = WM_GetDialogItem(VIDEOPLAYER_hWin, ID_PLAY_BUTTON);
  WM_InvalidateWindow(hItem);
  WM_Update(hItem);
  FullScreen = 0;
  return 0;
}
Exemplo n.º 2
0
/**
  * @brief  Start play
  * @param  filename: pointer to the video file name
  * @retval None
  */
static uint8_t _StartPlay(char * filename) 
{
  int XPos, YPos, XSize, YSize, nx, ny, n;
  
  
  if(f_open(&Video_File, filename, FA_OPEN_EXISTING | FA_READ) == FR_OK)
  {
    
    GUI_MOVIE_GetInfoEx(_GetData, &Video_File, &Video_Info);
    
    if((Video_Info.xSize == 0) || (Video_Info.ySize == 0) || 
       (Video_Info.xSize > 320) || (Video_Info.ySize > 240))
    {
      return 1;
    }
    
    hMovie = GUI_MOVIE_CreateEx(_GetData, &Video_File, _cbNotify);
    VideoPlayer_State = VIDEO_PLAY;

      __GetWindowRect(&XPos, &YPos, &XSize, &YSize);
      
      nx = (XSize * 1000) / Video_Info.xSize;
      ny = (YSize * 1000) / Video_Info.ySize; 
      
      if (nx < ny) {
        n = nx;
      } else {
        n = ny;
      }
      
      XPos = XPos + (XSize - ((Video_Info.xSize * n) / 1000)) / 2;
      YPos = YPos + (YSize - ((Video_Info.ySize * n) / 1000)) / 2;
      GUI_MOVIE_ShowScaled(hMovie, XPos, YPos, n, 1000, 0);
  }
  return 0;
}