Skip to content
This repository has been archived by the owner on Jun 26, 2023. It is now read-only.

Commit

Permalink
Fixed UI Bugs, Added Search in Playlists
Browse files Browse the repository at this point in the history
  • Loading branch information
rnayabed committed Jan 31, 2020
1 parent 497b98c commit bc891a4
Show file tree
Hide file tree
Showing 34 changed files with 71 additions and 61 deletions.
Binary file removed builds/Gramophy-20.01.2020-windows-x64.zip
Binary file not shown.
Binary file modified builds/linux-x64/Gramophy.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion builds/linux-x64/config
Original file line number Diff line number Diff line change
@@ -1 +1 @@
NULL::AIzaSyBdCjfmdiSOzLsd2emTAmpcWv92V6le16I::15::
NULL::AIzaSyBdCjfmdiSOzLsd2emTAmpcWv92V6le16I::30::
Binary file modified builds/linux-x64/youtube-dl
Binary file not shown.
Binary file modified builds/windows-x64/Gramophy.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion builds/windows-x64/config
Original file line number Diff line number Diff line change
@@ -1 +1 @@
NULL::AIzaSyBd-NNj7wHCbaYnxNxZCCw3Crx6Mu4ko34::15::
NULL::AIzaSyBd-NNj7wHCbaYnxNxZCCw3Crx6Mu4ko34::30::
Binary file modified builds/windows-x64/youtube-dl.exe
Binary file not shown.
Binary file modified out/artifacts/Gramophy_jar/Gramophy.jar
Binary file not shown.
Binary file modified out/production/Gramophy/Gramophy/Player$1.class
Binary file not shown.
Binary file modified out/production/Gramophy/Gramophy/Player$2.class
Binary file not shown.
Binary file modified out/production/Gramophy/Gramophy/Player$3.class
Binary file not shown.
Binary file modified out/production/Gramophy/Gramophy/Player.class
Binary file not shown.
33 changes: 12 additions & 21 deletions out/production/Gramophy/Gramophy/dash.fxml
Original file line number Diff line number Diff line change
@@ -1,25 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>

<?import com.jfoenix.controls.JFXButton?>
<?import com.jfoenix.controls.JFXListView?>
<?import com.jfoenix.controls.JFXMasonryPane?>
<?import com.jfoenix.controls.JFXSpinner?>
<?import com.jfoenix.controls.JFXTextField?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.ListView?>
<?import javafx.scene.control.ScrollPane?>
<?import javafx.scene.control.Slider?>
<?import javafx.scene.image.Image?>
<?import javafx.scene.image.ImageView?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.Region?>
<?import javafx.scene.layout.StackPane?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.text.Font?>
<?import com.jfoenix.controls.*?>
<?import javafx.geometry.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.image.*?>
<?import javafx.scene.layout.*?>
<?import javafx.scene.text.*?>

<AnchorPane fx:id="basePane" prefHeight="733.0" prefWidth="1119.0" styleClass="base_pane" stylesheets="@style.css" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="Gramophy.dashController">
<AnchorPane fx:id="basePane" prefHeight="733.0" prefWidth="1119.0" styleClass="base_pane" stylesheets="@style.css" xmlns="http://javafx.com/javafx/10.0.2-internal" xmlns:fx="http://javafx.com/fxml/1" fx:controller="Gramophy.dashController">
<children>
<StackPane fx:id="alertStackPane" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" />
<StackPane fx:id="importSongsFromYouTubePopupStackPane" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" />
Expand Down Expand Up @@ -148,14 +136,17 @@
<Font name="Roboto Regular" size="14.0" />
</font>
</JFXTextField>
<JFXButton fx:id="selectMusicLibraryFolderButton" onAction="#selectMusicLibraryFolderButtonClicked" text="Select " textFill="WHITE">
<JFXButton fx:id="selectMusicLibraryFolderButton" onAction="#selectMusicLibraryFolderButtonClicked" text="Select" textFill="WHITE">
<graphic>
<ImageView fitHeight="24.0" fitWidth="24.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@assets/icons8_folder_24px.png" />
</image>
</ImageView>
</graphic>
<font>
<Font name="Roboto Regular" size="13.0" />
</font>
</JFXButton>
</children>
</HBox>
Expand Down Expand Up @@ -216,7 +207,7 @@
</children>
</HBox>
<Region prefHeight="200.0" prefWidth="200.0" VBox.vgrow="ALWAYS" />
<Label text="Build 20.01.2020&#10;github.com/dubbadhar/gramophy&#10;This Software is licensed under the GNU GPLv3 License">
<Label text="Build 31.01.2020&#10;github.com/dubbadhar/gramophy&#10;This Software is licensed under the GNU GPLv3 License">
<font>
<Font name="Roboto Regular" size="13.0" />
</font>
Expand Down
Binary file modified out/production/Gramophy/Gramophy/dashController$11.class
Binary file not shown.
Binary file modified out/production/Gramophy/Gramophy/dashController$12$1.class
Binary file not shown.
Binary file modified out/production/Gramophy/Gramophy/dashController$12$2.class
Binary file not shown.
Binary file modified out/production/Gramophy/Gramophy/dashController$12$3.class
Binary file not shown.
Binary file modified out/production/Gramophy/Gramophy/dashController$12$4.class
Binary file not shown.
Binary file modified out/production/Gramophy/Gramophy/dashController$12.class
Binary file not shown.
Binary file modified out/production/Gramophy/Gramophy/dashController$13.class
Binary file not shown.
Binary file modified out/production/Gramophy/Gramophy/dashController$14.class
Binary file not shown.
Binary file modified out/production/Gramophy/Gramophy/dashController$15.class
Binary file not shown.
Binary file modified out/production/Gramophy/Gramophy/dashController$16$1.class
Binary file not shown.
Binary file modified out/production/Gramophy/Gramophy/dashController$16.class
Binary file not shown.
Binary file modified out/production/Gramophy/Gramophy/dashController$17.class
Binary file not shown.
Binary file modified out/production/Gramophy/Gramophy/dashController$18.class
Binary file not shown.
Binary file modified out/production/Gramophy/Gramophy/dashController$19.class
Binary file not shown.
Binary file modified out/production/Gramophy/Gramophy/dashController$20.class
Binary file not shown.
Binary file modified out/production/Gramophy/Gramophy/dashController.class
Binary file not shown.
4 changes: 4 additions & 0 deletions out/production/Gramophy/Gramophy/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
-fx-background : #484848;
}

.current_playlist_song > Label{
-fx-text-fill:green;
}

.card {
-fx-background-color : #383838;
-fx-background-radius: 10;
Expand Down
34 changes: 23 additions & 11 deletions src/Gramophy/Player.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.ConcurrentModificationException;
import java.util.HashMap;
import java.util.Random;

Expand Down Expand Up @@ -147,6 +148,28 @@ protected Void call(){

isActive = true;

while(true)
{
try
{
for(Node eachNode : dash.playlistListView.getItems())
{
HBox x = (HBox) eachNode;

if(x.getChildren().get(0).getId().equals(songIndex+""))
{
Platform.runLater(()->dash.playlistListView.getSelectionModel().select(x));
break;
}
}
break;
}
catch (ConcurrentModificationException e)
{
System.out.println("concurrent exception, retrying ...");
}
}

if(songDetails.get("location").toString().equals("local"))
{
source = "file:"+songDetails.get("source").toString();
Expand Down Expand Up @@ -179,7 +202,6 @@ else if(songDetails.get("location").toString().equals("youtube"))
dash.songNameLabel.setText(songDetails.get("title").toString());
dash.artistLabel.setText(songDetails.get("channelTitle").toString());
dash.albumArtImgView.setImage(x);

show();
});

Expand Down Expand Up @@ -238,16 +260,6 @@ else if(songDetails.get("location").toString().equals("youtube"))
return null;
}

for(Node eachNode : dash.playlistListView.getItems())
{
HBox x = (HBox) eachNode;

if(x.getChildren().get(0).getId().equals(songIndex+""))
{
Platform.runLater(()->dash.playlistListView.getSelectionModel().select(x));
}
}

System.out.println("starting ...");

media = new Media(source);
Expand Down
33 changes: 12 additions & 21 deletions src/Gramophy/dash.fxml
Original file line number Diff line number Diff line change
@@ -1,25 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>

<?import com.jfoenix.controls.JFXButton?>
<?import com.jfoenix.controls.JFXListView?>
<?import com.jfoenix.controls.JFXMasonryPane?>
<?import com.jfoenix.controls.JFXSpinner?>
<?import com.jfoenix.controls.JFXTextField?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.ListView?>
<?import javafx.scene.control.ScrollPane?>
<?import javafx.scene.control.Slider?>
<?import javafx.scene.image.Image?>
<?import javafx.scene.image.ImageView?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.Region?>
<?import javafx.scene.layout.StackPane?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.text.Font?>
<?import com.jfoenix.controls.*?>
<?import javafx.geometry.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.image.*?>
<?import javafx.scene.layout.*?>
<?import javafx.scene.text.*?>

<AnchorPane fx:id="basePane" prefHeight="733.0" prefWidth="1119.0" styleClass="base_pane" stylesheets="@style.css" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="Gramophy.dashController">
<AnchorPane fx:id="basePane" prefHeight="733.0" prefWidth="1119.0" styleClass="base_pane" stylesheets="@style.css" xmlns="http://javafx.com/javafx/10.0.2-internal" xmlns:fx="http://javafx.com/fxml/1" fx:controller="Gramophy.dashController">
<children>
<StackPane fx:id="alertStackPane" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" />
<StackPane fx:id="importSongsFromYouTubePopupStackPane" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" />
Expand Down Expand Up @@ -148,14 +136,17 @@
<Font name="Roboto Regular" size="14.0" />
</font>
</JFXTextField>
<JFXButton fx:id="selectMusicLibraryFolderButton" onAction="#selectMusicLibraryFolderButtonClicked" text="Select " textFill="WHITE">
<JFXButton fx:id="selectMusicLibraryFolderButton" onAction="#selectMusicLibraryFolderButtonClicked" text="Select" textFill="WHITE">
<graphic>
<ImageView fitHeight="24.0" fitWidth="24.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@assets/icons8_folder_24px.png" />
</image>
</ImageView>
</graphic>
<font>
<Font name="Roboto Regular" size="13.0" />
</font>
</JFXButton>
</children>
</HBox>
Expand Down Expand Up @@ -216,7 +207,7 @@
</children>
</HBox>
<Region prefHeight="200.0" prefWidth="200.0" VBox.vgrow="ALWAYS" />
<Label text="Build 20.01.2020&#10;github.com/dubbadhar/gramophy&#10;This Software is licensed under the GNU GPLv3 License">
<Label text="Build 31.01.2020&#10;github.com/dubbadhar/gramophy&#10;This Software is licensed under the GNU GPLv3 License">
<font>
<Font name="Roboto Regular" size="13.0" />
</font>
Expand Down
20 changes: 14 additions & 6 deletions src/Gramophy/dashController.java
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ public void checkForYouTubeDlUpdate() throws Exception
}
else if(line.startsWith("ERROR"))
{
showErrorAlert("Unable to check for YouTube Dl Update","\nMake sure you're connected to the internet\n\nYouTube Dl Output : "+line);
showErrorAlert("Unable to check for YouTube Dl Update","Make sure you're connected to the internet\n\nYouTube Dl Output : "+line);
}
}

Expand Down Expand Up @@ -702,7 +702,7 @@ else if(!currentPlaylist.equals(playlistName))
Platform.runLater(()->switchPane(3));
try
{
Thread.sleep(400);
Thread.sleep(300);
}
catch (Exception e)
{
Expand Down Expand Up @@ -1115,8 +1115,10 @@ protected Void call(){
pName.setFont(robotoRegular35);
pName.setStyle("-fx-text-fill: WHITE;");
JFXButton addButton = new JFXButton("ADD");
addButton.setFont(robotoRegular15);
addButton.setTextFill(PAINT_GREEN);
JFXButton cancelButton = new JFXButton("CANCEL");
cancelButton.setFont(robotoRegular15);
cancelButton.setTextFill(Color.RED);

cancelButton.setOnMouseClicked(event1 -> {
Expand Down Expand Up @@ -1258,7 +1260,7 @@ protected Void call() {

});

JFXButton saveToPlaylistButton = new JFXButton("");
JFXButton saveToPlaylistButton = new JFXButton();
saveToPlaylistButton.setGraphic(new ImageView(saveToPlaylistIcon));
saveToPlaylistButton.setId(x + "");
saveToPlaylistButton.setTextFill(PAINT_GREEN);
Expand Down Expand Up @@ -1390,7 +1392,7 @@ protected Void call() {
}).start();
});

JFXButton saveToPlaylistButton = new JFXButton("");
JFXButton saveToPlaylistButton = new JFXButton();
saveToPlaylistButton.setGraphic(new ImageView(saveToPlaylistIcon));
saveToPlaylistButton.setTextFill(PAINT_GREEN);
saveToPlaylistButton.setId(playlistID);
Expand Down Expand Up @@ -1431,9 +1433,9 @@ protected Void call() {

if (youtubeListView.getItems().size() > 0 && !youtubeNextPageToken.equals("")) {
JFXButton loadMoreButton = new JFXButton("Load More");
loadMoreButton.setFont(robotoRegular15);
loadMoreButton.setCache(true);
loadMoreButton.setCacheHint(CacheHint.SPEED);
loadMoreButton.setFont(robotoRegular15);
loadMoreButton.setTextFill(PAINT_GREEN);
Platform.runLater(() -> youtubeListView.getItems().add(new HBox(loadMoreButton)));
loadMoreButton.setOnMouseClicked(event -> {
Expand Down Expand Up @@ -1471,7 +1473,7 @@ private void switchPane(int paneNo)
// 1 : Browse, 2 : Library, 3: Settings
if(currentSelectedPane!=paneNo)
{
double speed = 2.5;
double speed = 4;
if(paneNo == 1)
{
browseButton.setTextFill(PAINT_GREEN);
Expand Down Expand Up @@ -1941,6 +1943,7 @@ protected Void call()
l.setBody(vb);

JFXButton cancelButton = new JFXButton("CANCEL");
cancelButton.setFont(robotoRegular15);
cancelButton.setTextFill(Color.RED);

l.setActions(cancelButton);
Expand Down Expand Up @@ -2027,8 +2030,10 @@ else if(sd.get("location").toString().equals("local"))
l.setBody(vb);

JFXButton confirmButton = new JFXButton("CONFIRM");
confirmButton.setFont(robotoRegular15);
confirmButton.setTextFill(WHITE_PAINT);
JFXButton cancelButton = new JFXButton("CANCEL");
cancelButton.setFont(robotoRegular15);
cancelButton.setTextFill(Color.RED);

l.setActions(confirmButton,cancelButton);
Expand Down Expand Up @@ -2189,6 +2194,7 @@ public void showErrorAlert(String heading, String content)
contentLabel.setWrapText(true);
l.setBody(contentLabel);
JFXButton okButton = new JFXButton("OK");
okButton.setFont(robotoRegular15);
okButton.setTextFill(WHITE_PAINT);
l.setActions(okButton);

Expand Down Expand Up @@ -2250,8 +2256,10 @@ private void playlistImportSongsFromYouTubePlaylist()
sp.setPrefSize(24,24);
sp.setVisible(false);
JFXButton confirmButton = new JFXButton("IMPORT");
confirmButton.setFont(robotoRegular15);
confirmButton.setTextFill(WHITE_PAINT);
JFXButton cancelButton = new JFXButton("CANCEL");
cancelButton.setFont(robotoRegular15);
cancelButton.setTextFill(Color.RED);

l.setActions(sp,confirmButton,cancelButton);
Expand Down
4 changes: 4 additions & 0 deletions src/Gramophy/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
-fx-background : #484848;
}

.current_playlist_song > Label{
-fx-text-fill:green;
}

.card {
-fx-background-color : #383838;
-fx-background-radius: 10;
Expand Down

0 comments on commit bc891a4

Please sign in to comment.