Skip to content

Commit

Permalink
Added documentation to source code
Browse files Browse the repository at this point in the history
  • Loading branch information
ngsankha committed Feb 24, 2012
1 parent f9b26e7 commit 8a63cbf
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/sngforge/panther/modules/audio/AudioEncoderWorkingPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,9 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
);
}// </editor-fold>//GEN-END:initComponents

/*
* method called when cancel button is clicked
*/
private void cancelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancelActionPerformed
int choice=JOptionPane.showConfirmDialog(this, "Are you sure you want to cancel?", "Panther", JOptionPane.YES_NO_OPTION);
if(choice==JOptionPane.YES_OPTION){
Expand All @@ -140,10 +143,16 @@ private void cancelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:
}
}//GEN-LAST:event_cancelActionPerformed

/*
* updates the progress bar on screen
*/
public void setProgress(int val){
currProgress.setValue(val);
}

/*
* this method is used when the task is started via the simple window
*/
public void processSimple(){
aewp=this;
Globals.cancelled=false;
Expand Down Expand Up @@ -188,6 +197,9 @@ protected Object doInBackground(){
sw.execute();
}

/*
* this method is used when the encoding process is started via the advanced window
*/
public void processAdvanced(){
aewp=this;
Globals.cancelled=false;
Expand Down
6 changes: 6 additions & 0 deletions src/sngforge/panther/modules/audio/AudioEntry.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ public class AudioEntry implements EncoderEntry{
public int bitrate,channels,samplingRate,volume;
public float duration,offset;

/*
* sets up the current format settings
*/
public void saveSet(String fin,String fout,String selectedFormat){
this.fin=fin;
if(selectedFormat.equals("MP3 File (.mp3)")){
Expand Down Expand Up @@ -74,6 +77,9 @@ else if(selectedFormat.equals("3GPP AMR file format (.amr)")){
}
}

/*
* sets up the current format settings also using the advanced options
*/
public void saveSetAdvanced(String fin,String fout,String selectedFormat,int bitrate,int channels,int samplingRate,int volume,float offset,float duration){
saveSet(fin,fout,selectedFormat);
this.fout=fout;
Expand Down
3 changes: 3 additions & 0 deletions src/sngforge/panther/modules/reducesize/ReduceSizeEntry.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ public class ReduceSizeEntry implements EncoderEntry{
public boolean copyTags;
public boolean openFolder;

/*
* saves the details for the reduuction of files in the current encoding task
*/
public void saveSet(Object files[],int bitrate,String outFolder,boolean copyTags,boolean openFolder){
this.files=files;
this.bitrate=bitrate;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,16 @@ private void cancelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:
}
}//GEN-LAST:event_cancelActionPerformed

/*
* upadtes the progress bar on screen
*/
public void setProgress(int val){
currProgress.setValue(val);
}

/*
* starts the encoding process to reduce the file size using the stored settings
*/
public void process(){
rswp=this;
Globals.cancelled=false;
Expand Down
12 changes: 12 additions & 0 deletions src/sngforge/panther/modules/video/PresetData.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
import java.util.ArrayList;
import java.util.Properties;

/*
* this class handles the presets
*/
public class PresetData {

public Properties p;
Expand All @@ -31,6 +34,9 @@ public PresetData(){
p=new Properties();
}

/*
* loads the in-built set of presets that comes with Panther
*/
public void loadPresetData(String desc) {
File presetDir = new File("./presets/");
File presets[] = presetDir.listFiles();
Expand All @@ -48,6 +54,9 @@ public void loadPresetData(String desc) {
}
}

/*
* loads the preset from an external file
*/
public void loadPresetData(File file){
try{
p.loadFromXML(new FileInputStream(file));
Expand All @@ -57,6 +66,9 @@ public void loadPresetData(File file){
}
}

/*
* gets the presets list as an array
*/
public static Object[] loadPresetsList() throws Exception{
ArrayList entries=new ArrayList();
File presetDir=new File("./presets/");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,16 @@ private void cancelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:
}
}//GEN-LAST:event_cancelActionPerformed

/*
* updates the progress bar on screen
*/
public void setProgress(int val){
currProgress.setValue(val);
}

/*
* starts the encoding process with the settings stored
*/
public void process(){
vewp=this;
Globals.cancelled=false;
Expand Down
4 changes: 4 additions & 0 deletions src/sngforge/panther/modules/video/VideoEntry.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ public class VideoEntry implements EncoderEntry {
public int aBitrate, aChannels, aSamplingRate, aVolume, vBitrate, fps, height, width;
public float duration, offset;

/*
* saves the setting for the current video encoding process
* these may come from the presets and/or the settings user specifies in the options window of the conversion task
*/
public void saveSet(String aCodec, String vCodec, String fin, String fout, String format, int aBitrate, int aChannels, int aSamplingRate, int aVolume, int vBitrate, int fps, int height, int width, float duration, float offset){
this.aCodec=aCodec;
this.vCodec=vCodec;
Expand Down

0 comments on commit 8a63cbf

Please sign in to comment.