Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
27d3451a
D
dragonwell8_jdk
项目概览
openanolis
/
dragonwell8_jdk
通知
4
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_jdk
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
27d3451a
编写于
8月 16, 2013
作者:
S
serb
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8005980: [findbugs] More com.sun.media.sound.* warnings
Reviewed-by: art, prr
上级
a3ba31ae
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
55 addition
and
41 deletion
+55
-41
src/share/classes/com/sun/media/sound/DataPusher.java
src/share/classes/com/sun/media/sound/DataPusher.java
+17
-9
src/share/classes/com/sun/media/sound/ModelStandardDirector.java
...re/classes/com/sun/media/sound/ModelStandardDirector.java
+10
-9
src/share/classes/com/sun/media/sound/ModelStandardIndexedDirector.java
...ses/com/sun/media/sound/ModelStandardIndexedDirector.java
+13
-12
src/share/classes/com/sun/media/sound/SoftMixingClip.java
src/share/classes/com/sun/media/sound/SoftMixingClip.java
+4
-2
src/share/classes/sun/audio/AudioData.java
src/share/classes/sun/audio/AudioData.java
+11
-9
未找到文件。
src/share/classes/com/sun/media/sound/DataPusher.java
浏览文件 @
27d3451a
...
@@ -25,6 +25,8 @@
...
@@ -25,6 +25,8 @@
package
com.sun.media.sound
;
package
com.sun.media.sound
;
import
java.util.Arrays
;
import
javax.sound.sampled.*
;
import
javax.sound.sampled.*
;
/**
/**
...
@@ -46,11 +48,11 @@ public final class DataPusher implements Runnable {
...
@@ -46,11 +48,11 @@ public final class DataPusher implements Runnable {
private
final
AudioFormat
format
;
private
final
AudioFormat
format
;
// stream as source data
// stream as source data
private
AudioInputStream
ais
=
null
;
private
final
AudioInputStream
ais
;
// byte array as source data
// byte array as source data
private
byte
[]
audioData
=
null
;
private
final
byte
[]
audioData
;
private
int
audioDataByteLength
=
0
;
private
final
int
audioDataByteLength
;
private
int
pos
;
private
int
pos
;
private
int
newPos
=
-
1
;
private
int
newPos
=
-
1
;
private
boolean
looping
;
private
boolean
looping
;
...
@@ -67,16 +69,22 @@ public final class DataPusher implements Runnable {
...
@@ -67,16 +69,22 @@ public final class DataPusher implements Runnable {
private
final
int
BUFFER_SIZE
=
16384
;
private
final
int
BUFFER_SIZE
=
16384
;
public
DataPusher
(
SourceDataLine
sourceLine
,
AudioFormat
format
,
byte
[]
audioData
,
int
byteLength
)
{
public
DataPusher
(
SourceDataLine
sourceLine
,
AudioFormat
format
,
byte
[]
audioData
,
int
byteLength
)
{
this
.
audioData
=
audioData
;
this
(
sourceLine
,
format
,
null
,
audioData
,
byteLength
);
this
.
audioDataByteLength
=
byteLength
;
this
.
format
=
format
;
this
.
source
=
sourceLine
;
}
}
public
DataPusher
(
SourceDataLine
sourceLine
,
AudioInputStream
ais
)
{
public
DataPusher
(
SourceDataLine
sourceLine
,
AudioInputStream
ais
)
{
this
(
sourceLine
,
ais
.
getFormat
(),
ais
,
null
,
0
);
}
private
DataPusher
(
final
SourceDataLine
source
,
final
AudioFormat
format
,
final
AudioInputStream
ais
,
final
byte
[]
audioData
,
final
int
audioDataByteLength
)
{
this
.
source
=
source
;
this
.
format
=
format
;
this
.
ais
=
ais
;
this
.
ais
=
ais
;
this
.
format
=
ais
.
getFormat
();
this
.
audioDataByteLength
=
audioDataByteLength
;
this
.
source
=
sourceLine
;
this
.
audioData
=
audioData
==
null
?
null
:
Arrays
.
copyOf
(
audioData
,
audioData
.
length
);
}
}
public
synchronized
void
start
()
{
public
synchronized
void
start
()
{
...
...
src/share/classes/com/sun/media/sound/ModelStandardDirector.java
浏览文件 @
27d3451a
...
@@ -24,6 +24,8 @@
...
@@ -24,6 +24,8 @@
*/
*/
package
com.sun.media.sound
;
package
com.sun.media.sound
;
import
java.util.Arrays
;
/**
/**
* A standard director who chooses performers
* A standard director who chooses performers
* by there keyfrom,keyto,velfrom,velto properties.
* by there keyfrom,keyto,velfrom,velto properties.
...
@@ -32,17 +34,16 @@ package com.sun.media.sound;
...
@@ -32,17 +34,16 @@ package com.sun.media.sound;
*/
*/
public
final
class
ModelStandardDirector
implements
ModelDirector
{
public
final
class
ModelStandardDirector
implements
ModelDirector
{
ModelPerformer
[]
performers
;
private
final
ModelPerformer
[]
performers
;
ModelDirectedPlayer
player
;
private
final
ModelDirectedPlayer
player
;
boolean
noteOnUsed
=
false
;
private
boolean
noteOnUsed
=
false
;
boolean
noteOffUsed
=
false
;
private
boolean
noteOffUsed
=
false
;
public
ModelStandardDirector
(
ModelPerformer
[]
performers
,
public
ModelStandardDirector
(
final
ModelPerformer
[]
performers
,
ModelDirectedPlayer
player
)
{
final
ModelDirectedPlayer
player
)
{
this
.
performers
=
performers
;
this
.
performers
=
Arrays
.
copyOf
(
performers
,
performers
.
length
)
;
this
.
player
=
player
;
this
.
player
=
player
;
for
(
int
i
=
0
;
i
<
performers
.
length
;
i
++)
{
for
(
final
ModelPerformer
p
:
this
.
performers
)
{
ModelPerformer
p
=
performers
[
i
];
if
(
p
.
isReleaseTriggered
())
{
if
(
p
.
isReleaseTriggered
())
{
noteOffUsed
=
true
;
noteOffUsed
=
true
;
}
else
{
}
else
{
...
...
src/share/classes/com/sun/media/sound/ModelStandardIndexedDirector.java
浏览文件 @
27d3451a
...
@@ -24,6 +24,8 @@
...
@@ -24,6 +24,8 @@
*/
*/
package
com.sun.media.sound
;
package
com.sun.media.sound
;
import
java.util.Arrays
;
/**
/**
* A standard indexed director who chooses performers
* A standard indexed director who chooses performers
* by there keyfrom,keyto,velfrom,velto properties.
* by there keyfrom,keyto,velfrom,velto properties.
...
@@ -32,22 +34,21 @@ package com.sun.media.sound;
...
@@ -32,22 +34,21 @@ package com.sun.media.sound;
*/
*/
public
final
class
ModelStandardIndexedDirector
implements
ModelDirector
{
public
final
class
ModelStandardIndexedDirector
implements
ModelDirector
{
ModelPerformer
[]
performers
;
private
final
ModelPerformer
[]
performers
;
ModelDirectedPlayer
player
;
private
final
ModelDirectedPlayer
player
;
boolean
noteOnUsed
=
false
;
private
boolean
noteOnUsed
=
false
;
boolean
noteOffUsed
=
false
;
private
boolean
noteOffUsed
=
false
;
// Variables needed for index
// Variables needed for index
byte
[][]
trantables
;
private
byte
[][]
trantables
;
int
[]
counters
;
private
int
[]
counters
;
int
[][]
mat
;
private
int
[][]
mat
;
public
ModelStandardIndexedDirector
(
ModelPerformer
[]
performers
,
public
ModelStandardIndexedDirector
(
final
ModelPerformer
[]
performers
,
ModelDirectedPlayer
player
)
{
final
ModelDirectedPlayer
player
)
{
this
.
performers
=
performers
;
this
.
performers
=
Arrays
.
copyOf
(
performers
,
performers
.
length
)
;
this
.
player
=
player
;
this
.
player
=
player
;
for
(
int
i
=
0
;
i
<
performers
.
length
;
i
++)
{
for
(
final
ModelPerformer
p
:
this
.
performers
)
{
ModelPerformer
p
=
performers
[
i
];
if
(
p
.
isReleaseTriggered
())
{
if
(
p
.
isReleaseTriggered
())
{
noteOffUsed
=
true
;
noteOffUsed
=
true
;
}
else
{
}
else
{
...
...
src/share/classes/com/sun/media/sound/SoftMixingClip.java
浏览文件 @
27d3451a
...
@@ -38,7 +38,7 @@ import javax.sound.sampled.LineEvent;
...
@@ -38,7 +38,7 @@ import javax.sound.sampled.LineEvent;
import
javax.sound.sampled.LineUnavailableException
;
import
javax.sound.sampled.LineUnavailableException
;
/**
/**
* Clip implemention for the SoftMixingMixer.
* Clip implement
at
ion for the SoftMixingMixer.
*
*
* @author Karl Helgason
* @author Karl Helgason
*/
*/
...
@@ -357,7 +357,9 @@ public final class SoftMixingClip extends SoftMixingDataLine implements Clip {
...
@@ -357,7 +357,9 @@ public final class SoftMixingClip extends SoftMixingDataLine implements Clip {
throw
new
IllegalArgumentException
(
throw
new
IllegalArgumentException
(
"Buffer size does not represent an integral number of sample frames!"
);
"Buffer size does not represent an integral number of sample frames!"
);
this
.
data
=
data
;
if
(
data
!=
null
)
{
this
.
data
=
Arrays
.
copyOf
(
data
,
data
.
length
);
}
this
.
offset
=
offset
;
this
.
offset
=
offset
;
this
.
bufferSize
=
bufferSize
;
this
.
bufferSize
=
bufferSize
;
this
.
format
=
format
;
this
.
format
=
format
;
...
...
src/share/classes/sun/audio/AudioData.java
浏览文件 @
27d3451a
...
@@ -26,6 +26,8 @@
...
@@ -26,6 +26,8 @@
package
sun.audio
;
package
sun.audio
;
import
java.io.*
;
import
java.io.*
;
import
java.util.Arrays
;
import
javax.sound.sampled.*
;
import
javax.sound.sampled.*
;
...
@@ -65,12 +67,11 @@ public final class AudioData {
...
@@ -65,12 +67,11 @@ public final class AudioData {
/**
/**
* Constructor
* Constructor
*/
*/
public
AudioData
(
byte
buffer
[])
{
public
AudioData
(
final
byte
[]
buffer
)
{
// if we cannot extract valid format information, we resort to assuming
this
.
buffer
=
buffer
;
// the data will be 8k mono u-law in order to provide maximal backwards
// if we cannot extract valid format information, we resort to assuming the data will be 8k mono u-law
// compatibility....
// in order to provide maximal backwards compatibility....
this
(
DEFAULT_FORMAT
,
buffer
);
this
.
format
=
DEFAULT_FORMAT
;
// okay, we need to extract the format and the byte buffer of data
// okay, we need to extract the format and the byte buffer of data
try
{
try
{
...
@@ -90,9 +91,10 @@ public final class AudioData {
...
@@ -90,9 +91,10 @@ public final class AudioData {
* Non-public constructor; this is the one we use in ADS and CADS
* Non-public constructor; this is the one we use in ADS and CADS
* constructors.
* constructors.
*/
*/
AudioData
(
AudioFormat
format
,
byte
[]
buffer
)
{
AudioData
(
final
AudioFormat
format
,
final
byte
[]
buffer
)
{
this
.
format
=
format
;
this
.
format
=
format
;
this
.
buffer
=
buffer
;
if
(
buffer
!=
null
)
{
this
.
buffer
=
Arrays
.
copyOf
(
buffer
,
buffer
.
length
);
}
}
}
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录