Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
paulpacifico authored Nov 19, 2024
1 parent 6bb59da commit a90250a
Show file tree
Hide file tree
Showing 12 changed files with 425 additions and 146 deletions.
1 change: 1 addition & 0 deletions src/application/RenderQueue.java
Original file line number Diff line number Diff line change
Expand Up @@ -642,6 +642,7 @@ public boolean isCellEditable(int row, int column) {
}
};
table.setForeground(new Color(235,235,240));
table.setBackground(new Color(42,42,47));
table.setDefaultRenderer(String.class, new BoardTableCellRenderer());
table.setShowVerticalLines(false);
table.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
Expand Down
21 changes: 2 additions & 19 deletions src/application/Settings.java
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ public class Settings {
public static JTextField txtImageDuration = new JTextField();
private JLabel lblScaleMode = new JLabel(Shutter.language.getProperty("lblScaleMode"));
public static JComboBox<String> comboScale = new JComboBox<String>(new String [] {"fast_bilinear", "bilinear", "bicubic", "neighbor", "area", "gauss", "sinc", "lanczos", "spline"});
public static JCheckBox btnNoUpscale = new JCheckBox(Shutter.language.getProperty("btnNoUpscale"));
public static JCheckBox btnPreviewOutput = new JCheckBox(Shutter.language.getProperty("btnPreviewOutput"));
private JLabel lblSyncMode = new JLabel(Shutter.language.getProperty("lblSyncMode"));
public static JComboBox<String> comboSync = new JComboBox<String>(new String [] {"auto", "passthrough", "cfr", "vfr", "drop"});
Expand Down Expand Up @@ -153,7 +152,6 @@ public Settings() {
btnHidePath.setName("btnHidePath");
btnLoadPreset.setName("btnLoadPreset");
comboLoadPreset.setName("comboLoadPreset");
btnNoUpscale.setName("btnNoUpscale");
btnPreviewOutput.setName("btnPreviewOutput");
btnWaitFileComplete.setName("btnWaitFileComplete");
btnDisableAnimations.setName("btnDisableAnimations");
Expand All @@ -174,7 +172,7 @@ public Settings() {
txtImageDuration.setName("txtImageDuration");
comboLanguage.setName("comboLanguage");

frame.setSize(370, 750);
frame.setSize(370, 722);
if (Shutter.getLanguage.equals(Locale.of("ru").getDisplayLanguage()) || Shutter.getLanguage.equals(Locale.of("uk").getDisplayLanguage()))
{
frame.setSize(frame.getWidth() + 30, frame.getHeight());
Expand Down Expand Up @@ -465,23 +463,8 @@ public void actionPerformed(ActionEvent arg0) {
comboAction.setEnabled(false);
frame.getContentPane().add(comboAction);

btnNoUpscale.setFont(new Font(Shutter.freeSansFont, Font.PLAIN, 12));
btnNoUpscale.setBounds(12, btnEndingAction.getLocation().y + btnEndingAction.getHeight() + 10, btnNoUpscale.getPreferredSize().width, 16);
frame.getContentPane().add(btnNoUpscale);

btnNoUpscale.addActionListener(new ActionListener() {

@Override
public void actionPerformed(ActionEvent arg0) {

VideoPlayer.playerSetTime(VideoPlayer.playerCurrentFrame); //Use VideoPlayer.resizeAll and reload the frame
VideoPlayer.resizeAll();
}

});

btnPreviewOutput.setFont(new Font(Shutter.freeSansFont, Font.PLAIN, 12));
btnPreviewOutput.setBounds(12, btnNoUpscale.getLocation().y + btnNoUpscale.getHeight() + 10, btnPreviewOutput.getPreferredSize().width, 16);
btnPreviewOutput.setBounds(12, btnEndingAction.getLocation().y + btnEndingAction.getHeight() + 10, btnPreviewOutput.getPreferredSize().width, 16);
frame.getContentPane().add(btnPreviewOutput);

btnPreviewOutput.addActionListener(new ActionListener() {
Expand Down
263 changes: 170 additions & 93 deletions src/application/Shutter.java

Large diffs are not rendered by default.

7 changes: 5 additions & 2 deletions src/application/SubtitlesEdit.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import java.awt.Cursor;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.Insets;
import java.awt.MouseInfo;
import java.awt.Toolkit;
import java.awt.event.AdjustmentEvent;
Expand Down Expand Up @@ -55,6 +56,8 @@
import javax.swing.JTextPane;
import javax.swing.SwingConstants;

import com.formdev.flatlaf.ui.FlatLineBorder;

public class SubtitlesEdit {

public static JFrame frame;
Expand Down Expand Up @@ -409,7 +412,7 @@ private static JTextField addInPoint(String subIn) {

JTextField in = new JTextField();
in.setText(subIn);
in.setBorder(new RoundedLineBorder(new Color(55,55,55), 1, 5, true));
in.setBorder(new FlatLineBorder(new Insets(0,0,0,0), new Color(55,55,55), 1, 5));
in.setForeground(Utils.themeColor);
in.setFont(new Font(Shutter.montserratFont, Font.PLAIN, 12));
in.setBounds(77, textPosition - 2, 94, 25);
Expand Down Expand Up @@ -475,7 +478,7 @@ private static JTextField addOutPoint(String subOut) {

JTextField out = new JTextField();
out.setText(subOut);
out.setBorder(new RoundedLineBorder(new Color(55,55,55), 1, 5, true));
out.setBorder(new FlatLineBorder(new Insets(0,0,0,0), new Color(55,55,55), 1, 5));
out.setForeground(Utils.themeColor);
out.setFont(new Font(Shutter.montserratFont, Font.PLAIN, 12));
out.setBounds(77, textPosition + 24, 94, 25);
Expand Down
7 changes: 6 additions & 1 deletion src/application/Update.java
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,12 @@ public void run() {
File appPath = new File(userFolder + "/Downloads/" + newVersion);
if (new File(userFolder + "/Downloads").exists() == false)
{
appPath = new File(userFolder + "/Desktop/" + newVersion);
if (new File(userFolder + "/Desktop").exists() == false)
{
appPath = new File(Shutter.dirTemp + newVersion);
}
else
appPath = new File(userFolder + "/Desktop/" + newVersion);
}

//Download
Expand Down
9 changes: 6 additions & 3 deletions src/application/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -2002,7 +2002,8 @@ public static void loadThemes() {
UIManager.put("TextComponent.arc", 10);
UIManager.put("Component.arc", 10);
UIManager.put("PopupMenu.arc", 15);

UIManager.put("ScrollPane.arc", 5);

UIManager.put("Component.borderColor", new Color(30,30,35));
UIManager.put("Component.disabledBorderColor", new Color(30,30,35));

Expand All @@ -2028,10 +2029,12 @@ public static void loadThemes() {
UIManager.put("ComboBox.popupBackground", new Color(42,42,47));
UIManager.put("ComboBox.buttonSeparatorColor", new Color(30,30,35));
UIManager.put("ComboBox.buttonDisabledSeparatorColor", new Color(30,30,35));
UIManager.put("ComboBox.buttonArrowColor", themeColor);
UIManager.put("ComboBox.buttonArrowColor", themeColor);
UIManager.put("ComboBox.selectionArc", 15);

UIManager.put("MenuItem.background", new Color(42,42,47));
UIManager.put("MenuItem.foreground", new Color(235,235,240));
UIManager.put("MenuItem.selectionArc", 15);
UIManager.put("MenuItem.selectionBackground", themeColor);

UIManager.put("CheckBoxMenuItem.background", new Color(42,42,47));
Expand Down Expand Up @@ -2199,7 +2202,7 @@ public static void restartApp() {

}

public static void disableSleepMode() {
public static void disableSleepMode() {

Timer timer = new Timer();

Expand Down
68 changes: 57 additions & 11 deletions src/application/VideoPlayer.java
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@
import javax.swing.event.ChangeListener;

import com.formdev.flatlaf.extras.FlatSVGIcon;

import functions.VideoEncoders;
import library.DCRAW;
import library.FFMPEG;
Expand Down Expand Up @@ -169,6 +168,7 @@ public class VideoPlayer {
public static JButton btnMarkOut;
public static JButton btnGoToIn;
public static JButton btnGoToOut;
private static JPanel panelForButtons;
public static JSlider slider;
public static JCheckBox caseShowWaveform = new JCheckBox(Shutter.language.getProperty("caseShowWaveform"));
public static JCheckBox caseVuMeter = new JCheckBox(Shutter.language.getProperty("caseVuMeter"));;
Expand Down Expand Up @@ -1643,6 +1643,7 @@ public static void setPlayerButtons(boolean enable) {
btnStop.setVisible(true);
btnMarkOut.setVisible(false);
btnGoToOut.setVisible(false);
panelForButtons.setVisible(true);
caseInternalTc.setVisible(false);
caseShowWaveform.setVisible(false);
caseVuMeter.setVisible(true);
Expand Down Expand Up @@ -1701,6 +1702,7 @@ else if (FFPROBE.totalLength <= 40 || Shutter.caseEnableSequence.isSelected() ||

btnMarkOut.setVisible(false);
btnGoToOut.setVisible(false);
panelForButtons.setVisible(false);
caseInternalTc.setVisible(false);
caseShowWaveform.setVisible(false);
caseVuMeter.setVisible(false);
Expand Down Expand Up @@ -1782,6 +1784,7 @@ else if (comboMode.getSelectedItem().equals(Shutter.language.getProperty("splitM
btnStop.setVisible(true);
btnMarkOut.setVisible(true);
btnGoToOut.setVisible(true);
panelForButtons.setVisible(true);

waveformContainer.setVisible(true);
cursorHead.setVisible(true);
Expand Down Expand Up @@ -2271,10 +2274,13 @@ public void run() {
}
}

@SuppressWarnings("serial")
private void buttons() {

btnPrevious = new JButton("<");
btnPrevious.setFont(new Font(Shutter.freeSansFont, Font.BOLD, 12));
btnPrevious.setBackground(new Color(30,30,35, 0));
btnPrevious.setBorder(null);
Shutter.frame.getContentPane().add(btnPrevious);

btnPrevious.addActionListener(new ActionListener(){
Expand Down Expand Up @@ -2360,7 +2366,9 @@ else if (bufferedFrames.size() > 0)
});

btnNext = new JButton(">");
btnNext.setFont(new Font(Shutter.freeSansFont, Font.BOLD, 12));
btnNext.setFont(new Font(Shutter.freeSansFont, Font.BOLD, 12));
btnNext.setBackground(new Color(30,30,35, 0));
btnNext.setBorder(null);
Shutter.frame.getContentPane().add(btnNext);

btnNext.addActionListener(new ActionListener(){
Expand Down Expand Up @@ -2417,8 +2425,10 @@ public void actionPerformed(ActionEvent e) {

});

btnPlay = new JButton(new FlatSVGIcon("contents/play.svg", 15, 15));
btnPlay.setMargin(new Insets(0,0,0,0));
btnPlay = new JButton(new FlatSVGIcon("contents/play.svg", 15, 15));
btnPlay.setMargin(new Insets(0,0,0,0));
btnPlay.setBackground(new Color(30,30,35, 0));
btnPlay.setBorder(null);
Shutter.frame.getContentPane().add(btnPlay);

btnPlay.addActionListener(new ActionListener() {
Expand Down Expand Up @@ -2496,6 +2506,8 @@ else if (btnPlay.getName().equals("play"))

btnStop = new JButton(new FlatSVGIcon("contents/stop.svg", 15, 15));
btnStop.setMargin(new Insets(0,0,0,0));
btnStop.setBackground(new Color(30,30,35, 0));
btnStop.setBorder(null);
Shutter.frame.getContentPane().add(btnStop);

btnStop.addActionListener(new ActionListener(){
Expand Down Expand Up @@ -2545,7 +2557,9 @@ else if (FFPROBE.totalLength <= 40 || Shutter.caseEnableSequence.isSelected()) /
});

btnMarkIn = new JButton("[");
btnMarkIn.setFont(new Font(Shutter.freeSansFont, Font.BOLD, 12));
btnMarkIn.setFont(new Font(Shutter.freeSansFont, Font.BOLD, 12));
btnMarkIn.setBackground(new Color(30,30,35, 0));
btnMarkIn.setBorder(null);
Shutter.frame.getContentPane().add(btnMarkIn);

btnMarkIn.addActionListener(new ActionListener() {
Expand All @@ -2566,7 +2580,9 @@ public void actionPerformed(ActionEvent arg0) {

btnGoToIn = new JButton("[<");
btnGoToIn.setMargin(new Insets(0,0,0,0));
btnGoToIn.setFont(new Font(Shutter.freeSansFont, Font.BOLD, 12));
btnGoToIn.setFont(new Font(Shutter.freeSansFont, Font.BOLD, 12));
btnGoToIn.setBackground(new Color(30,30,35, 0));
btnGoToIn.setBorder(null);
Shutter.frame.getContentPane().add(btnGoToIn);

btnGoToIn.addActionListener(new ActionListener() {
Expand All @@ -2588,6 +2604,8 @@ public void actionPerformed(ActionEvent arg0) {

btnMarkOut = new JButton("]");
btnMarkOut.setFont(new Font(Shutter.freeSansFont, Font.BOLD, 12));
btnMarkOut.setBackground(new Color(30,30,35, 0));
btnMarkOut.setBorder(null);
Shutter.frame.getContentPane().add(btnMarkOut);

btnMarkOut.addActionListener(new ActionListener() {
Expand All @@ -2607,7 +2625,9 @@ public void actionPerformed(ActionEvent arg0) {

btnGoToOut = new JButton(">]");
btnGoToOut.setMargin(new Insets(0,0,0,0));
btnGoToOut.setFont(new Font(Shutter.freeSansFont, Font.BOLD, 12));
btnGoToOut.setFont(new Font(Shutter.freeSansFont, Font.BOLD, 12));
btnGoToOut.setBackground(new Color(30,30,35, 0));
btnGoToOut.setBorder(null);
Shutter.frame.getContentPane().add(btnGoToOut);

btnGoToOut.addActionListener(new ActionListener() {
Expand All @@ -2625,6 +2645,25 @@ public void actionPerformed(ActionEvent arg0) {

});

panelForButtons = new JPanel() {

@Override
public void paintComponent(Graphics g) {

Graphics2D g2d = (Graphics2D) g;

g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);

g2d.setColor(new Color(42,42,47));
g2d.fillRoundRect(0, 0, (btnGoToOut.getX() + btnGoToOut.getWidth()) - btnGoToIn.getX() - 4, 21, 15, 15);

g2d.setColor(new Color(25,25,25));
g2d.drawLine(this.getWidth() / 2, 5, this.getWidth() / 2, this.getHeight() - 6);
}

};
Shutter.frame.getContentPane().add(panelForButtons);

showFPS = new JLabel("25 fps");
showFPS.setVisible(false);
showFPS.setFont(new Font(Shutter.freeSansFont, Font.BOLD, 12));
Expand Down Expand Up @@ -5334,7 +5373,7 @@ else if (FFMPEG.isGPUCompatible && FFPROBE.isRotated == false
bitDepth = "p010";
}

//Auto GPU Shutter.selection
//Auto GPU
if (FFMPEG.cudaAvailable)
{
filter = filter.replace("yadif", "yadif_cuda");
Expand All @@ -5344,9 +5383,8 @@ else if (FFMPEG.qsvAvailable && yadif == "")
{
filter += "scale_qsv=" + width + ":" + height + ":mode=low_power,hwdownload,format=" + bitDepth;
}
else if (FFMPEG.videotoolboxAvailable)
else if (FFMPEG.videotoolboxAvailable && yadif == "")
{
filter = filter.replace("yadif", "yadif_videotoolbox");
filter += "scale_vt=" + width + ":" + height + ",hwdownload,format=" + bitDepth;
}
else
Expand Down Expand Up @@ -5666,7 +5704,7 @@ public static void resizeAll() {
else
ratio = Float.parseFloat(Shutter.comboDAR.getSelectedItem().toString());
}
else if (Shutter.comboResolution.getSelectedItem().toString().equals(Shutter.language.getProperty("source")) == false && Settings.btnNoUpscale.isSelected() == false
else if (Shutter.comboResolution.getSelectedItem().toString().equals(Shutter.language.getProperty("source")) == false && Shutter.btnNoUpscale.isSelected() == false
&& Shutter.comboResolution.getSelectedItem().toString().contains("x")
&& Shutter.comboResolution.getSelectedItem().toString().contains("AI") == false)
{
Expand Down Expand Up @@ -5887,6 +5925,14 @@ else if (fullscreenPlayer)
btnGoToIn.setBounds(btnMarkIn.getLocation().x - 40 - 4, btnMarkIn.getLocation().y, 40, 21);
btnMarkOut.setBounds(btnStop.getLocation().x + btnStop.getSize().width + 4, btnStop.getLocation().y, 22, 21);
btnGoToOut.setBounds(btnMarkOut.getLocation().x + btnMarkOut.getSize().width + 4, btnMarkOut.getLocation().y, 40, 21);

if (Shutter.comboFonctions.getSelectedItem().equals(Shutter.language.getProperty("functionSubtitles")))
{
panelForButtons.setBounds(btnPlay.getX() + 2, btnPlay.getY(), (btnStop.getX() + btnStop.getWidth()) - btnPlay.getX() - 4, 21);
}
else
panelForButtons.setBounds(btnGoToIn.getX() + 2, btnPlay.getY(), (btnGoToOut.getX() + btnGoToOut.getWidth()) - btnGoToIn.getX() - 4, 21);

showFPS.setBounds(player.getX() + player.getWidth() / 2, player.getY() - 18, player.getWidth() / 2, showFPS.getPreferredSize().height);
showScale.setBounds(player.getX(), showFPS.getY(), player.getWidth() / 2, showScale.getPreferredSize().height);
comboAudioTrack.setBounds(waveformContainer.getX() + 7, waveformContainer.getY() + (waveformContainer.getHeight() / 2) - 8, 40, 16);
Expand Down
4 changes: 3 additions & 1 deletion src/application/VideoWeb.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import java.awt.Desktop;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.Insets;
import java.awt.MouseInfo;
import java.awt.Rectangle;
import java.awt.Toolkit;
Expand Down Expand Up @@ -63,6 +64,7 @@
import javax.swing.event.PopupMenuListener;

import com.formdev.flatlaf.extras.FlatSVGIcon;
import com.formdev.flatlaf.ui.FlatLineBorder;

import library.FFMPEG;
import library.YOUTUBEDL;
Expand Down Expand Up @@ -365,7 +367,7 @@ private void grpURL() {
grpURL.setLocation(6, 28);
grpURL.setSize(408, frame.getHeight() - 34);
grpURL.setBackground(new Color(30,30,35));
grpURL.setBorder(BorderFactory.createTitledBorder(new RoundedLineBorder(new Color(55,55,55), 1, 5, true), Shutter.language.getProperty("videoUrl") + " ", 0, 0, new Font(Shutter.montserratFont, Font.PLAIN, 12), new Color(235,235,240)));
grpURL.setBorder(BorderFactory.createTitledBorder(new FlatLineBorder(new Insets(0,0,0,0), new Color(55,55,55), 1, 5), Shutter.language.getProperty("videoUrl") + " ", 0, 0, new Font(Shutter.montserratFont, Font.PLAIN, 12), new Color(235,235,240)));

lblURL = new JLabel(Shutter.language.getProperty("lblURL"));
lblURL.setHorizontalAlignment(SwingConstants.RIGHT);
Expand Down
Loading

0 comments on commit a90250a

Please sign in to comment.