From: David ‘Bombe’ Roden Date: Thu, 14 Mar 2013 18:49:12 +0000 (+0100) Subject: Add container for format data. X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=026df9d8d6f298230a360b0fce99fd854b0633e8;p=sonitus.git Add container for format data. --- diff --git a/src/main/java/net/pterodactylus/sonitus/data/Format.java b/src/main/java/net/pterodactylus/sonitus/data/Format.java new file mode 100644 index 0000000..0657e33 --- /dev/null +++ b/src/main/java/net/pterodactylus/sonitus/data/Format.java @@ -0,0 +1,80 @@ +/* + * Sonitus - Format.java - Copyright © 2013 David Roden + * + * This program 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. + * + * This program 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 this program. If not, see . + */ + +package net.pterodactylus.sonitus.data; + +/** + * A format is a combination of a number of channels, a sampling frequency, and + * an encoding scheme. + * + * @author David ‘Bombe’ Roden + */ +public class Format { + + /** The number of channels of this format. */ + private final int channels; + + /** The sampling frequency of this format. */ + private final int frequency; + + /** The encoding of this format. */ + private final String encoding; + + /** + * Creates a new format. + * + * @param channels + * The number of channels of this format + * @param frequency + * The sampling frequency of this format + * @param encoding + * The encoding of this format + */ + public Format(int channels, int frequency, String encoding) { + this.channels = channels; + this.frequency = frequency; + this.encoding = encoding; + } + + /** + * Returns the number of channels of this format. + * + * @return The number of channels of this format + */ + public int channels() { + return channels; + } + + /** + * Returns the sampling frequency of this format. + * + * @return The sampling frequency of this format + */ + public int frequency() { + return frequency; + } + + /** + * Returns the encoding of this format + * + * @return The encoding of this format + */ + public String encoding() { + return encoding; + } + +}