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;
  }
}