Пример #1
0
 private static void checkAndPlayClip(Clip clip) {
   try {
     if (clip != null) {
       String soundsOn = PreferencesDialog.getCachedValue(PreferencesDialog.KEY_SOUNDS_ON, "true");
       if (soundsOn.equals("true")) {
         audioManager.play(clip);
       }
     }
   } catch (Exception e) {
     e.printStackTrace();
   }
 }
Пример #2
0
 private void btnLeftActionPerformed(
     java.awt.event.ActionEvent evt) { // GEN-FIRST:event_btnLeftActionPerformed
   this.selected = true;
   session.sendPlayerBoolean(gameId, true);
   AudioManager.playButtonCancel();
 } // GEN-LAST:event_btnLeftActionPerformed
Пример #3
0
  public static AudioManager getManager() {
    if (audioManager == null) {
      audioManager = new AudioManager();
      audioManager.nextPageClip =
          audioManager.loadClip(
              Constants.BASE_SOUND_PATH + "OnPrevPage.wav"); // sounds better than OnNextPage
      audioManager.prevPageClip =
          audioManager.loadClip(Constants.BASE_SOUND_PATH + "OnPrevPage.wav");
      audioManager.anotherTabClip =
          audioManager.loadClip(Constants.BASE_SOUND_PATH + "OnNextPage.wav");
      audioManager.nextPhaseClip =
          audioManager.loadClip(Constants.BASE_SOUND_PATH + "OnNextPhase.wav");
      audioManager.endTurnClip = audioManager.loadClip(Constants.BASE_SOUND_PATH + "OnEndTurn.wav");
      audioManager.tapPermanentClip =
          audioManager.loadClip(Constants.BASE_SOUND_PATH + "OnTapPermanent.wav");
      audioManager.summonClip = audioManager.loadClip(Constants.BASE_SOUND_PATH + "OnSummon.wav");
      audioManager.diedCreatureClip =
          audioManager.loadClip(Constants.BASE_SOUND_PATH + "OnSummon-.wav");
      audioManager.drawClip = audioManager.loadClip(Constants.BASE_SOUND_PATH + "OnDraw.wav");
      audioManager.buttonOkClip =
          audioManager.loadClip(Constants.BASE_SOUND_PATH + "OnButtonOk.wav");
      audioManager.buttonCancelClip =
          audioManager.loadClip(Constants.BASE_SOUND_PATH + "OnButtonCancel.wav");
      audioManager.attackClip = audioManager.loadClip(Constants.BASE_SOUND_PATH + "OnAttack.wav");
      audioManager.blockClip = audioManager.loadClip(Constants.BASE_SOUND_PATH + "OnBlock.wav");
      audioManager.addPermanentClip =
          audioManager.loadClip(Constants.BASE_SOUND_PATH + "OnAddPermanent.wav");
      audioManager.addArtifactClip =
          audioManager.loadClip(Constants.BASE_SOUND_PATH + "OnAddArtifact.wav");
      audioManager.updateStackClip =
          audioManager.loadClip(Constants.BASE_SOUND_PATH + "OnStackNew.wav");
      audioManager.onHover = audioManager.loadClip(Constants.BASE_SOUND_PATH + "OnHover.wav");

      audioManager.playerJoinedTable =
          audioManager.loadClip(Constants.BASE_SOUND_PATH + "OnPlayerJoinedTable.wav");
      audioManager.playerSubmittedDeck =
          audioManager.loadClip(Constants.BASE_SOUND_PATH + "OnPlayerSubmittedDeck.wav");
      audioManager.playerLeft =
          audioManager.loadClip(Constants.BASE_SOUND_PATH + "OnPlayerLeft.wav");
      audioManager.playerWon = audioManager.loadClip(Constants.BASE_SOUND_PATH + "OnPlayerWon.wav");
      audioManager.playerLost =
          audioManager.loadClip(Constants.BASE_SOUND_PATH + "OnPlayerLost.wav");
    }
    return audioManager;
  }