if (path != null) {
d_pathParameter.setValue(path);
new AEThread("SoundTest") {
public void runSupport() {
try {
Applet.newAudioClip(new File(path).toURL()).play();
Thread.sleep(2500);
} catch (Throwable e) {
}
}
}.start();
}
}
});
Label d_sound_info = new Label(cArea, SWT.WRAP);
Messages.setLanguageText(d_sound_info, INTERFACE_PREFIX
+ "wavlocation.info");
gridData = new GridData(GridData.FILL_HORIZONTAL);
gridData.widthHint = 100;
d_sound_info.setLayoutData(gridData);
d_play_sound.setAdditionalActionPerformer(new ChangeSelectionActionPerformer(
d_pathParameter.getControls()));
d_play_sound.setAdditionalActionPerformer(new ChangeSelectionActionPerformer(
new Control[] {
d_browse,
d_sound_info
}));
//
}
BooleanParameter f_play_sound = new BooleanParameter(cArea,
"Play File Finished", LBLKEY_PREFIX + "playfilefinished");
// OS X counterpart for alerts (see below for what is disabled)
if (Constants.isOSX) {
// per-file info
gridData = new GridData();
gridData.horizontalSpan = 3;
gridData.widthHint = 0;
gridData.heightHint = 0;
Composite f_filler = new Composite(cArea, SWT.NONE);
f_filler.setSize(0, 0);
f_filler.setLayoutData(gridData);
final BooleanParameter f_speechEnabledParameter = new BooleanParameter(
cArea, "Play File Finished Announcement", LBLKEY_PREFIX
+ "playfilespeech");
final StringParameter f_speechParameter = new StringParameter(cArea,
"Play File Finished Announcement Text");
gridData = new GridData();
gridData.horizontalSpan = 3;
gridData.widthHint = 150;
f_speechParameter.setLayoutData(gridData);
((Text) f_speechParameter.getControl()).setTextLimit(40);
f_speechEnabledParameter.setAdditionalActionPerformer(new ChangeSelectionActionPerformer(
f_speechParameter.getControls()));
final Label speechInfo = new Label(cArea, SWT.NONE);
gridData = new GridData();
gridData.horizontalSpan = 4;
gridData.horizontalIndent = 24;
speechInfo.setLayoutData(gridData);
Messages.setLanguageText(speechInfo, LBLKEY_PREFIX
+ "playfilespeech.info");
}
//Option disabled on OS X, as impossible to make it work correctly
if (!Constants.isOSX) {
// file info
gridData = new GridData(GridData.FILL_HORIZONTAL);
final StringParameter f_pathParameter = new StringParameter(cArea,
"Play File Finished File", "");
if (f_pathParameter.getValue().length() == 0) {
f_pathParameter.setValue("<default>");
}
f_pathParameter.setLayoutData(gridData);
Button f_browse = new Button(cArea, SWT.PUSH);
f_browse.setImage(imgOpenFolder);
imgOpenFolder.setBackground(f_browse.getBackground());
f_browse.setToolTipText(MessageText.getString("ConfigView.button.browse"));
f_browse.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event event) {
FileDialog dialog = new FileDialog(parent.getShell(),
SWT.APPLICATION_MODAL);
dialog.setFilterExtensions(new String[] { "*.wav"
});
dialog.setFilterNames(new String[] { "*.wav"
});
dialog.setText(MessageText.getString(INTERFACE_PREFIX + "wavlocation"));
final String path = dialog.open();
if (path != null) {
f_pathParameter.setValue(path);
new AEThread("SoundTest") {
public void runSupport() {
try {
Applet.newAudioClip(new File(path).toURL()).play();
Thread.sleep(2500);