Audacity 3.2.0
Functions | Variables
audacity::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 auto publicLabelText = XO("Public")
 
const auto publicDescriptionText
 
const auto unlistedLabelText = XO("Unlisted")
 
const auto unlistedDescriptionText
 
auto hooked
 

Function Documentation

◆ CalculateChannels()

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

Definition at line 302 of file ShareAudioDialog.cpp.

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

References TrackList::Any().

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

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

◆ GenerateTempPath()

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

Definition at line 62 of file ShareAudioDialog.cpp.

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

References anonymous_namespace{CloudProjectFileIOExtensions.cpp}::extension, and audacity::cloud::audiocom::GetUploadTempPath().

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

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

◆ SetTimeLabel()

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

Definition at line 528 of file ShareAudioDialog.cpp.

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

References label, and wxT().

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

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

Variable Documentation

◆ hooked

auto audacity::cloud::audiocom::anonymous_namespace{ShareAudioDialog.cpp}::hooked
Initial value:
= []
{
{
const auto window = &GetProjectFrame(project);
sync::CloudLocationDialog locationDialog {
window, sync::LocationDialogType::Export
};
const auto result = locationDialog.ShowDialog();
if (result == sync::LocationDialogResult::Cancel)
if (result == sync::LocationDialogResult::Local)
ShareAudioDialog shareDialog { project, window };
shareDialog.ShowModal();
},
1000);
return true;
}()
wxString FileExtension
File extension, not including any leading dot.
Definition: Identifier.h:224
AUDACITY_DLL_API wxFrame & GetProjectFrame(AudacityProject &project)
Get the top-level window associated with the project (as a wxFrame only, when you do not need to use ...
const auto project
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:90
static void RegisterExportHook(ExportHook hook, Priority=DEFAULT_EXPORT_HOOK_PRIORITY)
Definition: ExportUtils.cpp:60

Definition at line 737 of file ShareAudioDialog.cpp.

◆ publicDescriptionText

const auto audacity::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 84 of file ShareAudioDialog.cpp.

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

◆ publicLabelText

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

Definition at line 83 of file ShareAudioDialog.cpp.

◆ unlistedDescriptionText

const auto audacity::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 88 of file ShareAudioDialog.cpp.

◆ unlistedLabelText

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

Definition at line 87 of file ShareAudioDialog.cpp.