/*
* Created on 2004/08/13
* Author aki@www.xucker.jpn.org
* License Apache2.0 or Common Public License
*/
package org.jpn.xucker.wmatopcm;
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 WmaToPcmWrapper extends WrapperFileStandard {
Button waveformatextensible;
/**
* @param shell
*/
public WmaToPcmWrapper(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);
WmaToPcmWrapper main = new WmaToPcmWrapper(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 static String WAVE_FORMAT_EXTENSIVE = "WAVE_FORMAT_EXTENSIVE";
private Shell childshell;
protected void beforeInit() {
// TODO Auto-generated method stub
APP_NAME = "WmaToPcm Wrapper";
defaultCommandPath = "C:\\Program Files\\Windows Media Components\\Tools\\wmal2pcm\\wmal2pcm.exe";
logoPath = "org/jpn/xucker/wmatopcm/resource/logo.png";
iconPath = "org/jpn/xucker/wmatopcm/resource/icon.png";
settingLabel = "wmal2pcm設定";
exeName = "wmal2pcm.exe";
allowFileExtension = new String[] { "wma" };
execLabel = "変換";
myselfExeName = "wmatopcm.exe";
url = "http://www.xucker.jpn.org/product/wmatopcm.html";
version = 0.1;
resultLabels=new String[]{"結果","ファイル名","ディレクトリー"};
resultWidths=new int[]{50,100,100};
outputExtension=".wav";
}
/*
* (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);
}
/*
* (non-Javadoc)
*
* @see org.jpn.xucker.commons.swt.series.wfs.WrapperFileStandard#createWrapperExecuter()
*/
protected WrapperExecuter createWrapperExecuter() {
WmaToPcmExecuter executer = new WmaToPcmExecuter();
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();
}
}
}
|