From d00f434275bdc0c7fcb9aeb2ae9bc9b0075a3b29 Mon Sep 17 00:00:00 2001 From: Recrown Date: Fri, 1 Sep 2017 02:07:29 -0500 Subject: [PATCH] fixed issue with data cleaning thread crashing --- .../src/zero1hd/rhythmbullet/audio/Audio.java | 2 +- .../rhythmbullet/audio/AudioAnalyzer.java | 35 ++++++++++--------- .../rhythmbullet/audio/AudioDataPackage.java | 25 +++++++------ ...BasicMusicInfo.java => CoreMusicInfo.java} | 2 +- .../rhythmbullet/audio/Mp3AudioData.java | 2 +- .../rhythmbullet/audio/WavAudioData.java | 2 +- .../rhythmbullet/audio/map/GamePlayMap.java | 8 ++--- .../audio/map/RhythmMapAlgorithm.java | 4 --- .../rhythmbullet/screens/GameScreen.java | 4 +-- .../rhythmbullet/ui/pages/AnalyzePage.java | 8 ++--- .../ui/windows/BassUMGraphWindow.java | 6 ++-- .../rhythmbullet/ui/windows/BeatViewer.java | 6 ++-- .../rhythmbullet/ui/windows/MGraphWindow.java | 6 ++-- .../ui/windows/MusicController.java | 8 ++--- .../ui/windows/MusicSelector.java | 4 +-- .../rhythmbullet/ui/windows/VolumeWindow.java | 6 ++-- 16 files changed, 63 insertions(+), 65 deletions(-) rename core/src/zero1hd/rhythmbullet/audio/{BasicMusicInfo.java => CoreMusicInfo.java} (92%) diff --git a/core/src/zero1hd/rhythmbullet/audio/Audio.java b/core/src/zero1hd/rhythmbullet/audio/Audio.java index cc016cd..ddfde16 100755 --- a/core/src/zero1hd/rhythmbullet/audio/Audio.java +++ b/core/src/zero1hd/rhythmbullet/audio/Audio.java @@ -3,7 +3,7 @@ package zero1hd.rhythmbullet.audio; import com.badlogic.gdx.files.FileHandle; public class Audio { - public static BasicMusicInfo getAudioData(FileHandle file) { + public static CoreMusicInfo getAudioData(FileHandle file) { if (file.extension().equalsIgnoreCase("wav")) { return new WavAudioData(file); } else if (file.extension().equalsIgnoreCase("mp3")) { diff --git a/core/src/zero1hd/rhythmbullet/audio/AudioAnalyzer.java b/core/src/zero1hd/rhythmbullet/audio/AudioAnalyzer.java index 341476a..6c3603f 100755 --- a/core/src/zero1hd/rhythmbullet/audio/AudioAnalyzer.java +++ b/core/src/zero1hd/rhythmbullet/audio/AudioAnalyzer.java @@ -14,7 +14,7 @@ public class AudioAnalyzer { private boolean containsData; private boolean finalized; FloatFFT_1D fft; - private BasicMusicInfo audioData; + private CoreMusicInfo musicInfo; float[] audioPCM; float[] spectrum; @@ -63,7 +63,7 @@ public class AudioAnalyzer { analysisAlgorithm = () -> { progress = 0; int tasksDone = 0; - long totalTasks = audioData.getSampleCount()/audioData.getReadWindowSize(); + long totalTasks = musicInfo.getSampleCount()/musicInfo.getReadWindowSize(); bassThresholdMultiplier = 1.5f; mThresholdMultiplier = 1.4f; @@ -82,7 +82,7 @@ public class AudioAnalyzer { mThresholdCalcRange = thresholdRangeCalc(0.4f); umThresholdCalcRange = thresholdRangeCalc(0.4f); - Gdx.app.debug("Read freq", String.valueOf(audioData.getSampleRate())); + Gdx.app.debug("Read freq", String.valueOf(musicInfo.getSampleRate())); Gdx.app.debug("Using following bin ranges", "\nBass freq begin: " + bassBinBegin + "\nBass freq end: " + bassBinEnd + "\nMain freq begin: " + umBinBegin + "\nMain freq end: " + umBinEnd); Gdx.app.debug("Total tasks", String.valueOf(totalTasks)); @@ -91,10 +91,10 @@ public class AudioAnalyzer { Gdx.app.debug("Threshold Calc Range M", String.valueOf(umThresholdCalcRange)); Gdx.app.debug("Threshold Calc Range Bass", String.valueOf(bassThresholdCalcRange)); - fft = new FloatFFT_1D(audioData.getReadWindowSize()); + fft = new FloatFFT_1D(musicInfo.getReadWindowSize()); int seedDigit = 0; - while (audioData.readSamples(audioPCM) > 0 && work) { + while (musicInfo.readSamples(audioPCM) > 0 && work) { fft.realForward(audioPCM); @@ -188,7 +188,6 @@ public class AudioAnalyzer { Gdx.app.debug("Audio Analyzer", "Threshold calculated."); - //pruning data float prunnedCurrentVal; FloatArray bassPrunned = new FloatArray(); @@ -218,7 +217,7 @@ public class AudioAnalyzer { } Gdx.app.debug("Audio Analyzer", "Data prunned."); - secondsPerWindow = audioData.getReadWindowSize()/audioData.getSampleRate(); + secondsPerWindow = musicInfo.getReadWindowSize()/musicInfo.getSampleRate(); //peak detection int lastID = 0; @@ -289,16 +288,20 @@ public class AudioAnalyzer { pack = new AudioDataPackage(); pack.setBassData(bassPeaks, bassMaxValue, bassAvg); - pack.setmPeaks(mPeaks, mMaxValue, mAvg); - pack.setUmPeaks(umPeaks, umMaxValue, umAvg); + pack.setmData(mPeaks, mMaxValue, mAvg); + pack.setUmData(umPeaks, umMaxValue, umAvg); pack.setPUID(PUID); pack.setAvgSPB(avgSPB); pack.setSecPerWin(secondsPerWindow); + pack.setMusicInfo(musicInfo); - sender.send(MiniEvents.MUSIC_DATA_CLEANED); + if (work) { + finalized = true; + Gdx.app.debug("Audio Analyzer", "data cleaned and ready for map gen."); + sender.send(MiniEvents.MUSIC_DATA_CLEANED); + } }; - } public void shrinkData() { @@ -307,11 +310,11 @@ public class AudioAnalyzer { umSpectralFlux = null; } - public void startAnalyticalThread(BasicMusicInfo audiofile) { + public void startAnalyticalThread(CoreMusicInfo audiofile) { audioPCM = new float[audiofile.getReadWindowSize()]; spectrum = new float[(audiofile.getReadWindowSize()/2)+1]; lastSpectrum = new float[(audiofile.getReadWindowSize()/2)+1]; - this.audioData = audiofile; + this.musicInfo = audiofile; work = true; ExecutorService exec = Executors.newSingleThreadExecutor(); @@ -342,7 +345,7 @@ public class AudioAnalyzer { } private int thresholdRangeCalc(float durationOfRange) { - return (int) (durationOfRange/(audioData.getReadWindowSize()/audioData.getSampleRate())); + return (int) (durationOfRange/(musicInfo.getReadWindowSize()/musicInfo.getSampleRate())); } public float getBassMaxValue() { @@ -377,8 +380,8 @@ public class AudioAnalyzer { return PUID; } - public BasicMusicInfo getAudioData() { - return audioData; + public CoreMusicInfo getAudioData() { + return musicInfo; } public float getAvgSPB() { diff --git a/core/src/zero1hd/rhythmbullet/audio/AudioDataPackage.java b/core/src/zero1hd/rhythmbullet/audio/AudioDataPackage.java index d234a1f..98470ff 100755 --- a/core/src/zero1hd/rhythmbullet/audio/AudioDataPackage.java +++ b/core/src/zero1hd/rhythmbullet/audio/AudioDataPackage.java @@ -9,7 +9,7 @@ public class AudioDataPackage { private FloatArray mPeaks; private FloatArray umPeaks; - private BasicMusicInfo musicInfo; + private CoreMusicInfo musicInfo; private float bassMaxVal, bassAvg; private float mMaxVal, mAvg; @@ -25,13 +25,12 @@ public class AudioDataPackage { * @param bassAvg */ public void setBassData(FloatArray bassPeaks, float bassMaxVal, float bassAvg) { - if (bassPeaks != null) { - this.bassPeaks = bassPeaks; - this.bassMaxVal = bassMaxVal; - this.bassAvg = bassAvg; - } else { + if (this.bassPeaks != null) { throw new InvalidParameterException("The bass peaks of this audio pack has already been set."); } + this.bassPeaks = bassPeaks; + this.bassMaxVal = bassMaxVal; + this.bassAvg = bassAvg; } /** @@ -40,8 +39,8 @@ public class AudioDataPackage { * @param mMaxVal * @param mAvg */ - public void setmPeaks(FloatArray mPeaks, float mMaxVal, float mAvg) { - if (mPeaks != null) { + public void setmData(FloatArray mPeaks, float mMaxVal, float mAvg) { + if (this.mPeaks != null) { throw new InvalidParameterException("The midrange peaks of this audio pack has already been set."); } @@ -56,8 +55,8 @@ public class AudioDataPackage { * @param uMMaxVal * @param uMAvg */ - public void setUmPeaks(FloatArray umPeaks, float uMMaxVal, float uMAvg) { - if (umPeaks != null) { + public void setUmData(FloatArray umPeaks, float uMMaxVal, float uMAvg) { + if (this.umPeaks != null) { throw new InvalidParameterException("The upper midrange peaks have already been set."); } this.umPeaks = umPeaks; @@ -65,8 +64,8 @@ public class AudioDataPackage { this.uMAvg = uMAvg; } - public void setMusicInfo(BasicMusicInfo musicInfo) { - if (musicInfo != null) { + public void setMusicInfo(CoreMusicInfo musicInfo) { + if (this.musicInfo != null) { throw new InvalidParameterException("There is already music information in this package."); } this.musicInfo = musicInfo; @@ -109,7 +108,7 @@ public class AudioDataPackage { } } - public BasicMusicInfo getMusicInfo() { + public CoreMusicInfo getMusicInfo() { if (musicInfo == null) { throw new NullPointerException("Music info hasn't been baked in..."); } diff --git a/core/src/zero1hd/rhythmbullet/audio/BasicMusicInfo.java b/core/src/zero1hd/rhythmbullet/audio/CoreMusicInfo.java similarity index 92% rename from core/src/zero1hd/rhythmbullet/audio/BasicMusicInfo.java rename to core/src/zero1hd/rhythmbullet/audio/CoreMusicInfo.java index 02d84cf..36ce13e 100755 --- a/core/src/zero1hd/rhythmbullet/audio/BasicMusicInfo.java +++ b/core/src/zero1hd/rhythmbullet/audio/CoreMusicInfo.java @@ -4,7 +4,7 @@ package zero1hd.rhythmbullet.audio; import com.badlogic.gdx.audio.Music; import com.badlogic.gdx.utils.Disposable; -public interface BasicMusicInfo extends Disposable { +public interface CoreMusicInfo extends Disposable { /** * sets a integer variable to the current window of audio data the playback is at. * Useful for efficiency because we compute once for that frame then get the values everytime it is required instead of calculating every time we get the index. diff --git a/core/src/zero1hd/rhythmbullet/audio/Mp3AudioData.java b/core/src/zero1hd/rhythmbullet/audio/Mp3AudioData.java index 6a56f0c..6a9a04d 100755 --- a/core/src/zero1hd/rhythmbullet/audio/Mp3AudioData.java +++ b/core/src/zero1hd/rhythmbullet/audio/Mp3AudioData.java @@ -20,7 +20,7 @@ import javazoom.jl.decoder.Header; import javazoom.jl.decoder.MP3Decoder; import javazoom.jl.decoder.OutputBuffer; -public class Mp3AudioData implements BasicMusicInfo { +public class Mp3AudioData implements CoreMusicInfo { private int readWindowSize = 1024; private Music playbackMusic; diff --git a/core/src/zero1hd/rhythmbullet/audio/WavAudioData.java b/core/src/zero1hd/rhythmbullet/audio/WavAudioData.java index d7be12d..cb3a423 100755 --- a/core/src/zero1hd/rhythmbullet/audio/WavAudioData.java +++ b/core/src/zero1hd/rhythmbullet/audio/WavAudioData.java @@ -11,7 +11,7 @@ import com.badlogic.gdx.files.FileHandle; import zero1hd.wavedecoder.WavDecoder; -public class WavAudioData implements BasicMusicInfo { +public class WavAudioData implements CoreMusicInfo { private int readWindowSize = 1024; private AudioFormat format; int readIndex; diff --git a/core/src/zero1hd/rhythmbullet/audio/map/GamePlayMap.java b/core/src/zero1hd/rhythmbullet/audio/map/GamePlayMap.java index 156aded..400796b 100755 --- a/core/src/zero1hd/rhythmbullet/audio/map/GamePlayMap.java +++ b/core/src/zero1hd/rhythmbullet/audio/map/GamePlayMap.java @@ -1,13 +1,13 @@ package zero1hd.rhythmbullet.audio.map; -import zero1hd.rhythmbullet.audio.BasicMusicInfo; +import zero1hd.rhythmbullet.audio.CoreMusicInfo; import zero1hd.rhythmbullet.entity.Entity; import zero1hd.rhythmbullet.entity.EntityFrame; import zero1hd.rhythmbullet.entity.coordinator.Coordinator; import zero1hd.rhythmbullet.entity.coordinator.CoordinatorFrame; public class GamePlayMap { - private BasicMusicInfo musicData; + private CoreMusicInfo musicData; private MapWindowData[] spawnList; private boolean building; private int index; @@ -17,7 +17,7 @@ public class GamePlayMap { * GamePlayMap is what the game area will use to generate entities and judge current audio data * @param audioData audio data */ - public GamePlayMap(BasicMusicInfo audioData, int totalWindows) { + public GamePlayMap(CoreMusicInfo audioData, int totalWindows) { this.musicData = audioData; spawnList = new MapWindowData[totalWindows]; hudType = new byte[totalWindows]; @@ -68,7 +68,7 @@ public class GamePlayMap { index = spawnList.length-1; } - public BasicMusicInfo getMusicData() { + public CoreMusicInfo getMusicData() { return musicData; } diff --git a/core/src/zero1hd/rhythmbullet/audio/map/RhythmMapAlgorithm.java b/core/src/zero1hd/rhythmbullet/audio/map/RhythmMapAlgorithm.java index d4bed84..7fe9ebe 100755 --- a/core/src/zero1hd/rhythmbullet/audio/map/RhythmMapAlgorithm.java +++ b/core/src/zero1hd/rhythmbullet/audio/map/RhythmMapAlgorithm.java @@ -153,8 +153,4 @@ public class RhythmMapAlgorithm implements Runnable { public MiniSender getSender() { return sender; } - - public EntityManager getEm() { - return em; - } } diff --git a/core/src/zero1hd/rhythmbullet/screens/GameScreen.java b/core/src/zero1hd/rhythmbullet/screens/GameScreen.java index f662398..0d60902 100755 --- a/core/src/zero1hd/rhythmbullet/screens/GameScreen.java +++ b/core/src/zero1hd/rhythmbullet/screens/GameScreen.java @@ -13,7 +13,7 @@ import com.badlogic.gdx.scenes.scene2d.ui.ImageButton; import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener; import zero1hd.rhythmbullet.RhythmBullet; -import zero1hd.rhythmbullet.audio.BasicMusicInfo; +import zero1hd.rhythmbullet.audio.CoreMusicInfo; import zero1hd.rhythmbullet.audio.map.GamePlayMap; import zero1hd.rhythmbullet.stages.GamePlayArea; import zero1hd.rhythmbullet.stages.ui.GameHUD; @@ -26,7 +26,7 @@ public class GameScreen extends ScreenAdapter { public RhythmBullet core; - private BasicMusicInfo music; + private CoreMusicInfo music; SpriteBatch bgBatch; private ShaderProgram bgShader; diff --git a/core/src/zero1hd/rhythmbullet/ui/pages/AnalyzePage.java b/core/src/zero1hd/rhythmbullet/ui/pages/AnalyzePage.java index 5f6276b..c92c81d 100755 --- a/core/src/zero1hd/rhythmbullet/ui/pages/AnalyzePage.java +++ b/core/src/zero1hd/rhythmbullet/ui/pages/AnalyzePage.java @@ -18,7 +18,7 @@ import com.badlogic.gdx.utils.Align; import zero1hd.rhythmbullet.RhythmBullet; import zero1hd.rhythmbullet.audio.AudioAnalyzer; -import zero1hd.rhythmbullet.audio.BasicMusicInfo; +import zero1hd.rhythmbullet.audio.CoreMusicInfo; import zero1hd.rhythmbullet.audio.AudioInfo; import zero1hd.rhythmbullet.audio.map.GamePlayMap; import zero1hd.rhythmbullet.audio.map.RhythmMapAlgorithm; @@ -31,7 +31,7 @@ public class AnalyzePage extends Page implements MiniListener { private AnalyzePage ap = this; AudioAnalyzer audioAnalyzer; - BasicMusicInfo music; + CoreMusicInfo music; RhythmMapAlgorithm mapGenAlgorithm; private Table songInfo; @@ -86,7 +86,7 @@ public class AnalyzePage extends Page implements MiniListener { @Override public void changed(ChangeEvent event, Actor actor) { - sensitivityRatingTitle.setText("Base Difficulty: " + MathUtils.round(sensitivityRating.getValue()*100) +"%"); + sensitivityRatingTitle.setText("Base Difficulty: " + MathUtils.round(sensitivityRating.getValue()*100) + "%"); } }); @@ -185,7 +185,7 @@ public class AnalyzePage extends Page implements MiniListener { addActor(back); } - public void setSong(BasicMusicInfo music, AudioInfo audioInfo, MiniListener listener) { + public void setSong(CoreMusicInfo music, AudioInfo audioInfo, MiniListener listener) { confirmed = false; confirmDiffButton.setDisabled(false); sensitivityRating.setDisabled(false); diff --git a/core/src/zero1hd/rhythmbullet/ui/windows/BassUMGraphWindow.java b/core/src/zero1hd/rhythmbullet/ui/windows/BassUMGraphWindow.java index 1e55d03..60e3859 100755 --- a/core/src/zero1hd/rhythmbullet/ui/windows/BassUMGraphWindow.java +++ b/core/src/zero1hd/rhythmbullet/ui/windows/BassUMGraphWindow.java @@ -4,12 +4,12 @@ import com.badlogic.gdx.scenes.scene2d.ui.Skin; import com.badlogic.gdx.scenes.scene2d.ui.Window; import com.badlogic.gdx.utils.FloatArray; -import zero1hd.rhythmbullet.audio.BasicMusicInfo; +import zero1hd.rhythmbullet.audio.CoreMusicInfo; import zero1hd.rhythmbullet.ui.builders.AudioGraph; public class BassUMGraphWindow extends Window { AudioGraph graph; - BasicMusicInfo audioData; + CoreMusicInfo audioData; public BassUMGraphWindow(String title, Skin skin) { super(title, skin, "tinted"); @@ -30,7 +30,7 @@ public class BassUMGraphWindow extends Window { return graph; } - public void setData(FloatArray dataSet1, FloatArray dataSet2, BasicMusicInfo audioData) { + public void setData(FloatArray dataSet1, FloatArray dataSet2, CoreMusicInfo audioData) { this.audioData = audioData; graph.setGraphingData(dataSet1, dataSet2); } diff --git a/core/src/zero1hd/rhythmbullet/ui/windows/BeatViewer.java b/core/src/zero1hd/rhythmbullet/ui/windows/BeatViewer.java index 2915857..df6f448 100755 --- a/core/src/zero1hd/rhythmbullet/ui/windows/BeatViewer.java +++ b/core/src/zero1hd/rhythmbullet/ui/windows/BeatViewer.java @@ -10,12 +10,12 @@ import com.badlogic.gdx.scenes.scene2d.ui.WidgetGroup; import com.badlogic.gdx.scenes.scene2d.ui.Window; import zero1hd.rhythmbullet.audio.AudioDataPackage; -import zero1hd.rhythmbullet.audio.BasicMusicInfo; +import zero1hd.rhythmbullet.audio.CoreMusicInfo; public class BeatViewer extends Window { Pixmap lights; int songIndex; - BasicMusicInfo music; + CoreMusicInfo music; Texture lightOn; private AudioDataPackage data; @@ -125,7 +125,7 @@ public class BeatViewer extends Window { super.act(delta); } - public void setMusic(BasicMusicInfo audioData, AudioDataPackage adp) { + public void setMusic(CoreMusicInfo audioData, AudioDataPackage adp) { this.music = audioData; this.data = adp; } diff --git a/core/src/zero1hd/rhythmbullet/ui/windows/MGraphWindow.java b/core/src/zero1hd/rhythmbullet/ui/windows/MGraphWindow.java index 3ec6840..b8a7e75 100755 --- a/core/src/zero1hd/rhythmbullet/ui/windows/MGraphWindow.java +++ b/core/src/zero1hd/rhythmbullet/ui/windows/MGraphWindow.java @@ -4,12 +4,12 @@ import com.badlogic.gdx.scenes.scene2d.ui.Skin; import com.badlogic.gdx.scenes.scene2d.ui.Window; import com.badlogic.gdx.utils.FloatArray; -import zero1hd.rhythmbullet.audio.BasicMusicInfo; +import zero1hd.rhythmbullet.audio.CoreMusicInfo; import zero1hd.rhythmbullet.ui.builders.AudioGraph; public class MGraphWindow extends Window { private AudioGraph graph; - private BasicMusicInfo audioData; + private CoreMusicInfo audioData; public MGraphWindow(String title, Skin skin) { super(title, skin, "tinted"); @@ -30,7 +30,7 @@ public class MGraphWindow extends Window { return graph; } - public void setData(FloatArray dataSet1, FloatArray dataSet2, BasicMusicInfo audioData) { + public void setData(FloatArray dataSet1, FloatArray dataSet2, CoreMusicInfo audioData) { this.audioData = audioData; graph.setGraphingData(dataSet1, dataSet2); } diff --git a/core/src/zero1hd/rhythmbullet/ui/windows/MusicController.java b/core/src/zero1hd/rhythmbullet/ui/windows/MusicController.java index c0d933f..eb92a72 100755 --- a/core/src/zero1hd/rhythmbullet/ui/windows/MusicController.java +++ b/core/src/zero1hd/rhythmbullet/ui/windows/MusicController.java @@ -15,13 +15,13 @@ import com.badlogic.gdx.scenes.scene2d.ui.Window; import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener; import com.badlogic.gdx.scenes.scene2d.utils.ClickListener; -import zero1hd.rhythmbullet.audio.BasicMusicInfo; +import zero1hd.rhythmbullet.audio.CoreMusicInfo; public class MusicController extends Window implements OnCompletionListener { Skin skin; private Image togglePlay; private TextField info; - private BasicMusicInfo audiofile; + private CoreMusicInfo audiofile; public MusicController(final Skin skin) { super("Playback Controller", skin, "tinted"); @@ -110,7 +110,7 @@ public class MusicController extends Window implements OnCompletionListener { setSize(260, 75); } - public void setAudiofile(BasicMusicInfo audiofile) { + public void setAudiofile(CoreMusicInfo audiofile) { this.audiofile = audiofile; if (audiofile == null) { togglePlay.setDrawable(skin.getDrawable("loading")); @@ -125,7 +125,7 @@ public class MusicController extends Window implements OnCompletionListener { } } - public BasicMusicInfo getAudiofile() { + public CoreMusicInfo getAudiofile() { return audiofile; } diff --git a/core/src/zero1hd/rhythmbullet/ui/windows/MusicSelector.java b/core/src/zero1hd/rhythmbullet/ui/windows/MusicSelector.java index d3d2e09..a512178 100755 --- a/core/src/zero1hd/rhythmbullet/ui/windows/MusicSelector.java +++ b/core/src/zero1hd/rhythmbullet/ui/windows/MusicSelector.java @@ -12,7 +12,7 @@ import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener; import com.badlogic.gdx.utils.Array; import zero1hd.rhythmbullet.audio.Audio; -import zero1hd.rhythmbullet.audio.BasicMusicInfo; +import zero1hd.rhythmbullet.audio.CoreMusicInfo; import zero1hd.rhythmbullet.util.MiniEvents; import zero1hd.rhythmbullet.util.MiniSender; @@ -95,7 +95,7 @@ public class MusicSelector extends Window { return isBack; } - public BasicMusicInfo getSelectedMusic() { + public CoreMusicInfo getSelectedMusic() { if (selectedMusic != null) { return Audio.getAudioData(selectedMusic); } else { diff --git a/core/src/zero1hd/rhythmbullet/ui/windows/VolumeWindow.java b/core/src/zero1hd/rhythmbullet/ui/windows/VolumeWindow.java index e937c9b..984e13c 100755 --- a/core/src/zero1hd/rhythmbullet/ui/windows/VolumeWindow.java +++ b/core/src/zero1hd/rhythmbullet/ui/windows/VolumeWindow.java @@ -9,7 +9,7 @@ import com.badlogic.gdx.scenes.scene2d.ui.Slider; import com.badlogic.gdx.scenes.scene2d.ui.Window; import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener; -import zero1hd.rhythmbullet.audio.BasicMusicInfo; +import zero1hd.rhythmbullet.audio.CoreMusicInfo; public class VolumeWindow extends Window { @@ -17,7 +17,7 @@ public class VolumeWindow extends Window { private Slider musicVolSlider; private Preferences prefs; - private BasicMusicInfo music; + private CoreMusicInfo music; public VolumeWindow(String title, Skin skin, Preferences prefs) { super(title, skin, "tinted"); this.prefs = prefs; @@ -67,7 +67,7 @@ public class VolumeWindow extends Window { prefs.flush(); } - public void setMusic(BasicMusicInfo music) { + public void setMusic(CoreMusicInfo music) { this.music = music; if (music != null) { music.getPlaybackMusic().setVolume(prefs.getFloat("music vol")/100f);