diff --git a/src/main/java/musicplayer/BindingsModule.java b/src/main/java/musicplayer/BindingsModule.java deleted file mode 100644 index b9a4f48..0000000 --- a/src/main/java/musicplayer/BindingsModule.java +++ /dev/null @@ -1,14 +0,0 @@ -package musicplayer; - -import com.google.inject.AbstractModule; -import musicplayer.callbacks.PlayerCallbackInterface; -import musicplayer.player.IPlayer; -import musicplayer.player.GStreamerPlayer; - -public class BindingsModule extends AbstractModule { - @Override - protected void configure() { - bind(IPlayer.class).to(GStreamerPlayer.class); - bind(PlayerCallbackInterface.class).to(PlayerGUI.class); - } -} diff --git a/src/main/java/musicplayer/PlayerGUI.java b/src/main/java/musicplayer/PlayerGUI.java index 839102f..a9dda10 100644 --- a/src/main/java/musicplayer/PlayerGUI.java +++ b/src/main/java/musicplayer/PlayerGUI.java @@ -103,7 +103,7 @@ public class PlayerGUI implements PlayerCallbackInterface, LibraryCallbackInterf public static void main(String[] args) { DatabaseManager.init(); - Injector injector = Guice.createInjector(new BindingsModule()); + Injector injector = Guice.createInjector(); PlayerGUI playerGUI = injector.getInstance(PlayerGUI.class); JFrame frame = new JFrame(); frame.setMinimumSize(new Dimension(600, 400)); diff --git a/src/main/java/musicplayer/callbacks/PlayerCallbackInterface.java b/src/main/java/musicplayer/callbacks/PlayerCallbackInterface.java index f829a06..63a830b 100644 --- a/src/main/java/musicplayer/callbacks/PlayerCallbackInterface.java +++ b/src/main/java/musicplayer/callbacks/PlayerCallbackInterface.java @@ -1,7 +1,10 @@ package musicplayer.callbacks; +import com.google.inject.ImplementedBy; +import musicplayer.PlayerGUI; import musicplayer.model.Song; +@ImplementedBy(PlayerGUI.class) public interface PlayerCallbackInterface { /** diff --git a/src/main/java/musicplayer/player/IPlayer.java b/src/main/java/musicplayer/player/IPlayer.java index 063a430..8a934b2 100644 --- a/src/main/java/musicplayer/player/IPlayer.java +++ b/src/main/java/musicplayer/player/IPlayer.java @@ -1,10 +1,12 @@ package musicplayer.player; +import com.google.inject.ImplementedBy; import musicplayer.StartPlayingException; import musicplayer.model.Song; import java.util.Optional; +@ImplementedBy(GStreamerPlayer.class) public interface IPlayer { void playSong(Optional inputSong) throws StartPlayingException; void stop();