Audacity  3.0.3
Classes | Macros | Enumerations | Functions | Variables
ExportPCM.cpp File Reference
#include <wx/defs.h>
#include <wx/app.h>
#include <wx/choice.h>
#include <wx/dynlib.h>
#include <wx/filename.h>
#include <wx/intl.h>
#include <wx/timer.h>
#include <wx/string.h>
#include <wx/textctrl.h>
#include <wx/window.h>
#include "sndfile.h"
#include "Dither.h"
#include "../FileFormats.h"
#include "../Mix.h"
#include "Prefs.h"
#include "../ProjectSettings.h"
#include "../ShuttleGui.h"
#include "../Tags.h"
#include "../Track.h"
#include "../widgets/AudacityMessageBox.h"
#include "../widgets/ProgressDialog.h"
#include "../widgets/wxWidgetsBasicUI.h"
#include "../wxFileNameWrapper.h"
#include "Export.h"
Include dependency graph for ExportPCM.cpp:

Go to the source code of this file.

Classes

class  ExportPCMOptions
 
class  ExportPCM
 

Macros

#define ID_HEADER_CHOICE   7102
 
#define ID_ENCODING_CHOICE   7103
 

Enumerations

enum  {
  ScrubHeight = 14, ProperRulerHeight = 29, ItemNumberColumn, ActionColumn,
  ParamsColumn, kJson, kLisp, kBrief,
  nFormats, FMT_WAV, FMT_OTHER, ID_ShowAll = 10000,
  ID_ShowEnabled, ID_ShowDisabled, ID_ShowNew, ID_List,
  ID_ClearAll, ID_SelectAll, ID_Enable, ID_Disable,
  ePreviewID = wxID_PREVIEW, eDebugID = wxID_LOWEST - 2, eSettingsID = wxID_LOWEST - 3, ePreviewDryID = wxID_LOWEST - 4,
  eCloseID = wxID_CANCEL, ClearID = 10000, EditID, ResetID,
  LoadID, SaveID, SaveDefaultsID, AddID,
  RemoveID, DontShowID, CONTROL_GROUP_SAVE, CONTROL_GROUP_EXPORT,
  ETBActTooltips = 1, ETBActEnableDisable = 2, kMidiCellWidth = ( ( kTrackInfoWidth + kLeftMargin ) / 4) - 2, kMidiCellHeight = kTrackInfoBtnSize,
  kTrackInfoBtnSize = 18, kTrackInfoSliderHeight = 25, kTrackInfoSliderWidth = 84, kTrackInfoSliderAllowance = 5,
  kTrackInfoSliderExtra = 5
}
 

Functions

static int LoadOtherFormat (int def=0)
 
static void SaveOtherFormat (int val)
 
static int LoadEncoding (int type)
 
static void SaveEncoding (int type, int val)
 

Variables

struct {
   OSType   componentManufacturer
 
   OSType   componentType
 
   OSType   componentSubType
 
   const TranslatableString   name
 
   EffectDistortion::Params   params
 
   bool   do_exhaustive_model_search
 
   bool   do_escape_coding
 
   bool   do_mid_side_stereo
 
   bool   loose_mid_side_stereo
 
   unsigned   qlp_coeff_precision
 
   unsigned   min_residual_partition_order
 
   unsigned   max_residual_partition_order
 
   unsigned   rice_parameter_search_dist
 
   unsigned   max_lpc_order
 
   int   format
 
   const wxChar *   name
 
   const TranslatableString   desc
 
   TranslatableString   label
 
   wxString   name
 
kFormats []
 
static Exporter::RegisteredExportPlugin sRegisteredPlugin
 

Macro Definition Documentation

◆ ID_ENCODING_CHOICE

#define ID_ENCODING_CHOICE   7103

Definition at line 111 of file ExportPCM.cpp.

◆ ID_HEADER_CHOICE

#define ID_HEADER_CHOICE   7102

Definition at line 110 of file ExportPCM.cpp.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
ScrubHeight 
ProperRulerHeight 
ItemNumberColumn 
ActionColumn 
ParamsColumn 
kJson 
kLisp 
kBrief 
nFormats 
FMT_WAV 
FMT_OTHER 
ID_ShowAll 
ID_ShowEnabled 
ID_ShowDisabled 
ID_ShowNew 
ID_List 
ID_ClearAll 
ID_SelectAll 
ID_Enable 
ID_Disable 
ePreviewID 
eDebugID 
eSettingsID 
ePreviewDryID 
eCloseID 
ClearID 
EditID 
ResetID 
LoadID 
SaveID 
SaveDefaultsID 
AddID 
RemoveID 
DontShowID 
CONTROL_GROUP_SAVE 
CONTROL_GROUP_EXPORT 
ETBActTooltips 
ETBActEnableDisable 
kMidiCellWidth 
kMidiCellHeight 
kTrackInfoBtnSize 
kTrackInfoSliderHeight 
kTrackInfoSliderWidth 
kTrackInfoSliderAllowance 
kTrackInfoSliderExtra 

Definition at line 68 of file ExportPCM.cpp.

69 {
70 #if defined(__WXMAC__)
71  FMT_AIFF,
72 #endif
73  FMT_WAV,
74  FMT_OTHER
75 };

Function Documentation

◆ LoadEncoding()

static int LoadEncoding ( int  type)
static

Definition at line 93 of file ExportPCM.cpp.

94 {
95  return gPrefs->Read(wxString::Format(wxT("/FileFormats/ExportFormat_SF1_Type/%s_%x"),
96  sf_header_shortname(type), type), (long int) 0);
97 }

References gPrefs, and sf_header_shortname().

Referenced by ExportPCM::Export(), ExportPCMOptions::GetEncodings(), and ExportPCM::GetMaxChannels().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ LoadOtherFormat()

static int LoadOtherFormat ( int  def = 0)
static

Definition at line 81 of file ExportPCM.cpp.

82 {
83  return gPrefs->Read(wxT("/FileFormats/ExportFormat_SF1"),
84  kFormats[0].format & SF_FORMAT_TYPEMASK);
85 }

References format, gPrefs, and kFormats.

Referenced by ExportPCM::Export(), ExportPCM::GetExtension(), ExportPCM::GetFormat(), ExportPCM::GetMaxChannels(), and ExportPCMOptions::GetTypes().

Here is the caller graph for this function:

◆ SaveEncoding()

static void SaveEncoding ( int  type,
int  val 
)
static

Definition at line 99 of file ExportPCM.cpp.

100 {
101  gPrefs->Write(wxString::Format(wxT("/FileFormats/ExportFormat_SF1_Type/%s_%x"),
102  sf_header_shortname(type), type), val);
103  gPrefs->Flush();
104 }

References FileConfig::Flush(), gPrefs, and sf_header_shortname().

Referenced by ExportPCMOptions::OnEncodingChoice(), and ExportPCMOptions::~ExportPCMOptions().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SaveOtherFormat()

static void SaveOtherFormat ( int  val)
static

Definition at line 87 of file ExportPCM.cpp.

88 {
89  gPrefs->Write(wxT("/FileFormats/ExportFormat_SF1"), val);
90  gPrefs->Flush();
91 }

References FileConfig::Flush(), and gPrefs.

Referenced by ExportPCMOptions::OnHeaderChoice(), and ExportPCMOptions::~ExportPCMOptions().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ desc

const TranslatableString desc

◆ format

int format

Definition at line 56 of file ExportPCM.cpp.

Referenced by AUPImportFileHandle::AddFile(), AUPImportFileHandle::AddSamples(), AdjustFormatIndex(), SampleBuffer::Allocate(), Sequence::Append(), WaveClip::Append(), WaveTrack::Append(), Sequence::AppendBlock(), Sequence::AppendNewBlock(), WaveClip::AppendNewBlock(), ProjectSelectionManager::AS_SetSelectionFormat(), AudacityToPortAudioSampleFormat(), anonymous_namespace{Registry.cpp}::BadPath(), LegacyBlockFile::BuildFromXML(), ODDecodeBlockFile::CalcSummary(), ODPCMAliasBlockFile::CalcSummary(), ImportFileHandle::ChooseFormat(), RingBuffer::Clear(), ClearSamples(), ComputeLegacySummaryInfo(), FormatClassifier::ConvertSamples(), Sequence::ConvertToSampleFormat(), WaveClip::ConvertToSampleFormat(), WaveTrack::ConvertToSampleFormat(), CrossFader::CrossFadeMix(), cutCopyOptions(), ODFlacDecoder::Decode(), CommandManager::DescribeCommandsAndShortcuts(), Sequence::DoAppend(), LabelTrackView::DoEditLabels(), anonymous_namespace{FileMenus.cpp}::DoExport(), TranslatableString::DoSubstitute(), ExportFFmpegOptions::EnableDisableControls(), anonymous_namespace{Sequence.cpp}::ensureSampleBufferSize(), FileException::ErrorMessage(), ExportFLAC::Export(), ExportPCM::Export(), ExportPCM::ExportPCM(), ExportFFmpegOptions::FetchCompatibleCodecList(), AudioIO::FillBuffers(), FindDependencies(), NumericTextCtrl::Options::Format(), FormatClassifier::FormatClassifier(), Sequence::Get(), WaveTrack::Get(), RingBuffer::Get(), Importer::GetFileTypes(), WaveTrackCache::GetFloats(), FormatClassifier::GetResultFormatLibSndfile(), GetSampleFormatStr(), CrossFader::GetSamples(), WaveClip::GetSamples(), anonymous_namespace{SelectMenus.cpp}::GridMove(), Guess16Bit(), GuessFloatFormats(), GuessIntFormats(), ImportRaw(), Internat::Init(), Ruler::TickSizes::LabelString(), LoadOtherFormat(), MixAndRender(), WaveTrackFactory::NewWaveTrack(), NumericEditor::NumericEditor(), ScrubbingOverlay::OnTimer(), SelectionBar::OnUpdate(), ExportCL::OptionsCreate(), ExportFFmpeg::OptionsCreate(), ExportFLAC::OptionsCreate(), ExportMP3::OptionsCreate(), ExportOGG::OptionsCreate(), ExportPCM::OptionsCreate(), NumericConverter::ParseFormatString(), TimeToolBar::Populate(), ExportMultipleDialog::PopulateOrExchange(), NyquistEffect::ProcessOne(), RingBuffer::Put(), anonymous_namespace{Compressor.cpp}::RatioLabelFormat(), anonymous_namespace{Compressor.cpp}::RatioTextFormat(), RawAudioGuess(), Sequence::Read(), LegacyBlockFile::ReadData(), ODDecodeBlockFile::ReadData(), ODPCMAliasBlockFile::ReadData(), PCMAliasBlockFile::ReadData(), SilentBlockFile::ReadData(), SimpleBlockFile::ReadData(), MultiFormatReader::ReadSamples(), FormatClassifier::ReadSignal(), SnapManager::Reinit(), RemoveDependencies(), GrowableSampleBuffer::Resize(), ReverseSamples(), RingBuffer::RingBuffer(), RulerPanel::RulerPanel(), FFmpegPresets::SavePreset(), WaveTrack::Set(), ProjectSettings::SetAudioTimeFormat(), TimeToolBar::SetAudioTimeFormat(), NumericEditor::SetFormat(), ExportPlugin::SetFormat(), Ruler::SetFormat(), Sequence::SetSamples(), WaveClip::SetSamples(), ProjectSettings::SetSelectionFormat(), SelectionBar::SetSelectionFormat(), MixerToolBar::SetToolTips(), sf_header_extension(), sf_header_index_name(), sf_header_name(), sf_header_shortname(), sf_subtype_bytes_per_sample(), sf_subtype_is_integer(), sf_subtype_more_than_16_bits(), sf_subtype_to_effective_format(), anonymous_namespace{Sequence.cpp}::ShareOrCopySampleBlock(), EffectChangeSpeed::Startup(), anonymous_namespace{WaveTrackControls.cpp}::Status2DrawFunction(), anonymous_namespace{NoiseReduction.cpp}::ControlInfo::Text(), Ruler::TickSizes::TickSizes(), Internat::ToDisplayString(), NumberFormatter::ToString(), ProjectSelectionManager::TT_SetAudioTimeFormat(), WaveClip::WaveClip(), WaveTrack::WaveTrack(), and SimpleBlockFile::WriteSimpleBlockFile().

◆ kFormats

struct { ... } kFormats[]
Initial value:
=
{
{SF_FORMAT_WAV | SF_FORMAT_PCM_16, wxT("WAV"), XO("WAV (Microsoft)")},
}

Referenced by ExportPCM::ExportPCM(), ExportPCMOptions::ExportPCMOptions(), ExportPCM::GetMaxChannels(), and LoadOtherFormat().

◆ name

const wxChar* name

Definition at line 57 of file ExportPCM.cpp.

Referenced by ExportPCM::AddID3Chunk(), and ExportPCM::ExportPCM().

◆ sRegisteredPlugin

Exporter::RegisteredExportPlugin sRegisteredPlugin
static
Initial value:
{ "PCM",
[]{ return std::make_unique< ExportPCM >(); }
}

Definition at line 1101 of file ExportPCM.cpp.

sf_header_shortname
wxString sf_header_shortname(int format)
Get an abbreviated form of the string name of the specified format.
Definition: FileFormats.cpp:122
gPrefs
FileConfig * gPrefs
Definition: Prefs.cpp:70
XO
#define XO(s)
Definition: Internat.h:31
format
int format
Definition: ExportPCM.cpp:56
kFormats
struct @0 kFormats[]
FileConfig::Flush
virtual bool Flush(bool bCurrentOnly=false) wxOVERRIDE
Definition: FileConfig.cpp:143
FMT_WAV
@ FMT_WAV
Definition: ExportPCM.cpp:73
FMT_OTHER
@ FMT_OTHER
Definition: ExportPCM.cpp:74