Example #1
0
 public long getStageFinalTime() {
   if (mCurrentStage != null) {
     return mCurrentStage.getFinalTime();
   } else {
     return 0;
   }
 }
Example #2
0
  /**
   * Add a stage to the debate Has to be added in the order of the debate
   *
   * @param alarmChain
   * @param alarmSetName The name of the alarmset specified when added to the debate
   * @return
   */
  public boolean addStage(AlarmChain alarmChain, String alarmSetName) {
    if (mAlertSets.containsKey(alarmSetName)) {
      alarmChain.addTimes(mAlertSets.get(alarmSetName));

      if (alarmChain.getClass() == SpeakerTimer.class) {
        SpeakerTimer speakerTimer = (SpeakerTimer) alarmChain;
        speakerTimer.setSpeakersManager(mTeamsManager);
      }

      mStages.add(alarmChain);

      mStageIterator = mStages.iterator();
      return true;
    }
    return false;
  }
Example #3
0
 public String getStageStateText() {
   if (mCurrentStage != null) {
     return mCurrentStage.getStateText();
   } else {
     return "";
   }
 }
Example #4
0
 public long getStageNextTime() {
   if (mCurrentStage != null) {
     return mCurrentStage.getNextTime();
   } else {
     return 0;
   }
 }
Example #5
0
 public long getStageCurrentTime() {
   if (mCurrentStage != null) {
     return mCurrentStage.getSeconds();
   } else {
     return 0;
   }
 }
Example #6
0
 public void startNextSpeaker() {
   if (mCurrentStage != null) {
     mTickTimer.purge();
     mCurrentStage.start(mTickTimer);
     mAlertManager.hideNotification(); // Hide if already showing
     mAlertManager.showNotification(mCurrentStage);
   }
 }
Example #7
0
 public void stop() {
   if (getDebateStatus() == DebateStatus.speaking) {
     if (mCurrentStage != null) {
       mAlertManager.hideNotification();
       mCurrentStage.cancel();
     }
   }
 }
Example #8
0
  public void reset() {
    // Stop current stage timer, if on
    if (mCurrentStage != null) {
      mCurrentStage.cancel();
    }
    mCurrentStage = null;
    mTickTimer.purge();
    mTickTimer.cancel();
    mTickTimer = new Timer();

    mAlertManager.hideNotification();

    ListIterator<AlarmChain> stageIterator = mStages.listIterator();
    while (stageIterator.hasNext()) {
      AlarmChain stage = stageIterator.next();
      stage.cancel();
      stageIterator.set(stage.newCopy());
    }

    mStageIterator = mStages.iterator();
  }
Example #9
0
  public boolean prepareNextSpeaker() {
    if (mStageIterator.hasNext()) {
      if (mCurrentStage != null) {
        mCurrentStage.cancel();
      }
      mCurrentStage = mStageIterator.next();
      return true;
    } else {
      mCurrentStage = null;
    }

    return false;
  }
Example #10
0
 public DebateStatus getDebateStatus() {
   if (mCurrentStage != null) {
     switch (mCurrentStage.getRunningState()) {
       case Running:
         return DebateStatus.speaking;
       case Paused:
         return DebateStatus.paused;
       case Finished:
         if (!mStageIterator.hasNext()) {
           return DebateStatus.finished;
         }
       case Stopped:
       default:
         return DebateStatus.transitioning;
     }
   } else {
     return DebateStatus.setup;
   }
 }
Example #11
0
 public void pause() {
   if (mCurrentStage != null) {
     mCurrentStage.pause();
   }
 }
Example #12
0
 public void resume() {
   if (mCurrentStage != null) {
     mCurrentStage.resume();
   }
 }
Example #13
0
 public String getStageName() {
   if (mCurrentStage != null) {
     return mCurrentStage.getName();
   }
   return "";
 }