-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 796cbcd
Showing
13 changed files
with
855 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
To build manually on the command line: | ||
|
||
1. Compile | ||
|
||
Run: | ||
|
||
java -d [another directory] @sources.txt | ||
|
||
It is recommended to place the build files in another directory to avoid extra files in the JAR. | ||
|
||
2. Copy Resources | ||
|
||
Copy the resources (/res, /VERSION.txt, /LICENSE.txt) to the new directory. | ||
|
||
3. Package | ||
|
||
Navigate to the new directory, then run: | ||
|
||
jar cmf [original directory]/manifest.txt Salvato.jar ./* |
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,12 @@ | ||
Copyright (c) 2014 Philip Chung <http://philipchungtech.tk/> | ||
All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: | ||
|
||
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. | ||
|
||
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. | ||
|
||
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
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 @@ | ||
1.0 |
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 @@ | ||
Main-Class: tk.philipchungtech.salvato.Main |
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
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,5 @@ | ||
./tk/philipchungtech/salvato/About.java | ||
./tk/philipchungtech/salvato/AdvancedSettings.java | ||
./tk/philipchungtech/salvato/Main.java | ||
./tk/philipchungtech/salvato/MainWindow.java | ||
./tk/philipchungtech/salvato/TickerTask.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,102 @@ | ||
package tk.philipchungtech.salvato; | ||
|
||
import java.io.BufferedReader; | ||
import java.io.InputStreamReader; | ||
|
||
/** | ||
* About window | ||
*/ | ||
public class About extends javax.swing.JFrame { | ||
private javax.swing.JScrollPane copyrightscroll; | ||
private javax.swing.JTextArea copyrighttext; | ||
private javax.swing.JLabel versionlabel; | ||
|
||
/** | ||
* Create new about window. | ||
*/ | ||
public About() { | ||
initComponents(); | ||
//Set the icon | ||
try { | ||
this.setIconImage(javax.imageio.ImageIO.read(MainWindow.class.getResourceAsStream(Main.ICON_PATH))); | ||
} catch(Exception e) { | ||
//Do nothing | ||
} | ||
//Set information from files | ||
java.io.InputStream infostream; | ||
BufferedReader inforeader; | ||
String infoline; | ||
infostream = About.class.getResourceAsStream(Main.VERSION_PATH); | ||
String version; | ||
try { | ||
inforeader = new BufferedReader(new InputStreamReader(infostream)); | ||
if((infoline = inforeader.readLine()) != null) { | ||
version = infoline; | ||
} else { | ||
version = "[version info missing]"; | ||
} | ||
} catch(Exception e) { | ||
version = "[version info missing]"; | ||
} | ||
versionlabel.setText(versionlabel.getText()+version); | ||
infostream = About.class.getResourceAsStream(Main.COPYRIGHT_PATH); | ||
try { | ||
inforeader = new BufferedReader(new InputStreamReader(infostream)); | ||
while((infoline = inforeader.readLine()) != null) { | ||
copyrighttext.append(infoline+System.getProperty("line.separator")); | ||
} | ||
} catch(Exception e) { | ||
//Do nothing | ||
} | ||
//Move cursor to top | ||
copyrighttext.select(0, 0); | ||
} | ||
|
||
/** | ||
* Initialize the form components. This is automatically generated | ||
* by NetBeans. | ||
*/ | ||
@SuppressWarnings("unchecked") | ||
|
||
private void initComponents() { | ||
|
||
versionlabel = new javax.swing.JLabel(); | ||
copyrightscroll = new javax.swing.JScrollPane(); | ||
copyrighttext = new javax.swing.JTextArea(); | ||
|
||
setTitle("About - Salvato"); | ||
|
||
versionlabel.setText("Salvato Version "); | ||
|
||
copyrighttext.setEditable(false); | ||
copyrighttext.setColumns(50); | ||
copyrighttext.setLineWrap(true); | ||
copyrighttext.setWrapStyleWord(true); | ||
copyrightscroll.setViewportView(copyrighttext); | ||
|
||
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); | ||
getContentPane().setLayout(layout); | ||
layout.setHorizontalGroup( | ||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) | ||
.addGroup(layout.createSequentialGroup() | ||
.addContainerGap() | ||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) | ||
.addComponent(copyrightscroll, javax.swing.GroupLayout.DEFAULT_SIZE, 355, Short.MAX_VALUE) | ||
.addGroup(layout.createSequentialGroup() | ||
.addComponent(versionlabel) | ||
.addGap(0, 0, Short.MAX_VALUE))) | ||
.addContainerGap()) | ||
); | ||
layout.setVerticalGroup( | ||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) | ||
.addGroup(layout.createSequentialGroup() | ||
.addContainerGap() | ||
.addComponent(versionlabel) | ||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) | ||
.addComponent(copyrightscroll, javax.swing.GroupLayout.DEFAULT_SIZE, 244, Short.MAX_VALUE) | ||
.addContainerGap()) | ||
); | ||
|
||
pack(); | ||
} | ||
} |
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,104 @@ | ||
package tk.philipchungtech.salvato; | ||
|
||
import javax.sound.sampled.Mixer; | ||
import javax.sound.sampled.AudioSystem; | ||
|
||
/** | ||
* Advanced settings window | ||
*/ | ||
class AdvancedSettings extends javax.swing.JFrame { | ||
private javax.swing.JLabel devicelabel; | ||
private javax.swing.JList mixerlist; | ||
private javax.swing.JScrollPane mixerlistscroll; | ||
private javax.swing.DefaultListModel mixermodel; | ||
|
||
/** | ||
* Create new advanced settings window. | ||
*/ | ||
public AdvancedSettings() { | ||
//Set the icon | ||
try { | ||
this.setIconImage(javax.imageio.ImageIO.read(MainWindow.class.getResourceAsStream(Main.ICON_PATH))); | ||
} catch(Exception e) { | ||
//Do nothing | ||
} | ||
mixermodel = new javax.swing.DefaultListModel(); | ||
initComponents(); | ||
populateMixerList(); | ||
} | ||
|
||
/** | ||
* Populate the list of mixers. | ||
*/ | ||
private void populateMixerList() { | ||
Mixer.Info[] mixerinfos = AudioSystem.getMixerInfo(); | ||
Mixer.Info mixerinfo; | ||
for(int i = 0; i < mixerinfos.length; i++) { | ||
mixerinfo = mixerinfos[i]; | ||
mixermodel.addElement(mixerinfo.getName()); | ||
if(mixerinfo.equals(AudioSystem.getMixer(null).getMixerInfo())) { | ||
mixerlist.setSelectedIndex(i); | ||
} | ||
} | ||
} | ||
|
||
/** | ||
* Initialize the form components. This is automatically generated | ||
* by NetBeans. | ||
*/ | ||
@SuppressWarnings("unchecked") | ||
private void initComponents() { | ||
mixerlistscroll = new javax.swing.JScrollPane(); | ||
mixerlist = new javax.swing.JList(); | ||
devicelabel = new javax.swing.JLabel(); | ||
|
||
setTitle("Advanced Settings - Salvato"); | ||
|
||
mixerlist.setModel(mixermodel); | ||
mixerlist.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION); | ||
mixerlist.addListSelectionListener(new javax.swing.event.ListSelectionListener() { | ||
public void valueChanged(javax.swing.event.ListSelectionEvent evt) { | ||
mixerListValueChanged(evt); | ||
} | ||
}); | ||
mixerlistscroll.setViewportView(mixerlist); | ||
|
||
devicelabel.setText("Audio Output Device"); | ||
|
||
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); | ||
getContentPane().setLayout(layout); | ||
layout.setHorizontalGroup( | ||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) | ||
.addGroup(layout.createSequentialGroup() | ||
.addContainerGap() | ||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) | ||
.addComponent(mixerlistscroll, javax.swing.GroupLayout.DEFAULT_SIZE, 244, Short.MAX_VALUE) | ||
.addGroup(layout.createSequentialGroup() | ||
.addComponent(devicelabel) | ||
.addGap(0, 0, Short.MAX_VALUE))) | ||
.addContainerGap()) | ||
); | ||
layout.setVerticalGroup( | ||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) | ||
.addGroup(layout.createSequentialGroup() | ||
.addGap(15, 15, 15) | ||
.addComponent(devicelabel) | ||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) | ||
.addComponent(mixerlistscroll, javax.swing.GroupLayout.DEFAULT_SIZE, 156, Short.MAX_VALUE) | ||
.addContainerGap()) | ||
); | ||
|
||
pack(); | ||
} | ||
|
||
/** | ||
* Handle a change in the selection in the mixer list. | ||
* @param evt Event information | ||
* @see Main#setMixer(int) | ||
*/ | ||
private void mixerListValueChanged(javax.swing.event.ListSelectionEvent evt) { | ||
if(!evt.getValueIsAdjusting()) { | ||
Main.setMixer(mixerlist.getSelectedIndex()); | ||
} | ||
} | ||
} |
Oops, something went wrong.