Skip to content

Commit

Permalink
Removed JavaFX Library and used JLayer instead, due to Oracles setup in
Browse files Browse the repository at this point in the history
JDK7
  • Loading branch information
josephliccini committed Jun 23, 2014
1 parent a5cae27 commit 7fca31a
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 44 deletions.
5 changes: 5 additions & 0 deletions GrooveGator/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,5 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.source=1.7
4 changes: 4 additions & 0 deletions GrooveGator/.settings/org.eclipse.m2e.core.prefs
@@ -0,0 +1,4 @@
activeProfiles=
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1
58 changes: 32 additions & 26 deletions GrooveGator/pom.xml
Expand Up @@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>GrooveGator</groupId>
<version>0.0.3-SNAPSHOT</version>
<name>Groove Gator</name>
<name>GrooveGator</name>
<description>An Open Source Java Grooveshark Downloader</description>
<build>
<sourceDirectory>src</sourceDirectory>
Expand All @@ -23,34 +23,35 @@
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<archive>
<manifest>
<mainClass>com.josephliccini.groovegator.GrooveGator</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
<executions>
<execution>
<id>make-assembly</id> <!-- this is used for inheritance merges -->
<phase>package</phase> <!-- bind to the packaging phase -->
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<archive>
<manifest>
<mainClass>com.josephliccini.groovegator.GrooveGator</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
<executions>
<execution>
<id>make-assembly</id> <!-- this is used for inheritance merges -->
<phase>package</phase> <!-- bind to the packaging phase -->
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<url>http://www.github.com/josephliccini/groovegator</url>
<inceptionYear>6/1/14</inceptionYear>
<inceptionYear>2014</inceptionYear>
<organization>
<name>Joseph Liccini</name>
<url>www.github.com/josephliccini</url>
</organization>
<dependencies>
<dependency>
Expand All @@ -73,6 +74,11 @@
<artifactId>GrooveAPI</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>javazoom</groupId>
<artifactId>jlayer</artifactId>
<version>1.0.1</version>
</dependency>
</dependencies>
<artifactId>GrooveGator</artifactId>
</project>
34 changes: 16 additions & 18 deletions GrooveGator/src/com/josephliccini/groovegator/GrooveGator.java
Expand Up @@ -12,14 +12,9 @@
import java.nio.channels.Channels;
import java.nio.channels.ReadableByteChannel;
import java.util.Vector;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.prefs.Preferences;

import javafx.embed.swing.JFXPanel;
import javafx.scene.media.Media;
import javafx.scene.media.MediaPlayer;

import javax.swing.BorderFactory;
import javax.swing.ImageIcon;
import javax.swing.JButton;
Expand Down Expand Up @@ -47,6 +42,8 @@
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableColumn;

import javazoom.jl.decoder.JavaLayerException;
import javazoom.jl.player.advanced.AdvancedPlayer;
import net.miginfocom.swing.MigLayout;

import com.scilor.grooveshark.API.Base.GroovesharkAudioStream;
Expand All @@ -69,7 +66,6 @@ public class GrooveGator extends JFrame
private static AtomicInteger percentageDivisor;
private String version = "v0.3";
final URL beep = getClass().getResource("/beep.mp3");
MediaPlayer mediaPlayer;

private static AtomicInteger displayPercentage;
JTabbedPane tabbedPane;
Expand Down Expand Up @@ -128,21 +124,13 @@ public class GrooveGator extends JFrame

public static void main(String[] args)
{
final CountDownLatch latch = new CountDownLatch(1);
SwingUtilities.invokeLater(new Runnable()
{
public void run()
{
new JFXPanel();
latch.countDown();
createAndShowGUI();
}
});
try {
latch.await();
} catch (InterruptedException e) {
e.printStackTrace();
}
}

private static void createAndShowGUI()
Expand All @@ -165,7 +153,6 @@ private static void createAndShowGUI()
public GrooveGator(String s)
{
super(s);
mediaPlayer = new MediaPlayer(new Media(beep.toString()));

prefs = Preferences.userRoot().node(this.getClass().getName());
tabbedPane = new JTabbedPane();
Expand Down Expand Up @@ -415,6 +402,7 @@ public boolean isCellEditable(int rowIndex, int colIndex)

};


for(int i = 0; i < 5; ++i)
{
TableColumn column = table.getColumnModel().getColumn(i);
Expand Down Expand Up @@ -488,9 +476,19 @@ private void playlistToSearch(int playlistId)

private void beep()
{
mediaPlayer.play();
mediaPlayer.seek(mediaPlayer.getStartTime());
//mediaPlayer.pause();
SwingUtilities.invokeLater( new Runnable()
{
public void run()
{
AdvancedPlayer player;
try {
player = new AdvancedPlayer(beep.openStream());
player.play();
} catch (JavaLayerException | IOException e) {
e.printStackTrace();
}
}
});
}

private class ConfigureSettingsMenuItemListener implements ActionListener
Expand Down

0 comments on commit 7fca31a

Please sign in to comment.