mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-02-16 15:40:14 +00:00
GP-2858 - fixes to update the PR with theming concepts
This commit is contained in:
parent
0398f47f05
commit
1f70c3ffdc
@ -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]
|
||||
|
||||
|
@ -4,9 +4,9 @@
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
|
@ -19,38 +19,32 @@ 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;
|
||||
|
||||
|
||||
public AudioPlayer(byte[] bytes) {
|
||||
this.bytes = bytes;
|
||||
}
|
||||
|
||||
@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);
|
||||
@ -72,6 +66,6 @@ public class AudioPlayer implements Playable, LineListener {
|
||||
if (event.getSource() instanceof Clip clip) {
|
||||
clip.removeLineListener(this);
|
||||
clip.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user