ReactOS 0.4.16-dev-125-g798ea90
Collaboration diagram for mpg123 volume and equalizer:

Modules

 mpg123 status and information
 

Enumerations

enum  mpg123_channels { MPG123_LEFT =0x1 , MPG123_RIGHT =0x2 , MPG123_LR =0x3 }
 

Functions

MPG123_EXPORT int mpg123_eq (mpg123_handle *mh, enum mpg123_channels channel, int band, double val)
 
MPG123_EXPORT double mpg123_geteq (mpg123_handle *mh, enum mpg123_channels channel, int band)
 
MPG123_EXPORT int mpg123_reset_eq (mpg123_handle *mh)
 
MPG123_EXPORT int mpg123_volume (mpg123_handle *mh, double vol)
 
MPG123_EXPORT int mpg123_volume_change (mpg123_handle *mh, double change)
 
MPG123_EXPORT int mpg123_getvolume (mpg123_handle *mh, double *base, double *really, double *rva_db)
 

Detailed Description

Enumeration Type Documentation

◆ mpg123_channels

another channel enumeration, for left/right choice

Enumerator
MPG123_LEFT 

The Left Channel.

MPG123_RIGHT 

The Right Channel.

MPG123_LR 

Both left and right channel; same as MPG123_LEFT|MPG123_RIGHT

Definition at line 936 of file mpg123.h.

937{
938 MPG123_LEFT=0x1
939 ,MPG123_RIGHT=0x2
940 ,MPG123_LR=0x3
941};
@ MPG123_LEFT
Definition: mpg123.h:938
@ MPG123_RIGHT
Definition: mpg123.h:939
@ MPG123_LR
Definition: mpg123.h:940

Function Documentation

◆ mpg123_eq()

MPG123_EXPORT int mpg123_eq ( mpg123_handle mh,
enum mpg123_channels  channel,
int  band,
double  val 
)

Set the 32 Band Audio Equalizer settings.

Parameters
mhhandle
channelCan be MPG123_LEFT, MPG123_RIGHT or MPG123_LEFT|MPG123_RIGHT for both.
bandThe equaliser band to change (from 0 to 31)
valThe (linear) adjustment factor.
Returns
MPG123_OK on success

Definition at line 416 of file libmpg123.c.

417{
418#ifndef NO_EQUALIZER
419 if(mh == NULL) return MPG123_BAD_HANDLE;
420 if(band < 0 || band > 31){ mh->err = MPG123_BAD_BAND; return MPG123_ERR; }
421 switch(channel)
422 {
424 mh->equalizer[0][band] = mh->equalizer[1][band] = DOUBLE_TO_REAL(val);
425 break;
426 case MPG123_LEFT: mh->equalizer[0][band] = DOUBLE_TO_REAL(val); break;
427 case MPG123_RIGHT: mh->equalizer[1][band] = DOUBLE_TO_REAL(val); break;
428 default:
430 return MPG123_ERR;
431 }
433#endif
434 return MPG123_OK;
435}
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
GLuint GLfloat * val
Definition: glext.h:7180
@ MPG123_BAD_CHANNEL
Definition: mpg123.h:385
@ MPG123_BAD_HANDLE
Definition: mpg123.h:393
@ MPG123_ERR
Definition: mpg123.h:382
@ MPG123_BAD_BAND
Definition: mpg123.h:399
@ MPG123_OK
Definition: mpg123.h:383
#define DOUBLE_TO_REAL(x)
real equalizer[2][32]
Definition: frame.h:127

◆ mpg123_geteq()

MPG123_EXPORT double mpg123_geteq ( mpg123_handle mh,
enum mpg123_channels  channel,
int  band 
)

Get the 32 Band Audio Equalizer settings.

Parameters
mhhandle
channelCan be MPG123_LEFT, MPG123_RIGHT or MPG123_LEFT|MPG123_RIGHT for (arithmetic mean of) both.
bandThe equaliser band to change (from 0 to 31)
Returns
The (linear) adjustment factor (zero for pad parameters)

Definition at line 437 of file libmpg123.c.

438{
439 double ret = 0.;
440#ifndef NO_EQUALIZER
441
442 /* Handle this gracefully. When there is no band, it has no volume. */
443 if(mh != NULL && band > -1 && band < 32)
444 switch(channel)
445 {
447 ret = 0.5*(REAL_TO_DOUBLE(mh->equalizer[0][band])+REAL_TO_DOUBLE(mh->equalizer[1][band]));
448 break;
449 case MPG123_LEFT: ret = REAL_TO_DOUBLE(mh->equalizer[0][band]); break;
450 case MPG123_RIGHT: ret = REAL_TO_DOUBLE(mh->equalizer[1][band]); break;
451 /* Default case is already handled: ret = 0 */
452 }
453#endif
454 return ret;
455}
#define REAL_TO_DOUBLE(x)
int ret

◆ mpg123_getvolume()

MPG123_EXPORT int mpg123_getvolume ( mpg123_handle mh,
double base,
double really,
double rva_db 
)

Return current volume setting, the actual value due to RVA, and the RVA adjustment itself. It's all as double float value to abstract the sample format. The volume values are linear factors / amplitudes (not percent) and the RVA value is in decibels.

Parameters
mhhandle
basereturn address for base volume (linear factor)
reallyreturn address for actual volume (linear factor)
rva_dbreturn address for RVA value (decibels)
Returns
MPG123_OK on success

Definition at line 1045 of file frame.c.

1046{
1047 if(mh == NULL) return MPG123_ERR;
1048 if(base) *base = mh->p.outscale;
1049 if(really) *really = mh->lastscale;
1050 get_rva(mh, NULL, rva_db);
1051 return MPG123_OK;
1052}
static int get_rva(mpg123_handle *fr, double *peak, double *gain)
Definition: frame.c:991
struct mpg123_pars_struct p
Definition: frame.h:289
double lastscale
Definition: frame.h:237

◆ mpg123_reset_eq()

MPG123_EXPORT int mpg123_reset_eq ( mpg123_handle mh)

Reset the 32 Band Audio Equalizer settings to flat

Parameters
mhhandle
Returns
MPG123_OK on success

Definition at line 172 of file frame.c.

173{
174 int i;
175 if(mh == NULL) return MPG123_BAD_HANDLE;
176#ifndef NO_EQUALIZER
177 mh->have_eq_settings = 0;
178 for(i=0; i < 32; ++i) mh->equalizer[0][i] = mh->equalizer[1][i] = DOUBLE_TO_REAL(1.0);
179#endif
180 return MPG123_OK;
181}
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248

Referenced by frame_init_par().

◆ mpg123_volume()

MPG123_EXPORT int mpg123_volume ( mpg123_handle mh,
double  vol 
)

Set the absolute output volume including the RVA setting, vol<0 just applies (a possibly changed) RVA setting.

Parameters
mhhandle
volvolume value (linear factor)
Returns
MPG123_OK on success

Definition at line 980 of file frame.c.

981{
982 if(mh == NULL) return MPG123_ERR;
983
984 if(vol >= 0) mh->p.outscale = vol;
985 else mh->p.outscale = 0.;
986
987 do_rva(mh);
988 return MPG123_OK;
989}
#define do_rva
Definition: intsym.h:190

Referenced by mpg123_volume_change().

◆ mpg123_volume_change()

MPG123_EXPORT int mpg123_volume_change ( mpg123_handle mh,
double  change 
)

Adjust output volume including the RVA setting by chosen amount

Parameters
mhhandle
changevolume value (linear factor increment)
Returns
MPG123_OK on success

Definition at line 974 of file frame.c.

975{
976 if(mh == NULL) return MPG123_ERR;
977 return mpg123_volume(mh, change + (double) mh->p.outscale);
978}
int attribute_align_arg mpg123_volume(mpg123_handle *mh, double vol)
Definition: frame.c:980