summaryrefslogtreecommitdiff
path: root/songdbj/org/tritonus/share/sampled/TAudioFormat.java
diff options
context:
space:
mode:
authorMichiel Van Der Kolk <not.valid@email.address>2005-07-11 15:42:37 +0000
committerMichiel Van Der Kolk <not.valid@email.address>2005-07-11 15:42:37 +0000
commit9fee0ec4ca0c5b7a334cc29dbb58e76c7a4c736e (patch)
tree4c304cd4151020bd5494d279ee68a105ae3a5a3a /songdbj/org/tritonus/share/sampled/TAudioFormat.java
parentdfa8ecbe609ca8ea194d08560a44fb9a92e94b4b (diff)
downloadrockbox-9fee0ec4ca0c5b7a334cc29dbb58e76c7a4c736e.tar.gz
rockbox-9fee0ec4ca0c5b7a334cc29dbb58e76c7a4c736e.zip
Songdb java version, source. only 1.5 compatible
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7101 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'songdbj/org/tritonus/share/sampled/TAudioFormat.java')
-rw-r--r--songdbj/org/tritonus/share/sampled/TAudioFormat.java110
1 files changed, 110 insertions, 0 deletions
diff --git a/songdbj/org/tritonus/share/sampled/TAudioFormat.java b/songdbj/org/tritonus/share/sampled/TAudioFormat.java
new file mode 100644
index 0000000000..7911d5e005
--- /dev/null
+++ b/songdbj/org/tritonus/share/sampled/TAudioFormat.java
@@ -0,0 +1,110 @@
1/*
2 * TAudioFormat.java
3 *
4 * This file is part of Tritonus: http://www.tritonus.org/
5 */
6
7/*
8 * Copyright (c) 2003 by Matthias Pfisterer
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU Library General Public License as published
12 * by the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Library General Public License for more details.
19 *
20 * You should have received a copy of the GNU Library General Public
21 * License along with this program; if not, write to the Free Software
22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 */
24
25/*
26|<--- this code is formatted to fit into 80 columns --->|
27*/
28
29package org.tritonus.share.sampled;
30
31import java.util.Collections;
32import java.util.HashMap;
33import java.util.Map;
34
35import javax.sound.sampled.AudioFormat;
36
37
38
39public class TAudioFormat
40extends AudioFormat
41{
42 private Map<String, Object> m_properties;
43 private Map<String, Object> m_unmodifiableProperties;
44
45
46 public TAudioFormat(AudioFormat.Encoding encoding,
47 float sampleRate,
48 int sampleSizeInBits,
49 int channels,
50 int frameSize,
51 float frameRate,
52 boolean bigEndian,
53 Map<String, Object> properties)
54 {
55 super(encoding,
56 sampleRate,
57 sampleSizeInBits,
58 channels,
59 frameSize,
60 frameRate,
61 bigEndian);
62 initMaps(properties);
63 }
64
65
66 public TAudioFormat(float sampleRate,
67 int sampleSizeInBits,
68 int channels,
69 boolean signed,
70 boolean bigEndian,
71 Map<String, Object> properties)
72 {
73 super(sampleRate,
74 sampleSizeInBits,
75 channels,
76 signed,
77 bigEndian);
78 initMaps(properties);
79 }
80
81
82
83 private void initMaps(Map<String, Object> properties)
84 {
85 /* Here, we make a shallow copy of the map. It's unclear if this
86 is sufficient (or if a deep copy should be made).
87 */
88 m_properties = new HashMap<String, Object>();
89 m_properties.putAll(properties);
90 m_unmodifiableProperties = Collections.unmodifiableMap(m_properties);
91 }
92
93
94
95 public Map<String, Object> properties()
96 {
97 return m_unmodifiableProperties;
98 }
99
100
101
102 protected void setProperty(String key, Object value)
103 {
104 m_properties.put(key, value);
105 }
106}
107
108
109
110/*** TAudioFormat.java ***/