Audacity 3.2.0
Functions | Variables
cloud::audiocom::anonymous_namespace{ShareAudioDialog.cpp} Namespace Reference

Functions

wxString GenerateTempPath (FileExtension extension)
 
int CalculateChannels (const TrackList &trackList)
 
void SetTimeLabel (wxStaticText *label, std::chrono::milliseconds time)
 

Variables

const wxSize avatarSize = { 32, 32 }
 
const auto publicLabelText = XO("Public")
 
const auto publicDescriptionText
 
const auto unlistedLabelText = XO("Unlisted")
 
const auto unlistedDescriptionText
 

Function Documentation

◆ CalculateChannels()

int cloud::audiocom::anonymous_namespace{ShareAudioDialog.cpp}::CalculateChannels ( const TrackList trackList)

Definition at line 305 of file ShareAudioDialog.cpp.

306{
307 auto range = trackList.Any<const WaveTrack>();
308 return std::all_of(range.begin(), range.end(), [](const WaveTrack *track){
309 return IsMono(*track) && track->GetPan() == 0;
310 }) ? 1 : 2;
311}
auto Any() -> TrackIterRange< TrackType >
Definition: Track.h:1302
A Track that contains audio waveform data.
Definition: WaveTrack.h:51

References TrackList::Any().

Referenced by cloud::audiocom::ShareAudioDialog::ExportProject().

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

◆ GenerateTempPath()

wxString cloud::audiocom::anonymous_namespace{ShareAudioDialog.cpp}::GenerateTempPath ( FileExtension  extension)

Definition at line 63 of file ShareAudioDialog.cpp.

64{
65 const auto tempPath = GetUploadTempPath();
66
67 wxFileName fileName(
68 tempPath,
69 wxString::Format(
70 "%lld", std::chrono::system_clock::now().time_since_epoch().count()),
71 extension);
72
73 fileName.Mkdir(0700, wxPATH_MKDIR_FULL);
74
75 if (fileName.Exists())
76 {
77 if (!wxRemoveFile(fileName.GetFullPath()))
78 return {};
79 }
80
81 return fileName.GetFullPath();
82}
wxString GetUploadTempPath()

References cloud::audiocom::GetUploadTempPath().

Referenced by cloud::audiocom::ShareAudioDialog::ExportProject().

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

◆ SetTimeLabel()

void cloud::audiocom::anonymous_namespace{ShareAudioDialog.cpp}::SetTimeLabel ( wxStaticText *  label,
std::chrono::milliseconds  time 
)

Definition at line 500 of file ShareAudioDialog.cpp.

501{
502 wxTimeSpan tsElapsed(0, 0, 0, time.count());
503
504 label->SetLabel(tsElapsed.Format(wxT(" %H:%M:%S")));
505 label->SetName(label->GetLabel());
506 label->Update();
507}
wxT("CloseDown"))
TranslatableString label
Definition: TagsEditor.cpp:164

References label, and wxT().

Referenced by cloud::audiocom::ShareAudioDialog::UpdateProgress().

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

Variable Documentation

◆ avatarSize

const wxSize cloud::audiocom::anonymous_namespace{ShareAudioDialog.cpp}::avatarSize = { 32, 32 }

◆ publicDescriptionText

const auto cloud::audiocom::anonymous_namespace{ShareAudioDialog.cpp}::publicDescriptionText
Initial value:
=
XO("Anyone will be able to listen to this audio.")
XO("Cut/Copy/Paste")

Definition at line 85 of file ShareAudioDialog.cpp.

Referenced by cloud::audiocom::ShareAudioDialog::ProgressPanel::PopulateProgressPanel().

◆ publicLabelText

const auto cloud::audiocom::anonymous_namespace{ShareAudioDialog.cpp}::publicLabelText = XO("Public")

Definition at line 84 of file ShareAudioDialog.cpp.

◆ unlistedDescriptionText

const auto cloud::audiocom::anonymous_namespace{ShareAudioDialog.cpp}::unlistedDescriptionText
Initial value:
= XO(
"Only you and people you share a link with will be able to listen to this audio.")

Definition at line 89 of file ShareAudioDialog.cpp.

◆ unlistedLabelText

const auto cloud::audiocom::anonymous_namespace{ShareAudioDialog.cpp}::unlistedLabelText = XO("Unlisted")

Definition at line 88 of file ShareAudioDialog.cpp.