From fbbd079154986c30d01bb7101dba4291125aa0d9 Mon Sep 17 00:00:00 2001 From: Recrown Date: Fri, 8 Dec 2017 00:19:33 -0600 Subject: [PATCH] progress towards optimizations --- android/assets/uiskin.atlas | 2 +- android/assets/uiskin.png | Bin 11847 -> 11848 bytes .../rhythmbullet/audio/Mp3Manager.java | 1 + .../zero1hd/rhythmbullet/audio/MusicInfo.java | 10 +- .../zero1hd/rhythmbullet/audio/MusicList.java | 3 +- .../audio/MusicListController.java | 4 + .../ui/components/MusicSelectable.java | 2 +- .../graphics/ui/pages/MainPage.java | 3 +- .../graphics/ui/pages/MusicSelectionPage.java | 35 +++-- .../graphics/ui/windows/MusicController.java | 138 ------------------ 10 files changed, 35 insertions(+), 163 deletions(-) delete mode 100755 core/src/zero1hd/rhythmbullet/graphics/ui/windows/MusicController.java diff --git a/android/assets/uiskin.atlas b/android/assets/uiskin.atlas index 977afe2..91c0a71 100755 --- a/android/assets/uiskin.atlas +++ b/android/assets/uiskin.atlas @@ -350,7 +350,7 @@ holo-pane-down rotate: false xy: 133, 8 size: 20, 20 - split: 4, 4, 4, 4 + split: 2, 2, 2, 2 orig: 20, 20 offset: 0, 0 index: -1 diff --git a/android/assets/uiskin.png b/android/assets/uiskin.png index 8c65acaf57a7f3ad57e9e224337cea351e64fdf6..ad2946a2b6be5e6366d1ab44037d8faad386a060 100755 GIT binary patch literal 11848 zcmb7qcRZDU|NnK4BMxO8qExmcWTdR@nY|-qWF$L#g@ejLLWrDl%#iGreJVxDmc6n^ z_8y1tMSbqO&)w&~AHUxp*W)_pT<`a5ujl(Zp_=N~Pm$1(003}GNl{K403hH;2ta%S zyxnrix&z)|*3xRy08ki7x__Gx{0_gTXy6I}G~j0%Ldbv*p(Xeuk(-j5JkfVzB5DB< z!+V+w;7@1WxmebCw>&JTg`fr8l3=rbeH#2{&aE6ntiv)UY~Ei>*g1O=>Tl&*R68w z+MCi%pO&56jTd^+E;te>br&+xxev9sQPyDfK#0~_JMx+kcSbw z)l~>1X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JiO z^1L9S58R-%B&^Vj|LrpmBlMnI8eIRM&$%EWNDBz1>&HaQBnaizpJ<#D2<7u7)bM-o zICXc*r2)_=mP)w0J$NkTAWRJOL=W5nnhbj4pY64YL6e{n7GDzMy+BO(M$yexpfL%{ zs0kC$6V2|FPCTF|?p6lBj|)Iro^nXD&qNZ_d`iqQ1ebqVLe1Pb8IXFVGPpbz{IOBM gusY7A8}BDY{`$$Tt+yBW3vWPKUR|z0#w_6f0ONDpKL7v# diff --git a/core/src/zero1hd/rhythmbullet/audio/Mp3Manager.java b/core/src/zero1hd/rhythmbullet/audio/Mp3Manager.java index 237825e..6b47901 100755 --- a/core/src/zero1hd/rhythmbullet/audio/Mp3Manager.java +++ b/core/src/zero1hd/rhythmbullet/audio/Mp3Manager.java @@ -209,6 +209,7 @@ public class Mp3Manager implements MusicManager { @Override public void play() { + Gdx.app.debug("Mp3Manager", "MP3 Playing..."); playbackMusic.play(); } diff --git a/core/src/zero1hd/rhythmbullet/audio/MusicInfo.java b/core/src/zero1hd/rhythmbullet/audio/MusicInfo.java index 746efc9..ea7d7f3 100755 --- a/core/src/zero1hd/rhythmbullet/audio/MusicInfo.java +++ b/core/src/zero1hd/rhythmbullet/audio/MusicInfo.java @@ -24,7 +24,6 @@ public class MusicInfo implements Disposable { private long durationInSeconds; private String songName; - private Texture albumCover; private String author; private int previousTop; private int ratedDifficulty; @@ -118,11 +117,7 @@ public class MusicInfo implements Disposable { public String getMusicName() { return songName.replace('_', ' '); } - - public Texture getAlbumCover() { - return albumCover; - } - + public String getAuthor() { return author; } @@ -138,10 +133,9 @@ public class MusicInfo implements Disposable { public boolean isInvalidMusic() { return invalidMusic; } - + @Override public void dispose() { - albumCover.dispose(); } /** diff --git a/core/src/zero1hd/rhythmbullet/audio/MusicList.java b/core/src/zero1hd/rhythmbullet/audio/MusicList.java index f74f58f..96214fb 100755 --- a/core/src/zero1hd/rhythmbullet/audio/MusicList.java +++ b/core/src/zero1hd/rhythmbullet/audio/MusicList.java @@ -56,6 +56,7 @@ public class MusicList extends Observable { setChanged(); Sort.instance().sort(musicList, fhac); searched = true; + if (notify) { notifyObservers(); } @@ -69,10 +70,10 @@ public class MusicList extends Observable { searched = false; exec.submit(() -> { refresh(false); + Gdx.app.debug("Asynch-MusicList", "Async refresh done. Notification has been sent."); Gdx.app.postRunnable(() -> { notifyObservers(); searched = true; - Gdx.app.debug("Asynch-MusicList", "Async refresh done. Notification has been sent."); }); }); } diff --git a/core/src/zero1hd/rhythmbullet/audio/MusicListController.java b/core/src/zero1hd/rhythmbullet/audio/MusicListController.java index dea54a3..8af3040 100755 --- a/core/src/zero1hd/rhythmbullet/audio/MusicListController.java +++ b/core/src/zero1hd/rhythmbullet/audio/MusicListController.java @@ -27,8 +27,12 @@ public class MusicListController extends Observable implements OnCompletionListe rand = new Random(); } + /** + * This play method automatically sets the volume. + */ public void play() { if (mm != null) { + Gdx.app.debug("MusicListController", "Playing from MLC."); mm.play(); mm.setVolume(prefs.getFloat("music vol", 1f)); } else { diff --git a/core/src/zero1hd/rhythmbullet/graphics/ui/components/MusicSelectable.java b/core/src/zero1hd/rhythmbullet/graphics/ui/components/MusicSelectable.java index b963ddc..a5b8dfb 100755 --- a/core/src/zero1hd/rhythmbullet/graphics/ui/components/MusicSelectable.java +++ b/core/src/zero1hd/rhythmbullet/graphics/ui/components/MusicSelectable.java @@ -76,7 +76,7 @@ public class MusicSelectable extends WidgetGroup implements Disposable { @Override public void layout() { - displayName.setTargetWidth((int) (getWidth()/3f)); + displayName.setTargetWidth((int) (getWidth()*0.43f)); authorLabel.setTargetWidth((int) (getWidth()/3f)); displayName.resize(); authorLabel.resize(); diff --git a/core/src/zero1hd/rhythmbullet/graphics/ui/pages/MainPage.java b/core/src/zero1hd/rhythmbullet/graphics/ui/pages/MainPage.java index 549a89e..81b8200 100755 --- a/core/src/zero1hd/rhythmbullet/graphics/ui/pages/MainPage.java +++ b/core/src/zero1hd/rhythmbullet/graphics/ui/pages/MainPage.java @@ -119,12 +119,11 @@ public class MainPage extends Page implements Observer { MusicManager mm = mlc.getCurrentMusicManager(); updateVisualsForDifferentSong(mm); mMenu.getMusicSelectionPage().refreshUIList(); - mMenu.getMusicSelectionPage().selectMusicUI(mm); mlc.play(); } else if (o == mlc) { MusicManager mm = mlc.getCurrentMusicManager(); + mlc.play(); updateVisualsForDifferentSong(mm); - mm.play(); } } diff --git a/core/src/zero1hd/rhythmbullet/graphics/ui/pages/MusicSelectionPage.java b/core/src/zero1hd/rhythmbullet/graphics/ui/pages/MusicSelectionPage.java index d62c70c..cfcc84c 100755 --- a/core/src/zero1hd/rhythmbullet/graphics/ui/pages/MusicSelectionPage.java +++ b/core/src/zero1hd/rhythmbullet/graphics/ui/pages/MusicSelectionPage.java @@ -34,7 +34,6 @@ import zero1hd.rhythmbullet.graphics.ui.components.ScrollText; public class MusicSelectionPage extends Page implements Observer { Preferences musicFileAnnotation; - private boolean extraInfoDone; private MusicListController mc; private MusicInfoController mic; @@ -50,13 +49,13 @@ public class MusicSelectionPage extends Page implements Observer { private Label songLength; private Label previousTop; private Label ratedDifficulty; + private Texture albumCoverTexture; private Image albumCover; + private AssetManager assets; private MusicSelectable currentlySelected; private Skin skin; - private AssetManager assets; - private boolean down, up; private int musicSelectableIndex; @@ -68,11 +67,11 @@ public class MusicSelectionPage extends Page implements Observer { public MusicSelectionPage(Skin skin, MusicListController musicListController, AssetManager assetManager, Vector3 cameraTarget, 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()); musicFileAnnotation = Gdx.app.getPreferences("music_file_annotation"); - this.assets = assetManager; musicTable = new Table(); musicTableScrollPane = new ScrollPane(musicTable, skin); musicTable.defaults().spaceTop(5f).spaceBottom(5f); @@ -185,10 +184,15 @@ public class MusicSelectionPage extends Page implements Observer { musicTable.add(selectables.get(uiSongCount)).expandX().fillX(); uiSongCount++; musicTable.row(); - } - if (mic.isDoneLoading() && uiSongInfoCount < selectables.size) { + if (uiSongCount == mc.getMusicList().getAmountOfMusic()) { + selectMusicUI(mc.getCurrentMusicManager()); + } + } else if (uiSongInfoCount < selectables.size && mic.isDoneLoading() ) { selectables.get(uiSongInfoCount).updateInfo(mic.getSongInfoArray().get(uiSongInfoCount)); uiSongInfoCount++; + if (uiSongInfoCount == selectables.size) { + updateInformation(); + } } } @@ -204,13 +208,12 @@ public class MusicSelectionPage extends Page implements Observer { for (int i = 0; i < selectables.size; i++) { selectables.get(i).dispose(); } + mic.loadSongInfo(); musicTable.clear(); selectables.clear(); musicInfoTable.clear(); musicSubInfo.clear(); - extraInfoDone = false; uiSongCount = 0; - mic.loadSongInfo(); uiSongInfoCount = 0; Gdx.app.debug("MusicSelectionPage", "Refreshing..."); @@ -252,7 +255,7 @@ public class MusicSelectionPage extends Page implements Observer { this.currentlySelected = currentlySelected; songSelectionTimer = 1f; - if (extraInfoDone) { + if (mic.isDoneLoading()) { updateInformation(); } } @@ -308,9 +311,13 @@ public class MusicSelectionPage extends Page implements Observer { * This should only be called when everything is loaded. */ private void updateInformation() { + Gdx.app.debug("MusicSelectionPage", "Updating song info panel..."); + if (currentlySelected == null) throw new NullPointerException("Buddy, you need to update this page to have the proper current music selected..."); songTitle.setText(currentlySelected.getMusicInfo().getMusicName(), null); author.setText("Author: " + currentlySelected.getMusicInfo().getAuthor()); - + if (albumCoverTexture != null) { + albumCoverTexture.dispose(); + } long lengthInSeconds = currentlySelected.getMusicInfo().getDurationInSeconds(); int min = (int) (lengthInSeconds/60); int sec = (int) (lengthInSeconds - (min*60)); @@ -320,7 +327,11 @@ public class MusicSelectionPage extends Page implements Observer { String difficulty = (getSelectedMusicInfo().getRatedDifficulty() == -1 ? "N/A" : String.valueOf(getSelectedMusicInfo().getRatedDifficulty())); ratedDifficulty.setText("Rated Difficulty: " + difficulty); - - albumCover.setDrawable((new TextureRegionDrawable(new TextureRegion(currentlySelected.getMusicInfo().getAlbumCover())))); + albumCoverTexture = currentlySelected.getMusicInfo().loadTexture(); + if (albumCoverTexture != null) { + albumCover.setDrawable((new TextureRegionDrawable(new TextureRegion(albumCoverTexture)))); + } else { + albumCover.setDrawable((new TextureRegionDrawable(new TextureRegion(assets.get("defaultCover.png", Texture.class))))); + } } } diff --git a/core/src/zero1hd/rhythmbullet/graphics/ui/windows/MusicController.java b/core/src/zero1hd/rhythmbullet/graphics/ui/windows/MusicController.java deleted file mode 100755 index d68d18a..0000000 --- a/core/src/zero1hd/rhythmbullet/graphics/ui/windows/MusicController.java +++ /dev/null @@ -1,138 +0,0 @@ -package zero1hd.rhythmbullet.graphics.ui.windows; - -import com.badlogic.gdx.Input.Keys; -import com.badlogic.gdx.audio.Music; -import com.badlogic.gdx.audio.Music.OnCompletionListener; -import com.badlogic.gdx.math.MathUtils; -import com.badlogic.gdx.scenes.scene2d.Actor; -import com.badlogic.gdx.scenes.scene2d.InputEvent; -import com.badlogic.gdx.scenes.scene2d.InputListener; -import com.badlogic.gdx.scenes.scene2d.ui.Image; -import com.badlogic.gdx.scenes.scene2d.ui.ImageButton; -import com.badlogic.gdx.scenes.scene2d.ui.Skin; -import com.badlogic.gdx.scenes.scene2d.ui.TextField; -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.MusicManager; - -public class MusicController extends Window implements OnCompletionListener { - Skin skin; - private Image togglePlay; - private TextField info; - private MusicManager audiofile; - - public MusicController(final Skin skin) { - super("Playback Controller", skin, "tinted"); - - defaults().space(5f); - - this.skin = skin; - final ImageButton rewind = new ImageButton(skin.getDrawable("left-double-arrow")); - rewind.addListener(new ChangeListener() { - - @Override - public void changed(ChangeEvent event, Actor actor) { - audiofile.setPosition(audiofile.getPositionInSeconds() - 2); - info.setText(String.valueOf(MathUtils.round(audiofile.getPositionInSeconds())) + " sec"); - } - }); - - add(rewind).center(); - - togglePlay = new Image(skin.getDrawable("loading")) { - @Override - public void act(float delta) { - super.act(delta); - } - }; - togglePlay.addListener(new ClickListener() { - @Override - public void clicked(InputEvent event, float x, float y) { - if (audiofile != null) { - if (audiofile.isPlaying()) { - audiofile.pause(); - - togglePlay.setDrawable(skin.getDrawable("arrow")); - - } else { - togglePlay.setDrawable(skin.getDrawable("pause")); - audiofile.play(); - } - } - super.clicked(event, x, y); - } - }); - add(togglePlay).minWidth(togglePlay.getDrawable().getMinWidth()).center(); - - final ImageButton fastForward = new ImageButton(skin.getDrawable("right-double-arrow")); - fastForward.addListener(new ChangeListener() { - @Override - public void changed(ChangeEvent event, Actor actor) { - if (audiofile != null) { - audiofile.play(); - audiofile.setPosition(audiofile.getPositionInSeconds() + 2); - info.setText(String.valueOf(MathUtils.round(audiofile.getPositionInSeconds())) + " sec"); - } - } - }); - - add(fastForward); - - info = new TextField(null, skin, "ui") { - @Override - public void act(float delta) { - if (audiofile != null && audiofile.isPlaying()) { - setText(String.valueOf(MathUtils.round(audiofile.getPositionInSeconds())) + " sec"); - } - super.act(delta); - } - }; - add(info); - - - addListener(new InputListener() { - @Override - public boolean keyUp(InputEvent event, int keycode) { - if (keycode == Keys.ENTER) { - if (!info.getText().replaceAll("(?![0-9])\\S+", "").trim().isEmpty()) { - audiofile.setPosition(Float.valueOf(info.getText().replaceAll("(?![0-9])\\S+", "").trim())); - } - } - return super.keyUp(event, keycode); - } - }); - - - setSize(260, 75); - } - - public void setAudiofile(MusicManager audiofile) { - this.audiofile = audiofile; - if (this.audiofile != null) { - this.audiofile.dispose(); - this.audiofile = null; - } - if (audiofile == null) { - togglePlay.setDrawable(skin.getDrawable("loading")); - info.setText("Analyzing..."); - } else { - togglePlay.setDrawable(skin.getDrawable("arrow")); - info.setText("Ready."); - audiofile.play(); - audiofile.pause(); - audiofile.setOnCompletionListener(this); - } - } - - public MusicManager getAudiofile() { - return audiofile; - } - - @Override - public void onCompletion(Music music) { - audiofile.dispose(); - audiofile = null; - } -}