timeline: vastly improved snapping

This commit is contained in:
itsmattkc
2020-06-06 13:59:49 +10:00
parent 5055c136b6
commit aaee2ab9ed
13 changed files with 285 additions and 99 deletions
+31
View File
@@ -0,0 +1,31 @@
#ifndef SNAPSERVICE_H
#define SNAPSERVICE_H
#include "common/rational.h"
OLIVE_NAMESPACE_ENTER
class SnapService
{
public:
SnapService() = default;
enum SnapPoints {
kSnapToClips = 0x1,
kSnapToPlayhead = 0x2,
kSnapToMarkers = 0x4,
kSnapAll = 0xFF
};
/**
* @brief Snaps point `start_point` that is moving by `movement` to currently existing clips
*/
virtual bool SnapPoint(QList<rational> start_times, rational *movement, int snap_points = kSnapAll) = 0;
virtual void HideSnaps() = 0;
};
OLIVE_NAMESPACE_EXIT
#endif // SNAPSERVICE_H