Commit 9be218d5 authored by Renaud Dartus's avatar Renaud Dartus

Ajout des fonctions de r�glage du volume (touches : +, -, m)
parent a61212cc
......@@ -57,12 +57,19 @@
/* Default stereo mode (0 stands for mono, 1 for stereo) */
#define AOUT_DEFAULT_STEREO 1
/* #define AOUT_DEFAULT_STEREO 0 */
/* Audio output rate, in Hz */
#define AOUT_MIN_RATE 22050 /* XXX?? */
#define AOUT_DEFAULT_RATE 44100
#define AOUT_MAX_RATE 48000
/* Volume (default 100) */
#define VOL 100
#define VOLSTEP 5
#define VOLMAX 300
/* Number of audio output frames contained in an audio output fifo.
* (AOUT_FIFO_SIZE + 1) must be a power of 2, in order to optimise the
* %(AOUT_FIFO_SIZE + 1) operation with an &AOUT_FIFO_SIZE.
......@@ -227,6 +234,10 @@ typedef struct aout_thread_s
* for the OSS output */
p_aout_sys_t p_sys;
/* there is the current volume */
int vol;
} aout_thread_t;
/* Those are from <linux/soundcard.h> but are needed because of formats
......
This diff is collapsed.
......@@ -42,6 +42,8 @@
#include "plugins.h"
#include "input.h"
#include "audio_output.h"
#include "intf_msg.h"
#include "interface.h"
#include "intf_cmd.h"
......@@ -263,6 +265,8 @@ int intf_SelectChannel( intf_thread_t * p_intf, int i_channel )
*****************************************************************************/
int intf_ProcessKey( intf_thread_t *p_intf, int i_key )
{
static int i_volbackup;
switch( i_key )
{
case 'Q': /* quit order */
......@@ -286,14 +290,22 @@ int intf_ProcessKey( intf_thread_t *p_intf, int i_key )
intf_SelectChannel( p_intf, i_key - '0' );
break;
case '+': /* volume + */
/* XXX?? */
if( (p_main->p_aout != NULL) && (p_main->p_aout->vol < VOLMAX) )
p_main->p_aout->vol += VOLSTEP;
break;
case '-': /* volume - */
/* XXX?? */
if( (p_main->p_aout != NULL) && (p_main->p_aout->vol > VOLSTEP) )
p_main->p_aout->vol -= VOLSTEP;
break;
case 'M': /* toggle mute */
case 'm':
/* XXX?? */
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 'g': /* gamma - */
if( (p_intf->p_vout != NULL) && (p_intf->p_vout->f_gamma > -INTF_GAMMA_LIMIT) )
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment