Audacity 3.2.0
MusicInformationRetrieval.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: GPL-2.0-or-later */
2/*!********************************************************************
3
4 Audacity: A Digital Audio Editor
5
6 MusicInformationRetrieval.h
7
8 Matthieu Hodgkinson
9
10**********************************************************************/
11#pragma once
12
13#include "AcidizerTags.h"
14#include "MirTypes.h"
15
16#include <functional>
17#include <optional>
18#include <string>
19#include <unordered_map>
20#include <vector>
21
22namespace MIR
23{
24class MirAudioReader;
25class ProjectInterface;
26
28{
33
37 const double threshold;
38};
39
48static const std::unordered_map<FalsePositiveTolerance, LoopClassifierSettings>
50 { FalsePositiveTolerance::Strict, { .04, 0.8679721717368254 } },
51 { FalsePositiveTolerance::Lenient, { .1, 0.7129778875046098 } },
52 };
53
55{
57 std::string filename;
58 std::optional<LibFileFormats::AcidizerTags> tags;
59 std::function<void(double progress)> progressCallback;
60 double projectTempo = 120.;
61 bool projectWasEmpty = false;
63};
64
65std::optional<ProjectSyncInfo> MUSIC_INFORMATION_RETRIEVAL_API
67
68// Used internally by `MusicInformation`, made public for testing.
69MUSIC_INFORMATION_RETRIEVAL_API std::optional<double>
70GetBpmFromFilename(const std::string& filename);
71
72MUSIC_INFORMATION_RETRIEVAL_API std::optional<MusicalMeter>
74 const MirAudioReader& source, FalsePositiveTolerance tolerance,
75 const std::function<void(double)>& progressCallback,
76 QuantizationFitDebugOutput* debugOutput = nullptr);
77
78MUSIC_INFORMATION_RETRIEVAL_API void SynchronizeProject(
79 const std::vector<std::shared_ptr<AnalyzedAudioClip>>& clips,
80 ProjectInterface& project, bool projectWasEmpty);
81
82} // namespace MIR
const auto project
std::optional< MusicalMeter > GetMusicalMeterFromSignal(const MirAudioReader &audio, FalsePositiveTolerance tolerance, const std::function< void(double)> &progressCallback, QuantizationFitDebugOutput *debugOutput)
static const std::unordered_map< FalsePositiveTolerance, LoopClassifierSettings > loopClassifierSettings
std::optional< double > GetBpmFromFilename(const std::string &filename)
FalsePositiveTolerance
Definition: MirTypes.h:25
std::optional< ProjectSyncInfo > GetProjectSyncInfo(const ProjectSyncInfoInput &in)
void SynchronizeProject(const std::vector< std::shared_ptr< AnalyzedAudioClip > > &clips, ProjectInterface &project, bool projectWasEmpty)
std::function< void(double progress)> progressCallback
std::optional< LibFileFormats::AcidizerTags > tags