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:1097
A Track that contains audio waveform data.
Definition: WaveTrack.h:227

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 65 of file ShareAudioDialog.cpp.

66{
67 const auto tempPath = GetUploadTempPath();
68
69 wxFileName fileName(
70 tempPath,
71 wxString::Format(
72 "%lld", std::chrono::system_clock::now().time_since_epoch().count()),
73 extension);
74
75 fileName.Mkdir(0700, wxPATH_MKDIR_FULL);
76
77 if (fileName.Exists())
78 {
79 if (!wxRemoveFile(fileName.GetFullPath()))
80 return {};
81 }
82
83 return fileName.GetFullPath();
84}
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 531 of file ShareAudioDialog.cpp.

532{
533 wxTimeSpan tsElapsed(0, 0, 0, time.count());
534
535 label->SetLabel(tsElapsed.Format(wxT(" %H:%M:%S")));
536 label->SetName(label->GetLabel());
537 label->Update();
538}
wxT("CloseDown"))
TranslatableString label
Definition: TagsEditor.cpp:165

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 87 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 86 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 91 of file ShareAudioDialog.cpp.

◆ unlistedLabelText

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

Definition at line 90 of file ShareAudioDialog.cpp.