diff --git a/src/AudacityApp.cpp b/src/AudacityApp.cpp index 6e02f6828..21cd48a46 100644 --- a/src/AudacityApp.cpp +++ b/src/AudacityApp.cpp @@ -1371,6 +1371,21 @@ Click the 'Help' button for known issue."), Sequence::SetMaxDiskBlockSize(lval); } + wxString fileName; + if (parser->Found(wxT("d"), &fileName)) + { + AutoSaveFile asf; + if (asf.Decode(fileName)) + { + wxPrintf(_("File decoded successfully\n")); + } + else + { + wxPrintf(_("Decoding failed\n")); + } + exit(1); + } + // No Splash screen on wx3 whislt we sort out the problem // with showing a dialog AND a splash screen during inits. #if !wxCHECK_VERSION(3, 0, 0) @@ -1814,6 +1829,10 @@ wxCmdLineParser *AudacityApp::ParseCommandLine() parser->AddOption(wxT("b"), wxT("blocksize"), _("set max disk block size in bytes"), wxCMD_LINE_VAL_NUMBER); + /*i18n-hint: This decodes an autosave file */ + parser->AddOption(wxT("d"), wxT("decode"), _("decode an autosave file"), + wxCMD_LINE_VAL_STRING); + /*i18n-hint: This displays a list of available options */ parser->AddSwitch(wxT("h"), wxT("help"), _("this help message"), wxCMD_LINE_OPTION_HELP); diff --git a/src/AutoRecovery.h b/src/AutoRecovery.h index 0833ca0ef..8d5ee548b 100644 --- a/src/AutoRecovery.h +++ b/src/AutoRecovery.h @@ -66,8 +66,8 @@ private: #define AutoSaveIdent "" WX_DECLARE_STRING_HASH_MAP_WITH_DECL(short, NameMap, class AUDACITY_DLL_API); -WX_DECLARE_HASH_MAP(short, wxString, wxIntegerHash, wxIntegerEqual, IdMap); -WX_DECLARE_OBJARRAY(IdMap, IdMapArray); +WX_DECLARE_HASH_MAP_WITH_DECL(short, wxString, wxIntegerHash, wxIntegerEqual, IdMap, class AUDACITY_DLL_API); +WX_DECLARE_OBJARRAY_WITH_DECL(IdMap, IdMapArray, class AUDACITY_DLL_API); class AUDACITY_DLL_API AutoSaveFile : public XMLWriter {