-/*****************************************************************************
- * intf_ProcessKey: process standard keys
- *****************************************************************************
- * This function will process standard keys and return non 0 if the key was
- * unknown.
- *****************************************************************************/
-int intf_ProcessKey( intf_thread_t *p_intf, int g_key )
-{
- static int i_volbackup;
- keyparm k_reply;
-
- k_reply = intf_GetKey( p_intf, g_key);
-
- switch( k_reply.key )
- {
- case INTF_KEY_QUIT: /* quit order */
- p_intf->b_die = 1;
- break;
- case INTF_KEY_SET_CHANNEL:
- /* Change channel - return code is ignored since SelectChannel displays
- * its own error messages */
- intf_SelectChannel( p_intf, k_reply.param );
- break;
- case INTF_KEY_INC_VOLUME: /* volume + */
- if( (p_main->p_aout != NULL) && (p_main->p_aout->vol < VOLUME_MAX) )
- p_main->p_aout->vol += VOLUME_STEP;
- break;
- case INTF_KEY_DEC_VOLUME: /* volume - */
- if( (p_main->p_aout != NULL) && (p_main->p_aout->vol > VOLUME_STEP) )
- p_main->p_aout->vol -= VOLUME_STEP;
- break;
- case INTF_KEY_TOGGLE_VOLUME: /* toggle mute */
- if( (p_main->p_aout != NULL) && (p_main->p_aout->vol))
- {
- i_volbackup = p_main->p_aout->vol;
- p_main->p_aout->vol = 0;
- }
- else if( (p_main->p_aout != NULL) && (!p_main->p_aout->vol))
- p_main->p_aout->vol = i_volbackup;
- break;
- case INTF_KEY_DEC_GAMMA: /* gamma - */
- if( (p_intf->p_vout != NULL) && (p_intf->p_vout->f_gamma > -INTF_GAMMA_LIMIT) )
- {
- vlc_mutex_lock( &p_intf->p_vout->change_lock );
- p_intf->p_vout->f_gamma -= INTF_GAMMA_STEP;
- p_intf->p_vout->i_changes |= VOUT_GAMMA_CHANGE;
- vlc_mutex_unlock( &p_intf->p_vout->change_lock );
- }
- break;
- case INTF_KEY_INC_GAMMA: /* gamma + */
- if( (p_intf->p_vout != NULL) && (p_intf->p_vout->f_gamma < INTF_GAMMA_LIMIT) )
- {
- vlc_mutex_lock( &p_intf->p_vout->change_lock );
- p_intf->p_vout->f_gamma += INTF_GAMMA_STEP;
- p_intf->p_vout->i_changes |= VOUT_GAMMA_CHANGE;
- vlc_mutex_unlock( &p_intf->p_vout->change_lock );
- }
- break;
- case INTF_KEY_TOGGLE_GRAYSCALE: /* toggle grayscale */
- if( p_intf->p_vout != NULL )
- {
- vlc_mutex_lock( &p_intf->p_vout->change_lock );
- p_intf->p_vout->b_grayscale = !p_intf->p_vout->b_grayscale;
- p_intf->p_vout->i_changes |= VOUT_GRAYSCALE_CHANGE;
- vlc_mutex_unlock( &p_intf->p_vout->change_lock );
- }
- break;
- case INTF_KEY_TOGGLE_INTERFACE: /* toggle interface */
- if( p_intf->p_vout != NULL )
- {
- vlc_mutex_lock( &p_intf->p_vout->change_lock );
- p_intf->p_vout->b_interface = !p_intf->p_vout->b_interface;
- p_intf->p_vout->i_changes |= VOUT_INTF_CHANGE;
- vlc_mutex_unlock( &p_intf->p_vout->change_lock );
- }
- break;
- case INTF_KEY_TOGGLE_INFO: /* toggle info */
- if( p_intf->p_vout != NULL )
- {
- vlc_mutex_lock( &p_intf->p_vout->change_lock );
- p_intf->p_vout->b_info = !p_intf->p_vout->b_info;
- p_intf->p_vout->i_changes |= VOUT_INFO_CHANGE;
- vlc_mutex_unlock( &p_intf->p_vout->change_lock );
- }
- break;
- case INTF_KEY_TOGGLE_SCALING: /* toggle scaling */
- if( p_intf->p_vout != NULL )
- {
- vlc_mutex_lock( &p_intf->p_vout->change_lock );
- p_intf->p_vout->b_scale = !p_intf->p_vout->b_scale;
- p_intf->p_vout->i_changes |= VOUT_SCALE_CHANGE;
- vlc_mutex_unlock( &p_intf->p_vout->change_lock );
- }
- break;
- default: /* unknown key */
- return( 1 );