0657e339ecd7a931f70a3bff8f318c8d1e628757
[sonitus.git] / src / main / java / net / pterodactylus / sonitus / data / Format.java
1 /*
2  * Sonitus - Format.java - Copyright © 2013 David Roden
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
16  */
17
18 package net.pterodactylus.sonitus.data;
19
20 /**
21  * A format is a combination of a number of channels, a sampling frequency, and
22  * an encoding scheme.
23  *
24  * @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
25  */
26 public class Format {
27
28         /** The number of channels of this format. */
29         private final int channels;
30
31         /** The sampling frequency of this format. */
32         private final int frequency;
33
34         /** The encoding of this format. */
35         private final String encoding;
36
37         /**
38          * Creates a new format.
39          *
40          * @param channels
41          *              The number of channels of this format
42          * @param frequency
43          *              The sampling frequency of this format
44          * @param encoding
45          *              The encoding of this format
46          */
47         public Format(int channels, int frequency, String encoding) {
48                 this.channels = channels;
49                 this.frequency = frequency;
50                 this.encoding = encoding;
51         }
52
53         /**
54          * Returns the number of channels of this format.
55          *
56          * @return The number of channels of this format
57          */
58         public int channels() {
59                 return channels;
60         }
61
62         /**
63          * Returns the sampling frequency of this format.
64          *
65          * @return The sampling frequency of this format
66          */
67         public int frequency() {
68                 return frequency;
69         }
70
71         /**
72          * Returns the encoding of this format
73          *
74          * @return The encoding of this format
75          */
76         public String encoding() {
77                 return encoding;
78         }
79
80 }