2010-01-23 19:44:49 +00:00
|
|
|
/**********************************************************************
|
|
|
|
|
|
|
|
Audacity: A Digital Audio Editor
|
|
|
|
|
|
|
|
ImportExportPrefs.cpp
|
|
|
|
|
|
|
|
Joshua Haberman
|
|
|
|
Dominic Mazzoni
|
|
|
|
James Crook
|
|
|
|
|
|
|
|
*******************************************************************//**
|
|
|
|
|
|
|
|
\class ImportExportPrefs
|
|
|
|
\brief A PrefsPanel used to select import and export options.
|
|
|
|
|
|
|
|
*//*******************************************************************/
|
|
|
|
|
2021-05-09 15:16:56 +00:00
|
|
|
|
2018-11-10 19:47:12 +00:00
|
|
|
#include "ImportExportPrefs.h"
|
2010-01-23 19:44:49 +00:00
|
|
|
|
|
|
|
#include <wx/defs.h>
|
|
|
|
|
|
|
|
#include "../Prefs.h"
|
|
|
|
#include "../ShuttleGui.h"
|
|
|
|
|
2017-10-28 00:35:52 +00:00
|
|
|
ImportExportPrefs::ImportExportPrefs(wxWindow * parent, wxWindowID winid)
|
2019-12-08 02:00:39 +00:00
|
|
|
: PrefsPanel(parent, winid, XO("Import / Export"))
|
2010-01-23 19:44:49 +00:00
|
|
|
{
|
|
|
|
Populate();
|
|
|
|
}
|
|
|
|
|
|
|
|
ImportExportPrefs::~ImportExportPrefs()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2019-04-15 12:01:24 +00:00
|
|
|
ComponentInterfaceSymbol ImportExportPrefs::GetSymbol()
|
|
|
|
{
|
|
|
|
return IMPORT_EXPORT_PREFS_PLUGIN_SYMBOL;
|
|
|
|
}
|
|
|
|
|
2019-12-08 18:53:48 +00:00
|
|
|
TranslatableString ImportExportPrefs::GetDescription()
|
2019-04-15 12:01:24 +00:00
|
|
|
{
|
2019-12-08 18:53:48 +00:00
|
|
|
return XO("Preferences for ImportExport");
|
2019-04-15 12:01:24 +00:00
|
|
|
}
|
|
|
|
|
2021-06-06 16:18:35 +00:00
|
|
|
ManualPageID ImportExportPrefs::HelpPageName()
|
2019-04-15 12:01:24 +00:00
|
|
|
{
|
|
|
|
return "Import_-_Export_Preferences";
|
|
|
|
}
|
|
|
|
|
2010-01-23 19:44:49 +00:00
|
|
|
/// Creates the dialog and its contents.
|
|
|
|
void ImportExportPrefs::Populate()
|
|
|
|
{
|
|
|
|
//------------------------- Main section --------------------
|
|
|
|
// Now construct the GUI itself.
|
2014-06-03 20:30:19 +00:00
|
|
|
// Use 'eIsCreatingFromPrefs' so that the GUI is
|
2010-01-23 19:44:49 +00:00
|
|
|
// initialised with values from gPrefs.
|
|
|
|
ShuttleGui S(this, eIsCreatingFromPrefs);
|
|
|
|
PopulateOrExchange(S);
|
|
|
|
// ----------------------- End of main section --------------
|
|
|
|
}
|
|
|
|
|
2019-03-19 16:06:57 +00:00
|
|
|
EnumSetting< bool > ImportExportPrefs::ExportDownMixSetting{
|
|
|
|
wxT("/FileFormats/ExportDownMixChoice"),
|
|
|
|
{
|
2020-05-11 15:28:14 +00:00
|
|
|
EnumValueSymbol{ wxT("MixDown"), XXO("&Mix down to Stereo or Mono") },
|
|
|
|
EnumValueSymbol{ wxT("Custom"), XXO("&Use Advanced Mixing Options") },
|
2019-03-19 16:06:57 +00:00
|
|
|
},
|
|
|
|
0, // true
|
|
|
|
|
|
|
|
// for migrating old preferences:
|
|
|
|
{
|
|
|
|
true, false,
|
|
|
|
},
|
|
|
|
wxT("/FileFormats/ExportDownMix"),
|
|
|
|
};
|
|
|
|
|
2020-10-22 16:32:26 +00:00
|
|
|
EnumSetting< bool > ImportExportPrefs::LabelStyleSetting{
|
|
|
|
wxT("/FileFormats/LabelStyleChoice"),
|
|
|
|
{
|
|
|
|
EnumValueSymbol{ wxT("Standard"), XXO("S&tandard") },
|
|
|
|
EnumValueSymbol{ wxT("Extended"), XXO("E&xtended (with frequency ranges)") },
|
|
|
|
},
|
|
|
|
0, // true
|
|
|
|
|
|
|
|
{
|
|
|
|
true, false,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
2019-03-19 16:06:57 +00:00
|
|
|
EnumSetting< bool > ImportExportPrefs::AllegroStyleSetting{
|
|
|
|
wxT("/FileFormats/AllegroStyleChoice"),
|
|
|
|
{
|
2020-05-11 15:28:14 +00:00
|
|
|
EnumValueSymbol{ wxT("Seconds"), XXO("&Seconds") },
|
|
|
|
EnumValueSymbol{ wxT("Beats"), XXO("&Beats") },
|
2019-03-19 16:06:57 +00:00
|
|
|
},
|
|
|
|
0, // true
|
|
|
|
|
|
|
|
// for migrating old preferences:
|
|
|
|
{
|
|
|
|
true, false,
|
|
|
|
},
|
|
|
|
wxT("/FileFormats/AllegroStyle"),
|
|
|
|
};
|
|
|
|
|
2010-01-23 19:44:49 +00:00
|
|
|
void ImportExportPrefs::PopulateOrExchange(ShuttleGui & S)
|
|
|
|
{
|
|
|
|
S.SetBorder(2);
|
2018-01-17 20:41:40 +00:00
|
|
|
S.StartScroller();
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2019-12-22 19:58:36 +00:00
|
|
|
S.StartStatic(XO("When exporting tracks to an audio file"));
|
2010-01-23 19:44:49 +00:00
|
|
|
{
|
2021-04-02 01:00:12 +00:00
|
|
|
// Bug 2692: Place button group in panel so tabbing will work and,
|
|
|
|
// on the Mac, VoiceOver will announce as radio buttons.
|
|
|
|
S.StartPanel();
|
2010-01-23 19:44:49 +00:00
|
|
|
{
|
2021-04-02 01:00:12 +00:00
|
|
|
S.StartRadioButtonGroup(ImportExportPrefs::ExportDownMixSetting);
|
|
|
|
{
|
|
|
|
S.TieRadioButton();
|
|
|
|
S.TieRadioButton();
|
|
|
|
}
|
|
|
|
S.EndRadioButtonGroup();
|
2010-01-23 19:44:49 +00:00
|
|
|
}
|
2021-04-02 01:00:12 +00:00
|
|
|
S.EndPanel();
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2020-05-11 15:28:14 +00:00
|
|
|
S.TieCheckBox(XXO("S&how Metadata Tags editor before export"),
|
2019-04-03 14:57:59 +00:00
|
|
|
{wxT("/AudioFiles/ShowId3Dialog"),
|
|
|
|
true});
|
2019-09-04 19:12:26 +00:00
|
|
|
/* i18n-hint 'blank space' is space on the tracks with no audio in it*/
|
2020-05-11 15:28:14 +00:00
|
|
|
S.TieCheckBox(XXO("&Ignore blank space at the beginning"),
|
2019-04-03 14:57:59 +00:00
|
|
|
{wxT("/AudioFiles/SkipSilenceAtBeginning"),
|
|
|
|
false});
|
2010-01-23 19:44:49 +00:00
|
|
|
}
|
|
|
|
S.EndStatic();
|
2020-10-22 16:32:26 +00:00
|
|
|
|
|
|
|
S.StartStatic(XO("Exported Label Style:"));
|
|
|
|
{
|
2021-04-02 01:00:12 +00:00
|
|
|
// Bug 2692: Place button group in panel so tabbing will work and,
|
|
|
|
// on the Mac, VoiceOver will announce as radio buttons.
|
|
|
|
S.StartPanel();
|
2020-10-22 16:32:26 +00:00
|
|
|
{
|
2021-04-02 01:00:12 +00:00
|
|
|
S.StartRadioButtonGroup(ImportExportPrefs::LabelStyleSetting);
|
|
|
|
{
|
|
|
|
S.TieRadioButton();
|
|
|
|
S.TieRadioButton();
|
|
|
|
}
|
|
|
|
S.EndRadioButtonGroup();
|
2020-10-22 16:32:26 +00:00
|
|
|
}
|
2021-04-02 01:00:12 +00:00
|
|
|
S.EndPanel();
|
2020-10-22 16:32:26 +00:00
|
|
|
}
|
|
|
|
S.EndStatic();
|
|
|
|
|
2010-09-18 21:02:36 +00:00
|
|
|
#ifdef USE_MIDI
|
2019-12-22 19:58:36 +00:00
|
|
|
S.StartStatic(XO("Exported Allegro (.gro) files save time as:"));
|
2010-09-18 21:02:36 +00:00
|
|
|
{
|
2021-04-02 01:00:12 +00:00
|
|
|
// Bug 2692: Place button group in panel so tabbing will work and,
|
|
|
|
// on the Mac, VoiceOver will announce as radio buttons.
|
|
|
|
S.StartPanel();
|
2010-09-18 21:02:36 +00:00
|
|
|
{
|
2021-04-02 01:00:12 +00:00
|
|
|
S.StartRadioButtonGroup(ImportExportPrefs::AllegroStyleSetting);
|
|
|
|
{
|
|
|
|
S.TieRadioButton();
|
|
|
|
S.TieRadioButton();
|
|
|
|
}
|
|
|
|
S.EndRadioButtonGroup();
|
2010-09-18 21:02:36 +00:00
|
|
|
}
|
2021-04-02 01:00:12 +00:00
|
|
|
S.EndPanel();
|
2010-09-18 21:02:36 +00:00
|
|
|
}
|
|
|
|
S.EndStatic();
|
|
|
|
#endif
|
2018-01-17 20:41:40 +00:00
|
|
|
S.EndScroller();
|
2010-01-23 19:44:49 +00:00
|
|
|
}
|
|
|
|
|
2017-06-25 14:57:26 +00:00
|
|
|
bool ImportExportPrefs::Commit()
|
2014-06-03 20:30:19 +00:00
|
|
|
{
|
2010-01-23 19:44:49 +00:00
|
|
|
ShuttleGui S(this, eIsSavingToPrefs);
|
2014-06-03 20:30:19 +00:00
|
|
|
PopulateOrExchange(S);
|
|
|
|
|
2010-01-23 19:44:49 +00:00
|
|
|
return true;
|
|
|
|
}
|
2015-06-13 21:59:47 +00:00
|
|
|
|
2020-01-20 01:53:03 +00:00
|
|
|
namespace{
|
2019-01-16 17:18:40 +00:00
|
|
|
PrefsPanel::Registration sAttachment{ "ImportExport",
|
2020-01-20 01:53:03 +00:00
|
|
|
[](wxWindow *parent, wxWindowID winid, AudacityProject *)
|
|
|
|
{
|
|
|
|
wxASSERT(parent); // to justify safenew
|
|
|
|
return safenew ImportExportPrefs(parent, winid);
|
2019-01-16 17:18:40 +00:00
|
|
|
}
|
2019-01-14 01:55:52 +00:00
|
|
|
};
|
2020-01-20 01:53:03 +00:00
|
|
|
}
|