| 25 | AUDACITY_EXPORT_FORMAT_CHANGE_EVENT, wxCommandEvent); |
| 26 | |
| 27 | class ExportFilePanel final : public wxPanelWrapper |
| 28 | { |
| 29 | constexpr static auto MaxExportChannels = 32u; |
| 30 | public: |
| 31 | |
| 32 | ExportFilePanel(AudacityProject& project, |
| 33 | bool monoStereoMode = false, |
| 34 | wxWindow* parent = nullptr, |
| 35 | wxWindowID winid = wxID_ANY); |
| 36 | ~ExportFilePanel() override; |
| 37 | |
| 38 | void PopulateOrExchange(ShuttleGui& S); |
| 39 | |
| 40 | /** |
| 41 | * \brief Initializes panel with export settings provided as arguments. |
| 42 | * Call is required. |
| 43 | * \param filename Default output filename |
| 44 | * \param sampleRate Export sample rate > 0 |
| 45 | * \param format Export format string identifier (see FormatInfo::format) |
| 46 | * \param channels Pass 0(default) to choose automatically depending on project tracks |
| 47 | * \param parameters Pass empty(default) array to initialize with plugin defaults |
| 48 | * \param mixerSpec Try use custom channel mapping, `channels` argument will be igonred |
| 49 | */ |
| 50 | void Init(const wxFileName& filename, |
| 51 | int sampleRate, |
| 52 | const wxString& format = wxEmptyString, |
| 53 | int channels = 0, |
| 54 | const ExportProcessor::Parameters& parameters = {}, |
| 55 | const MixerOptions::Downmix* mixerSpec = nullptr); |
| 56 | void SetInitialFocus(); |
| 57 | |
| 58 | void SetCustomMappingEnabled(bool enabled); |
| 59 | |
| 60 | wxString GetPath() const; |
| 61 | wxString GetFullName(); |
| 62 | |
| 63 | const ExportPlugin* GetPlugin() const; |
| 64 | int GetFormat() const; |
| 65 | int GetSampleRate() const; |
| 66 | |
| 67 | ///@return May return std::nullopt if plugin isn't properly configured |
| 68 | std::optional<ExportProcessor::Parameters> GetParameters() const; |
| 69 | int GetChannels() const; |
| 70 | |
| 71 | MixerOptions::Downmix* GetMixerSpec() const; |
| 72 | |
| 73 | private: |
| 74 | |
| 75 | void ValidateAndFixExt(); |
| 76 | |
| 77 | void OnFullNameFocusKill(wxFocusEvent& event); |
| 78 | void OnFormatChange(wxCommandEvent& event); |
| 79 | void OnSampleRateChange(wxCommandEvent& event); |
| 80 | |
| 81 | void OnFolderBrowse(wxCommandEvent& event); |
| 82 | |
| 83 | void OnChannelsChange(wxCommandEvent& event); |
| 84 | void OnChannelsConfigure(wxCommandEvent& event); |
no outgoing calls
no test coverage detected