mirror of
https://github.com/cookiengineer/audacity
synced 2025-12-13 16:16:33 +01:00
Add command line option to decode autosave files
On Windows, you use: /d <filename> --decode <filename> On Linux and OSX, you use: -d <filename> --decode <filename> Note that the input (binary) file IS replaced with the decoded XML file.
This commit is contained in:
@@ -1371,6 +1371,21 @@ Click the 'Help' button for known issue."),
|
|||||||
Sequence::SetMaxDiskBlockSize(lval);
|
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
|
// No Splash screen on wx3 whislt we sort out the problem
|
||||||
// with showing a dialog AND a splash screen during inits.
|
// with showing a dialog AND a splash screen during inits.
|
||||||
#if !wxCHECK_VERSION(3, 0, 0)
|
#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"),
|
parser->AddOption(wxT("b"), wxT("blocksize"), _("set max disk block size in bytes"),
|
||||||
wxCMD_LINE_VAL_NUMBER);
|
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 */
|
/*i18n-hint: This displays a list of available options */
|
||||||
parser->AddSwitch(wxT("h"), wxT("help"), _("this help message"),
|
parser->AddSwitch(wxT("h"), wxT("help"), _("this help message"),
|
||||||
wxCMD_LINE_OPTION_HELP);
|
wxCMD_LINE_OPTION_HELP);
|
||||||
|
|||||||
@@ -66,8 +66,8 @@ private:
|
|||||||
#define AutoSaveIdent "<?xml autosave>"
|
#define AutoSaveIdent "<?xml autosave>"
|
||||||
|
|
||||||
WX_DECLARE_STRING_HASH_MAP_WITH_DECL(short, NameMap, class AUDACITY_DLL_API);
|
WX_DECLARE_STRING_HASH_MAP_WITH_DECL(short, NameMap, class AUDACITY_DLL_API);
|
||||||
WX_DECLARE_HASH_MAP(short, wxString, wxIntegerHash, wxIntegerEqual, IdMap);
|
WX_DECLARE_HASH_MAP_WITH_DECL(short, wxString, wxIntegerHash, wxIntegerEqual, IdMap, class AUDACITY_DLL_API);
|
||||||
WX_DECLARE_OBJARRAY(IdMap, IdMapArray);
|
WX_DECLARE_OBJARRAY_WITH_DECL(IdMap, IdMapArray, class AUDACITY_DLL_API);
|
||||||
|
|
||||||
class AUDACITY_DLL_API AutoSaveFile : public XMLWriter
|
class AUDACITY_DLL_API AutoSaveFile : public XMLWriter
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user