class PlayerLogic {

	public int setVolume(String volumeString) {
		int volume = getVolume();
		if (volume != -1) {
			switch (volumeString) {
			case "mute":
				return setVolume(VOLUME_MUTE_VALUE);
			case "max":
			case "full":
				return setVolume(VOLUME_MAX_VALUE);
			case "up":
				volume = Math.min(VOLUME_MAX_VALUE, volume + VOLUME_UPDOWN_VALUE);
				return setVolume(volume);
			case "down":
				volume = Math.max(VOLUME_MUTE_VALUE, volume - VOLUME_UPDOWN_VALUE);
				return setVolume(volume);
			default:
				this.logger.warn("Incorrect volume command");
				return -1;
			}
		}
		return volume;
	}

}