toggle method

PlayingRoute toggle()

Note: this only makes sense because we have exactly two playing routes. If that ever was to change, this method would need to be removed.

Implementation

PlayingRoute toggle() {
  switch (this) {
    case PlayingRoute.SPEAKERS:
      return PlayingRoute.EARPIECE;
    case PlayingRoute.EARPIECE:
      return PlayingRoute.SPEAKERS;
  }
}