video_widgets.c
上传用户:kjfoods
上传日期:2020-07-06
资源大小:29949k
文件大小:3k
源码类别:

midi

开发平台:

Unix_Linux

  1. /*****************************************************************************
  2.  * video_widgets.c : OSD widgets manipulation functions
  3.  *****************************************************************************
  4.  * Copyright (C) 2004-2005 the VideoLAN team
  5.  * $Id: f0a1ded2bc0098f223d20a4196226232a0bd9a5f $
  6.  *
  7.  * Author: Yoann Peronneau <yoann@videolan.org>
  8.  *
  9.  * This program is free software; you can redistribute it and/or modify
  10.  * it under the terms of the GNU General Public License as published by
  11.  * the Free Software Foundation; either version 2 of the License, or
  12.  * (at your option) any later version.
  13.  *
  14.  * This program is distributed in the hope that it will be useful,
  15.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  17.  * GNU General Public License for more details.
  18.  *
  19.  * You should have received a copy of the GNU General Public License
  20.  * along with this program; if not, write to the Free Software
  21.  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  22.  *****************************************************************************/
  23. /*****************************************************************************
  24.  * Preamble
  25.  *****************************************************************************/
  26. #ifdef HAVE_CONFIG_H
  27. # include "config.h"
  28. #endif
  29. #include <vlc_common.h>
  30. #include <vlc_vout.h>
  31. #include <vlc_osd.h>
  32. #include <vlc_filter.h>
  33. /*****************************************************************************
  34.  * Displays an OSD slider.
  35.  * Types are: OSD_HOR_SLIDER and OSD_VERT_SLIDER.
  36.  *****************************************************************************/
  37. void vout_OSDSlider( vlc_object_t *p_caller, int i_channel, int i_position,
  38.                      short i_type )
  39. {
  40.     vout_thread_t *p_vout = vlc_object_find( p_caller, VLC_OBJECT_VOUT,
  41.                                              FIND_ANYWHERE );
  42.     if( p_vout && ( config_GetInt( p_caller, "osd" ) || ( i_position >= 0 ) ) )
  43.     {
  44.         osd_Slider( p_caller, p_vout->p_spu, p_vout->render.i_width,
  45.             p_vout->render.i_height, p_vout->fmt_in.i_x_offset,
  46.             p_vout->fmt_in.i_height - p_vout->fmt_in.i_visible_height
  47.                                     - p_vout->fmt_in.i_y_offset,
  48.             i_channel, i_position, i_type );
  49.     }
  50.     vlc_object_release( p_vout );
  51. }
  52. /*****************************************************************************
  53.  * Displays an OSD icon.
  54.  * Types are: OSD_PLAY_ICON, OSD_PAUSE_ICON, OSD_SPEAKER_ICON, OSD_MUTE_ICON
  55.  *****************************************************************************/
  56. void vout_OSDIcon( vlc_object_t *p_caller, int i_channel, short i_type )
  57. {
  58.     vout_thread_t *p_vout = vlc_object_find( p_caller, VLC_OBJECT_VOUT,
  59.                                              FIND_ANYWHERE );
  60.     if( !p_vout ) return;
  61.     if( config_GetInt( p_caller, "osd" ) )
  62.     {
  63.         osd_Icon( p_caller,
  64.                   p_vout->p_spu,
  65.                   p_vout->render.i_width,
  66.                   p_vout->render.i_height,
  67.                   p_vout->fmt_in.i_width - p_vout->fmt_in.i_visible_width
  68.                                          - p_vout->fmt_in.i_x_offset,
  69.                   p_vout->fmt_in.i_y_offset,
  70.                   i_channel, i_type );
  71.     }
  72.     vlc_object_release( p_vout );
  73. }