Skip to content

Commit 4586f71

Browse files
committed
v0.13 rolling. UI changes, extension filter bug fixed.
1 parent 603f62d commit 4586f71

File tree

9 files changed

+196
-24
lines changed

9 files changed

+196
-24
lines changed

Readme.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
mplayer4anime is mplayer launcher to play video file with audio layer and/or subtitles (.ass, .srt, etc,,,) at once.
44

5+
![Screenshot](https://farm8.staticflickr.com/7917/40285210053_fe9c781698_o.png)
6+
57
## License
68

79
Source code spreads under the GNU General Public License v.3. You can find it in LICENSE file or just visit www.gnu.org (it should be there for sure).

pom.xml

Lines changed: 110 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,36 +5,144 @@
55
<modelVersion>4.0.0</modelVersion>
66

77
<groupId>loper</groupId>
8+
<name>mplayer4anime</name>
9+
810
<artifactId>mplayer4anime</artifactId>
9-
<version>0.12-SNAPSHOT</version>
11+
<version>0.13-SNAPSHOT</version>
12+
1013
<packaging>jar</packaging>
11-
<name>InnaIrcBot</name>
14+
15+
<url>https://github.com/developersu/mplayer4anime</url>
16+
<description>
17+
mplayer front end to play content pairs, that mostly used for anime (mka+mkv, mp4+ac3, mkv+srt)
18+
</description>
19+
<inceptionYear>2018-2019</inceptionYear>
20+
<organization>
21+
<name>Dmitry Isaenko</name>
22+
<url>https://developersu.blogspot.com/search/label/mplayer4anime</url>
23+
</organization>
24+
25+
<licenses>
26+
<license>
27+
<name>GPLv3</name>
28+
<url>LICENSE</url>
29+
<distribution>manual</distribution>
30+
</license>
31+
</licenses>
32+
33+
<developers>
34+
<developer>
35+
<id>developer.su</id>
36+
<name>Dmitry Isaenko</name>
37+
<roles>
38+
<role>Developer</role>
39+
</roles>
40+
<timezone>+3</timezone>
41+
<url>https://developersu.blogspot.com/</url>
42+
</developer>
43+
</developers>
44+
1245
<properties>
1346
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1447
</properties>
48+
49+
<issueManagement>
50+
<system>GitHub</system>
51+
<url>https://github.com/developer_su/${project.artifactId}/issues</url>
52+
</issueManagement>
53+
1554
<dependencies>
1655
<dependency>
1756
<groupId>com.google.code.gson</groupId>
1857
<artifactId>gson</artifactId>
1958
<version>2.8.5</version>
2059
<scope>compile</scope>
2160
</dependency>
61+
<!-- openJFX Linux -->
2262
<dependency>
2363
<groupId>org.openjfx</groupId>
2464
<artifactId>javafx-controls</artifactId>
2565
<version>11</version>
66+
<classifier>linux</classifier>
2667
<scope>compile</scope>
2768
</dependency>
2869
<dependency>
2970
<groupId>org.openjfx</groupId>
3071
<artifactId>javafx-media</artifactId>
3172
<version>11</version>
73+
<classifier>linux</classifier>
3274
<scope>compile</scope>
3375
</dependency>
3476
<dependency>
3577
<groupId>org.openjfx</groupId>
3678
<artifactId>javafx-fxml</artifactId>
3779
<version>11</version>
80+
<classifier>linux</classifier>
81+
<scope>compile</scope>
82+
</dependency>
83+
<dependency>
84+
<groupId>org.openjfx</groupId>
85+
<artifactId>javafx-graphics</artifactId>
86+
<version>11</version>
87+
<classifier>linux</classifier>
88+
<scope>compile</scope>
89+
</dependency>
90+
<!-- openJFX Windows -->
91+
<dependency>
92+
<groupId>org.openjfx</groupId>
93+
<artifactId>javafx-controls</artifactId>
94+
<version>11</version>
95+
<classifier>win</classifier>
96+
<scope>compile</scope>
97+
</dependency>
98+
<dependency>
99+
<groupId>org.openjfx</groupId>
100+
<artifactId>javafx-media</artifactId>
101+
<version>11</version>
102+
<classifier>win</classifier>
103+
<scope>compile</scope>
104+
</dependency>
105+
<dependency>
106+
<groupId>org.openjfx</groupId>
107+
<artifactId>javafx-fxml</artifactId>
108+
<version>11</version>
109+
<classifier>win</classifier>
110+
<scope>compile</scope>
111+
</dependency>
112+
<dependency>
113+
<groupId>org.openjfx</groupId>
114+
<artifactId>javafx-graphics</artifactId>
115+
<version>11</version>
116+
<classifier>win</classifier>
117+
<scope>compile</scope>
118+
</dependency>
119+
<!-- openJFX MAC -->
120+
<dependency>
121+
<groupId>org.openjfx</groupId>
122+
<artifactId>javafx-controls</artifactId>
123+
<version>11</version>
124+
<classifier>mac</classifier>
125+
<scope>compile</scope>
126+
</dependency>
127+
<dependency>
128+
<groupId>org.openjfx</groupId>
129+
<artifactId>javafx-media</artifactId>
130+
<version>11</version>
131+
<classifier>mac</classifier>
132+
<scope>compile</scope>
133+
</dependency>
134+
<dependency>
135+
<groupId>org.openjfx</groupId>
136+
<artifactId>javafx-fxml</artifactId>
137+
<version>11</version>
138+
<classifier>mac</classifier>
139+
<scope>compile</scope>
140+
</dependency>
141+
<dependency>
142+
<groupId>org.openjfx</groupId>
143+
<artifactId>javafx-graphics</artifactId>
144+
<version>11</version>
145+
<classifier>mac</classifier>
38146
<scope>compile</scope>
39147
</dependency>
40148
</dependencies>

src/main/java/mplayer4anime/AppPreferences.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ private void storeSingleStringList(String whichList, String[] strArr){
5252
/** Handle lists of the audio files extensions */
5353
public void setAudioExtensionsList(String[] audioExtensionsList){ storeSingleStringList("AUDIO_EXTENSIONS_LIST", audioExtensionsList); }
5454
public String[] getAudioExtensionsList(){ return preferences.get("AUDIO_EXTENSIONS_LIST", "*.mka *.ac3").split(" "); }
55-
5655
/** Handle lists of the subtitles extensions selector */
5756
public void setSubsExtensionsList(String[] subsList){ storeSingleStringList("SUBS_EXTENSIONS_LIST", subsList); }
5857
public String[] getSubsExtensionsList(){ return preferences.get("SUBS_EXTENSIONS_LIST", "*.ass *.srt ").split(" "); }

src/main/java/mplayer4anime/Settings/ControllerListsSelector.java

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public void initialize(URL url, ResourceBundle rb) {
3131
* Must be run on start
3232
* Set list content
3333
*/
34-
void setList(String[] listFromStorage, boolean isListOfExtensions){
34+
void setList(String[] listFromStorage, boolean isListOfExtensions){
3535
observableList = FXCollections.observableArrayList(listFromStorage);
3636
listView.setItems(observableList);
3737
this.listOfExtensions = isListOfExtensions;
@@ -71,31 +71,40 @@ private void downRecord(){
7171
private void removeRecord(){ observableList.remove(listView.getSelectionModel().getSelectedItem()); }
7272
@FXML
7373
private void addNewRecord(){
74-
String addingItem = newRecordText.getText().trim();
74+
String addingItem = newRecordText.getText().trim().toLowerCase();
7575
if (!addingItem.isEmpty()) // If this field is non-empty
7676
if (!addingItem.contains(" ") && !addingItem.contains("\t")) {
7777
if (this.listOfExtensions) {
78-
if (addingItem.startsWith("*."))
78+
if (addingItem.startsWith("*.")) {
7979
if (addingItem.substring(2).contains("*")) {
8080
ServiceWindow.getErrorNotification(resourceBundle.getString("Error"), resourceBundle.getString("settings_fieldContainUnacceptedChars"));
81-
} else {
82-
observableList.add(addingItem);
8381
}
82+
else {
83+
validateAndAdd(addingItem);
84+
}
85+
}
8486
else if (addingItem.contains("*")) {
8587
ServiceWindow.getErrorNotification(resourceBundle.getString("Error"), resourceBundle.getString("settings_fieldContainUnacceptedChars"));
86-
} else if (addingItem.startsWith(".")) {
87-
observableList.add("*" + addingItem);
88-
} else {
89-
observableList.add("*." + addingItem);
88+
}
89+
else if (addingItem.startsWith(".")) {
90+
validateAndAdd("*" + addingItem);
91+
}
92+
else {
93+
validateAndAdd("*." + addingItem);
9094
}
9195
}
9296
else {
93-
observableList.add(addingItem);
97+
validateAndAdd(addingItem);
9498
}
9599
}
96100
else{
97101
ServiceWindow.getErrorNotification(resourceBundle.getString("Error"), resourceBundle.getString("settings_fieldContainUnacceptedChars"));
98102
}
99103
newRecordText.clear();
100104
}
101-
}
105+
private void validateAndAdd(String addingItem){
106+
if (!observableList.contains(addingItem)) {
107+
observableList.add(addingItem);
108+
}
109+
}
110+
}

src/main/java/mplayer4anime/appPanes/ControllerPane.java

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import java.io.File;
1717
import java.io.FilenameFilter;
1818
import java.net.URL;
19+
import java.util.ArrayList;
1920
import java.util.Arrays;
2021
import java.util.List;
2122
import java.util.ResourceBundle;
@@ -126,22 +127,29 @@ public void updateItem(File item, boolean empty){
126127
* */
127128
@FXML
128129
void openDirChooser(){
129-
String[] filesExtension;
130+
String[] filesExtensionTmp;
130131
switch (paneType) {
131132
case "Video":
132-
filesExtension = appPreferences.getVideoExtensionsList();
133+
filesExtensionTmp = appPreferences.getVideoExtensionsList();
133134
break;
134135
case "Audio":
135-
filesExtension = appPreferences.getAudioExtensionsList();
136+
filesExtensionTmp = appPreferences.getAudioExtensionsList();
136137
break;
137138
case "Subtitles":
138-
filesExtension = appPreferences.getSubsExtensionsList();
139+
filesExtensionTmp = appPreferences.getSubsExtensionsList();
139140
break;
140141
default:
141-
filesExtension = new String[]{"*"};
142+
filesExtensionTmp = new String[]{"*"};
142143
break;
143144
}
144145

146+
List<String> lowerAndUpperExts = new ArrayList<>();
147+
for (String s: filesExtensionTmp) {
148+
lowerAndUpperExts.add(s);
149+
lowerAndUpperExts.add(s.toUpperCase());
150+
}
151+
String[] filesExtension = lowerAndUpperExts.toArray(new String[lowerAndUpperExts.size()]);
152+
145153
File directoryReceived; // Store files (folder) received from selector
146154
DirectoryChooser dirSelect;
147155

@@ -164,7 +172,7 @@ public boolean accept(File file, String Name) {
164172
if (Name.lastIndexOf('.') > 0) {
165173
int lastindex = Name.lastIndexOf('.');
166174
String ext = Name.substring(lastindex);
167-
for (String key : filesExtension){
175+
for (String key : filesExtension){ // TODO: add toLowerCase and validate whatever registry extension noted
168176
if (ext.equals(key.substring(1)))
169177
return true;
170178
}
@@ -200,6 +208,13 @@ void openFilesChooser(){
200208
break;
201209
}
202210

211+
List<String> lowerAndUpperExts = new ArrayList<>();
212+
for (String s: filesExtension) {
213+
lowerAndUpperExts.add(s);
214+
lowerAndUpperExts.add(s.toUpperCase());
215+
}
216+
filesExtension = lowerAndUpperExts.toArray(new String[lowerAndUpperExts.size()]);
217+
203218
List<File> filesRecievedList;
204219

205220
FileChooser fc = new FileChooser();
@@ -211,7 +226,7 @@ void openFilesChooser(){
211226
fc.getExtensionFilters().addAll(new FileChooser.ExtensionFilter(paneType, filesExtension));
212227

213228
filesRecievedList = fc.showOpenMultipleDialog(paneListView.getScene().getWindow());
214-
if (filesRecievedList != null){
229+
if (filesRecievedList != null){ // TODO: and !filesRecieved.isEmpty()
215230
File[] filesRecieved = new File[filesRecievedList.size()];
216231
filesRecievedList.toArray(filesRecieved);
217232
displayFiles(filesRecieved);

src/main/resources/Settings/SettingsLayout.fxml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
<VBox xmlns="http://javafx.com/javafx/8.0.141" xmlns:fx="http://javafx.com/fxml/1" fx:controller="mplayer4anime.Settings.SettingsController">
1616
<children>
17-
<TabPane side="LEFT" tabClosingPolicy="UNAVAILABLE" tabMaxHeight="100.0" tabMaxWidth="500.0" tabMinHeight="100.0" tabMinWidth="80.0" VBox.vgrow="ALWAYS">
17+
<TabPane side="LEFT" styleClass="tab-paneSettings" stylesheets="@../res/landing.css" tabClosingPolicy="UNAVAILABLE" tabMaxHeight="100.0" tabMaxWidth="500.0" tabMinHeight="100.0" tabMinWidth="80.0" VBox.vgrow="ALWAYS">
1818
<tabs>
1919
<Tab closable="false">
2020
<content>

src/main/resources/locale_en.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
about_line1=mplayer4amine distributes under GNU GPLv3 license.
2-
about_line2=Release: v0.12
2+
about_line2=Release: v0.13
33
about_line3=Development & maintenance by Dmitry Isaenko.
44
about_AboutName=About
55
main_tab_audio=Audio

src/main/resources/locale_ru.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
menu_File_Recent=\u041F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0435 \u0444\u0430\u0439\u043B\u044B...
22
about_line1=mplayer4amine \u0440\u0430\u0441\u043F\u0440\u043E\u0441\u0442\u0440\u0430\u043D\u044F\u0435\u0442\u0441\u044F \u043F\u043E \u043B\u0438\u0446\u0435\u043D\u0437\u0438\u0438 GNU GPLv3.
3-
about_line2=\u0420\u0435\u043B\u0438\u0437: v0.12
3+
about_line2=\u0420\u0435\u043B\u0438\u0437: v0.13
44
about_line3=\u0420\u0430\u0437\u0440\u0430\u0431\u043E\u0442\u0430\u043D\u043E \u0438 \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044F \u0414\u043C\u0438\u0442\u0440\u0438\u0435\u043C \u0418\u0441\u0430\u0435\u043D\u043A\u043E.
55
about_AboutName=\u041E \u043F\u0440\u0438\u043B\u043E\u0436\u0435\u043D\u0438\u0438
66
main_tab_audio=\u0410\u0443\u0434\u0438\u043E

src/main/resources/res/landing.css

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,4 +90,43 @@
9090
-fx-background-image: url(gjel.png);
9191
-fx-background-position: center;
9292
-fx-background-repeat: repeat;
93+
}
94+
95+
/* -======================== TAB PANE =========================- */
96+
.tab-paneSettings .tab SVGPath{
97+
-fx-fill: #000000;
98+
}
99+
.tab-paneSettings .tab:selected SVGPath{
100+
-fx-fill: #267a9e;
101+
}
102+
.tab-paneSettings .tab{
103+
-fx-background-color: #ffffff;
104+
-fx-focus-color: transparent;
105+
-fx-faint-focus-color: transparent;
106+
-fx-border-radius: 0 0 0 0;
107+
-fx-border-width: 0 0 5 0;
108+
-fx-border-color: #ffffff;
109+
}
110+
111+
.tab-paneSettings .tab:selected{
112+
-fx-background-color: #ebffff;
113+
-fx-focus-color: transparent;
114+
-fx-faint-focus-color: transparent;
115+
-fx-border-radius: 0 0 0 0;
116+
-fx-border-width: 0 0 5 0;
117+
-fx-border-color: #8dbee4;
118+
}
119+
120+
.tab-paneSettings > .tab-header-area {
121+
-fx-background-insets: 0.0;
122+
-fx-padding: 0;
123+
}
124+
125+
.tab-paneSettings > .tab-header-area > .tab-header-background
126+
{
127+
-fx-background-color: #ffffff;
128+
129+
}
130+
.tab-paneSettings > .tab-header-area > .headers-region > .tab {
131+
-fx-padding: 10;
93132
}

0 commit comments

Comments
 (0)