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

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