aboutsummaryrefslogtreecommitdiff
path: root/subsonic-main/src/main/java/net/sourceforge/subsonic/domain/TranscodeScheme.java
diff options
context:
space:
mode:
Diffstat (limited to 'subsonic-main/src/main/java/net/sourceforge/subsonic/domain/TranscodeScheme.java')
-rw-r--r--subsonic-main/src/main/java/net/sourceforge/subsonic/domain/TranscodeScheme.java104
1 files changed, 0 insertions, 104 deletions
diff --git a/subsonic-main/src/main/java/net/sourceforge/subsonic/domain/TranscodeScheme.java b/subsonic-main/src/main/java/net/sourceforge/subsonic/domain/TranscodeScheme.java
deleted file mode 100644
index f45b452a..00000000
--- a/subsonic-main/src/main/java/net/sourceforge/subsonic/domain/TranscodeScheme.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- This file is part of Subsonic.
-
- Subsonic is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- Subsonic is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with Subsonic. If not, see <http://www.gnu.org/licenses/>.
-
- Copyright 2009 (C) Sindre Mehus
- */
-package net.sourceforge.subsonic.domain;
-
-/**
- * Enumeration of transcoding schemes. Transcoding is the process of
- * converting an audio stream to a lower bit rate.
- *
- * @author Sindre Mehus
- */
-public enum TranscodeScheme {
-
- OFF(0),
- MAX_32(32),
- MAX_40(40),
- MAX_48(48),
- MAX_56(56),
- MAX_64(64),
- MAX_80(80),
- MAX_96(96),
- MAX_112(112),
- MAX_128(128),
- MAX_160(160),
- MAX_192(192),
- MAX_224(224),
- MAX_256(256),
- MAX_320(320);
-
- private int maxBitRate;
-
- TranscodeScheme(int maxBitRate) {
- this.maxBitRate = maxBitRate;
- }
-
- /**
- * Returns the maximum bit rate for this transcoding scheme.
- *
- * @return The maximum bit rate for this transcoding scheme.
- */
- public int getMaxBitRate() {
- return maxBitRate;
- }
-
- /**
- * Returns the strictest transcode scheme (i.e., the scheme with the lowest max bitrate).
- *
- * @param other The other transcode scheme. May be <code>null</code>, in which case 'this' is returned.
- * @return The strictest scheme.
- */
- public TranscodeScheme strictest(TranscodeScheme other) {
- if (other == null || other == TranscodeScheme.OFF) {
- return this;
- }
-
- if (this == TranscodeScheme.OFF) {
- return other;
- }
-
- return maxBitRate < other.maxBitRate ? this : other;
- }
-
- /**
- * Returns a human-readable string representation of this object.
- *
- * @return A human-readable string representation of this object.
- */
- public String toString() {
- if (this == OFF) {
- return "No limit";
- }
- return "" + getMaxBitRate() + " Kbps";
- }
-
- /**
- * Returns the enum constant which corresponds to the given max bit rate.
- *
- * @param maxBitRate The max bit rate.
- * @return The corresponding enum, or <code>null</code> if not found.
- */
- public static TranscodeScheme valueOf(int maxBitRate) {
- for (TranscodeScheme scheme : values()) {
- if (scheme.getMaxBitRate() == maxBitRate) {
- return scheme;
- }
- }
- return null;
- }
-}