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

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