40 lines
1.1 KiB
C++
40 lines
1.1 KiB
C++
#pragma once
|
|
|
|
#include <cstddef>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
#include "core/Frame.hpp"
|
|
|
|
namespace tahgibu {
|
|
|
|
// Modelo de datos del proyecto. No conoce raylib ni la interfaz.
|
|
class Project {
|
|
public:
|
|
Project(); // 1280x720, FPS base kDefaultFps, un frame inicial
|
|
|
|
const std::string& name() const noexcept { return name_; }
|
|
int width() const noexcept { return width_; }
|
|
int height() const noexcept { return height_; }
|
|
|
|
float baseFps() const noexcept { return baseFps_; }
|
|
void setBaseFps(float fps) noexcept; // aplica Frame::clampFps
|
|
|
|
std::size_t frameCount() const noexcept { return frames_.size(); }
|
|
const Frame& frame(std::size_t index) const { return frames_.at(index); }
|
|
Frame& frame(std::size_t index) { return frames_.at(index); }
|
|
std::size_t addFrame(); // devuelve el índice del frame nuevo
|
|
|
|
double frameDurationSeconds(std::size_t index) const;
|
|
double totalDurationSeconds() const;
|
|
|
|
private:
|
|
std::string name_;
|
|
int width_ = 1280;
|
|
int height_ = 720;
|
|
float baseFps_ = kDefaultFps;
|
|
std::vector<Frame> frames_;
|
|
};
|
|
|
|
} // namespace tahgibu
|