Пример #1
0
 public long getStageFinalTime() {
   if (mCurrentStage != null) {
     return mCurrentStage.getFinalTime();
   } else {
     return 0;
   }
 }
Пример #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;
  }
Пример #3
0
 public String getStageStateText() {
   if (mCurrentStage != null) {
     return mCurrentStage.getStateText();
   } else {
     return "";
   }
 }
Пример #4
0
 public long getStageNextTime() {
   if (mCurrentStage != null) {
     return mCurrentStage.getNextTime();
   } else {
     return 0;
   }
 }
Пример #5
0
 public long getStageCurrentTime() {
   if (mCurrentStage != null) {
     return mCurrentStage.getSeconds();
   } else {
     return 0;
   }
 }
Пример #6
0
 public void startNextSpeaker() {
   if (mCurrentStage != null) {
     mTickTimer.purge();
     mCurrentStage.start(mTickTimer);
     mAlertManager.hideNotification(); // Hide if already showing
     mAlertManager.showNotification(mCurrentStage);
   }
 }
Пример #7
0
 public void stop() {
   if (getDebateStatus() == DebateStatus.speaking) {
     if (mCurrentStage != null) {
       mAlertManager.hideNotification();
       mCurrentStage.cancel();
     }
   }
 }
Пример #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();
  }
Пример #9
0
  public boolean prepareNextSpeaker() {
    if (mStageIterator.hasNext()) {
      if (mCurrentStage != null) {
        mCurrentStage.cancel();
      }
      mCurrentStage = mStageIterator.next();
      return true;
    } else {
      mCurrentStage = null;
    }

    return false;
  }
Пример #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;
   }
 }
Пример #11
0
 public void pause() {
   if (mCurrentStage != null) {
     mCurrentStage.pause();
   }
 }
Пример #12
0
 public void resume() {
   if (mCurrentStage != null) {
     mCurrentStage.resume();
   }
 }
Пример #13
0
 public String getStageName() {
   if (mCurrentStage != null) {
     return mCurrentStage.getName();
   }
   return "";
 }