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

304{
305 auto range = trackList.Any<const WaveTrack>();
306 return std::all_of(range.begin(), range.end(), [](const WaveTrack *track){
307 return IsMono(*track) && track->GetPan() == 0;
308 }) ? 1 : 2;
309}
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 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}

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

530{
531 wxTimeSpan tsElapsed(0, 0, 0, time.count());
532
533 label->SetLabel(tsElapsed.Format(wxT(" %H:%M:%S")));
534 label->SetName(label->GetLabel());
535 label->Update();
536}
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:
= []
{
[](AudacityProject& project, const FileExtension&, bool selectedOnly)
{
if(selectedOnly)
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:67

Definition at line 738 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 85 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 84 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 89 of file ShareAudioDialog.cpp.

◆ unlistedLabelText

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

Definition at line 88 of file ShareAudioDialog.cpp.