/*
* Created on 2004/08/13
* Author aki@www.xucker.jpn.org
* License Apache2.0 or Common Public License
*/
package org.jpn.xucker.audiotowma9;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.RowData;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.jpn.xucker.commons.swt.series.wfs.WrapperExecuter;
import org.jpn.xucker.commons.swt.series.wfs.WrapperFileStandard;
import org.jpn.xucker.commons.swt.series.wfs.WrapperFileStandardSettingDialog;
/**
*
*
*/
public class AudioToWma9Wrapper extends WrapperFileStandard {
Button waveformatextensible;
/**
* @param shell
*/
public AudioToWma9Wrapper(Shell shell) {
super(shell);
// TODO Auto-generated constructor stub
}
public static void main(String[] args) {
Display display = new Display();
Shell shell = new Shell(display,SWT.CLOSE|SWT.MIN);
AudioToWma9Wrapper main = new AudioToWma9Wrapper(shell);
shell.open();
shell.setSize(500,380);
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) {
display.sleep();
}
}
display.dispose();
}
/*
* (non-Javadoc)
*
* @see org.jpn.xucker.commons.swt.series.wfs.WrapperFileStandard#beforeInit()
*/
public final static String WAVE_FORMAT_EXTENSIVE = "WAVE_FORMAT_EXTENSIVE";
private Shell childshell;
protected void beforeInit() {
// TODO Auto-generated method stub
APP_NAME = "wmcmd(WMA9Lossless) Wrapper";
defaultCommandPath = "C:\\Program Files\\Windows Media Components\\Encoder\\wmcmd.vbs";
logoPath = "org/jpn/xucker/audiotowma9/resource/logo.png";
iconPath = "org/jpn/xucker/audiotowma9/resource/icon.png";
settingLabel = "WMA9Lossless設定";
exeName = "wmcmd.vbs";
allowFileExtension = new String[] { "wav","mp3"};
execLabel = "変換";
myselfExeName = "audiotowma9.exe";
url = "http://www.xucker.jpn.org/product/audiotowma9.html";
version = 0.1;
resultLabels=new String[]{"結果","ファイル名","ディレクトリー"};
resultWidths=new int[]{50,100,100};
outputExtension=".wma";
}
/*
* (non-Javadoc)
*
* @see org.jpn.xucker.commons.swt.series.wfs.WrapperFileStandard#afterInit()
*/
protected void afterInit() {
waveformatextensible = new Button(optionGroup, SWT.NULL | SWT.CHECK);
waveformatextensible.setText("WaveFormatExtensible");
waveformatextensible.setSelection(false);
waveformatextensible.addSelectionListener(this);
RowData dobackup_data = new RowData();
waveformatextensible.setLayoutData(dobackup_data);
optionGroup.setVisible(false);
}
/*
* (non-Javadoc)
*
* @see org.jpn.xucker.commons.swt.series.wfs.WrapperFileStandard#createWrapperExecuter()
*/
protected WrapperExecuter createWrapperExecuter() {
AudioToWma9Executer executer = new AudioToWma9Executer();
executer.setResultLabel(resultLabels);
if (waveformatextensible.getSelection()) {
executer.setValue(WAVE_FORMAT_EXTENSIVE, "true");
}
return executer;
}
public void openProperty() {
if(childshell==null || childshell.isDisposed()){
childshell = new Shell(shell);
WrapperFileStandardSettingDialog dialog = new WrapperFileStandardSettingDialog(
this, childshell);
dialog.setExeName(exeName);
dialog.setCommandLabel(exeName + "パス");
dialog.createGUI();
dialog.createOkCancellButton();
if (fileProperties != null) {
if (fileProperties.get(COMMAND_PATH) != null) {
dialog.setCommandPath(fileProperties.get(COMMAND_PATH));
}
}
childshell.open();
}else{
childshell.setFocus();
}
}
}
|