Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#include "casmconfigpanel2.h"
Toshihiro Shimizu 890ddd
#include "filebrowserpopup.h"
Toshihiro Shimizu 890ddd
#include "application.h"
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#include "tw/mainshell.h"
Toshihiro Shimizu 890ddd
#include "tw/label.h"
Toshihiro Shimizu 890ddd
#include "tw/optionmenu.h"
Toshihiro Shimizu 890ddd
#include "tw/button.h"
Toshihiro Shimizu 890ddd
#include "tw/checkbox.h"
Toshihiro Shimizu 890ddd
#include "tw/keycodes.h"
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#include "tconvert.h"
Toshihiro Shimizu 890ddd
#include "util.h"
Toshihiro Shimizu 890ddd
#include "tsystem.h"
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#include "tw/message.h"
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
using namespace TwConsts;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//==============================================================================
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
FilePathField::FilePathField(TWidget *parent, string name)
Shinya Kitaoka 120a6e
    : TTextField(parent, name) {
Shinya Kitaoka 120a6e
  m_page = dynamic_cast<casmconfigpanel2 *="">(parent);</casmconfigpanel2>
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//------------------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
void FilePathField::onFocusChange(bool on) {
Shinya Kitaoka 120a6e
  if (!on) close();
Shinya Kitaoka 120a6e
  TWidget::onFocusChange(on);
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//------------------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
void FilePathField::close() {
Shinya Kitaoka 120a6e
  static string oldText;
Shinya Kitaoka 120a6e
  if (oldText != toString(m_text)) {
Shinya Kitaoka 120a6e
    TFilePath fp(m_text);
Shinya Kitaoka 120a6e
    try {
Shinya Kitaoka 120a6e
      string uncString;
Shinya Kitaoka 120a6e
      try {
Shinya Kitaoka 120a6e
        uncString = convertToUncString(fp);
Shinya Kitaoka 120a6e
        m_text    = toWideString(uncString);
Shinya Kitaoka 120a6e
        m_page->loadSetup(TFilePath(uncString));
Shinya Kitaoka 120a6e
      } catch (TException &) {
Shinya Kitaoka 120a6e
        TFileStatus fs(fp);
Shinya Kitaoka 120a6e
        if (fs.doesExist() && !fs.isDirectory())
Shinya Kitaoka 120a6e
          m_page->loadSetup(TFilePath(toString(fp.getWideString())));
Shinya Kitaoka 120a6e
        else {
Shinya Kitaoka 120a6e
          CasmTask2 *task = dynamic_cast<casmtask2 *="">(m_page->getTask());</casmtask2>
Shinya Kitaoka 120a6e
          if (task) task->m_setupFile = toString(m_text);
Shinya Kitaoka 120a6e
        }
Shinya Kitaoka 120a6e
      }
Shinya Kitaoka 120a6e
      oldText = toString(m_text);
Shinya Kitaoka 120a6e
    } catch (...) {
Shinya Kitaoka 120a6e
      TMessage::error("boh");
Shinya Kitaoka 120a6e
    }
Shinya Kitaoka 120a6e
  }
Shinya Kitaoka 120a6e
  invalidate();
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//------------------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
void FilePathField::keyDown(int key, unsigned long flags, const TPoint &p) {
Shinya Kitaoka 120a6e
  if (key == TK_Return)
Shinya Kitaoka 120a6e
    close();
Shinya Kitaoka 120a6e
  else
Shinya Kitaoka 120a6e
    TTextField::keyDown(key, flags, p);
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//==============================================================================
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
enum numFieldType {
Shinya Kitaoka 120a6e
  M_FROM = 0,
Shinya Kitaoka 120a6e
  M_TO,
Shinya Kitaoka 120a6e
  M_STEP,
Shinya Kitaoka 120a6e
  M_SHRINK,
Shinya Kitaoka 120a6e
  M_RTILE,
Shinya Kitaoka 120a6e
  M_MCHUNK,
Shinya Kitaoka 120a6e
  M_COLUMN,
Shinya Kitaoka 120a6e
  M_THICK,
Shinya Kitaoka 120a6e
  M_GAMMA,
Shinya Kitaoka 120a6e
  M_CHUNKSIZE
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
enum textFieldType { M_TCOLUMN = 0, M_TSETUP, M_TENTRYPOINT };
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
namespace {
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
class NumFieldChanger : public TNumField::Action {
Shinya Kitaoka 120a6e
  CasmConfigPanel2 *m_ccp;
Shinya Kitaoka 120a6e
  numFieldType m_type;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
public:
Shinya Kitaoka 120a6e
  NumFieldChanger(CasmConfigPanel2 *ccp, numFieldType type)
Shinya Kitaoka 120a6e
      : m_ccp(ccp), m_type(type) {}
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  void sendCommand(const TNumField::Event &ev);
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
void NumFieldChanger::sendCommand(const TNumField::Event &ev) {
Shinya Kitaoka 120a6e
  m_ccp->onNumField(ev.m_value, m_type);
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
class ColumnFieldChanger : public TTextField::Action {
Shinya Kitaoka 120a6e
  CasmConfigPanel2 *m_ccp;
Shinya Kitaoka 120a6e
  textFieldType m_type;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
public:
Shinya Kitaoka 120a6e
  ColumnFieldChanger(CasmConfigPanel2 *ccp, textFieldType type)
Shinya Kitaoka 120a6e
      : m_ccp(ccp), m_type(type) {}
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  void sendCommand(std::wstring value) {
Shinya Kitaoka 120a6e
    m_ccp->onColumnField(toString(value), m_type);
Shinya Kitaoka 120a6e
  }
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//------------------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
static bool is_num(string word) {
Shinya Kitaoka 120a6e
  string::iterator it = word.begin();
Shinya Kitaoka 120a6e
  while (it != word.end()) {
Shinya Kitaoka 120a6e
    if ((*it < '0' || *it > '9') && *it != '.') return false;
Shinya Kitaoka 120a6e
    it++;
Shinya Kitaoka 120a6e
  }
Shinya Kitaoka 120a6e
  return true;
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//==============================================================================
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
CasmConfigPanel2::CasmConfigPanel2(TWidget *parent)
Shinya Kitaoka 120a6e
    : TaskConfigPanel(parent), m_task(0) {
Shinya Kitaoka 120a6e
  m_chunkSizeLabel = new TLabel(this);
Shinya Kitaoka 120a6e
  m_chunkSizeLabel->setText("Task Chunk Size:");
Shinya Kitaoka 120a6e
  m_chunkSize = new TNumField(this);
Shinya Kitaoka 120a6e
  m_chunkSize->setIsInteger(true);
Shinya Kitaoka 120a6e
  m_chunkSize->setRange(1, std::numeric_limits<int>::max());</int>
Shinya Kitaoka 120a6e
  m_chunkSize->addAction(new NumFieldChanger(this, M_CHUNKSIZE));
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  m_setupLabel = new TLabel(this);
Shinya Kitaoka 120a6e
  m_setupLabel->setText("Setup Path:");
Shinya Kitaoka 120a6e
  m_setupTextField = new FilePathField(this);
Shinya Kitaoka 120a6e
  // m_setupTextField->addAction(new ColumnFieldChanger(this, M_TSETUP));
Shinya Kitaoka 120a6e
  m_setupBrowseBtn = new TButton(this);
Shinya Kitaoka 120a6e
  m_setupBrowseBtn->setTitle("...");
Shinya Kitaoka 120a6e
  tconnect(*m_setupBrowseBtn, this, &CasmConfigPanel2::browseSetupFiles);
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  m_fromLabel = new TLabel(this);
Shinya Kitaoka 120a6e
  m_fromLabel->setText("From:");
Shinya Kitaoka 120a6e
  m_from = new TNumField(this);
Shinya Kitaoka 120a6e
  m_from->setIsInteger(true);
Shinya Kitaoka 120a6e
  m_from->addAction(new NumFieldChanger(this, M_FROM));
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  m_toLabel = new TLabel(this);
Shinya Kitaoka 120a6e
  m_toLabel->setText("To:");
Shinya Kitaoka 120a6e
  m_to = new TNumField(this);
Shinya Kitaoka 120a6e
  m_to->setIsInteger(true);
Shinya Kitaoka 120a6e
  m_to->addAction(new NumFieldChanger(this, M_TO));
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  m_stepLabel = new TLabel(this);
Shinya Kitaoka 120a6e
  m_stepLabel->setText("Step:");
Shinya Kitaoka 120a6e
  m_step = new TNumField(this);
Shinya Kitaoka 120a6e
  m_step->setIsInteger(true);
Shinya Kitaoka 120a6e
  m_step->addAction(new NumFieldChanger(this, M_STEP));
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  m_shrinkLabel = new TLabel(this);
Shinya Kitaoka 120a6e
  m_shrinkLabel->setText("Shrink:");
Shinya Kitaoka 120a6e
  m_shrink = new TNumField(this);
Shinya Kitaoka 120a6e
  m_shrink->setIsInteger(true);
Shinya Kitaoka 120a6e
  m_shrink->addAction(new NumFieldChanger(this, M_SHRINK));
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  m_renderTileLabel = new TLabel(this);
Shinya Kitaoka 120a6e
  m_renderTileLabel->setText("Render Tile:");
Shinya Kitaoka 120a6e
  m_renderTile = new TNumField(this);
Shinya Kitaoka 120a6e
  m_renderTile->setIsInteger(true);
Shinya Kitaoka 120a6e
  m_renderTile->addAction(new NumFieldChanger(this, M_RTILE));
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  m_memChunkLabel = new TLabel(this);
Shinya Kitaoka 120a6e
  m_memChunkLabel->setText("Mem Chunk:");
Shinya Kitaoka 120a6e
  m_memChunk = new TNumField(this);
Shinya Kitaoka 120a6e
  m_memChunk->setIsInteger(true);
Shinya Kitaoka 120a6e
  m_memChunk->addAction(new NumFieldChanger(this, M_MCHUNK));
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  m_subPixelMoveLabel = new TLabel(this);
Shinya Kitaoka 120a6e
  m_subPixelMoveLabel->setText("Subpixel Move:");
Shinya Kitaoka 120a6e
  m_subPixelMove = new TOptionMenu(this);
Shinya Kitaoka 120a6e
  m_subPixelMove->addOption("None");
Shinya Kitaoka 120a6e
  m_subPixelMove->addOption("RGB");
Shinya Kitaoka 120a6e
  m_subPixelMove->addOption("All");
Shinya Kitaoka 120a6e
  m_subPixelMove->setAction(new TOptionMenuAction<casmconfigpanel2>(</casmconfigpanel2>
Shinya Kitaoka 120a6e
      this, &CasmConfigPanel2::onSubPixelMove));
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  m_processingLabel = new TLabel(this);
Shinya Kitaoka 120a6e
  m_processingLabel->setText("Processing:");
Shinya Kitaoka 120a6e
  m_processing = new TOptionMenu(this);
Shinya Kitaoka 120a6e
  m_processing->addOption("32 Bit");
Shinya Kitaoka 120a6e
  m_processing->addOption("64 Bit");
Shinya Kitaoka 120a6e
  m_processing->setAction(new TOptionMenuAction<casmconfigpanel2>(</casmconfigpanel2>
Shinya Kitaoka 120a6e
      this, &CasmConfigPanel2::onProcessing));
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  m_resampleQualityLabel = new TLabel(this);
Shinya Kitaoka 120a6e
  m_resampleQualityLabel->setText("Resample Quality:");
Shinya Kitaoka 120a6e
  m_resampleQuality = new TOptionMenu(this);
Shinya Kitaoka 120a6e
  m_resampleQuality->addOption("Standard");
Shinya Kitaoka 120a6e
  m_resampleQuality->addOption("Improved");
Shinya Kitaoka 120a6e
  m_resampleQuality->addOption("High");
Shinya Kitaoka 120a6e
  m_resampleQuality->setAction(new TOptionMenuAction<casmconfigpanel2>(</casmconfigpanel2>
Shinya Kitaoka 120a6e
      this, &CasmConfigPanel2::onResampleQuality));
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  m_focus = new TCheckBox(this, "Constant Focus");
Shinya Kitaoka 120a6e
  tconnect<casmconfigpanel2>(*m_focus, this, onConstantFocus);</casmconfigpanel2>
Shinya Kitaoka 120a6e
  m_noOverwrite = new TCheckBox(this, "No Overwrite");
Shinya Kitaoka 120a6e
  tconnect<casmconfigpanel2>(*m_noOverwrite, this, onOverwrite);</casmconfigpanel2>
Shinya Kitaoka 120a6e
  m_multimedia = new TCheckBox(this, "Multimedia");
Shinya Kitaoka 120a6e
  tconnect<casmconfigpanel2>(*m_multimedia, this, onMultimedia);</casmconfigpanel2>
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  m_column = new TTextField(this);
Shinya Kitaoka 120a6e
  m_column->setText("All");
Shinya Kitaoka 120a6e
  m_column->disable();
Shinya Kitaoka 120a6e
  m_column->addAction(new ColumnFieldChanger(this, M_TCOLUMN));
Shinya Kitaoka 120a6e
  m_lineart = new TCheckBox(this, "Lineart");
Shinya Kitaoka 120a6e
  m_lineart->disable();
Shinya Kitaoka 120a6e
  tconnect<casmconfigpanel2>(*m_lineart, this, onLineart);</casmconfigpanel2>
Shinya Kitaoka 120a6e
  m_edgeAliasing = new TCheckBox(this, "Edge Aliasing");
Shinya Kitaoka 120a6e
  m_edgeAliasing->disable();
Shinya Kitaoka 120a6e
  tconnect<casmconfigpanel2>(*m_edgeAliasing, this, onEdgeAliasing);</casmconfigpanel2>
Shinya Kitaoka 120a6e
  m_thickness = new TNumField(this);
Shinya Kitaoka 120a6e
  m_thickness->setIsInteger(true);
Shinya Kitaoka 120a6e
  m_thickness->setRange(0, 15);
Shinya Kitaoka 120a6e
  m_thickness->setValue(8);
Shinya Kitaoka 120a6e
  m_thickness->disable();
Shinya Kitaoka 120a6e
  m_thickness->addAction(new NumFieldChanger(this, M_THICK));
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  m_gamma = new TCheckBox(this, "Gamma");
Shinya Kitaoka 120a6e
  tconnect<casmconfigpanel2>(*m_gamma, this, onGamma);</casmconfigpanel2>
Shinya Kitaoka 120a6e
  m_gammaValue = new TNumField(this);
Shinya Kitaoka 120a6e
  m_gammaValue->setValue(0);
Shinya Kitaoka 120a6e
  m_gammaValue->disable();
Shinya Kitaoka 120a6e
  m_gammaValue->addAction(new NumFieldChanger(this, M_GAMMA));
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  m_clap = new TCheckBox(this, "Add Clap");
Shinya Kitaoka 120a6e
  // tconnect<casmconfigpanel2>(*m_clap, this, onClap);</casmconfigpanel2>
Shinya Kitaoka 120a6e
  /*
Shinya Kitaoka 120a6e
m_outputScriptLabel = new TLabel(this);
Shinya Kitaoka 120a6e
m_outputScriptLabel->setText("Output Script:");
Shinya Kitaoka 120a6e
m_outputScript = new TOptionMenu(this);
Shinya Kitaoka 120a6e
m_outputScript->addOption("None");
Shinya Kitaoka 120a6e
//m_subPixelMove->setAction(new TOptionMenuAction<casmconfigpanel2>(this,</casmconfigpanel2>
Shinya Kitaoka 120a6e
&CasmConfigPanel2::onOutputScript));
Shinya Kitaoka 120a6e
m_entryPointLabel = new TLabel(this);
Shinya Kitaoka 120a6e
m_entryPointLabel->setText("Entry Point:");
Shinya Kitaoka 120a6e
m_entryPoint = new TTextField(this);
Shinya Kitaoka 120a6e
m_entryPoint->setText("");
Shinya Kitaoka 120a6e
m_entryPoint->addAction(new ColumnFieldChanger(this, M_TENTRYPOINT));
Shinya Kitaoka 120a6e
*/
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//------------------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
void CasmConfigPanel2::configureNotify(const TDimension &d) {
Shinya Kitaoka 120a6e
  int x0 = 20;
Shinya Kitaoka 120a6e
  int y  = d.ly - 1 - 10;
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  int x = x0;
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  m_setupLabel->setGeometry(x, y - 15, x + 100, y);
Shinya Kitaoka 120a6e
  m_setupTextField->setGeometry(x + 104, y - 15, x + 650, y);
Shinya Kitaoka 120a6e
  m_setupBrowseBtn->setGeometry(x + 660, y - 15, x + 680, y);
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  y -= 60;
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  m_chunkSizeLabel->setGeometry(x, y - 15, x + 100, y);
Shinya Kitaoka 120a6e
  m_chunkSize->setGeometry(x + 110, y - 15, x + 156, y);
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  y -= 40;
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  m_fromLabel->setGeometry(x, y - 15, x + 50, y);
Shinya Kitaoka 120a6e
  m_from->setGeometry(x + 54, y - 15, x + 100, y);
Shinya Kitaoka 120a6e
  x += 120;
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  m_toLabel->setGeometry(x, y - 15, x + 80, y);
Shinya Kitaoka 120a6e
  m_to->setGeometry(x + 84, y - 15, x + 130, y);
Shinya Kitaoka 120a6e
  x += 150;
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  m_stepLabel->setGeometry(x, y - 15, x + 80, y);
Shinya Kitaoka 120a6e
  m_step->setGeometry(x + 84, y - 15, x + 130, y);
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  ///
Shinya Kitaoka 120a6e
  x = x0;
Shinya Kitaoka 120a6e
  y -= 40;
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  m_shrinkLabel->setGeometry(x, y - 15, x + 50, y);
Shinya Kitaoka 120a6e
  m_shrink->setGeometry(x + 54, y - 15, x + 100, y);
Shinya Kitaoka 120a6e
  x += 120;
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  m_renderTileLabel->setGeometry(x, y - 15, x + 80, y);
Shinya Kitaoka 120a6e
  m_renderTile->setGeometry(x + 84, y - 15, x + 130, y);
Shinya Kitaoka 120a6e
  x += 150;
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  m_memChunkLabel->setGeometry(x, y - 15, x + 80, y);
Shinya Kitaoka 120a6e
  m_memChunk->setGeometry(x + 84, y - 15, x + 130, y);
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  x = x0;
Shinya Kitaoka 120a6e
  y -= 40;
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  m_subPixelMoveLabel->setGeometry(x, y - 15, x + 94, y);
Shinya Kitaoka 120a6e
  m_subPixelMove->setGeometry(x + 98, y - 15, x + 160, y);
Shinya Kitaoka 120a6e
  x += 180;
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  m_processingLabel->setGeometry(x, y - 15, x + 74, y);
Shinya Kitaoka 120a6e
  m_processing->setGeometry(x + 78, y - 15, x + 140, y);
Shinya Kitaoka 120a6e
  x += 160;
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  m_resampleQualityLabel->setGeometry(x, y - 15, x + 114, y);
Shinya Kitaoka 120a6e
  m_resampleQuality->setGeometry(x + 118, y - 15, x + 200, y);
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  x = x0;
Shinya Kitaoka 120a6e
  y -= 40;
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  x += 8;
Shinya Kitaoka 120a6e
  m_focus->setGeometry(x, y - 15, x + 90, y);
Shinya Kitaoka 120a6e
  x += 120;
Shinya Kitaoka 120a6e
  m_noOverwrite->setGeometry(x, y - 15, x + 80, y);
Shinya Kitaoka 120a6e
  x += 110;
Shinya Kitaoka 120a6e
  m_gamma->setGeometry(x, y - 15, x + 60, y);
Shinya Kitaoka 120a6e
  x += 70;
Shinya Kitaoka 120a6e
  m_gammaValue->setGeometry(x, y - 15, x + 30, y);
Shinya Kitaoka 120a6e
  x += 60;
Shinya Kitaoka 120a6e
  m_clap->setGeometry(x, y - 15, x + 90, y);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
  x = x0;
Shinya Kitaoka 120a6e
  y -= 40;
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  x += 8;
Shinya Kitaoka 120a6e
  m_multimedia->setGeometry(x, y - 15, x + 80, y);
Shinya Kitaoka 120a6e
  x += 90;
Shinya Kitaoka 120a6e
  m_column->setGeometry(x, y - 15, x + 20, y);
Shinya Kitaoka 120a6e
  x += 30;
Shinya Kitaoka 120a6e
  m_lineart->setGeometry(x, y - 15, x + 60, y);
Shinya Kitaoka 120a6e
  x += 65;
Shinya Kitaoka 120a6e
  m_edgeAliasing->setGeometry(x, y - 15, x + 80, y);
Shinya Kitaoka 120a6e
  x += 90;
Shinya Kitaoka 120a6e
  m_thickness->setGeometry(x, y - 15, x + 30, y);
Shinya Kitaoka 120a6e
  /*
Shinya Kitaoka 120a6e
x = x0;
Shinya Kitaoka 120a6e
y -=40;
Shinya Kitaoka 120a6e
m_outputScriptLabel->setGeometry(x, y-15, x+94, y);
Shinya Kitaoka 120a6e
m_outputScript->setGeometry(x+98, y-15, x+160, y);
Shinya Kitaoka 120a6e
x +=180;
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
m_entryPointLabel->setGeometry(x, y-15, x+94, y);
Shinya Kitaoka 120a6e
m_entryPoint->setGeometry(x+98, y-15, x+160, y);
Shinya Kitaoka 120a6e
*/
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//------------------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
void CasmConfigPanel2::setTask(SubmitPageTask *task) {
Shinya Kitaoka 120a6e
  m_task = dynamic_cast<casmtask2 *="">(task);</casmtask2>
Shinya Kitaoka 120a6e
  assert(m_task);
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  m_setupTextField->setText(m_task->m_setupFile);
Shinya Kitaoka 120a6e
  m_chunkSize->setValue(m_task->m_taskChunksize);
Shinya Kitaoka 120a6e
  m_from->setValue(m_task->m_start);
Shinya Kitaoka 120a6e
  m_to->setValue(m_task->m_end);
Shinya Kitaoka 120a6e
  m_step->setValue(m_task->m_step);
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  m_shrink->setValue(m_task->m_reduction);
Shinya Kitaoka 120a6e
  m_renderTile->setValue(m_task->m_renderTile);
Shinya Kitaoka 120a6e
  m_memChunk->setValue(m_task->m_memChunk);
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  string move;
Shinya Kitaoka 120a6e
  if (m_task->m_moveType == CasmTask2::M_INTMOVE)
Shinya Kitaoka 120a6e
    move = "None";
Shinya Kitaoka 120a6e
  else if (m_task->m_moveType == CasmTask2::M_BG_FRACMOVE)
Shinya Kitaoka 120a6e
    move = "RGB";
Shinya Kitaoka 120a6e
  else
Shinya Kitaoka 120a6e
    move = "All";
Shinya Kitaoka 120a6e
  m_subPixelMove->setText(move);
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  string bits;
Shinya Kitaoka 120a6e
  if (m_task->m_prec == 32)
Shinya Kitaoka 120a6e
    bits = "32 Bit";
Shinya Kitaoka 120a6e
  else
Shinya Kitaoka 120a6e
    bits = "64 Bit";
Shinya Kitaoka 120a6e
  m_processing->setText(bits);
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  string quality = "";
Shinya Kitaoka 120a6e
  if (m_task->m_restype == CasmTask2::RES_TYPE_STANDARD)
Shinya Kitaoka 120a6e
    quality = "Standard";
Shinya Kitaoka 120a6e
  else if (m_task->m_restype == CasmTask2::RES_TYPE_IMPROVED)
Shinya Kitaoka 120a6e
    quality = "Improved";
Shinya Kitaoka 120a6e
  else if (m_task->m_restype == CasmTask2::RES_TYPE_HIGH)
Shinya Kitaoka 120a6e
    quality = "High";
Shinya Kitaoka 120a6e
  m_resampleQuality->setText(quality);
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  m_focus->select(m_task->m_cf);
Shinya Kitaoka 120a6e
  m_noOverwrite->select(m_task->m_noOverwrite);
Shinya Kitaoka 120a6e
  m_multimedia->select(m_task->m_multimedia);
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  if (m_task->m_numColumn < 0)
Shinya Kitaoka 120a6e
    m_column->setText("All");
Shinya Kitaoka 120a6e
  else
Shinya Kitaoka 120a6e
    m_column->setText(toString(m_task->m_numColumn));
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  if (m_task->m_lineart < 0) {
Shinya Kitaoka 120a6e
    m_lineart->disable();
Shinya Kitaoka 120a6e
    m_lineart->select(false);
Shinya Kitaoka 120a6e
  } else {
Shinya Kitaoka 120a6e
    m_lineart->enable();
Shinya Kitaoka 120a6e
    m_lineart->select(true);
Shinya Kitaoka 120a6e
  }
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  if (m_task->m_edgeAliasing < 0) {
Shinya Kitaoka 120a6e
    m_edgeAliasing->disable();
Shinya Kitaoka 120a6e
    m_edgeAliasing->select(false);
Shinya Kitaoka 120a6e
  } else {
Shinya Kitaoka 120a6e
    m_edgeAliasing->enable();
Shinya Kitaoka 120a6e
    m_edgeAliasing->select(true);
Shinya Kitaoka 120a6e
  }
Shinya Kitaoka 120a6e
  if (m_task->m_edgeAliasing >= 0 || m_task->m_lineart >= 0)
Shinya Kitaoka 120a6e
    m_thickness->setValue(tmax(m_task->m_edgeAliasing, m_task->m_lineart));
Shinya Kitaoka 120a6e
  else
Shinya Kitaoka 120a6e
    m_thickness->setValue(8);
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  if (m_task->m_gamma < 0.) {
Shinya Kitaoka 120a6e
    m_gamma->select(false);
Shinya Kitaoka 120a6e
    m_gammaValue->setValue(0.0);
Shinya Kitaoka 120a6e
    m_gammaValue->disable();
Shinya Kitaoka 120a6e
  } else {
Shinya Kitaoka 120a6e
    m_gamma->select(true);
Shinya Kitaoka 120a6e
    m_gammaValue->setValue(m_task->m_gamma);
Shinya Kitaoka 120a6e
    m_gammaValue->enable();
Shinya Kitaoka 120a6e
  }
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//------------------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
SubmitPageTask *CasmConfigPanel2::getTask() const { return m_task; }
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//------------------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
void CasmConfigPanel2::onNumField(double v, int type) {
Shinya Kitaoka 120a6e
  if (!m_task) return;
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  switch (type) {
Shinya Kitaoka 120a6e
  case M_FROM:
Shinya Kitaoka 120a6e
    m_task->m_start = (int)v;
Shinya Kitaoka 120a6e
    break;
Shinya Kitaoka 120a6e
  case M_TO:
Shinya Kitaoka 120a6e
    m_task->m_end = (int)v;
Shinya Kitaoka 120a6e
    break;
Shinya Kitaoka 120a6e
  case M_STEP:
Shinya Kitaoka 120a6e
    m_task->m_step = (int)v;
Shinya Kitaoka 120a6e
    break;
Shinya Kitaoka 120a6e
  case M_SHRINK:
Shinya Kitaoka 120a6e
    m_task->m_reduction = (int)v;
Shinya Kitaoka 120a6e
    break;
Shinya Kitaoka 120a6e
  case M_RTILE:
Shinya Kitaoka 120a6e
    m_task->m_renderTile = (int)v;
Shinya Kitaoka 120a6e
    break;
Shinya Kitaoka 120a6e
  case M_MCHUNK:
Shinya Kitaoka 120a6e
    m_task->m_memChunk = (int)v;
Shinya Kitaoka 120a6e
    break;
Shinya Kitaoka 120a6e
  case M_THICK:
Shinya Kitaoka 120a6e
    if (m_lineart->isSelected()) m_task->m_lineart           = (int)v;
Shinya Kitaoka 120a6e
    if (m_edgeAliasing->isSelected()) m_task->m_edgeAliasing = (int)v;
Shinya Kitaoka 120a6e
    break;
Shinya Kitaoka 120a6e
  case M_GAMMA:
Shinya Kitaoka 120a6e
    m_task->m_gamma = v;
Shinya Kitaoka 120a6e
    break;
Shinya Kitaoka 120a6e
  case M_CHUNKSIZE:
Shinya Kitaoka 120a6e
    m_task->m_taskChunksize = (int)v;
Shinya Kitaoka 120a6e
    break;
Shinya Kitaoka 120a6e
  }
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//------------------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
void CasmConfigPanel2::onColumnField(string value, int type) {
Shinya Kitaoka 120a6e
  if (!m_task) return;
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  switch (type) {
Shinya Kitaoka 120a6e
  case M_TCOLUMN:
Shinya Kitaoka 120a6e
    if (value == "" || value == "ALL" || value == "All" || value == "all" ||
Shinya Kitaoka 120a6e
        value == "AL" || value == "Al" || value == "a" || value == "A")
Shinya Kitaoka 120a6e
      m_task->m_numColumn = -1;
Shinya Kitaoka 120a6e
    else if (is_num(value))
Shinya Kitaoka 120a6e
      m_task->m_numColumn = atoi(value.c_str());
Shinya Kitaoka 120a6e
    else {
Shinya Kitaoka 120a6e
      m_task->m_numColumn = -1;
Shinya Kitaoka 120a6e
      m_column->setText("All");
Shinya Kitaoka 120a6e
      TMessage::error("Only \"All\" or a number is a valid argument");
Shinya Kitaoka 120a6e
    }
Shinya Kitaoka 120a6e
    break;
Shinya Kitaoka 120a6e
  case M_TSETUP:
Shinya Kitaoka 120a6e
    m_task->m_setupFile = value;
Shinya Kitaoka 120a6e
    break;
Shinya Kitaoka 120a6e
  default:
Shinya Kitaoka 120a6e
    break;
Shinya Kitaoka 120a6e
  }
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//------------------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
void CasmConfigPanel2::browseSetupFiles() {
Shinya Kitaoka 120a6e
  static FileBrowserPopup *popup = 0;
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  if (!popup) {
Shinya Kitaoka 120a6e
    CasmConfigPanel2 *csp = this;
Shinya Kitaoka 120a6e
    vector<string> fileTypes;</string>
Shinya Kitaoka 120a6e
    fileTypes.push_back("setup");
Shinya Kitaoka 120a6e
    popup = new FileBrowserPopup(csp, fileTypes);
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
    popup->setOkAction(new TFileBrowserPopupAction<casmconfigpanel2>(</casmconfigpanel2>
Shinya Kitaoka 120a6e
        csp, &CasmConfigPanel2::loadSetup));
Shinya Kitaoka 120a6e
  }
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  if (!popup) return;
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  TFilePath fp = Application::instance()->getCurrentFolder();
Shinya Kitaoka 120a6e
  /*
Shinya Kitaoka 120a6e
E'stato necessario fare questo controllo perche' il popup non e' in grado
Shinya Kitaoka 120a6e
di impostare opportunamente le cose
Shinya Kitaoka 120a6e
*/
Shinya Kitaoka 120a6e
  string path = toString(fp.getWideString()).c_str();
Shinya Kitaoka 120a6e
  if (fp != TFilePath() && (path[0] != '\\')) popup->setCurrentDir(fp);
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  TDimension d = TMainshell::getMainshell()->getSize();
Toshihiro Shimizu 890ddd
#ifdef WIN32
Shinya Kitaoka 120a6e
  HDC hdc = GetDC(0);
Shinya Kitaoka 120a6e
  d.lx    = GetDeviceCaps(hdc, HORZRES);
Shinya Kitaoka 120a6e
  d.ly    = GetDeviceCaps(hdc, VERTRES);
Shinya Kitaoka 120a6e
  ReleaseDC(0, hdc);
Toshihiro Shimizu 890ddd
#endif
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  d -= popup->getSize();
Shinya Kitaoka 120a6e
  // TDimension d = TMainshell::getMainshell()->getSize() - popup->getSize();
Shinya Kitaoka 120a6e
  popup->popup(TPoint(d.lx / 2, d.ly / 2));
Shinya Kitaoka 120a6e
  popup->setCaption("Load Setup");
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//------------------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
void CasmConfigPanel2::loadSetup(const TFilePath &fp) {
Shinya Kitaoka 120a6e
  if (!TFileStatus(fp).doesExist()) {
Shinya Kitaoka 120a6e
    string msg = toString(fp.getWideString()) + "\n";
Shinya Kitaoka 120a6e
    msg += "File not found\n";
Shinya Kitaoka 120a6e
    msg += "Please verify that the path and file name are correct";
Shinya Kitaoka 120a6e
    m_setupTextField->setText("");
Shinya Kitaoka 120a6e
    TMessage::error(msg);
Shinya Kitaoka 120a6e
    return;
Shinya Kitaoka 120a6e
  }
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  string uncString = toString(fp.getWideString());
Shinya Kitaoka 120a6e
  if (toString(m_setupTextField->getText()) != uncString) try {
Shinya Kitaoka 120a6e
      uncString = convertToUncString(fp);
Shinya Kitaoka 120a6e
    } catch (TException &e) {
Shinya Kitaoka 120a6e
      TMessage::error(toString(e.getMessage()));
Shinya Kitaoka 120a6e
      return;
Shinya Kitaoka 120a6e
    }
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  Application::instance()->setCurrentFolder(fp.getParentDir());
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  m_setupTextField->setText(uncString);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#ifdef WIN32
Shinya Kitaoka 120a6e
  int x = uncString.find("\\", 2);
Shinya Kitaoka 120a6e
  while (x != string::npos) {
Shinya Kitaoka 120a6e
    uncString.replace(x, 1, "/", 0, 1);
Shinya Kitaoka 120a6e
    x = uncString.find("\\", x + 1);
Shinya Kitaoka 120a6e
  }
Toshihiro Shimizu 890ddd
#endif
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  if (m_task) m_task->m_setupFile = uncString;
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//------------------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
void CasmConfigPanel2::onMultimedia(TCheckBox *box, bool on) {
Shinya Kitaoka 120a6e
  if (!m_task) return;
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  if (on) {
Shinya Kitaoka 120a6e
    m_task->m_multimedia = true;
Shinya Kitaoka 120a6e
    m_column->enable();
Shinya Kitaoka 120a6e
    m_lineart->enable();
Shinya Kitaoka 120a6e
    m_edgeAliasing->enable();
Shinya Kitaoka 120a6e
    if (m_lineart->isSelected() || m_edgeAliasing->isSelected())
Shinya Kitaoka 120a6e
      m_thickness->enable();
Shinya Kitaoka 120a6e
    else
Shinya Kitaoka 120a6e
      m_thickness->disable();
Shinya Kitaoka 120a6e
  } else {
Shinya Kitaoka 120a6e
    m_task->m_multimedia = false;
Shinya Kitaoka 120a6e
    m_column->disable();
Shinya Kitaoka 120a6e
    m_lineart->disable();
Shinya Kitaoka 120a6e
    m_lineart->select(false);
Shinya Kitaoka 120a6e
    m_edgeAliasing->disable();
Shinya Kitaoka 120a6e
    m_edgeAliasing->select(false);
Shinya Kitaoka 120a6e
    m_thickness->setValue(8);
Shinya Kitaoka 120a6e
    m_thickness->disable();
Shinya Kitaoka 120a6e
    m_task->m_lineart = m_task->m_edgeAliasing = -1;
Shinya Kitaoka 120a6e
  }
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//------------------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
void CasmConfigPanel2::onLineart(TCheckBox *box, bool on) {
Shinya Kitaoka 120a6e
  if (!m_task) return;
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  if (on) {
Shinya Kitaoka 120a6e
    m_task->m_lineart      = (int)m_thickness->getValue();
Shinya Kitaoka 120a6e
    m_task->m_edgeAliasing = -1;
Shinya Kitaoka 120a6e
    m_lineart->enable();
Shinya Kitaoka 120a6e
    m_edgeAliasing->disable();
Shinya Kitaoka 120a6e
    m_thickness->enable();
Shinya Kitaoka 120a6e
  } else {
Shinya Kitaoka 120a6e
    m_task->m_lineart = -1;
Shinya Kitaoka 120a6e
    m_lineart->enable();
Shinya Kitaoka 120a6e
    m_edgeAliasing->enable();
Shinya Kitaoka 120a6e
    m_thickness->disable();
Shinya Kitaoka 120a6e
  }
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//------------------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
void CasmConfigPanel2::onEdgeAliasing(TCheckBox *box, bool on) {
Shinya Kitaoka 120a6e
  if (!m_task) return;
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  if (on) {
Shinya Kitaoka 120a6e
    m_task->m_edgeAliasing = (int)m_thickness->getValue();
Shinya Kitaoka 120a6e
    m_task->m_lineart      = -1;
Shinya Kitaoka 120a6e
    m_lineart->disable();
Shinya Kitaoka 120a6e
    m_edgeAliasing->enable();
Shinya Kitaoka 120a6e
    m_thickness->enable();
Shinya Kitaoka 120a6e
  } else {
Shinya Kitaoka 120a6e
    m_task->m_edgeAliasing = -1;
Shinya Kitaoka 120a6e
    m_lineart->enable();
Shinya Kitaoka 120a6e
    m_edgeAliasing->enable();
Shinya Kitaoka 120a6e
    m_thickness->disable();
Shinya Kitaoka 120a6e
  }
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//------------------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
void CasmConfigPanel2::onConstantFocus(TCheckBox *box, bool on) {
Shinya Kitaoka 120a6e
  if (!m_task) return;
Shinya Kitaoka 120a6e
  m_task->m_cf = on;
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//------------------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
void CasmConfigPanel2::onOverwrite(TCheckBox *box, bool on) {
Shinya Kitaoka 120a6e
  if (!m_task) return;
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  m_task->m_noOverwrite = on;
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//------------------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
void CasmConfigPanel2::onGamma(TCheckBox *box, bool on) {
Shinya Kitaoka 120a6e
  if (!m_task) return;
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  if (on)
Shinya Kitaoka 120a6e
    m_task->m_gamma = m_gammaValue->getValue();
Shinya Kitaoka 120a6e
  else
Shinya Kitaoka 120a6e
    m_task->m_gamma = -1.;
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//------------------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
void CasmConfigPanel2::onSubPixelMove(string move) {
Shinya Kitaoka 120a6e
  if (!m_task) return;
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  if (move == "None")
Shinya Kitaoka 120a6e
    m_task->m_moveType = CasmTask2::M_INTMOVE;
Shinya Kitaoka 120a6e
  else if (move == "RGB")
Shinya Kitaoka 120a6e
    m_task->m_moveType = CasmTask2::M_BG_FRACMOVE;
Shinya Kitaoka 120a6e
  else
Shinya Kitaoka 120a6e
    m_task->m_moveType = CasmTask2::M_FRACMOVE;
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//------------------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
void CasmConfigPanel2::onProcessing(string bits) {
Shinya Kitaoka 120a6e
  if (!m_task) return;
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  if (bits == "32 Bit")
Shinya Kitaoka 120a6e
    m_task->m_prec = 32;
Shinya Kitaoka 120a6e
  else
Shinya Kitaoka 120a6e
    m_task->m_prec = 64;
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//------------------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
void CasmConfigPanel2::onResampleQuality(string quality) {
Shinya Kitaoka 120a6e
  if (!m_task) return;
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  if (quality == "Standard")
Shinya Kitaoka 120a6e
    m_task->m_restype = CasmTask2::RES_TYPE_STANDARD;
Shinya Kitaoka 120a6e
  else if (quality == "Improved")
Shinya Kitaoka 120a6e
    m_task->m_restype = CasmTask2::RES_TYPE_IMPROVED;
Shinya Kitaoka 120a6e
  else if (quality == "High")
Shinya Kitaoka 120a6e
    m_task->m_restype = CasmTask2::RES_TYPE_HIGH;
Shinya Kitaoka 120a6e
  else
Shinya Kitaoka 120a6e
    m_task->m_restype = CasmTask2::RES_TYPE_NONE;
Toshihiro Shimizu 890ddd
}