Audacity 3.2.0
Functions
audacity::cloud::audiocom::sync::anonymous_namespace{MixdownUploader.cpp} Namespace Reference

Functions

std::string GenerateTempPath (FileExtension extension)
 
int CalculateChannels (const TrackList &trackList)
 
bool HasPlayableTracks (const AudacityProject &project)
 

Function Documentation

◆ CalculateChannels()

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

Definition at line 57 of file MixdownUploader.cpp.

58{
59 auto range = trackList.Any<const WaveTrack>();
60 return std::all_of(
61 range.begin(), range.end(),
62 [](const WaveTrack* track)
63 { return IsMono(*track) && track->GetPan() == 0; }) ?
64 1 :
65 2;
66}
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::sync::MixdownUploader::ExportProject().

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

◆ GenerateTempPath()

std::string audacity::cloud::audiocom::sync::anonymous_namespace{MixdownUploader.cpp}::GenerateTempPath ( FileExtension  extension)

Definition at line 36 of file MixdownUploader.cpp.

37{
38 const auto tempPath = GetUploadTempPath();
39
40 wxFileName fileName(
41 tempPath,
42 wxString::Format(
43 "%lld", std::chrono::system_clock::now().time_since_epoch().count()),
44 extension);
45
46 fileName.Mkdir(0700, wxPATH_MKDIR_FULL);
47
48 if (fileName.Exists())
49 {
50 if (!wxRemoveFile(fileName.GetFullPath()))
51 return {};
52 }
53
54 return audacity::ToUTF8(fileName.GetFullPath());
55}
std::string ToUTF8(const std::wstring &wstr)

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

Referenced by audacity::cloud::audiocom::sync::MixdownUploader::ExportProject().

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

◆ HasPlayableTracks()

bool audacity::cloud::audiocom::sync::anonymous_namespace{MixdownUploader.cpp}::HasPlayableTracks ( const AudacityProject project)

Definition at line 68 of file MixdownUploader.cpp.

69{
70 // Why Any requires non const ref???
71 for (const auto& track :
73 .Any<PlayableTrack>())
74 {
75 if (track->GetStartTime() != track->GetEndTime())
76 return true;
77 }
78
79 return false;
80}
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 TrackList & Get(AudacityProject &project)
Definition: Track.cpp:314

References TrackList::Get(), and project.

Referenced by audacity::cloud::audiocom::sync::MixdownUploader::ExportProject().

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