mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-04 18:29:37 +02:00
GP-2858 - fixes to update the PR with theming concepts
This commit is contained in:
parent
0398f47f05
commit
1f70c3ffdc
3 changed files with 12 additions and 20 deletions
|
@ -4,9 +4,7 @@
|
|||
icon.content.handler.archive.dt = closedBookBlue.png
|
||||
icon.content.handler.program = program_obj.png
|
||||
|
||||
icon.data.type.aiff = audio-volume-medium.png
|
||||
icon.data.type.au = audio-volume-medium.png
|
||||
icon.data.type.wave = audio-volume-medium.png
|
||||
icon.data.type.audio.player = audio-volume-medium.png
|
||||
|
||||
[Dark Defaults]
|
||||
|
||||
|
|
|
@ -19,23 +19,16 @@ import java.awt.event.MouseEvent;
|
|||
import java.io.ByteArrayInputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
import javax.sound.sampled.AudioInputStream;
|
||||
import javax.sound.sampled.AudioSystem;
|
||||
import javax.sound.sampled.Clip;
|
||||
import javax.sound.sampled.LineEvent;
|
||||
import javax.sound.sampled.*;
|
||||
import javax.sound.sampled.LineEvent.Type;
|
||||
import javax.sound.sampled.LineListener;
|
||||
import javax.sound.sampled.LineUnavailableException;
|
||||
import javax.sound.sampled.UnsupportedAudioFileException;
|
||||
import javax.swing.ImageIcon;
|
||||
import javax.swing.Icon;
|
||||
|
||||
import generic.theme.GIcon;
|
||||
import ghidra.util.Msg;
|
||||
import resources.ResourceManager;
|
||||
|
||||
public class AudioPlayer implements Playable, LineListener {
|
||||
|
||||
private static final ImageIcon AUDIO_ICON =
|
||||
ResourceManager.loadImage("images/audio-volume-medium.png");
|
||||
private static final Icon AUDIO_ICON = new GIcon("icon.data.type.audio.player");
|
||||
|
||||
private byte[] bytes;
|
||||
|
||||
|
@ -44,13 +37,14 @@ public class AudioPlayer implements Playable, LineListener {
|
|||
}
|
||||
|
||||
@Override
|
||||
public ImageIcon getImageIcon() {
|
||||
public Icon getImageIcon() {
|
||||
return AUDIO_ICON;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clicked(MouseEvent event) {
|
||||
try (AudioInputStream stream = AudioSystem.getAudioInputStream(new ByteArrayInputStream(bytes))) {
|
||||
try (AudioInputStream stream =
|
||||
AudioSystem.getAudioInputStream(new ByteArrayInputStream(bytes))) {
|
||||
Clip clip = AudioSystem.getClip();
|
||||
clip.addLineListener(this);
|
||||
clip.open(stream);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue