Ticket #8996: scummvmtool.patch

File scummvmtool.patch, 51.9 KB (added by SF/remere, 16 years ago)

SVN diff file

  • trunk/tools_gui.cpp

     
    6262
    6363MainFrame::MainFrame(const wxString& title) : wxFrame((wxFrame *)NULL, wxID_ANY, title, wxDefaultPosition, wxSize(600, 450)) {
    6464        wxBoxSizer *mainSizer = new wxBoxSizer(wxVERTICAL);
    65         this->SetSizer(mainSizer);
     65        SetSizer(mainSizer);
    6666
    6767        _mainNotebook = new wxNotebook(this, wxID_ANY);
    6868
     
    8484        _mainNotebook->AddPage(extractionPage, wxT("Extraction"), false, wxID_ANY);
    8585
    8686        mainSizer->Add(_mainNotebook, 1, wxEXPAND);
    87         this->SetMinSize(wxSize(600, 450));
     87        SetMinSize(wxSize(600, 450));
    8888}
    8989
    9090/* ----- Common ----- */
     
    9292Process::Process(MainFrame *parent, wxTextCtrl *target) : wxProcess(parent) {
    9393        _parent = parent;
    9494        _target = target;
    95         this->Redirect();
     95        Redirect();
    9696}
    9797
    9898bool Process::HasInput() {
    99         if (this->IsInputAvailable()) {
    100                 wxTextInputStream stream(*this->GetInputStream());
     99        if (IsInputAvailable()) {
     100                wxTextInputStream stream(*GetInputStream());
    101101
    102102                wxString output;
    103103                output << stream.ReadLine() << wxT("\n");
    104104
    105                 this->_target->AppendText(output);
     105                _target->AppendText(output);
    106106
    107107                return true;
    108108        }
     
    111111}
    112112
    113113void Process::OnTerminate(int pid, int status) {
    114         while (this->HasInput());
    115         this->_target->AppendText(wxT("\n\n-------------------------"));
    116         this->_target->AppendText(wxT("\nOperation Finished."));
    117         this->_target->AppendText(wxT("\n-------------------------"));
     114        while (HasInput());
     115        _target->AppendText(wxT("\n\n-------------------------"));
     116        _target->AppendText(wxT("\nOperation Finished."));
     117        _target->AppendText(wxT("\n-------------------------"));
    118118        _parent->OnProcessTerminated(this);
    119119        delete this;
    120120}
     
    131131}
    132132
    133133void LocationDialog::prompt() {
    134         if (this->_isFileChooser) {
     134        if (_isFileChooser) {
    135135                wxFileDialog *dialog = dynamic_cast<wxFileDialog*>(_dialog);
    136136
    137137                if (dialog->ShowModal() == wxID_OK) {
    138138                        wxArrayString filenames;
    139139                        dialog->GetPaths(filenames);
    140140
    141                         this->_target->SetValue(wxT("\""));
    142                         this->_target->AppendText(filenames.Item(0));
    143                         this->_target->AppendText(wxT("\""));
     141                        _target->SetValue(wxT("\""));
     142                        _target->AppendText(filenames.Item(0));
     143                        _target->AppendText(wxT("\""));
    144144       
    145                         this->_target->SetInsertionPoint(0);
     145                        _target->SetInsertionPoint(0);
    146146                }
    147147        } else {
    148148                wxDirDialog *dialog = dynamic_cast<wxDirDialog*>(_dialog);
    149149
    150150                if (dialog->ShowModal() == wxID_OK) {
    151                         this->_target->SetValue(wxT("\""));
    152                         this->_target->AppendText(dialog->GetPath());
    153                         this->_target->AppendText(wxT("\""));
     151                        _target->SetValue(wxT("\""));
     152                        _target->AppendText(dialog->GetPath());
     153                        _target->AppendText(wxT("\""));
    154154       
    155                         this->_target->SetInsertionPoint(0);
     155                        _target->SetInsertionPoint(0);
    156156                }
    157157        }
    158158}
     
    180180IOChooser::IOChooser(wxWindow *parent, kEventId buttonId, wxString title, bool isFileChooser) : wxPanel(parent) {
    181181        wxStaticBox *staticBox = new wxStaticBox(this, wxID_ANY, title);
    182182        wxStaticBoxSizer *staticBoxSizer = new wxStaticBoxSizer(staticBox, wxHORIZONTAL);
    183         this->SetSizer(staticBoxSizer);
     183        SetSizer(staticBoxSizer);
    184184
    185185        wxPanel *panel = new wxPanel(this);
    186186        wxBoxSizer *sizer = new wxBoxSizer(wxHORIZONTAL);
     
    203203DropDownBox::DropDownBox(wxWindow *parent, kEventId boxId, wxString title, int numItems, wxString items[]) : wxPanel(parent) {
    204204        wxStaticBox *box = new wxStaticBox(this, wxID_ANY, title);
    205205        wxStaticBoxSizer *sizer = new wxStaticBoxSizer(box, wxHORIZONTAL);
    206         this->SetSizer(sizer);
     206        SetSizer(sizer);
    207207
    208208        _choice = new wxChoice(this, boxId, wxDefaultPosition, wxDefaultSize, numItems, items);
    209209
     
    215215CompressionOptions::CompressionOptions(wxWindow *parent) : wxPanel(parent) {
    216216        wxStaticBox *box = new wxStaticBox(this, wxID_ANY, wxT("Compression Options"));
    217217        wxStaticBoxSizer *sizer = new wxStaticBoxSizer(box, wxVERTICAL);
    218         this->SetSizer(sizer);
     218        SetSizer(sizer);
    219219
    220220        wxPanel *grid = new wxPanel(this);
    221221        wxGridSizer *gridSizer = new wxGridSizer(2, 5, 0, 10);
     
    237237        _mpegQualityChooser = new wxChoice(grid, wxID_ANY, wxDefaultPosition, wxDefaultSize, kNumValidQuality, kVaildQualityNames);
    238238
    239239        wxStaticText *compressionLevelLabel = new wxStaticText(grid, wxID_ANY, wxT("Compression Level"));
    240         _compressionLevelChooser = new wxChoice(grid, wxID_ANY, wxDefaultPosition, wxDefaultSize, kNumValidCompressionLevels, kVaildCompressionLevels);
     240        _compressionLevelChooser = new wxChoice(grid, wxID_ANY, wxDefaultPosition, wxDefaultSize, kNumValidCompressionLevels, kValidCompressionLevels);
    241241
    242242        wxStaticText *modeLabel = new wxStaticText(grid, wxID_ANY, wxT("Compression Mode"));
    243243        _modeChooser = new wxChoice(grid, kCompressionModeChoice, wxDefaultPosition, wxDefaultSize, kNumMP3Modes, kMP3ModeNames);
     
    280280
    281281CompressionPanel::CompressionPanel(wxWindow *parent) : wxPanel(parent) {
    282282        wxBoxSizer *sizer = new wxBoxSizer(wxVERTICAL);
    283         this->SetSizer(sizer);
     283        SetSizer(sizer);
    284284
    285285        /* Top Panel */
    286286        wxPanel *topPanel = new wxPanel(this);
     
    325325        /* Simulate selecting the first tool to set up the compression options */
    326326        _compressionToolChooserBox->_choice->SetSelection(0);
    327327        wxCommandEvent toolEvent = wxCommandEvent(wxEVT_COMMAND_CHOICE_SELECTED, kCompressionToolChoice);
    328         this->OnCompressionToolChange(toolEvent);
     328        OnCompressionToolChange(toolEvent);
    329329
    330330        /* Simulate selecting the first compression type to set up the compression options */
    331331        _compressionTypeBox->_choice->SetSelection(0);
    332332        wxCommandEvent compressionEvent = wxCommandEvent(wxEVT_COMMAND_CHOICE_SELECTED, kCompressionTypeChoice);
    333         this->OnCompressionTypeChange(compressionEvent);
     333        OnCompressionTypeChange(compressionEvent);
    334334}
    335335
    336336/* ----- Extraction ----- */
     
    338338ExtractionOptions::ExtractionOptions(wxWindow *parent) : wxPanel(parent) {
    339339        wxStaticBox *box = new wxStaticBox(this, wxID_ANY, wxT("Extraction Options"));
    340340        wxStaticBoxSizer *sizer = new wxStaticBoxSizer(box, wxVERTICAL);
    341         this->SetSizer(sizer);
     341        SetSizer(sizer);
    342342
    343343        wxPanel *grid = new wxPanel(this);
    344344        wxFlexGridSizer *gridSizer = new wxFlexGridSizer(2, 5, 0, 20);
     
    377377
    378378ExtractionPanel::ExtractionPanel(wxWindow *parent) : wxPanel(parent) {
    379379        wxBoxSizer *sizer = new wxBoxSizer(wxVERTICAL);
    380         this->SetSizer(sizer);
     380        SetSizer(sizer);
    381381
    382382        /* Top Panel */
    383383        wxPanel *topPanel = new wxPanel(this);
     
    415415        /* Simulate selecting the first tool to set up the extraction options */
    416416        _extractionToolChooserPanel->_choice->SetSelection(0);
    417417        wxCommandEvent toolEvent = wxCommandEvent(wxEVT_COMMAND_CHOICE_SELECTED, kExtractionToolChoice);
    418         this->OnExtractionToolChange(toolEvent);
     418        OnExtractionToolChange(toolEvent);
    419419}
    420420
    421421/* ----- Compression Events ----- */
    422422
    423423void CompressionPanel::OnCompressionToolChange(wxCommandEvent &event) {
    424         wxString selectedTool = this->_compressionToolChooserBox->_choice->GetStringSelection();
     424        wxString selectedTool = _compressionToolChooserBox->_choice->GetStringSelection();
    425425
    426         this->_inputPanel->_browse->Enable(true);
    427         this->_inputPanel->_text->Enable(true);
    428         this->_inputPanel->_text->Clear();
    429         this->_outputPanel->_isFileChooser = false;
    430         this->_outputPanel->_text->Clear();
     426        _inputPanel->_browse->Enable(true);
     427        _inputPanel->_text->Enable(true);
     428        _inputPanel->_text->Clear();
     429        _outputPanel->_isFileChooser = false;
     430        _outputPanel->_text->Clear();
    431431
    432432        if (selectedTool == wxT("AGOS")) {
    433                 this->_inputPanel->_isFileChooser = true;
    434                 this->_outputPanel->_browse->Enable(false);
    435                 this->_outputPanel->_text->Enable(false);
     433                _inputPanel->_isFileChooser = true;
     434                _outputPanel->_browse->Enable(false);
     435                _outputPanel->_text->Enable(false);
    436436        } else if (selectedTool == wxT("Broken Sword 1")) {
    437                 this->_inputPanel->_isFileChooser = false;
    438                 this->_outputPanel->_browse->Enable(false);
    439                 this->_outputPanel->_text->Enable(false);
     437                _inputPanel->_isFileChooser = false;
     438                _outputPanel->_browse->Enable(false);
     439                _outputPanel->_text->Enable(false);
    440440        } else if (selectedTool == wxT("Broken Sword 2")) {
    441                 this->_inputPanel->_isFileChooser = true;
    442                 this->_outputPanel->_browse->Enable(false);
    443                 this->_outputPanel->_text->Enable(false);
     441                _inputPanel->_isFileChooser = true;
     442                _outputPanel->_browse->Enable(false);
     443                _outputPanel->_text->Enable(false);
    444444        } else if (selectedTool == wxT("Encode DXA")) {
    445                 this->_inputPanel->_isFileChooser = true;
    446                 this->_outputPanel->_browse->Enable(false);
    447                 this->_outputPanel->_text->Enable(false);
     445                _inputPanel->_isFileChooser = true;
     446                _outputPanel->_browse->Enable(false);
     447                _outputPanel->_text->Enable(false);
    448448        } else if (selectedTool == wxT("Flight of the Amazon Queen")) {
    449                 this->_inputPanel->_isFileChooser = true;
    450                 this->_outputPanel->_browse->Enable(false);
    451                 this->_outputPanel->_text->Enable(false);
     449                _inputPanel->_isFileChooser = true;
     450                _outputPanel->_browse->Enable(false);
     451                _outputPanel->_text->Enable(false);
    452452        } else if (selectedTool == wxT("Kyra")) {
    453                 this->_inputPanel->_isFileChooser = true;
    454                 this->_outputPanel->_browse->Enable(true);
    455                 this->_outputPanel->_text->Enable(true);
     453                _inputPanel->_isFileChooser = true;
     454                _outputPanel->_browse->Enable(true);
     455                _outputPanel->_text->Enable(true);
    456456        } else if (selectedTool == wxT("SAGA")) {
    457                 this->_inputPanel->_isFileChooser = true;
    458                 this->_outputPanel->_browse->Enable(false);
    459                 this->_outputPanel->_text->Enable(false);
     457                _inputPanel->_isFileChooser = true;
     458                _outputPanel->_browse->Enable(false);
     459                _outputPanel->_text->Enable(false);
    460460        } else if (selectedTool == wxT("SCUMM BUN")) {
    461                 this->_inputPanel->_isFileChooser = true;
    462                 this->_outputPanel->_browse->Enable(true);
    463                 this->_outputPanel->_text->Enable(true);
     461                _inputPanel->_isFileChooser = true;
     462                _outputPanel->_browse->Enable(true);
     463                _outputPanel->_text->Enable(true);
    464464        } else if (selectedTool == wxT("SCUMM SAN")) {
    465                 this->_inputPanel->_isFileChooser = true;
    466                 this->_outputPanel->_browse->Enable(true);
    467                 this->_outputPanel->_text->Enable(true);
     465                _inputPanel->_isFileChooser = true;
     466                _outputPanel->_browse->Enable(true);
     467                _outputPanel->_text->Enable(true);
    468468        } else if (selectedTool == wxT("SCUMM SOU")) {
    469                 this->_inputPanel->_isFileChooser = true;
    470                 this->_outputPanel->_browse->Enable(false);
    471                 this->_outputPanel->_text->Enable(false);
     469                _inputPanel->_isFileChooser = true;
     470                _outputPanel->_browse->Enable(false);
     471                _outputPanel->_text->Enable(false);
    472472        } else if (selectedTool == wxT("Simon 2 (MAC)")) {
    473                 this->_inputPanel->_isFileChooser = false;
    474                 this->_outputPanel->_browse->Enable(false);
    475                 this->_outputPanel->_text->Enable(false);
     473                _inputPanel->_isFileChooser = false;
     474                _outputPanel->_browse->Enable(false);
     475                _outputPanel->_text->Enable(false);
    476476        } else if (selectedTool == wxT("Touche")) {
    477                 this->_inputPanel->_isFileChooser = false;
    478                 this->_outputPanel->_browse->Enable(true);
    479                 this->_outputPanel->_text->Enable(true);
     477                _inputPanel->_isFileChooser = false;
     478                _outputPanel->_browse->Enable(true);
     479                _outputPanel->_text->Enable(true);
    480480        } else {
    481                 this->_inputPanel->_browse->Enable(false);
    482                 this->_inputPanel->_text->Enable(false);
    483                 this->_inputPanel->_isFileChooser = false;
    484                 this->_outputPanel->_browse->Enable(false);
    485                 this->_outputPanel->_text->Enable(false);
    486                 this->_outputPanel->_isFileChooser = false;
     481                _inputPanel->_browse->Enable(false);
     482                _inputPanel->_text->Enable(false);
     483                _inputPanel->_isFileChooser = false;
     484                _outputPanel->_browse->Enable(false);
     485                _outputPanel->_text->Enable(false);
     486                _outputPanel->_isFileChooser = false;
    487487        }
    488488}
    489489
    490490void CompressionPanel::OnCompressionTypeChange(wxCommandEvent &event) {
    491         wxString selectedCompression = this->_compressionTypeBox->_choice->GetStringSelection();
     491        wxString selectedCompression = _compressionTypeBox->_choice->GetStringSelection();
    492492
    493493        if (selectedCompression == wxT("MP3")) {
    494                 this->_compressionOptionsPanel->_avgBitrateChooser->SetSelection(0);
    495                 this->_compressionOptionsPanel->_blockSize->SetSelection(0);
    496                 this->_compressionOptionsPanel->_compressionLevelChooser->SetSelection(0);
    497                 this->_compressionOptionsPanel->_maxBitrateChooser->SetStringSelection(kDefaultMP3VBRMaxBitrate);
    498                 this->_compressionOptionsPanel->_minBitrateChooser->SetStringSelection(kDefaultMP3VBRMinBitrate);
    499                 this->_compressionOptionsPanel->_modeChooser->SetStringSelection(kDefaultMP3CompressionType);
    500                 this->_compressionOptionsPanel->_mpegQualityChooser->SetStringSelection(kDefaultMP3MpegQuality);
    501                 this->_compressionOptionsPanel->_silentChooser->SetValue(true);
    502                 this->_compressionOptionsPanel->_verifyChooser->SetValue(false);
    503                 this->_compressionOptionsPanel->_vbrQualityChooser->SetStringSelection(kDefaultMP3VBRQuality);
     494                _compressionOptionsPanel->_avgBitrateChooser->SetSelection(0);
     495                _compressionOptionsPanel->_blockSize->SetSelection(0);
     496                _compressionOptionsPanel->_compressionLevelChooser->SetSelection(0);
     497                _compressionOptionsPanel->_maxBitrateChooser->SetStringSelection(kDefaultMP3VBRMaxBitrate);
     498                _compressionOptionsPanel->_minBitrateChooser->SetStringSelection(kDefaultMP3VBRMinBitrate);
     499                _compressionOptionsPanel->_modeChooser->SetStringSelection(kDefaultMP3CompressionType);
     500                _compressionOptionsPanel->_mpegQualityChooser->SetStringSelection(kDefaultMP3MpegQuality);
     501                _compressionOptionsPanel->_silentChooser->SetValue(true);
     502                _compressionOptionsPanel->_verifyChooser->SetValue(false);
     503                _compressionOptionsPanel->_vbrQualityChooser->SetStringSelection(kDefaultMP3VBRQuality);
    504504
    505                 this->_compressionOptionsPanel->_minBitrateChooser->Enable(true);
    506                 this->_compressionOptionsPanel->_avgBitrateChooser->Enable(false);
    507                 this->_compressionOptionsPanel->_maxBitrateChooser->Enable(true);
    508                 this->_compressionOptionsPanel->_vbrQualityChooser->Enable(true);
    509                 this->_compressionOptionsPanel->_mpegQualityChooser->Enable(true);
    510                 this->_compressionOptionsPanel->_compressionLevelChooser->Enable(false);
    511                 this->_compressionOptionsPanel->_modeChooser->Enable(true);
    512                 this->_compressionOptionsPanel->_blockSize->Enable(false);
    513                 this->_compressionOptionsPanel->_verifyChooser->Enable(false);
    514                 this->_compressionOptionsPanel->_silentChooser->Enable(false);
     505                _compressionOptionsPanel->_minBitrateChooser->Enable(true);
     506                _compressionOptionsPanel->_avgBitrateChooser->Enable(false);
     507                _compressionOptionsPanel->_maxBitrateChooser->Enable(true);
     508                _compressionOptionsPanel->_vbrQualityChooser->Enable(true);
     509                _compressionOptionsPanel->_mpegQualityChooser->Enable(true);
     510                _compressionOptionsPanel->_compressionLevelChooser->Enable(false);
     511                _compressionOptionsPanel->_modeChooser->Enable(true);
     512                _compressionOptionsPanel->_blockSize->Enable(false);
     513                _compressionOptionsPanel->_verifyChooser->Enable(false);
     514                _compressionOptionsPanel->_silentChooser->Enable(false);
    515515        } else if (selectedCompression == wxT("Vorbis")) {
    516                 this->_compressionOptionsPanel->_avgBitrateChooser->SetSelection(0);
    517                 this->_compressionOptionsPanel->_blockSize->SetSelection(0);
    518                 this->_compressionOptionsPanel->_compressionLevelChooser->SetSelection(0);
    519                 this->_compressionOptionsPanel->_maxBitrateChooser->SetSelection(0);
    520                 this->_compressionOptionsPanel->_minBitrateChooser->SetSelection(0);
    521                 this->_compressionOptionsPanel->_modeChooser->SetSelection(0);
    522                 this->_compressionOptionsPanel->_mpegQualityChooser->SetSelection(0);
    523                 this->_compressionOptionsPanel->_silentChooser->SetValue(false);
    524                 this->_compressionOptionsPanel->_verifyChooser->SetValue(false);
    525                 this->_compressionOptionsPanel->_vbrQualityChooser->SetStringSelection(kDefaultOggQuality);
     516                _compressionOptionsPanel->_avgBitrateChooser->SetSelection(0);
     517                _compressionOptionsPanel->_blockSize->SetSelection(0);
     518                _compressionOptionsPanel->_compressionLevelChooser->SetSelection(0);
     519                _compressionOptionsPanel->_maxBitrateChooser->SetSelection(0);
     520                _compressionOptionsPanel->_minBitrateChooser->SetSelection(0);
     521                _compressionOptionsPanel->_modeChooser->SetSelection(0);
     522                _compressionOptionsPanel->_mpegQualityChooser->SetSelection(0);
     523                _compressionOptionsPanel->_silentChooser->SetValue(false);
     524                _compressionOptionsPanel->_verifyChooser->SetValue(false);
     525                _compressionOptionsPanel->_vbrQualityChooser->SetStringSelection(kDefaultOggQuality);
    526526
    527                 this->_compressionOptionsPanel->_minBitrateChooser->Enable(true);
    528                 this->_compressionOptionsPanel->_avgBitrateChooser->Enable(true);
    529                 this->_compressionOptionsPanel->_maxBitrateChooser->Enable(true);
    530                 this->_compressionOptionsPanel->_vbrQualityChooser->Enable(true);
    531                 this->_compressionOptionsPanel->_mpegQualityChooser->Enable(false);
    532                 this->_compressionOptionsPanel->_compressionLevelChooser->Enable(false);
    533                 this->_compressionOptionsPanel->_modeChooser->Enable(false);
    534                 this->_compressionOptionsPanel->_blockSize->Enable(false);
    535                 this->_compressionOptionsPanel->_verifyChooser->Enable(false);
    536                 this->_compressionOptionsPanel->_silentChooser->Enable(true);
     527                _compressionOptionsPanel->_minBitrateChooser->Enable(true);
     528                _compressionOptionsPanel->_avgBitrateChooser->Enable(true);
     529                _compressionOptionsPanel->_maxBitrateChooser->Enable(true);
     530                _compressionOptionsPanel->_vbrQualityChooser->Enable(true);
     531                _compressionOptionsPanel->_mpegQualityChooser->Enable(false);
     532                _compressionOptionsPanel->_compressionLevelChooser->Enable(false);
     533                _compressionOptionsPanel->_modeChooser->Enable(false);
     534                _compressionOptionsPanel->_blockSize->Enable(false);
     535                _compressionOptionsPanel->_verifyChooser->Enable(false);
     536                _compressionOptionsPanel->_silentChooser->Enable(true);
    537537        } else if (selectedCompression == wxT("FLAC")) {
    538                 this->_compressionOptionsPanel->_avgBitrateChooser->SetSelection(0);
    539                 this->_compressionOptionsPanel->_blockSize->SetStringSelection(kDefaultFlacBlocksize);
    540                 this->_compressionOptionsPanel->_compressionLevelChooser->SetStringSelection(kDefaultFlacCompress);
    541                 this->_compressionOptionsPanel->_maxBitrateChooser->SetSelection(0);
    542                 this->_compressionOptionsPanel->_minBitrateChooser->SetSelection(0);
    543                 this->_compressionOptionsPanel->_modeChooser->SetSelection(0);
    544                 this->_compressionOptionsPanel->_mpegQualityChooser->SetSelection(0);
    545                 this->_compressionOptionsPanel->_silentChooser->SetValue(false);
    546                 this->_compressionOptionsPanel->_verifyChooser->SetValue(false);
    547                 this->_compressionOptionsPanel->_vbrQualityChooser->SetSelection(0);
     538                _compressionOptionsPanel->_avgBitrateChooser->SetSelection(0);
     539                _compressionOptionsPanel->_blockSize->SetStringSelection(kDefaultFlacBlocksize);
     540                _compressionOptionsPanel->_compressionLevelChooser->SetStringSelection(kDefaultFlacCompress);
     541                _compressionOptionsPanel->_maxBitrateChooser->SetSelection(0);
     542                _compressionOptionsPanel->_minBitrateChooser->SetSelection(0);
     543                _compressionOptionsPanel->_modeChooser->SetSelection(0);
     544                _compressionOptionsPanel->_mpegQualityChooser->SetSelection(0);
     545                _compressionOptionsPanel->_silentChooser->SetValue(false);
     546                _compressionOptionsPanel->_verifyChooser->SetValue(false);
     547                _compressionOptionsPanel->_vbrQualityChooser->SetSelection(0);
    548548
    549                 this->_compressionOptionsPanel->_minBitrateChooser->Enable(false);
    550                 this->_compressionOptionsPanel->_avgBitrateChooser->Enable(false);
    551                 this->_compressionOptionsPanel->_maxBitrateChooser->Enable(false);
    552                 this->_compressionOptionsPanel->_vbrQualityChooser->Enable(false);
    553                 this->_compressionOptionsPanel->_mpegQualityChooser->Enable(false);
    554                 this->_compressionOptionsPanel->_compressionLevelChooser->Enable(true);
    555                 this->_compressionOptionsPanel->_modeChooser->Enable(false);
    556                 this->_compressionOptionsPanel->_blockSize->Enable(true);
    557                 this->_compressionOptionsPanel->_verifyChooser->Enable(true);
    558                 this->_compressionOptionsPanel->_silentChooser->Enable(true);
     549                _compressionOptionsPanel->_minBitrateChooser->Enable(false);
     550                _compressionOptionsPanel->_avgBitrateChooser->Enable(false);
     551                _compressionOptionsPanel->_maxBitrateChooser->Enable(false);
     552                _compressionOptionsPanel->_vbrQualityChooser->Enable(false);
     553                _compressionOptionsPanel->_mpegQualityChooser->Enable(false);
     554                _compressionOptionsPanel->_compressionLevelChooser->Enable(true);
     555                _compressionOptionsPanel->_modeChooser->Enable(false);
     556                _compressionOptionsPanel->_blockSize->Enable(true);
     557                _compressionOptionsPanel->_verifyChooser->Enable(true);
     558                _compressionOptionsPanel->_silentChooser->Enable(true);
    559559        } else {
    560                 this->_compressionOptionsPanel->_avgBitrateChooser->SetSelection(0);
    561                 this->_compressionOptionsPanel->_blockSize->SetSelection(0);
    562                 this->_compressionOptionsPanel->_compressionLevelChooser->SetSelection(0);
    563                 this->_compressionOptionsPanel->_maxBitrateChooser->SetSelection(0);
    564                 this->_compressionOptionsPanel->_minBitrateChooser->SetSelection(0);
    565                 this->_compressionOptionsPanel->_modeChooser->SetSelection(0);
    566                 this->_compressionOptionsPanel->_mpegQualityChooser->SetSelection(0);
    567                 this->_compressionOptionsPanel->_silentChooser->SetValue(false);
    568                 this->_compressionOptionsPanel->_verifyChooser->SetValue(false);
    569                 this->_compressionOptionsPanel->_vbrQualityChooser->SetSelection(0);
     560                _compressionOptionsPanel->_avgBitrateChooser->SetSelection(0);
     561                _compressionOptionsPanel->_blockSize->SetSelection(0);
     562                _compressionOptionsPanel->_compressionLevelChooser->SetSelection(0);
     563                _compressionOptionsPanel->_maxBitrateChooser->SetSelection(0);
     564                _compressionOptionsPanel->_minBitrateChooser->SetSelection(0);
     565                _compressionOptionsPanel->_modeChooser->SetSelection(0);
     566                _compressionOptionsPanel->_mpegQualityChooser->SetSelection(0);
     567                _compressionOptionsPanel->_silentChooser->SetValue(false);
     568                _compressionOptionsPanel->_verifyChooser->SetValue(false);
     569                _compressionOptionsPanel->_vbrQualityChooser->SetSelection(0);
    570570
    571                 this->_compressionOptionsPanel->_minBitrateChooser->Enable(false);
    572                 this->_compressionOptionsPanel->_avgBitrateChooser->Enable(false);
    573                 this->_compressionOptionsPanel->_maxBitrateChooser->Enable(false);
    574                 this->_compressionOptionsPanel->_vbrQualityChooser->Enable(false);
    575                 this->_compressionOptionsPanel->_mpegQualityChooser->Enable(false);
    576                 this->_compressionOptionsPanel->_compressionLevelChooser->Enable(false);
    577                 this->_compressionOptionsPanel->_modeChooser->Enable(false);
    578                 this->_compressionOptionsPanel->_verifyChooser->Enable(false);
    579                 this->_compressionOptionsPanel->_silentChooser->Enable(false);
     571                _compressionOptionsPanel->_minBitrateChooser->Enable(false);
     572                _compressionOptionsPanel->_avgBitrateChooser->Enable(false);
     573                _compressionOptionsPanel->_maxBitrateChooser->Enable(false);
     574                _compressionOptionsPanel->_vbrQualityChooser->Enable(false);
     575                _compressionOptionsPanel->_mpegQualityChooser->Enable(false);
     576                _compressionOptionsPanel->_compressionLevelChooser->Enable(false);
     577                _compressionOptionsPanel->_modeChooser->Enable(false);
     578                _compressionOptionsPanel->_verifyChooser->Enable(false);
     579                _compressionOptionsPanel->_silentChooser->Enable(false);
    580580        }
    581581}
    582582
    583583void CompressionOptions::OnCompressionModeChange(wxCommandEvent &event) {
    584         wxString selectedMode = this->_modeChooser->GetStringSelection();
     584        wxString selectedMode = _modeChooser->GetStringSelection();
    585585
    586586        if (selectedMode == wxT("VBR")) {
    587                 this->_avgBitrateChooser->SetSelection(0);
    588                 this->_maxBitrateChooser->SetStringSelection(kDefaultMP3VBRMaxBitrate);
    589                 this->_minBitrateChooser->SetStringSelection(kDefaultMP3VBRMinBitrate);
    590                 this->_vbrQualityChooser->SetStringSelection(kDefaultMP3VBRQuality);
     587                _avgBitrateChooser->SetSelection(0);
     588                _maxBitrateChooser->SetStringSelection(kDefaultMP3VBRMaxBitrate);
     589                _minBitrateChooser->SetStringSelection(kDefaultMP3VBRMinBitrate);
     590                _vbrQualityChooser->SetStringSelection(kDefaultMP3VBRQuality);
    591591
    592                 this->_avgBitrateChooser->Enable(false);
    593                 this->_minBitrateChooser->Enable(true);
    594                 this->_maxBitrateChooser->Enable(true);
    595                 this->_vbrQualityChooser->Enable(true);
     592                _avgBitrateChooser->Enable(false);
     593                _minBitrateChooser->Enable(true);
     594                _maxBitrateChooser->Enable(true);
     595                _vbrQualityChooser->Enable(true);
    596596        } else if (selectedMode == wxT("ABR")) {
    597                 this->_avgBitrateChooser->SetStringSelection(kDefaultMP3ABRAvgBitrate);
    598                 this->_maxBitrateChooser->SetSelection(0);
    599                 this->_minBitrateChooser->SetSelection(0);
    600                 this->_vbrQualityChooser->SetSelection(0);
     597                _avgBitrateChooser->SetStringSelection(kDefaultMP3ABRAvgBitrate);
     598                _maxBitrateChooser->SetSelection(0);
     599                _minBitrateChooser->SetSelection(0);
     600                _vbrQualityChooser->SetSelection(0);
    601601
    602                 this->_avgBitrateChooser->Enable(true);
    603                 this->_minBitrateChooser->Enable(true);
    604                 this->_maxBitrateChooser->Enable(true);
    605                 this->_vbrQualityChooser->Enable(false);
     602                _avgBitrateChooser->Enable(true);
     603                _minBitrateChooser->Enable(true);
     604                _maxBitrateChooser->Enable(true);
     605                _vbrQualityChooser->Enable(false);
    606606        } else {
    607                 this->_avgBitrateChooser->SetSelection(0);
    608                 this->_maxBitrateChooser->SetSelection(0);
    609                 this->_minBitrateChooser->SetSelection(0);
    610                 this->_vbrQualityChooser->SetSelection(0);
     607                _avgBitrateChooser->SetSelection(0);
     608                _maxBitrateChooser->SetSelection(0);
     609                _minBitrateChooser->SetSelection(0);
     610                _vbrQualityChooser->SetSelection(0);
    611611
    612                 this->_avgBitrateChooser->Enable(false);
    613                 this->_minBitrateChooser->Enable(false);
    614                 this->_maxBitrateChooser->Enable(false);
    615                 this->_vbrQualityChooser->Enable(false);
     612                _avgBitrateChooser->Enable(false);
     613                _minBitrateChooser->Enable(false);
     614                _maxBitrateChooser->Enable(false);
     615                _vbrQualityChooser->Enable(false);
    616616        }
    617617}
    618618
    619619void CompressionPanel::OnCompressionInputBrowse(wxCommandEvent &event) {
    620         LocationDialog *dialog = new LocationDialog(this->_inputPanel->_text, this->_inputPanel->_isFileChooser, wxT("*.*"));
     620        LocationDialog *dialog = new LocationDialog(_inputPanel->_text, _inputPanel->_isFileChooser, wxT("*.*"));
    621621        dialog->prompt();
    622622
    623623        dialog->_dialog->Destroy();
     
    625625}
    626626
    627627void CompressionPanel::OnCompressionOutputBrowse(wxCommandEvent &event) {
    628         LocationDialog *dialog = new LocationDialog(this->_outputPanel->_text, this->_outputPanel->_isFileChooser, wxT("*.*"));
     628        LocationDialog *dialog = new LocationDialog(_outputPanel->_text, _outputPanel->_isFileChooser, wxT("*.*"));
    629629        dialog->prompt();
    630630
    631631        dialog->_dialog->Destroy();
     
    635635/* ----- Extraction Events ----- */
    636636
    637637void ExtractionPanel::OnExtractionToolChange(wxCommandEvent &event) {
    638         wxString selectedTool = this->_extractionToolChooserPanel->_choice->GetStringSelection();
     638        wxString selectedTool = _extractionToolChooserPanel->_choice->GetStringSelection();
    639639
    640         this->_input1Panel->_browse->Enable(true);
    641         this->_input1Panel->_text->Enable(true);
    642         this->_input1Panel->_isFileChooser = true;
    643         this->_input1Panel->_text->Clear();
    644         this->_input2Panel->_isFileChooser = true;
    645         this->_input2Panel->_text->Clear();
    646         this->_outputPanel->_isFileChooser = false;
    647         this->_outputPanel->_text->Clear();
     640        _input1Panel->_browse->Enable(true);
     641        _input1Panel->_text->Enable(true);
     642        _input1Panel->_isFileChooser = true;
     643        _input1Panel->_text->Clear();
     644        _input2Panel->_isFileChooser = true;
     645        _input2Panel->_text->Clear();
     646        _outputPanel->_isFileChooser = false;
     647        _outputPanel->_text->Clear();
    648648
    649649        if (selectedTool == wxT("AGOS")) {
    650                 this->_input2Panel->_browse->Enable(false);
    651                 this->_input2Panel->_text->Enable(false);
    652                 this->_outputPanel->_browse->Enable(false);
    653                 this->_outputPanel->_text->Enable(false);
    654                 this->_extractionOptionsPanel->_kyraAllFiles->Enable(false);
    655                 this->_extractionOptionsPanel->_kyraAmiga->Enable(false);
    656                 this->_extractionOptionsPanel->_kyraFilename->Enable(false);
    657                 this->_extractionOptionsPanel->_kyraSingleFile->Enable(false);
    658                 this->_extractionOptionsPanel->_parallactionSmall->Enable(false);
     650                _input2Panel->_browse->Enable(false);
     651                _input2Panel->_text->Enable(false);
     652                _outputPanel->_browse->Enable(false);
     653                _outputPanel->_text->Enable(false);
     654                _extractionOptionsPanel->_kyraAllFiles->Enable(false);
     655                _extractionOptionsPanel->_kyraAmiga->Enable(false);
     656                _extractionOptionsPanel->_kyraFilename->Enable(false);
     657                _extractionOptionsPanel->_kyraSingleFile->Enable(false);
     658                _extractionOptionsPanel->_parallactionSmall->Enable(false);
    659659        } else if (selectedTool == wxT("Kyra")) {
    660                 this->_input2Panel->_browse->Enable(false);
    661                 this->_input2Panel->_text->Enable(false);
    662                 this->_outputPanel->_browse->Enable(false);
    663                 this->_outputPanel->_text->Enable(false);
    664                 this->_extractionOptionsPanel->_kyraAllFiles->Enable(true);
    665                 this->_extractionOptionsPanel->_kyraAmiga->Enable(true);
    666                 this->_extractionOptionsPanel->_kyraFilename->Enable(true);
    667                 this->_extractionOptionsPanel->_kyraSingleFile->Enable(true);
    668                 this->_extractionOptionsPanel->_parallactionSmall->Enable(false);
     660                _input2Panel->_browse->Enable(false);
     661                _input2Panel->_text->Enable(false);
     662                _outputPanel->_browse->Enable(false);
     663                _outputPanel->_text->Enable(false);
     664                _extractionOptionsPanel->_kyraAllFiles->Enable(true);
     665                _extractionOptionsPanel->_kyraAmiga->Enable(true);
     666                _extractionOptionsPanel->_kyraFilename->Enable(true);
     667                _extractionOptionsPanel->_kyraSingleFile->Enable(true);
     668                _extractionOptionsPanel->_parallactionSmall->Enable(false);
    669669        } else if (selectedTool == wxT("Loom (TG16)")) {
    670                 this->_input2Panel->_browse->Enable(false);
    671                 this->_input2Panel->_text->Enable(false);
    672                 this->_outputPanel->_browse->Enable(false);
    673                 this->_outputPanel->_text->Enable(false);
    674                 this->_extractionOptionsPanel->_kyraAllFiles->Enable(false);
    675                 this->_extractionOptionsPanel->_kyraAmiga->Enable(false);
    676                 this->_extractionOptionsPanel->_kyraFilename->Enable(false);
    677                 this->_extractionOptionsPanel->_kyraSingleFile->Enable(false);
    678                 this->_extractionOptionsPanel->_parallactionSmall->Enable(false);
     670                _input2Panel->_browse->Enable(false);
     671                _input2Panel->_text->Enable(false);
     672                _outputPanel->_browse->Enable(false);
     673                _outputPanel->_text->Enable(false);
     674                _extractionOptionsPanel->_kyraAllFiles->Enable(false);
     675                _extractionOptionsPanel->_kyraAmiga->Enable(false);
     676                _extractionOptionsPanel->_kyraFilename->Enable(false);
     677                _extractionOptionsPanel->_kyraSingleFile->Enable(false);
     678                _extractionOptionsPanel->_parallactionSmall->Enable(false);
    679679        } else if (selectedTool == wxT("Maniac Mansion (Apple)")) {
    680                 this->_input2Panel->_browse->Enable(true);
    681                 this->_input2Panel->_text->Enable(true);
    682                 this->_outputPanel->_browse->Enable(false);
    683                 this->_outputPanel->_text->Enable(false);
    684                 this->_extractionOptionsPanel->_kyraAllFiles->Enable(false);
    685                 this->_extractionOptionsPanel->_kyraAmiga->Enable(false);
    686                 this->_extractionOptionsPanel->_kyraFilename->Enable(false);
    687                 this->_extractionOptionsPanel->_kyraSingleFile->Enable(false);
    688                 this->_extractionOptionsPanel->_parallactionSmall->Enable(false);
     680                _input2Panel->_browse->Enable(true);
     681                _input2Panel->_text->Enable(true);
     682                _outputPanel->_browse->Enable(false);
     683                _outputPanel->_text->Enable(false);
     684                _extractionOptionsPanel->_kyraAllFiles->Enable(false);
     685                _extractionOptionsPanel->_kyraAmiga->Enable(false);
     686                _extractionOptionsPanel->_kyraFilename->Enable(false);
     687                _extractionOptionsPanel->_kyraSingleFile->Enable(false);
     688                _extractionOptionsPanel->_parallactionSmall->Enable(false);
    689689        } else if (selectedTool == wxT("Maniac Mansion (C64)")) {
    690                 this->_input2Panel->_browse->Enable(true);
    691                 this->_input2Panel->_text->Enable(true);
    692                 this->_outputPanel->_browse->Enable(false);
    693                 this->_outputPanel->_text->Enable(false);
    694                 this->_extractionOptionsPanel->_kyraAllFiles->Enable(false);
    695                 this->_extractionOptionsPanel->_kyraAmiga->Enable(false);
    696                 this->_extractionOptionsPanel->_kyraFilename->Enable(false);
    697                 this->_extractionOptionsPanel->_kyraSingleFile->Enable(false);
    698                 this->_extractionOptionsPanel->_parallactionSmall->Enable(false);
     690                _input2Panel->_browse->Enable(true);
     691                _input2Panel->_text->Enable(true);
     692                _outputPanel->_browse->Enable(false);
     693                _outputPanel->_text->Enable(false);
     694                _extractionOptionsPanel->_kyraAllFiles->Enable(false);
     695                _extractionOptionsPanel->_kyraAmiga->Enable(false);
     696                _extractionOptionsPanel->_kyraFilename->Enable(false);
     697                _extractionOptionsPanel->_kyraSingleFile->Enable(false);
     698                _extractionOptionsPanel->_parallactionSmall->Enable(false);
    699699        } else if (selectedTool == wxT("Maniac Mansion (NES)")) {
    700                 this->_input2Panel->_browse->Enable(false);
    701                 this->_input2Panel->_text->Enable(false);
    702                 this->_outputPanel->_browse->Enable(false);
    703                 this->_outputPanel->_text->Enable(false);
    704                 this->_extractionOptionsPanel->_kyraAllFiles->Enable(false);
    705                 this->_extractionOptionsPanel->_kyraAmiga->Enable(false);
    706                 this->_extractionOptionsPanel->_kyraFilename->Enable(false);
    707                 this->_extractionOptionsPanel->_kyraSingleFile->Enable(false);
    708                 this->_extractionOptionsPanel->_parallactionSmall->Enable(false);
     700                _input2Panel->_browse->Enable(false);
     701                _input2Panel->_text->Enable(false);
     702                _outputPanel->_browse->Enable(false);
     703                _outputPanel->_text->Enable(false);
     704                _extractionOptionsPanel->_kyraAllFiles->Enable(false);
     705                _extractionOptionsPanel->_kyraAmiga->Enable(false);
     706                _extractionOptionsPanel->_kyraFilename->Enable(false);
     707                _extractionOptionsPanel->_kyraSingleFile->Enable(false);
     708                _extractionOptionsPanel->_parallactionSmall->Enable(false);
    709709        } else if (selectedTool == wxT("Parallaction")) {
    710                 this->_input2Panel->_browse->Enable(false);
    711                 this->_input2Panel->_text->Enable(false);
    712                 this->_outputPanel->_browse->Enable(true);
    713                 this->_outputPanel->_text->Enable(true);
    714                 this->_extractionOptionsPanel->_kyraAllFiles->Enable(false);
    715                 this->_extractionOptionsPanel->_kyraAmiga->Enable(false);
    716                 this->_extractionOptionsPanel->_kyraFilename->Enable(false);
    717                 this->_extractionOptionsPanel->_kyraSingleFile->Enable(false);
    718                 this->_extractionOptionsPanel->_parallactionSmall->Enable(true);
     710                _input2Panel->_browse->Enable(false);
     711                _input2Panel->_text->Enable(false);
     712                _outputPanel->_browse->Enable(true);
     713                _outputPanel->_text->Enable(true);
     714                _extractionOptionsPanel->_kyraAllFiles->Enable(false);
     715                _extractionOptionsPanel->_kyraAmiga->Enable(false);
     716                _extractionOptionsPanel->_kyraFilename->Enable(false);
     717                _extractionOptionsPanel->_kyraSingleFile->Enable(false);
     718                _extractionOptionsPanel->_parallactionSmall->Enable(true);
    719719        } else if (selectedTool == wxT("SCUMM (MAC)")) {
    720                 this->_input2Panel->_browse->Enable(false);
    721                 this->_input2Panel->_text->Enable(false);
    722                 this->_outputPanel->_browse->Enable(false);
    723                 this->_outputPanel->_text->Enable(false);
    724                 this->_extractionOptionsPanel->_kyraAllFiles->Enable(false);
    725                 this->_extractionOptionsPanel->_kyraAmiga->Enable(false);
    726                 this->_extractionOptionsPanel->_kyraFilename->Enable(false);
    727                 this->_extractionOptionsPanel->_kyraSingleFile->Enable(false);
    728                 this->_extractionOptionsPanel->_parallactionSmall->Enable(false);
     720                _input2Panel->_browse->Enable(false);
     721                _input2Panel->_text->Enable(false);
     722                _outputPanel->_browse->Enable(false);
     723                _outputPanel->_text->Enable(false);
     724                _extractionOptionsPanel->_kyraAllFiles->Enable(false);
     725                _extractionOptionsPanel->_kyraAmiga->Enable(false);
     726                _extractionOptionsPanel->_kyraFilename->Enable(false);
     727                _extractionOptionsPanel->_kyraSingleFile->Enable(false);
     728                _extractionOptionsPanel->_parallactionSmall->Enable(false);
    729729        } else if (selectedTool == wxT("Zak McKracken (C64)")) {
    730                 this->_input2Panel->_browse->Enable(true);
    731                 this->_input2Panel->_text->Enable(true);
    732                 this->_outputPanel->_browse->Enable(false);
    733                 this->_outputPanel->_text->Enable(false);
    734                 this->_extractionOptionsPanel->_kyraAllFiles->Enable(false);
    735                 this->_extractionOptionsPanel->_kyraAmiga->Enable(false);
    736                 this->_extractionOptionsPanel->_kyraFilename->Enable(false);
    737                 this->_extractionOptionsPanel->_kyraSingleFile->Enable(false);
    738                 this->_extractionOptionsPanel->_parallactionSmall->Enable(false);
     730                _input2Panel->_browse->Enable(true);
     731                _input2Panel->_text->Enable(true);
     732                _outputPanel->_browse->Enable(false);
     733                _outputPanel->_text->Enable(false);
     734                _extractionOptionsPanel->_kyraAllFiles->Enable(false);
     735                _extractionOptionsPanel->_kyraAmiga->Enable(false);
     736                _extractionOptionsPanel->_kyraFilename->Enable(false);
     737                _extractionOptionsPanel->_kyraSingleFile->Enable(false);
     738                _extractionOptionsPanel->_parallactionSmall->Enable(false);
    739739        } else {
    740                 this->_input1Panel->_browse->Enable(false);
    741                 this->_input1Panel->_text->Enable(false);
    742                 this->_input1Panel->_isFileChooser = false;
    743                 this->_input2Panel->_browse->Enable(false);
    744                 this->_input2Panel->_text->Enable(false);
    745                 this->_input2Panel->_isFileChooser = false;
    746                 this->_outputPanel->_browse->Enable(false);
    747                 this->_outputPanel->_text->Enable(false);
    748                 this->_outputPanel->_isFileChooser = false;
    749                 this->_extractionOptionsPanel->_kyraAllFiles->Enable(false);
    750                 this->_extractionOptionsPanel->_kyraAmiga->Enable(false);
    751                 this->_extractionOptionsPanel->_kyraFilename->Enable(false);
    752                 this->_extractionOptionsPanel->_kyraSingleFile->Enable(false);
    753                 this->_extractionOptionsPanel->_parallactionSmall->Enable(false);
     740                _input1Panel->_browse->Enable(false);
     741                _input1Panel->_text->Enable(false);
     742                _input1Panel->_isFileChooser = false;
     743                _input2Panel->_browse->Enable(false);
     744                _input2Panel->_text->Enable(false);
     745                _input2Panel->_isFileChooser = false;
     746                _outputPanel->_browse->Enable(false);
     747                _outputPanel->_text->Enable(false);
     748                _outputPanel->_isFileChooser = false;
     749                _extractionOptionsPanel->_kyraAllFiles->Enable(false);
     750                _extractionOptionsPanel->_kyraAmiga->Enable(false);
     751                _extractionOptionsPanel->_kyraFilename->Enable(false);
     752                _extractionOptionsPanel->_kyraSingleFile->Enable(false);
     753                _extractionOptionsPanel->_parallactionSmall->Enable(false);
    754754        }
    755755}
    756756
    757757void ExtractionPanel::OnExtractionInput1Browse(wxCommandEvent &event) {
    758         LocationDialog *dialog = new LocationDialog(this->_input1Panel->_text, this->_input1Panel->_isFileChooser, wxT("*.*"));
     758        LocationDialog *dialog = new LocationDialog(_input1Panel->_text, _input1Panel->_isFileChooser, wxT("*.*"));
    759759        dialog->prompt();
    760760
    761761        dialog->_dialog->Destroy();
     
    763763}
    764764
    765765void ExtractionPanel::OnExtractionInput2Browse(wxCommandEvent &event) {
    766         LocationDialog *dialog = new LocationDialog(this->_input2Panel->_text, this->_input2Panel->_isFileChooser, wxT("*.*"));
     766        LocationDialog *dialog = new LocationDialog(_input2Panel->_text, _input2Panel->_isFileChooser, wxT("*.*"));
    767767        dialog->prompt();
    768768
    769769        dialog->_dialog->Destroy();
     
    771771}
    772772
    773773void ExtractionPanel::OnExtractionOutputBrowse(wxCommandEvent &event) {
    774         LocationDialog *dialog = new LocationDialog(this->_outputPanel->_text, this->_outputPanel->_isFileChooser, wxT("*.*"));
     774        LocationDialog *dialog = new LocationDialog(_outputPanel->_text, _outputPanel->_isFileChooser, wxT("*.*"));
    775775        dialog->prompt();
    776776
    777777        dialog->_dialog->Destroy();
     
    781781/* ----- MainFrame Events ----- */
    782782
    783783void MainFrame::OnCompressionOptionsToggle(wxCommandEvent &event) {
    784         this->_compressionTools->_compressionOptionsPanel->Show(!this->_compressionTools->_compressionOptionsPanel->IsShown());
     784        _compressionTools->_compressionOptionsPanel->Show(!_compressionTools->_compressionOptionsPanel->IsShown());
    785785
    786         this->_compressionTools->Fit();
    787         this->_compressionTools->SetSize(this->_mainNotebook->GetPage(0)->GetSize());
     786        _compressionTools->Fit();
     787        _compressionTools->SetSize(_mainNotebook->GetPage(0)->GetSize());
    788788
    789         this->_extractionTools->Fit();
    790         this->_extractionTools->SetSize(this->_mainNotebook->GetPage(1)->GetSize());
     789        _extractionTools->Fit();
     790        _extractionTools->SetSize(_mainNotebook->GetPage(1)->GetSize());
    791791}
    792792
    793793void MainFrame::OnCompressionStart(wxCommandEvent &event) {
    794         this->_compressionTools->_toolOutput->Clear();
     794        _compressionTools->_toolOutput->Clear();
    795795
    796         wxString selectedTool = kCompressionToolFilenames[this->_compressionTools->_compressionToolChooserBox->_choice->GetSelection()];
    797         wxString compressionType = kCompressionTypeArguments[this->_compressionTools->_compressionTypeBox->_choice->GetSelection()];
    798         wxString inputPath = this->_compressionTools->_inputPanel->_text->GetValue();
    799         wxString outputPath = this->_compressionTools->_outputPanel->_text->GetValue();
     796        wxString selectedTool = kCompressionToolFilenames[_compressionTools->_compressionToolChooserBox->_choice->GetSelection()];
     797        wxString compressionType = kCompressionTypeArguments[_compressionTools->_compressionTypeBox->_choice->GetSelection()];
     798        wxString inputPath = _compressionTools->_inputPanel->_text->GetValue();
     799        wxString outputPath = _compressionTools->_outputPanel->_text->GetValue();
    800800
    801         wxString avgBitrate = this->_compressionTools->_compressionOptionsPanel->_avgBitrateChooser->GetStringSelection();
    802         wxString blocksize = this->_compressionTools->_compressionOptionsPanel->_blockSize->GetStringSelection();
    803         wxString compressionLevel = this->_compressionTools->_compressionOptionsPanel->_compressionLevelChooser->GetStringSelection();
    804         wxString maxBitrate = this->_compressionTools->_compressionOptionsPanel->_maxBitrateChooser->GetStringSelection();
    805         wxString minBitrate = this->_compressionTools->_compressionOptionsPanel->_minBitrateChooser->GetStringSelection();
    806         wxString mode = this->_compressionTools->_compressionOptionsPanel->_modeChooser->GetStringSelection();
    807         wxString mpegQuality = this->_compressionTools->_compressionOptionsPanel->_mpegQualityChooser->GetStringSelection();
    808         bool isSilent = this->_compressionTools->_compressionOptionsPanel->_silentChooser->IsChecked();
    809         wxString vbrQuality = this->_compressionTools->_compressionOptionsPanel->_vbrQualityChooser->GetStringSelection();
    810         bool isVerify = this->_compressionTools->_compressionOptionsPanel->_verifyChooser->IsChecked();
     801        wxString avgBitrate = _compressionTools->_compressionOptionsPanel->_avgBitrateChooser->GetStringSelection();
     802        wxString blocksize = _compressionTools->_compressionOptionsPanel->_blockSize->GetStringSelection();
     803        wxString compressionLevel = _compressionTools->_compressionOptionsPanel->_compressionLevelChooser->GetStringSelection();
     804        wxString maxBitrate = _compressionTools->_compressionOptionsPanel->_maxBitrateChooser->GetStringSelection();
     805        wxString minBitrate = _compressionTools->_compressionOptionsPanel->_minBitrateChooser->GetStringSelection();
     806        wxString mode = _compressionTools->_compressionOptionsPanel->_modeChooser->GetStringSelection();
     807        wxString mpegQuality = _compressionTools->_compressionOptionsPanel->_mpegQualityChooser->GetStringSelection();
     808        bool isSilent = _compressionTools->_compressionOptionsPanel->_silentChooser->IsChecked();
     809        wxString vbrQuality = _compressionTools->_compressionOptionsPanel->_vbrQualityChooser->GetStringSelection();
     810        bool isVerify = _compressionTools->_compressionOptionsPanel->_verifyChooser->IsChecked();
    811811
    812812        if (!inputPath.IsEmpty()) {
    813813                wxString commandString = wxT("");
     
    918918                        commandString += outputPath;
    919919                }
    920920
    921                 this->_compressionTools->_toolOutput->AppendText(commandString);
    922                 this->_compressionTools->_toolOutput->AppendText(wxT("\n\n"));
     921                _compressionTools->_toolOutput->AppendText(commandString);
     922                _compressionTools->_toolOutput->AppendText(wxT("\n\n"));
    923923
    924                 Process *command = new Process(this, this->_compressionTools->_toolOutput);
    925                 this->_processList.Add(command);
     924                Process *command = new Process(this, _compressionTools->_toolOutput);
     925                _processList.Add(command);
    926926                wxExecute(commandString, wxEXEC_ASYNC, command);
    927927        }
    928928}
    929929
    930930void MainFrame::OnExtractionStart(wxCommandEvent &event) {
    931         this->_extractionTools->_toolOutput->Clear();
     931        _extractionTools->_toolOutput->Clear();
    932932
    933         wxString selectedTool = kExtractionToolFilenames[this->_extractionTools->_extractionToolChooserPanel->_choice->GetSelection()];
    934         wxString input1Path = this->_extractionTools->_input1Panel->_text->GetValue();
    935         wxString input2Path = this->_extractionTools->_input2Panel->_text->GetValue();
    936         wxString outputPath = this->_extractionTools->_outputPanel->_text->GetValue();
     933        wxString selectedTool = kExtractionToolFilenames[_extractionTools->_extractionToolChooserPanel->_choice->GetSelection()];
     934        wxString input1Path = _extractionTools->_input1Panel->_text->GetValue();
     935        wxString input2Path = _extractionTools->_input2Panel->_text->GetValue();
     936        wxString outputPath = _extractionTools->_outputPanel->_text->GetValue();
    937937
    938         bool kyraAllFiles = this->_extractionTools->_extractionOptionsPanel->_kyraAllFiles->IsChecked();
    939         bool kyraAmiga = this->_extractionTools->_extractionOptionsPanel->_kyraAmiga->IsChecked();
    940         wxString kyraFilename = this->_extractionTools->_extractionOptionsPanel->_kyraFilename->GetValue();
    941         bool kyraSingleFile = this->_extractionTools->_extractionOptionsPanel->_kyraSingleFile->IsChecked();
    942         bool parallactionSmall = this->_extractionTools->_extractionOptionsPanel->_parallactionSmall->IsChecked();
     938        bool kyraAllFiles = _extractionTools->_extractionOptionsPanel->_kyraAllFiles->IsChecked();
     939        bool kyraAmiga = _extractionTools->_extractionOptionsPanel->_kyraAmiga->IsChecked();
     940        wxString kyraFilename = _extractionTools->_extractionOptionsPanel->_kyraFilename->GetValue();
     941        bool kyraSingleFile = _extractionTools->_extractionOptionsPanel->_kyraSingleFile->IsChecked();
     942        bool parallactionSmall = _extractionTools->_extractionOptionsPanel->_parallactionSmall->IsChecked();
    943943
    944944        if (!input1Path.IsEmpty()) {
    945945                wxString commandString = wxT("");
     
    979979                        commandString += outputPath;
    980980                }
    981981
    982                 this->_extractionTools->_toolOutput->AppendText(commandString);
    983                 this->_extractionTools->_toolOutput->AppendText(wxT("\n\n"));
     982                _extractionTools->_toolOutput->AppendText(commandString);
     983                _extractionTools->_toolOutput->AppendText(wxT("\n\n"));
    984984
    985                 Process *command = new Process(this, this->_extractionTools->_toolOutput);
    986                 this->_processList.Add(command);
     985                Process *command = new Process(this, _extractionTools->_toolOutput);
     986                _processList.Add(command);
    987987                wxExecute(commandString, wxEXEC_ASYNC, command);
    988988        }
    989989}
    990990
    991991void MainFrame::OnIdle(wxIdleEvent& event) {
    992         for (size_t x = 0; x < this->_processList.GetCount(); x++) {
    993                 if (this->_processList[x]->HasInput()) {
     992        for (size_t x = 0; x < _processList.GetCount(); x++) {
     993                if (_processList[x]->HasInput()) {
    994994                        event.RequestMore();
    995995                }
    996996
    997                 if (this->_processList[x]->HasInput()) {
     997                if (_processList[x]->HasInput()) {
    998998                        event.RequestMore();
    999999                }
    10001000        }
    10011001}
    10021002
    10031003void MainFrame::OnProcessTerminated(Process* process) {
    1004         this->_processList.Remove(process);
     1004        _processList.Remove(process);
    10051005}
  • trunk/tools_gui.h

     
    6363#  define wxFD_MULTIPLE wxMULTIPLE
    6464#endif
    6565
    66 #define kNumCompressionTools 12
     66/* Options available in the UI
     67 * In most cases, the "Names" filled in here will directly be provided in the UI
     68 * For the fields that have two options, the second option will be the one
     69 * passed on as a command line option, in other cases the Name will be directly
     70 * passed
     71 */
     72
     73/* List of compression tools, name will display in UI */
    6774wxString kCompressionToolNames[12] = {wxT("AGOS"), wxT("Broken Sword 1"), wxT("Broken Sword 2"), wxT("Encode DXA"), wxT("Flight of the Amazon Queen"), wxT("Kyra"), wxT("SAGA"), wxT("SCUMM BUN"), wxT("SCUMM SAN"), wxT("SCUMM SOU"), wxT("Simon 2 (MAC)"), wxT("Touche")};
     75/* Name of tool executable (position must match list above), .exe will be appended under Windows */
    6876wxString kCompressionToolFilenames[12] = {wxT("compress_agos"), wxT("compress_sword1"), wxT("compress_sword2"), wxT("encode_dxa"), wxT("compress_queen"), wxT("compress_kyra"), wxT("compress_saga"), wxT("compress_scumm_bun"), wxT("compress_scumm_san"), wxT("compress_scumm_sou"), wxT("compress_agos --mac"), wxT("compress_touche")};
    6977
    70 #define kNumExtractionTools 9
     78/* List of extraction tools, name will display in UI */
    7179wxString kExtractionToolNames[9] = {wxT("AGOS"), wxT("Kyra"), wxT("Loom (TG16)"), wxT("Maniac Mansion (Apple)"), wxT("Maniac Mansion (C64)"), wxT("Maniac Mansion (NES)"), wxT("Parallaction"), wxT("SCUMM (MAC)"), wxT("Zak McKracken (C64)")};
     80/* Name of extraction executable */
    7281wxString kExtractionToolFilenames[9] = {wxT("extract_agos"), wxT("extract_kyra"), wxT("extract_loom_tg16"), wxT("extract_mm_apple"), wxT("extract_mm_c64"), wxT("extract_mm_nes"), wxT("extract_parallaction"), wxT("extract_scumm_mac"), wxT("extract_zak_c64")};
    7382
    74 #define kNumCompressionTypes 3
     83/* List of possible audio codecs to use when compressing */
    7584wxString kCompressionTypeNames[3] = {wxT("MP3"), wxT("Vorbis"), wxT("FLAC")};
     85/* The codecs respective CLI arguments */
    7686wxString kCompressionTypeArguments[3] = {wxT("--mp3"), wxT("--vorbis"), wxT("--flac")};
    7787
    78 #define kNumValidBitrates 21
     88/* List of possible bitrates, first entry is default (no argument will be if input equals it) */
    7989wxString kValidBitrateNames[21] = {wxT(""), wxT("8"), wxT("16"), wxT("24"), wxT("32"), wxT("40"), wxT("48"), wxT("56"), wxT("64"), wxT("72"), wxT("80"), wxT("88"), wxT("96"), wxT("104"), wxT("112"), wxT("120"), wxT("128"), wxT("136"), wxT("144"), wxT("152"), wxT("160")};
    8090
    81 #define kNumValidQuality 10
     91/* VBR/MPEG quality options */
    8292wxString kVaildQualityNames[10] = {wxT("0"), wxT("1"), wxT("2"), wxT("3"), wxT("4"), wxT("5"), wxT("6"), wxT("7"), wxT("8"), wxT("9")};
    8393
    84 #define kNumValidCompressionLevels 9
    85 wxString kVaildCompressionLevels[9] = {wxT("0"), wxT("1"), wxT("2"), wxT("3"), wxT("4"), wxT("5"), wxT("6"), wxT("7"), wxT("8")};
     94/* Compression level options */
     95wxString kValidCompressionLevels[9] = {wxT("0"), wxT("1"), wxT("2"), wxT("3"), wxT("4"), wxT("5"), wxT("6"), wxT("7"), wxT("8")};
    8696
    87 #define kNumValidFlacBlocksize 4
     97/* Possible FLAC block sizes */
    8898wxString kValidFlacBlocksize[4] = {wxT("576"), wxT("1152"), wxT("2304"), wxT("4608")};
    8999
    90 #define kNumMP3Modes 2
     100/* Possible MP3 compression modes */
    91101wxString kMP3ModeNames[2] = {wxT("VBR"), wxT("ABR")};
    92102
     103// Length of above fields
     104#define kNumCompressionTools (sizeof kCompressionToolNames / sizeof *kCompressionToolNames)
     105#define kNumExtractionTools (sizeof kExtractionToolNames / sizeof *kExtractionToolNames)
     106#define kNumCompressionTypes (sizeof kCompressionTypeNames / sizeof *kCompressionTypeNames)
     107#define kNumValidBitrates (sizeof kValidBitrateNames / sizeof *kValidBitrateNames)
     108#define kNumValidQuality (sizeof kVaildQualityNames / sizeof *kVaildQualityNames)
     109#define kNumValidCompressionLevels (sizeof kValidCompressionLevels / sizeof *kValidCompressionLevels)
     110#define kNumValidFlacBlocksize (sizeof kValidFlacBlocksize / sizeof *kValidFlacBlocksize)
     111#define kNumMP3Modes (sizeof kMP3ModeNames / sizeof *kMP3ModeNames)
     112
     113// Window IDs for the widgets in the tool
     114// used for event handling
    93115enum kEventId {
    94         kCompressionToolChoice,
     116        kCompressionToolChoice = wxID_HIGHEST,
    95117        kCompressionTypeChoice,
    96118        kCompressionModeChoice,
    97119        kCompressionInputBrowse,
     
    133155
    134156/* ----- Common ----- */
    135157
     158/* A process with the additional functionality of redirectig output to a
     159 * target text control
     160 */
    136161class Process : public wxProcess {
    137162public:
    138163    Process(MainFrame *parent, wxTextCtrl *target);
     
    144169    virtual bool HasInput();
    145170};
    146171
     172/* A wxFileDialog with a constructor argument for picking directories instead */
    147173class LocationDialog {
    148174public:
    149175        LocationDialog(wxTextCtrl *target, bool isFileChooser, wxString wildcard);
     
    155181        void prompt();
    156182};
    157183
     184/* Used to enable drag & drop ontop of the file picker control */
    158185#if wxUSE_DRAG_AND_DROP
    159186class FileDrop : public wxFileDropTarget {
    160187public:
     
    167194};
    168195#endif
    169196
     197/* This is just a wxFilePicker with the addition of a constructor
     198 * argument for picking directiories instead
     199 */
    170200class IOChooser : public wxPanel {
    171201public:
    172202        IOChooser(wxWindow *parent, kEventId buttonId, wxString title, bool isFileChooser);
     
    179209#endif
    180210};
    181211
     212/* Very thin wrapper for a wxChoice, it's purpose being
     213 * constructor arguments rewrite and putting a frame
     214 * around the control.
     215 */
    182216class DropDownBox : public wxPanel {
    183217public:
    184218        DropDownBox(wxWindow *parent, kEventId boxId, wxString title, int numItems, wxString items[]);
     
    188222
    189223/* ----- Compression ----- */
    190224
     225/* The compression options, a panel containing the controls
     226 * for controlling the output of the tools
     227 */
    191228class CompressionOptions : public wxPanel {
    192229public:
    193230        CompressionOptions(wxWindow *parent);
     
    208245        DECLARE_EVENT_TABLE()
    209246};
    210247
     248/* Compression Panel (tab) */
    211249class CompressionPanel : public wxPanel {
    212250public:
    213251        CompressionPanel(wxWindow *parent);
     
    231269
    232270/* ----- Extraction ----- */
    233271
     272/* Panel containing all the options for extracting */
    234273class ExtractionOptions : public wxPanel {
    235274public:
    236275        ExtractionOptions(wxWindow *parent);
     
    242281        wxCheckBox *_parallactionSmall;
    243282};
    244283
     284/* Extraction Panel (tab) */
    245285class ExtractionPanel : public wxPanel {
    246286public:
    247287        ExtractionPanel(wxWindow *parent);