diff --git a/desktop/src/zero1hd/rhythmbullet/desktop/DesktopLauncher.java b/desktop/src/zero1hd/rhythmbullet/desktop/DesktopLauncher.java index 4f9712d..e0807ce 100755 --- a/desktop/src/zero1hd/rhythmbullet/desktop/DesktopLauncher.java +++ b/desktop/src/zero1hd/rhythmbullet/desktop/DesktopLauncher.java @@ -1,5 +1,8 @@ package zero1hd.rhythmbullet.desktop; +import java.util.logging.Level; +import java.util.logging.Logger; + import com.badlogic.gdx.backends.lwjgl.LwjglApplication; import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration; @@ -8,6 +11,8 @@ import zero1hd.rhythmbullet.desktop.screens.LoadingScreen; public class DesktopLauncher { public static void main (String[] arg) { + Logger.getLogger("org.jaudiotagger").setLevel(Level.OFF); + RhythmBullet core; LwjglApplicationConfiguration config = new LwjglApplicationConfiguration(); config.title = "Rhythm Bullet"; diff --git a/desktop/src/zero1hd/rhythmbullet/desktop/audio/Mp3Manager.java b/desktop/src/zero1hd/rhythmbullet/desktop/audio/Mp3Manager.java index e55b530..08a4bdd 100755 --- a/desktop/src/zero1hd/rhythmbullet/desktop/audio/Mp3Manager.java +++ b/desktop/src/zero1hd/rhythmbullet/desktop/audio/Mp3Manager.java @@ -5,8 +5,6 @@ import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; import java.util.concurrent.locks.ReentrantLock; -import java.util.logging.Level; -import java.util.logging.Logger; import org.jaudiotagger.audio.exceptions.InvalidAudioFrameException; import org.jaudiotagger.audio.exceptions.ReadOnlyFileException; @@ -60,7 +58,6 @@ public class Mp3Manager implements MusicManager { exec = Executors.newSingleThreadExecutor(); exec.submit(() -> { lock.lock(); - Logger.getLogger("org.jaudiotagger").setLevel(Level.OFF); try { MP3File mp3File = new MP3File(audioFile.file()); sampleRate = mp3File.getMP3AudioHeader().getSampleRateAsNumber(); diff --git a/desktop/src/zero1hd/rhythmbullet/desktop/graphics/ui/components/MusicSelectable.java b/desktop/src/zero1hd/rhythmbullet/desktop/graphics/ui/components/MusicSelectable.java index 1eafe95..c113e71 100755 --- a/desktop/src/zero1hd/rhythmbullet/desktop/graphics/ui/components/MusicSelectable.java +++ b/desktop/src/zero1hd/rhythmbullet/desktop/graphics/ui/components/MusicSelectable.java @@ -1,6 +1,5 @@ package zero1hd.rhythmbullet.desktop.graphics.ui.components; -import com.badlogic.gdx.Gdx; import com.badlogic.gdx.files.FileHandle; import com.badlogic.gdx.graphics.g2d.Batch; import com.badlogic.gdx.scenes.scene2d.InputEvent; @@ -54,7 +53,6 @@ public class MusicSelectable extends WidgetGroup implements Disposable { * @param musicInfo the music information for this song. */ public void updateInfo(MusicInfo musicInfo) { - Gdx.app.debug("MusicSelectable", "Updating info for: " + getName()); this.musicInfo = musicInfo; displayName.setOriginalText(musicInfo.getMusicName()); } diff --git a/desktop/src/zero1hd/rhythmbullet/desktop/graphics/ui/pages/MainPage.java b/desktop/src/zero1hd/rhythmbullet/desktop/graphics/ui/pages/MainPage.java index 326f147..4afa021 100755 --- a/desktop/src/zero1hd/rhythmbullet/desktop/graphics/ui/pages/MainPage.java +++ b/desktop/src/zero1hd/rhythmbullet/desktop/graphics/ui/pages/MainPage.java @@ -93,12 +93,6 @@ public class MainPage extends Page implements Observer { scrollText.setWidth(0.5f*getWidth()); scrollText.setPosition(15, getHeight() - scrollText.getHeight()-25f); addActor(scrollText); - - if (mlc.getMusicList().isSearched() && mlc.getCurrentMusicManager() != null) { - MusicManager mManager = mlc.getCurrentMusicManager(); - updateVisualsForDifferentSong(mManager); - mMenu.getMusicSelectionPage().refreshUIList(); - } } @Override diff --git a/desktop/src/zero1hd/rhythmbullet/desktop/graphics/ui/pages/MusicSelectionPage.java b/desktop/src/zero1hd/rhythmbullet/desktop/graphics/ui/pages/MusicSelectionPage.java index 039325f..5c435a2 100755 --- a/desktop/src/zero1hd/rhythmbullet/desktop/graphics/ui/pages/MusicSelectionPage.java +++ b/desktop/src/zero1hd/rhythmbullet/desktop/graphics/ui/pages/MusicSelectionPage.java @@ -65,12 +65,12 @@ public class MusicSelectionPage extends Page implements Observer { private int uiSongInfoCount; private float scrollTimer, scrollDelay = 0.2f, scrollDelMod, songSelectionTimer; - public MusicSelectionPage(Skin skin, MusicListController musicListController, AssetManager assetManager, final Vector3 cameraTarget, final AnalysisPage ap) { + public MusicSelectionPage(Skin skin, MusicListController musicListController, MusicInfoController musicInfoController, AssetManager assetManager, final Vector3 cameraTarget, final AnalysisPage ap) { setTextureBackground(assetManager.get("gradients.atlas", TextureAtlas.class).findRegion("red-round")); this.assets = assetManager; this.skin = skin; this.mc = musicListController; - mic = new MusicInfoController(mc.getMusicList()); + this.mic = musicInfoController; musicFileAnnotation = Gdx.app.getPreferences("music_file_annotation"); musicTable = new Table(); musicTableScrollPane = new ScrollPane(musicTable, skin); @@ -132,6 +132,7 @@ public class MusicSelectionPage extends Page implements Observer { previousTop = new Label(null, skin, "sub-font", skin.getColor("default")); ratedDifficulty = new Label(null, skin, "sub-font", skin.getColor("default")); albumCover = new Image(assetManager.get("defaultCover.png", Texture.class)); + beginButton = new TextButton("Begin", skin); beginButton.addListener(new ChangeListener() { @Override diff --git a/desktop/src/zero1hd/rhythmbullet/desktop/screens/MainMenu.java b/desktop/src/zero1hd/rhythmbullet/desktop/screens/MainMenu.java index a77685e..1cf801e 100755 --- a/desktop/src/zero1hd/rhythmbullet/desktop/screens/MainMenu.java +++ b/desktop/src/zero1hd/rhythmbullet/desktop/screens/MainMenu.java @@ -19,6 +19,7 @@ import com.badlogic.gdx.scenes.scene2d.utils.ClickListener; import com.badlogic.gdx.utils.viewport.ScreenViewport; import zero1hd.rhythmbullet.RhythmBullet; +import zero1hd.rhythmbullet.desktop.audio.MusicInfoController; import zero1hd.rhythmbullet.desktop.audio.MusicList; import zero1hd.rhythmbullet.desktop.audio.MusicListController; import zero1hd.rhythmbullet.desktop.graphics.ui.pages.AnalysisPage; @@ -29,6 +30,7 @@ import zero1hd.rhythmbullet.desktop.graphics.ui.pages.MusicSelectionPage; import zero1hd.rhythmbullet.desktop.graphics.ui.pages.OptionsPage; import zero1hd.rhythmbullet.desktop.graphics.ui.pages.VideoOptionsPage; import zero1hd.rhythmbullet.util.AdvancedResizeScreen; +import zero1hd.rhythmbullet.util.MusicManager; public class MainMenu extends ScreenAdapter implements AdvancedResizeScreen { public Stage stage; @@ -44,6 +46,7 @@ public class MainMenu extends ScreenAdapter implements AdvancedResizeScreen { private RhythmBullet core; private MusicListController mlc; + private MusicInfoController mic; private float lerpAlpha; @@ -70,12 +73,13 @@ public class MainMenu extends ScreenAdapter implements AdvancedResizeScreen { mlc = new MusicListController(musicList, core.getPrefs()); mlc.setAutoPlay(true); mlc.setShuffle(true); + + mic = new MusicInfoController(musicList); } @Override public void postAssetLoad() { attemptLoadShaders(); - mainPage = new MainPage(core, cameraPosition, mlc, this); mainPage.setPosition(0, 0); stage.addActor(mainPage); @@ -102,7 +106,7 @@ public class MainMenu extends ScreenAdapter implements AdvancedResizeScreen { analysisPage.setPosition(2*Gdx.graphics.getWidth(), 0f); stage.addActor(analysisPage); - musicSelectionPage = new MusicSelectionPage(core.getDefaultSkin(), mlc, core.getAssetManager(), cameraPosition, analysisPage); + musicSelectionPage = new MusicSelectionPage(core.getDefaultSkin(), mlc, mic, core.getAssetManager(), cameraPosition, analysisPage); musicSelectionPage.setPosition(1f*Gdx.graphics.getWidth(), 0f); stage.addActor(musicSelectionPage); stage.addListener(new InputListener() { @@ -136,6 +140,11 @@ public class MainMenu extends ScreenAdapter implements AdvancedResizeScreen { mlc.addObserver(mainPage); mlc.getMusicList().addObserver(mainPage); + if (mlc.getMusicList().isSearched() && mlc.getCurrentMusicManager() != null) { + MusicManager mManager = mlc.getCurrentMusicManager(); + mainPage.updateVisualsForDifferentSong(mManager); + musicSelectionPage.refreshUIList(); + } } @Override @@ -217,6 +226,7 @@ public class MainMenu extends ScreenAdapter implements AdvancedResizeScreen { optionsPage.dispose(); creditsPage.dispose(); keybindPage.dispose(); + musicSelectionPage.dispose(); } @Override @@ -252,6 +262,7 @@ public class MainMenu extends ScreenAdapter implements AdvancedResizeScreen { public void dispose() { stage.dispose(); unloadShaders(); + mic.dispose(); super.dispose(); } @@ -293,10 +304,6 @@ public class MainMenu extends ScreenAdapter implements AdvancedResizeScreen { return cameraPosition; } - public MainPage getMainPage() { - return mainPage; - } - public CreditsPage getCreditsPage() { return creditsPage; }