// Path: libuosl/src/org/solhost/folko/uosl/libuosl/data/SLSound.java
// public class SLSound {
//     private final SLDataFile sound, soundIdx;
// 
//     public SLSound(String soundPath, String soundIdxPath) throws IOException {
//         this.sound = new SLDataFile(soundPath, false);
//         this.soundIdx = new SLDataFile(soundIdxPath, true);
//     }
// 
//     public class SoundEntry {
//         public long id;
//         public long unknown;
//         public String fileName;
//         public byte[] pcmData;
//     }
// 
//     public int getNumEntries() {
//         return soundIdx.getLength() / 12;
//     }
// 
//     public synchronized SoundEntry getEntry(int index) {
//         int idxOffset = index * 12;
//         soundIdx.seek(idxOffset);
// 
//         SoundEntry entry = new SoundEntry();
// 
//         long offset = soundIdx.readUDWord();
//         long length = soundIdx.readUDWord();
//         if(offset == -1 || length == -1) {
//             return null;
//         }
// 
//         entry.id = index;
//         entry.unknown = soundIdx.readUDWord();
//         sound.seek((int) offset);
//         entry.fileName = sound.readString(16);
//         sound.skip(24);
//         entry.pcmData = sound.readRaw((int) (length - 16 - 24));
// 
//         return entry;
//     }
// 
// }
// 
// Path: libuosl/src/org/solhost/folko/uosl/libuosl/data/SLSound.java
// public class SoundEntry {
//     public long id;
//     public long unknown;
//     public String fileName;
//     public byte[] pcmData;
// }


import java.awt.BorderLayout;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.List;
import javax.sound.sampled.AudioFormat;
import javax.sound.sampled.AudioSystem;
import javax.sound.sampled.Clip;
import javax.sound.sampled.DataLine;
import javax.swing.AbstractListModel;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.ListSelectionModel;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import org.solhost.folko.uosl.libuosl.data.SLSound;
import org.solhost.folko.uosl.libuosl.data.SLSound.SoundEntry;
/*******************************************************************************
 * Copyright (c) 2013 Folke Will <folke.will@gmail.com>
 *
 * This file is part of JPhex.
 *
 * JPhex is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * JPhex is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 ******************************************************************************/
package org.solhost.folko.uosl.viewsl;




public class SoundView extends JPanel {
    private static final long serialVersionUID = 534689691557745487L;
// Path: libuosl/src/org/solhost/folko/uosl/libuosl/data/SLSound.java
// public class SLSound {
//     private final SLDataFile sound, soundIdx;
// 
//     public SLSound(String soundPath, String soundIdxPath) throws IOException {
//         this.sound = new SLDataFile(soundPath, false);
//         this.soundIdx = new SLDataFile(soundIdxPath, true);
//     }
// 
//     public class SoundEntry {
//         public long id;
//         public long unknown;
//         public String fileName;
//         public byte[] pcmData;
//     }
// 
//     public int getNumEntries() {
//         return soundIdx.getLength() / 12;
//     }
// 
//     public synchronized SoundEntry getEntry(int index) {
//         int idxOffset = index * 12;
//         soundIdx.seek(idxOffset);
// 
//         SoundEntry entry = new SoundEntry();
// 
//         long offset = soundIdx.readUDWord();
//         long length = soundIdx.readUDWord();
//         if(offset == -1 || length == -1) {
//             return null;
//         }
// 
//         entry.id = index;
//         entry.unknown = soundIdx.readUDWord();
//         sound.seek((int) offset);
//         entry.fileName = sound.readString(16);
//         sound.skip(24);
//         entry.pcmData = sound.readRaw((int) (length - 16 - 24));
// 
//         return entry;
//     }
// 
// }
// 
// Path: libuosl/src/org/solhost/folko/uosl/libuosl/data/SLSound.java
// public class SoundEntry {
//     public long id;
//     public long unknown;
//     public String fileName;
//     public byte[] pcmData;
// }


// Path: viewsl/src/org/solhost/folko/uosl/viewsl/SoundView.java
import java.awt.BorderLayout;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.List;
import javax.sound.sampled.AudioFormat;
import javax.sound.sampled.AudioSystem;
import javax.sound.sampled.Clip;
import javax.sound.sampled.DataLine;
import javax.swing.AbstractListModel;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.ListSelectionModel;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import org.solhost.folko.uosl.libuosl.data.SLSound;
import org.solhost.folko.uosl.libuosl.data.SLSound.SoundEntry;

/*******************************************************************************
 * Copyright (c) 2013 Folke Will <folke.will@gmail.com>
 *
 * This file is part of JPhex.
 *
 * JPhex is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * JPhex is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 ******************************************************************************/
package org.solhost.folko.uosl.viewsl;




public class SoundView extends JPanel {
    private static final long serialVersionUID = 534689691557745487L;
    private SLSound sound;