Audacity 3.2.0
Classes | Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
ProjectFormatExtensionsRegistry Class Referencefinal

The class that allows evaluating the minimum version of Audacity required to support the project. More...

#include <ProjectFormatExtensionsRegistry.h>

Inheritance diagram for ProjectFormatExtensionsRegistry:
[legend]
Collaboration diagram for ProjectFormatExtensionsRegistry:
[legend]

Classes

struct  Extension
 A struct to register the project extension that requires a different project version. More...
 

Public Types

using ProjectVersionResolver = ProjectFormatVersion(*)(const AudacityProject &)
 

Public Member Functions

ProjectFormatVersion GetRequiredVersion (const AudacityProject &project) const
 Returns the minimum possible version that can be used to save the project. More...
 
- Public Member Functions inherited from ClientData::Base
virtual ~Base ()
 

Static Public Member Functions

static const ProjectFormatExtensionsRegistryGet ()
 

Private Member Functions

void Register (ProjectVersionResolver resolver)
 

Private Attributes

std::vector< ProjectVersionResolvermRegisteredExtensions
 

Detailed Description

The class that allows evaluating the minimum version of Audacity required to support the project.

Definition at line 22 of file ProjectFormatExtensionsRegistry.h.

Member Typedef Documentation

◆ ProjectVersionResolver

Definition at line 26 of file ProjectFormatExtensionsRegistry.h.

Member Function Documentation

◆ Get()

const ProjectFormatExtensionsRegistry & ProjectFormatExtensionsRegistry::Get ( )
static

Definition at line 24 of file ProjectFormatExtensionsRegistry.cpp.

25{
27}
ProjectFormatExtensionsRegistry & GetProjectFormatExtensionsRegistry()

References GetProjectFormatExtensionsRegistry().

Referenced by ProjectFileIO::WriteDoc().

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

◆ GetRequiredVersion()

ProjectFormatVersion ProjectFormatExtensionsRegistry::GetRequiredVersion ( const AudacityProject project) const

Returns the minimum possible version that can be used to save the project.

Definition at line 35 of file ProjectFormatExtensionsRegistry.cpp.

37{
39
40 for (auto formatExtension : mRegisteredExtensions)
41 {
42 if (!formatExtension)
43 continue;
44
45 const auto formatExtensionVersion = formatExtension(project);
46
47 if (minVersion < formatExtensionVersion)
48 minVersion = formatExtensionVersion;
49 }
50
51 return minVersion;
52}
const ProjectFormatVersion BaseProjectFormatVersion
This is a helper constant for the "most compatible" project version with the value (3,...
const auto project
std::vector< ProjectVersionResolver > mRegisteredExtensions
A structure that holds the project version.

References BaseProjectFormatVersion, mRegisteredExtensions, and project.

Referenced by ProjectFileIO::WriteDoc().

Here is the caller graph for this function:

◆ Register()

void ProjectFormatExtensionsRegistry::Register ( ProjectVersionResolver  resolver)
private

Definition at line 29 of file ProjectFormatExtensionsRegistry.cpp.

31{
32 mRegisteredExtensions.emplace_back(std::move(formatExtension));
33}

References mRegisteredExtensions.

Referenced by ProjectFormatExtensionsRegistry::Extension::Extension().

Here is the caller graph for this function:

Member Data Documentation

◆ mRegisteredExtensions

std::vector<ProjectVersionResolver> ProjectFormatExtensionsRegistry::mRegisteredExtensions
private

Definition at line 42 of file ProjectFormatExtensionsRegistry.h.

Referenced by GetRequiredVersion(), and Register().


The documentation for this class was generated from the following files: