• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 package com.jme3.audio.android;
2 
3 import com.jme3.asset.AssetKey;
4 import com.jme3.audio.AudioData;
5 import com.jme3.audio.AudioRenderer;
6 import com.jme3.util.NativeObject;
7 
8 public class AndroidAudioData extends AudioData {
9 
10     protected AssetKey<?> assetKey;
11     protected float currentVolume = 0f;
12 
AndroidAudioData()13     public AndroidAudioData(){
14         super();
15     }
16 
AndroidAudioData(int id)17     protected AndroidAudioData(int id){
18         super(id);
19     }
20 
getAssetKey()21     public AssetKey<?> getAssetKey() {
22         return assetKey;
23     }
24 
setAssetKey(AssetKey<?> assetKey)25     public void setAssetKey(AssetKey<?> assetKey) {
26         this.assetKey = assetKey;
27     }
28 
29     @Override
getDataType()30     public DataType getDataType() {
31         return DataType.Buffer;
32     }
33 
34     @Override
getDuration()35     public float getDuration() {
36         return 0; // TODO: ???
37     }
38 
39     @Override
resetObject()40     public void resetObject() {
41         this.id = -1;
42         setUpdateNeeded();
43     }
44 
45     @Override
deleteObject(Object rendererObject)46     public void deleteObject(Object rendererObject) {
47         ((AudioRenderer)rendererObject).deleteAudioData(this);
48     }
49 
getCurrentVolume()50     public float getCurrentVolume() {
51         return currentVolume;
52     }
53 
setCurrentVolume(float currentVolume)54     public void setCurrentVolume(float currentVolume) {
55         this.currentVolume = currentVolume;
56     }
57 
58     @Override
createDestructableClone()59     public NativeObject createDestructableClone() {
60         return new AndroidAudioData(id);
61     }
62 }
63