Exemplo n.º 1
0
void vs_setvolume(int vol) //0 - 100%
{
  if(vol <= 0) //<= 0
  {
    vs_write_reg(VS_VOL, 0xFFFF); //analog power off
  }
  else if(vol > 100) //> 100
  {
    vs_vol = 100;
    if(vs_playing)
    {
      vs_write_volume();
    }
  }
  else //1 - 99
  {
    vs_vol = vol;
    if(vs_playing)
    {
      vs_write_volume();
    }
  }

  menu_drawvol();

  return;
}
Exemplo n.º 2
0
void vs_setvolume(int unit, int vol) //0 - 100%
{
  if(vol <= 0) //<= 0
  {
    vs_write_reg(unit, VS_VOL, 0xFFFF); //analog power off
  }
  else if(vol > 100) //> 100
  {
    vs_vol = 100;
    if(vs_status[unit].vs_playing)
    {
      vs_write_volume(unit);
    }
  }
  else //1 - 99
  {
	vs_status[unit].vs_vol = vol;
    if(vs_status[unit].vs_playing)
    {
      vs_write_volume(unit);
    }
  }

  return;
}
Exemplo n.º 3
0
void audio_set_volume(int vol) //0 - 100%
{
  if(vol <= 0) //<= 0
  {
	  vs_write_volume(0);
  }
  else if(vol > 100) //> 100
  {
      vs_write_volume(100);
  }
  else //1 - 99
  {
      vs_write_volume(vol);
  }

  return;
}