diff --git a/core/src/zero1hd/rhythmbullet/audio/MusicList.java b/core/src/zero1hd/rhythmbullet/audio/MusicList.java index 30eab11..f74f58f 100755 --- a/core/src/zero1hd/rhythmbullet/audio/MusicList.java +++ b/core/src/zero1hd/rhythmbullet/audio/MusicList.java @@ -53,7 +53,7 @@ public class MusicList extends Observable { Gdx.files.internal("music/Alan Walker - Spectre.mp3").copyTo(Gdx.files.external("RhythmBullet/Alan Walker - Spectre.mp3")); } musicList.add(Gdx.files.external("RhythmBullet/Alan Walker - Spectre.mp3")); - + setChanged(); Sort.instance().sort(musicList, fhac); searched = true; if (notify) { diff --git a/core/src/zero1hd/rhythmbullet/audio/MusicListController.java b/core/src/zero1hd/rhythmbullet/audio/MusicListController.java index 4408c0f..dea54a3 100755 --- a/core/src/zero1hd/rhythmbullet/audio/MusicListController.java +++ b/core/src/zero1hd/rhythmbullet/audio/MusicListController.java @@ -132,7 +132,6 @@ public class MusicListController extends Observable implements OnCompletionListe public MusicManager getCurrentMusicManager() { - if (mm == null) throw new NullPointerException("Music manager not loaded yet. try calling load music."); return mm; } diff --git a/core/src/zero1hd/rhythmbullet/graphics/ui/components/MusicSelectable.java b/core/src/zero1hd/rhythmbullet/graphics/ui/components/MusicSelectable.java index d365642..7be0fe1 100755 --- a/core/src/zero1hd/rhythmbullet/graphics/ui/components/MusicSelectable.java +++ b/core/src/zero1hd/rhythmbullet/graphics/ui/components/MusicSelectable.java @@ -3,6 +3,7 @@ package zero1hd.rhythmbullet.graphics.ui.components; import com.badlogic.gdx.Preferences; import com.badlogic.gdx.files.FileHandle; import com.badlogic.gdx.graphics.Texture; +import com.badlogic.gdx.graphics.g2d.Batch; import com.badlogic.gdx.graphics.g2d.TextureRegion; import com.badlogic.gdx.scenes.scene2d.InputEvent; import com.badlogic.gdx.scenes.scene2d.ui.Image; @@ -40,6 +41,7 @@ public class MusicSelectable extends WidgetGroup implements Disposable { public MusicSelectable(FileHandle musicFile, Preferences musicAnnotation, Skin skin, Texture defaultAlbumC, MusicSelectionPage msp) { table = new Table(skin); table.setBackground("holo-pane"); + table.setFillParent(true); vGroup = new VerticalGroup(); this.msp = msp; setName(musicFile.name()); @@ -64,7 +66,6 @@ public class MusicSelectable extends WidgetGroup implements Disposable { table.add(vGroup).expandX().fillX().center(); addActor(table); - table.pack(); addListener(new ClickListener() { @Override public void clicked(InputEvent event, float x, float y) { @@ -72,7 +73,6 @@ public class MusicSelectable extends WidgetGroup implements Disposable { super.clicked(event, x, y); } }); - table.pack(); } /** @@ -102,9 +102,13 @@ public class MusicSelectable extends WidgetGroup implements Disposable { super.layout(); } + @Override + public void draw(Batch batch, float parentAlpha) { + super.draw(batch, parentAlpha); + } + @Override public void act(float delta) { - table.setSize(getWidth(), getHeight()); super.act(delta); } diff --git a/core/src/zero1hd/rhythmbullet/graphics/ui/pages/MusicSelectionPage.java b/core/src/zero1hd/rhythmbullet/graphics/ui/pages/MusicSelectionPage.java index 99f10c6..414bfc0 100755 --- a/core/src/zero1hd/rhythmbullet/graphics/ui/pages/MusicSelectionPage.java +++ b/core/src/zero1hd/rhythmbullet/graphics/ui/pages/MusicSelectionPage.java @@ -62,6 +62,7 @@ public class MusicSelectionPage extends Page implements Observer { private TextButton beginButton; private float scrollTimer, scrollDelay = 0.2f, scrollDelMod, songSelectionTimer; + private ExecutorService exec; public MusicSelectionPage(Skin skin, MusicListController musicListController, AssetManager assetManager, Vector3 cameraTarget, AnalysisPage ap) { setTextureBackground(assetManager.get("gradients.atlas", TextureAtlas.class).findRegion("red-round")); @@ -136,6 +137,8 @@ public class MusicSelectionPage extends Page implements Observer { ap.processSong(mc.getMusicList().getAudioData(getSelectedMusic())); } }); + + exec = Executors.newSingleThreadExecutor(); } @Override @@ -203,7 +206,6 @@ public class MusicSelectionPage extends Page implements Observer { musicTable.row(); } - ExecutorService exec = Executors.newSingleThreadExecutor(); exec.submit(() -> { for (int i = 0; i < selectables.size; i++) { MusicSelectable info = selectables.get(i);