diff --git a/client/src/main/java/client/audio/MidiBank.java b/client/src/main/java/client/audio/MidiBank.java index d720bea6..224b5f4d 100644 --- a/client/src/main/java/client/audio/MidiBank.java +++ b/client/src/main/java/client/audio/MidiBank.java @@ -23,8 +23,8 @@ public enum MidiBank implements Identifyable, Displayable { SWTIMBR("swtimbr", "SWTimbr"), TMB_DEFAULT("tmb_default", "TMB"), WALLENCE("wallence", "Wallence"), - FAT2("fat2", "TheFatMan 2OP"), - FAT4("fat4", "TheFatMan 4OP"), + FAT2("fat2", "FatMan 2OP"), + FAT4("fat4", "FatMan 4OP"), OP2X2("op2x2", "2x2OP"), WALLACE("wallace", "Wallace"), EARTHSIEG("earthsieg", "Earthsieg"), diff --git a/client/src/main/java/client/gui/GuiPlayer.java b/client/src/main/java/client/gui/GuiPlayer.java index d0eea7fe..c309d06f 100644 --- a/client/src/main/java/client/gui/GuiPlayer.java +++ b/client/src/main/java/client/gui/GuiPlayer.java @@ -7,6 +7,7 @@ import client.Client.FileMode; import client.audio.MidiDecoder; import client.gui.element.ActButton; import client.gui.element.ButtonCallback; +import client.gui.element.Element; import client.gui.element.Fill; import client.gui.element.GuiList; import client.gui.element.ListEntry; @@ -33,6 +34,24 @@ public class GuiPlayer extends GuiList { GuiPlayer.this.select(); } } + + private class Visualizer extends Element { + public Visualizer(int x, int y, int w, int h) { + super(x, y, w, h, null); + } + + public boolean canHover() { + return false; + } + + protected void drawBackground() { + Drawing.drawRect(this.pos_x, this.pos_y, this.size_x, this.size_y, 0xff000000); + } + + protected void drawForeground(int x1, int y1, int x2, int y2) { + + } + } public static enum RepeatMode { REPEAT_OFF("N"), @@ -230,11 +249,11 @@ public class GuiPlayer extends GuiList { public void init(int width, int height) { super.init(width, height); - this.setDimensions(320, height, 18, height - 18); + this.setDimensions(360, height, 18, height - 18); this.add(new NavButton(0, 0, 60, 18, GuiMenu.INSTANCE, "Zurück")); - this.add(new Fill(60, 0, 242, 18, "SKC OPL MIDI Player v 0.0.1 (~ Sen)", true)); - this.addSelector("mid_visualizer", 302, 0, 18, 18); + this.add(new Fill(60, 0, 142, 18, "OPL MIDI Player")); + this.addSelector("mid_visualizer", 202, 0, 158, 18); this.playButton = this.add(new ActButton(0, height - 18, 18, 18, new ButtonCallback() { public void use(ActButton elem, PressType action) { @@ -282,8 +301,8 @@ public class GuiPlayer extends GuiList { } }, "X")); - this.addSelector("mid_opl_bank", 162, height - 18, 122, -18); - this.add(new ActButton(284, height - 18, 18, 18, new ButtonCallback() { + this.addSelector("mid_opl_bank", 162, height - 18, 162, -18); + this.add(new ActButton(324, height - 18, 18, 18, new ButtonCallback() { public void use(ActButton elem, PressType action) { GuiPlayer.this.gm.showFileDialog(FileMode.FILE_LOAD_MULTI, "MIDIs laden", null, new FileCallback() { public void selected(File file) { @@ -292,7 +311,7 @@ public class GuiPlayer extends GuiList { }); } }, "+")); - this.add(new ActButton(302, height - 18, 18, 18, new ButtonCallback() { + this.add(new ActButton(342, height - 18, 18, 18, new ButtonCallback() { public void use(ActButton elem, PressType action) { GuiPlayer.this.gm.showFileDialog(FileMode.DIRECTORY_LOAD, "MIDIs laden", null, new FileCallback() { public void selected(File file) { @@ -306,8 +325,7 @@ public class GuiPlayer extends GuiList { // GuiPlayer.this.test(0, 255, 500, 36); // } // }, "MIDI-Bank testen")); - -// gui_add_custom(win, 720, 0, frame_x - 720, frame_y, gui_render_player); + this.add(new Visualizer(360, 0, width - 360, height)); this.updateDisplay(); }