began integrating mini events into main music selection system
This commit is contained in:
@@ -11,22 +11,21 @@ import com.badlogic.gdx.scenes.scene2d.ui.Image;
|
||||
import com.badlogic.gdx.scenes.scene2d.ui.Label;
|
||||
|
||||
import zero1hd.polyjet.Polyjet;
|
||||
import zero1hd.polyjet.audio.AudioAnalyzer;
|
||||
import zero1hd.polyjet.audio.Audio;
|
||||
import zero1hd.polyjet.audio.WavAudioData;
|
||||
import zero1hd.polyjet.controls.RhythmMap;
|
||||
import zero1hd.polyjet.ui.pages.AnalyzePage;
|
||||
import zero1hd.polyjet.ui.pages.MusicSelectionPage;
|
||||
import zero1hd.polyjet.util.MiniEvents;
|
||||
import zero1hd.polyjet.util.MiniListener;
|
||||
import zero1hd.polyjet.util.TransitionAdapter;
|
||||
|
||||
|
||||
public class PreGameScreen extends ScreenAdapter implements TransitionAdapter {
|
||||
public class PreGameScreen extends ScreenAdapter implements TransitionAdapter, MiniListener {
|
||||
Polyjet core;
|
||||
Stage stage;
|
||||
Label statusText;
|
||||
|
||||
AudioAnalyzer analyzer;
|
||||
WavAudioData audiofile;
|
||||
RhythmMap rhythmMap;
|
||||
Vector3 cameraTarget;
|
||||
|
||||
Label lastStatement;
|
||||
@@ -36,8 +35,6 @@ public class PreGameScreen extends ScreenAdapter implements TransitionAdapter {
|
||||
private AnalyzePage analyzePage;
|
||||
public PreGameScreen(final Polyjet core, MainMenu mainMenu) {
|
||||
this.core = core;
|
||||
analyzer = new AudioAnalyzer();
|
||||
rhythmMap = new RhythmMap(analyzer);
|
||||
|
||||
this.mainMenu = mainMenu;
|
||||
|
||||
@@ -64,7 +61,8 @@ public class PreGameScreen extends ScreenAdapter implements TransitionAdapter {
|
||||
stage.addActor(analyzePage);
|
||||
|
||||
//draw music selector
|
||||
musicSelection = new MusicSelectionPage(core, mainMenu, analyzePage);
|
||||
musicSelection = new MusicSelectionPage(core, mainMenu);
|
||||
musicSelection.addListener(this);
|
||||
stage.addActor(musicSelection);
|
||||
musicSelection.beginMusicSearch();
|
||||
|
||||
@@ -91,7 +89,6 @@ public class PreGameScreen extends ScreenAdapter implements TransitionAdapter {
|
||||
@Override
|
||||
public void show() {
|
||||
Gdx.input.setInputProcessor(stage);
|
||||
analyzer.resetVars();
|
||||
super.show();
|
||||
}
|
||||
|
||||
@@ -106,4 +103,13 @@ public class PreGameScreen extends ScreenAdapter implements TransitionAdapter {
|
||||
stage.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handle(MiniEvents ID) {
|
||||
switch (ID) {
|
||||
case MUSIC_SELECTED:
|
||||
analyzePage.setSong(Audio.getAudioData(musicSelection.getSelectedMusic()), musicSelection.getSelectedMusicInfo());
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user