cuticle/ui/timeline.h

58 lines
821 B
C++

#ifndef _CUTICLE_TIMELINE_H
#define _CUTICLE_TIMELINE_H
#include<wx/frame.h>
#include<wx/panel.h>
struct Frame;
struct GrNode;
struct CHiKeyframes;
struct Timeline : wxPanel {
int64_t camX = 0;
int64_t camY = 0;
int64_t mouseX = 0;
int64_t mouseY = 0;
CHiKeyframes *captureKfs;
size_t captureKfIdx;
struct Row {
enum Type {
KEYFRAMES,
NODE_LIFESPAN
};
int y, h;
Type type;
union {
CHiKeyframes *kfs;
GrNode *gn;
};
};
std::vector<Row> rows;
enum class CaptureMode {
CAM, KF
} captureMode;
int scale = 100;
Timeline(struct Frame *parent);
virtual ~Timeline() = default;
void Paint(wxPaintEvent&);
Timeline::Row *GetRow(int y);
bool MouseOverKF(wxPoint p, CHiKeyframes* &kfs, size_t &kfIdx);
float SnapTime(float t);
void ResetRows();
};
#endif