12#include <catch2/catch.hpp>
19#include "MockedAudio.h"
20#include "MockedPrefs.h"
32 bool nearest,
int upper,
int lower)
36 timeSignature.SetTempo(60.0);
37 timeSignature.SetUpperTimeSignature(upper);
38 timeSignature.SetLowerTimeSignature(lower);
50 double expected,
bool upwards,
bool successful)
54 .snapped == successful);
63 double expected,
bool upwards)
67 timeSignature.SetTempo(60.0);
68 timeSignature.SetUpperTimeSignature(4);
69 timeSignature.SetLowerTimeSignature(4);
81 MockedPrefs mockedPrefs;
82 MockedAudio mockedAudio;
TEST_CASE("Snapping", "")
void TimeStepCase(const AudacityProject &project, const char *format, double time, double expected, bool upwards, bool successful)
void BeatsCase(AudacityProject &project, const char *format, double time, double expected, bool nearest, int upper, int lower)
void BarStepCase(AudacityProject &project, const char *format, double time, double expected, bool upwards)
void TimeCase(const AudacityProject &project, const char *format, double time, double expected, bool nearest)
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
static std::shared_ptr< AudacityProject > Create()
Use this factory function.
static ProjectTimeSignature & Get(AudacityProject &project)
static SnapResult Snap(const Identifier &id, const AudacityProject &project, double time, bool nearest)
static SnapResult SingleStep(const Identifier &id, const AudacityProject &project, double time, bool upwards)