private void releaseResources() {
   if (player != null) {
     try {
       player.stop();
       player.close();
     } catch (Exception e) {
     }
   }
 }
コード例 #2
0
ファイル: Notify.java プロジェクト: fin-nick/fj
 private void closePlayer() {
   if (null != player) {
     try {
       player.stop();
     } catch (Exception e) {
     }
     try {
       player.close();
     } catch (Exception e) {
     }
     player = null;
   }
 }
コード例 #3
0
 public void stop() {
   if (mPlayer == null) return; // nothing to stop
   mRunning = false;
   try {
     if (mPlayer.getState() == Player.STARTED) {
       mPlayer.stop();
     }
     if (mPlayer.getState() != Player.CLOSED) {
       mPlayer.close();
     }
   } catch (MediaException e) {
     sLogger.error("Error stopping reveive stream", e);
   }
 }
コード例 #4
0
 public static final void Tiger_Sound_Final() {
   // #if (TIGER=="TRUE")
   if (SoundPlayer != null) {
     if (SoundPlayer.getState() == Player.STARTED) {
       try {
         SoundPlayer.stop();
       } catch (Exception e) {
       }
     }
     SoundPlayer.deallocate();
     SoundPlayer.close();
     SoundPlayer = null;
   }
   ;
   // #endif
 }
コード例 #5
0
  public void stopAll() throws Exception {
    LogUtil.put(LogFactory.getInstance(CommonStrings.getInstance().START, this, "stopAll"));

    Sound[] soundInterfaceArray = soundsFactoryInterface.getSoundInterfaceArray();

    ProgressCanvas progressCanvas = ProgressCanvasFactory.getInstance();

    for (int index = 0; index < soundInterfaceArray.length; index++) {
      if (soundInterfaceArray[index] != null) {
        Player player = soundInterfaceArray[index].getPlayer();

        if (player != null) {
          player.stop();

          progressCanvas.addPortion(100, "Stopping Sound: ", index);
        }
      }
    }
  }