Audacity 3.2.0
Namespaces | Enumerations | Functions | Variables
anonymous_namespace{ExportOpus.cpp} Namespace Reference

Namespaces

namespace  VBRMode
 

Enumerations

enum  : int {
  OPUSOptionIDBitRate = 0 , OPUSOptionIDQuality , OPUSOptionIDFrameDuration , OPUSOptionIDVBRMode ,
  OPUSOptionIDApplication , OPUSOptionIDCutoff
}
 

Functions

TranslatableString GetOpusEncErrorString (int error)
 
void FailExport (const TranslatableString &title, int errorCode=0)
 
TranslatableString n_kbps (int n)
 
bool IsValidSampleRate (int sampleRate) noexcept
 

Variables

const std::initializer_list< PlainExportOptionsEditor::OptionDescOPUSOptions
 
constexpr int supportedSampleRates [] = { 8000, 12000, 16000, 24000, 48000 }
 

Enumeration Type Documentation

◆ anonymous enum

anonymous enum : int
Enumerator
OPUSOptionIDBitRate 
OPUSOptionIDQuality 
OPUSOptionIDFrameDuration 
OPUSOptionIDVBRMode 
OPUSOptionIDApplication 
OPUSOptionIDCutoff 

Definition at line 85 of file ExportOpus.cpp.

Function Documentation

◆ FailExport()

void anonymous_namespace{ExportOpus.cpp}::FailExport ( const TranslatableString title,
int  errorCode = 0 
)

Definition at line 67 of file ExportOpus.cpp.

68{
69 if (errorCode != 0)
70 {
71 throw ExportException(Verbatim("%s: %s")
73 .Translation());
74 }
75
76 throw ExportException(title.Translation());
77}
static const auto title
TranslatableString Verbatim(wxString str)
Require calls to the one-argument constructor to go through this distinct global function name.
Abstract base class used in importing a file.
TranslatableString GetOpusEncErrorString(int error)
Definition: ExportOpus.cpp:42

References GetOpusEncErrorString(), title, and Verbatim().

Referenced by OpusExportProcessor::Initialize(), OpusExportProcessor::Process(), and OpusExportProcessor::OggPacket::Write().

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

◆ GetOpusEncErrorString()

TranslatableString anonymous_namespace{ExportOpus.cpp}::GetOpusEncErrorString ( int  error)

Definition at line 42 of file ExportOpus.cpp.

43{
44 switch (error)
45 {
46 case OPUS_OK:
47 return XO("no error");
48 case OPUS_BAD_ARG:
49 return XO("invalid argument");
50 case OPUS_BUFFER_TOO_SMALL:
51 return XO("buffer too small");
52 case OPUS_INTERNAL_ERROR:
53 return XO("internal error");
54 case OPUS_INVALID_PACKET:
55 return XO("invalid packet");
56 case OPUS_UNIMPLEMENTED:
57 return XO("not implemented");
58 case OPUS_INVALID_STATE:
59 return XO("invalid state");
60 case OPUS_ALLOC_FAIL:
61 return XO("memory allocation has failed");
62 default:
63 return XO("Unknown error");
64 }
65}
XO("Cut/Copy/Paste")

References XO().

Referenced by FailExport().

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

◆ IsValidSampleRate()

bool anonymous_namespace{ExportOpus.cpp}::IsValidSampleRate ( int  sampleRate)
noexcept

Definition at line 225 of file ExportOpus.cpp.

226{
227 for (auto sr : supportedSampleRates)
228 if (sr == sampleRate)
229 return true;
230 return false;
231}

References anonymous_namespace{ClipSegmentTest.cpp}::sampleRate, and supportedSampleRates.

Referenced by OpusExportProcessor::Initialize().

Here is the caller graph for this function:

◆ n_kbps()

TranslatableString anonymous_namespace{ExportOpus.cpp}::n_kbps ( int  n)

Definition at line 80 of file ExportOpus.cpp.

81{
82 return XO("%d kbps").Format(n);
83}

References XO().

Here is the call graph for this function:

Variable Documentation

◆ OPUSOptions

const std::initializer_list<PlainExportOptionsEditor::OptionDesc> anonymous_namespace{ExportOpus.cpp}::OPUSOptions

◆ supportedSampleRates

constexpr int anonymous_namespace{ExportOpus.cpp}::supportedSampleRates[] = { 8000, 12000, 16000, 24000, 48000 }
constexpr

Definition at line 223 of file ExportOpus.cpp.

Referenced by AudioIOBase::GetDeviceInfo(), and IsValidSampleRate().