-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Video length is a double vlaue on Twitch. changed to double in the Mo…
…del and cast it to int. Improved the Download Worker. It should be more reliable. twitch has some issues lattly resulting to an incomplete download.
- Loading branch information
1 parent
ad5b1a5
commit c7ecd12
Showing
6 changed files
with
256 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
115 changes: 115 additions & 0 deletions
115
src/com/trabauer/twitchtools/gui/vod/channelsync/VideoInfoPreferencesDialog.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
package com.trabauer.twitchtools.gui.vod.channelsync; | ||
|
||
import com.trabauer.twitchtools.model.twitch.TwitchVideoInfo; | ||
|
||
import javax.swing.*; | ||
import java.awt.*; | ||
import java.awt.event.ActionEvent; | ||
import java.awt.event.ActionListener; | ||
|
||
/** | ||
* Created by flo on 7/19/15. | ||
*/ | ||
public class VideoInfoPreferencesDialog extends JDialog implements ActionListener { | ||
|
||
private TwitchVideoInfo tvi; | ||
|
||
private JTextField startOffsetFld; | ||
private JSlider startOffsetSlider; | ||
private JLabel startOffsetTimeLbl; | ||
|
||
private JTextField endOffsetFld; | ||
private JSlider endOffsetSlider; | ||
private JLabel endOffsetTimeLbl; | ||
|
||
JButton okBtn; | ||
|
||
public VideoInfoPreferencesDialog() { | ||
super(); | ||
|
||
setTitle("Video Download Settings"); | ||
GridBagLayout layout = new GridBagLayout(); | ||
this.setLayout(layout); | ||
GridBagConstraints c = new GridBagConstraints(); | ||
|
||
startOffsetFld = new JTextField(); | ||
startOffsetFld.setColumns(10); | ||
startOffsetSlider = new JSlider(); | ||
startOffsetTimeLbl = new JLabel("00:00:00"); | ||
|
||
endOffsetFld = new JTextField(); | ||
endOffsetFld.setColumns(10); | ||
endOffsetSlider = new JSlider(); | ||
endOffsetTimeLbl = new JLabel("00:00:00"); | ||
|
||
okBtn = new JButton("OK"); | ||
okBtn.addActionListener(this); | ||
okBtn.setActionCommand("okBtn"); | ||
|
||
// Start Offset | ||
c.anchor = GridBagConstraints.LINE_START; | ||
c.gridy = 0; | ||
c.gridx = 0; | ||
c.gridwidth = 4; | ||
add(new JLabel("Start Offset"), c); | ||
|
||
c.gridy++; | ||
c.gridwidth=1; | ||
add(new JLabel("Sec"), c); | ||
|
||
c.gridx++; | ||
add(startOffsetFld, c); | ||
|
||
c.gridx++; | ||
add(startOffsetSlider, c); | ||
|
||
c.gridx++; | ||
add(startOffsetTimeLbl, c); | ||
|
||
//END Offset | ||
c.gridy++; | ||
c.gridx = 0; | ||
c.gridwidth = 4; | ||
add(new JLabel("End Offset"), c); | ||
|
||
c.gridy++; | ||
c.gridwidth=1; | ||
add(new JLabel("Sec"), c); | ||
|
||
c.gridx++; | ||
add(endOffsetFld, c); | ||
|
||
c.gridx++; | ||
add(endOffsetSlider, c); | ||
|
||
c.gridx++; | ||
add(endOffsetTimeLbl, c); | ||
|
||
|
||
c.gridy++; | ||
c.gridx=3; | ||
c.anchor = GridBagConstraints.LINE_END; | ||
add(okBtn, c); | ||
|
||
pack(); | ||
|
||
|
||
} | ||
|
||
public TwitchVideoInfo getTvi() { | ||
return tvi; | ||
} | ||
|
||
public void setTvi(TwitchVideoInfo tvi) { | ||
this.tvi = tvi; | ||
} | ||
|
||
@Override | ||
public void actionPerformed(ActionEvent e) { | ||
if(e.getActionCommand().equals("okBtn")) { | ||
// tvi.setStartOffset(startOffsetSlider.getValue()); | ||
// tvi.setEndOffset(endOffsetSlider.getValue()); | ||
this.setVisible(false); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
src/com/trabauer/twitchtools/worker/TwitchDownloadException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package com.trabauer.twitchtools.worker; | ||
|
||
import com.trabauer.twitchtools.model.twitch.TwitchVideoPart; | ||
|
||
/** | ||
* Created by flo on 7/19/15. | ||
*/ | ||
public class TwitchDownloadException extends Exception { | ||
private TwitchVideoPart videoPart; | ||
|
||
public TwitchDownloadException() { | ||
} | ||
|
||
public TwitchDownloadException(String message) { | ||
super(message); | ||
} | ||
|
||
public TwitchDownloadException(TwitchVideoPart videoPart) { | ||
this.videoPart = videoPart; | ||
} | ||
|
||
public TwitchDownloadException(String message, TwitchVideoPart videoPart) { | ||
super(message); | ||
this.videoPart = videoPart; | ||
} | ||
|
||
public TwitchVideoPart getVideoPart() { | ||
return videoPart; | ||
} | ||
|
||
public void setVideoPart(TwitchVideoPart videoPart) { | ||
this.videoPart = videoPart; | ||
} | ||
} |
Oops, something went wrong.