diff --git a/libraries/lib-project-file-io/ProjectFileIO.cpp b/libraries/lib-project-file-io/ProjectFileIO.cpp index c5383f546..0ace696a4 100644 --- a/libraries/lib-project-file-io/ProjectFileIO.cpp +++ b/libraries/lib-project-file-io/ProjectFileIO.cpp @@ -774,10 +774,12 @@ bool ProjectFileIO::CheckVersion() // Project file version is higher than ours. We will refuse to // process it since we can't trust anything about it. - if (SupportedProjectFormatVersion < version) + // TODO: use the SupportedProjectFormatVersion instead and make a way to + // clearly distinguish projects created by either Audacity or Tenacity. + if (SupportedAudacityProjectFormatVersion < version) { SetError( - XO("This project was created with a newer version of Audacity.\n\nYou will need to upgrade to open it.") + XO("This project was created with a version of Audacity that is not supported by Tenacity.\n\nYou will need to use that version to open it.") ); return false; } @@ -785,8 +787,8 @@ bool ProjectFileIO::CheckVersion() using namespace BasicUI; wxString currentVersionStr = wxString::Format("%u.%u", BaseProjectFormatVersion.Major, BaseProjectFormatVersion.Minor); bool updateVersion = (MessageBoxResult::Yes == ShowMessageBox( - XO("This project was created using an older Audacity version. " - "Once saved, the project can only be opened with Audacity version %s or newer.").Format(currentVersionStr), + XO("This project was created using an older Tenacity version. " + "Once saved, the project can only be opened with Tenacity version %s or newer.").Format(currentVersionStr), MessageBoxOptions{} .Caption(XO("Project update required")))); } diff --git a/libraries/lib-project/ProjectFormatVersion.cpp b/libraries/lib-project/ProjectFormatVersion.cpp index be8da409a..03dcb54ee 100644 --- a/libraries/lib-project/ProjectFormatVersion.cpp +++ b/libraries/lib-project/ProjectFormatVersion.cpp @@ -50,7 +50,9 @@ bool ProjectFormatVersion::IsValid() const noexcept } const ProjectFormatVersion SupportedProjectFormatVersion = { - TENACITY_VERSION, TENACITY_RELEASE, TENACITY_REVISION, 0 + TENACITY_VERSION, TENACITY_RELEASE, TENACITY_REVISION, 0, true }; -const ProjectFormatVersion BaseProjectFormatVersion = { TENACITY_VERSION, TENACITY_RELEASE, 0, 0 }; +const ProjectFormatVersion SupportedAudacityProjectFormatVersion = { 3, 7, 0, 0, false }; +const ProjectFormatVersion BaseProjectFormatVersion = { 1, 3, 0, 0, true }; +const ProjectFormatVersion BaseAudacityProjectFormatVersion = { 3, 0, 0, 0, false }; diff --git a/libraries/lib-project/ProjectFormatVersion.h b/libraries/lib-project/ProjectFormatVersion.h index 2c88353f5..14d987dfc 100644 --- a/libraries/lib-project/ProjectFormatVersion.h +++ b/libraries/lib-project/ProjectFormatVersion.h @@ -24,6 +24,7 @@ struct PROJECT_API ProjectFormatVersion final uint8_t Minor { 0 }; uint8_t Revision { 0 }; uint8_t ModLevel { 0 }; + bool IsTenacity { false }; // Create ProjectFormatVersion from the uint32_t value static ProjectFormatVersion FromPacked(uint32_t) noexcept; @@ -38,7 +39,16 @@ PROJECT_API bool operator==(ProjectFormatVersion lhs, ProjectFormatVersion rhs) PROJECT_API bool operator!=(ProjectFormatVersion lhs, ProjectFormatVersion rhs) noexcept; PROJECT_API bool operator<(ProjectFormatVersion lhs, ProjectFormatVersion rhs) noexcept; -//! This constant represents the current version of Audacity +/// This constant represents the current version of Tenacity. PROJECT_API extern const ProjectFormatVersion SupportedProjectFormatVersion; -//! This is a helper constant for the "most compatible" project version which is the current MAJ.MIN.0.0 + +/// This constant represents the maximum supported Audacity project version. +PROJECT_API extern const ProjectFormatVersion SupportedAudacityProjectFormatVersion; + +/// This is a helper constant for the "most compatible" project version created +/// by Tenacity with the value (MAJ, MIN, 0, 0). PROJECT_API extern const ProjectFormatVersion BaseProjectFormatVersion; + +/// This is a helper constant for the "most compatible" project version created +/// by Audacity with the value {AUD_MAJ, AUD_MIN, 0, 0}. +PROJECT_API extern const ProjectFormatVersion BaseAudacityProjectFormatVersion;