在令牌" int"上说语法错误,删除此令牌

时间:2015-03-09 21:40:53

标签: java android

in line“int k = 2 * AudioTrack.getMinBufferSize(paramInt1,i,j);”给我标题错误,我打字不知道为什么给我这个错误,有什么不对? (我的ide = eclipse)

public class EmuMedia
{
private static SurfaceHolder holder;
private static Emulator.OnFrameDrawnListener onFrameDrawnListener;
private static Rect region = new Rect();
private static AudioTrack track;
private static float volume = AudioTrack.getMaxVolume();

static boolean audioCreate(int paramInt1, int paramInt2, int paramInt3)
{
  int i = 3;
  int j;
  if (paramInt2 == 16)
  {
    j = 2;
    if (paramInt3 != 2) {
      break label61;
    }
  }
  for (;;)
  {
    if ((track == null) || (track.getSampleRate() != paramInt1) ||     (track.getAudioFormat() != j) || (track.getChannelCount() != paramInt3)) {
      break label66;
    }
    return true;
    j = i;
    break;
    label61:
    i = 2;
  }
  label66:
   int k = 2 * AudioTrack.getMinBufferSize(paramInt1, i, j);
  if (k < 1500) {
    k = 1500;
  }
  try
  {
    track = new AudioTrack(3, paramInt1, i, j, k, 1);
    if (track.getState() == 0) {
      track = null;
    }
    if (track == null) {
      return false;
    }
  }
  catch (IllegalArgumentException localIllegalArgumentException)
  {
    for (;;)
    {
      track = null;
    }
    track.setStereoVolume(volume, volume);
  }
  return true;
}

static void audioDestroy()
{
  if (track != null)
  {
    track.stop();
    track = null;
  }
}

static void audioPause()
{
  if (track != null) {
    track.pause();
  }
}

static void audioPlay(byte[] paramArrayOfByte, int paramInt)
{
  if (track != null) {
    track.write(paramArrayOfByte, 0, paramInt);
  }
}

static void audioSetVolume(int paramInt)
{
  float f = AudioTrack.getMinVolume();
  volume = f + (AudioTrack.getMaxVolume() - f) * paramInt / 100.0F;
  if (track != null) {
    track.setStereoVolume(volume, volume);
  }
}

static void audioStart()
{
  if (track != null) {
    track.play();
  }
}

static void audioStop()
{
  if (track != null)
  {
    track.stop();
    track.flush();
  }
}

static void bitBlt(int[] paramArrayOfInt, boolean paramBoolean)
{
  Canvas localCanvas = holder.lockCanvas();
  localCanvas.drawColor(-16777216);
  if (paramBoolean) {
      localCanvas.rotate(180.0F, localCanvas.getWidth() / 2,     localCanvas.getHeight() / 2);
  }
  localCanvas.drawBitmap(paramArrayOfInt, 0, region.width(),   region.left, region.top, region.width(), region.height(), false, null);
  if (onFrameDrawnListener != null) {
    onFrameDrawnListener.onFrameDrawn(localCanvas);
  }
  holder.unlockCanvasAndPost(localCanvas);
}

static void destroy()
{
  if (track != null)
  {
    track.stop();
    track = null;
  }
}

public static void setOnFrameDrawnListener(Emulator.OnFrameDrawnListener     paramOnFrameDrawnListener)
{
  onFrameDrawnListener = paramOnFrameDrawnListener;
}

static void setSurface(SurfaceHolder paramSurfaceHolder)
{
  holder = paramSurfaceHolder;
}

static void setSurfaceRegion(int paramInt1, int paramInt2, int   paramInt3, int paramInt4)
{
  region.set(paramInt1, paramInt2, paramInt1 + paramInt3, paramInt2 +   paramInt4);
}
}

任何人都可以帮助我吗?特别感谢您的帮助

1 个答案:

答案 0 :(得分:1)

您可以在任意语句上添加标签。因此int k; label: k = 0;是完全合法的java。但是label: int k = 0;不能编译,因为声明不算作语句。但是,你真的应该只在循环语句中使用标签,即使只是在极少数情况下(例如突破嵌套循环)。你当然不应该使用标签来解决goto不受支持的事实。