Switched tom JIT bindings for default implementations.
This commit is contained in:
parent
95979fff29
commit
5e80829db0
@ -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);
|
|
||||||
}
|
|
||||||
}
|
|
@ -103,7 +103,7 @@ public class PlayerGUI implements PlayerCallbackInterface, LibraryCallbackInterf
|
|||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
DatabaseManager.init();
|
DatabaseManager.init();
|
||||||
Injector injector = Guice.createInjector(new BindingsModule());
|
Injector injector = Guice.createInjector();
|
||||||
PlayerGUI playerGUI = injector.getInstance(PlayerGUI.class);
|
PlayerGUI playerGUI = injector.getInstance(PlayerGUI.class);
|
||||||
JFrame frame = new JFrame();
|
JFrame frame = new JFrame();
|
||||||
frame.setMinimumSize(new Dimension(600, 400));
|
frame.setMinimumSize(new Dimension(600, 400));
|
||||||
|
@ -1,7 +1,10 @@
|
|||||||
package musicplayer.callbacks;
|
package musicplayer.callbacks;
|
||||||
|
|
||||||
|
import com.google.inject.ImplementedBy;
|
||||||
|
import musicplayer.PlayerGUI;
|
||||||
import musicplayer.model.Song;
|
import musicplayer.model.Song;
|
||||||
|
|
||||||
|
@ImplementedBy(PlayerGUI.class)
|
||||||
public interface PlayerCallbackInterface {
|
public interface PlayerCallbackInterface {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1,10 +1,12 @@
|
|||||||
package musicplayer.player;
|
package musicplayer.player;
|
||||||
|
|
||||||
|
import com.google.inject.ImplementedBy;
|
||||||
import musicplayer.StartPlayingException;
|
import musicplayer.StartPlayingException;
|
||||||
import musicplayer.model.Song;
|
import musicplayer.model.Song;
|
||||||
|
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
|
@ImplementedBy(GStreamerPlayer.class)
|
||||||
public interface IPlayer {
|
public interface IPlayer {
|
||||||
void playSong(Optional<Song> inputSong) throws StartPlayingException;
|
void playSong(Optional<Song> inputSong) throws StartPlayingException;
|
||||||
void stop();
|
void stop();
|
||||||
|
Loading…
Reference in New Issue
Block a user