- Recorder (imgui/window/recorder.*) owns a render: frame times, captured frames on disk, per-frame trigger sounds, and assembling PNGs, spritesheets (Image::paste) or ffmpeg output. Start, finish, cancel and failure share one stop path. - Isolated and bounded renders no longer overwrite and restore Settings, pan, zoom and overlay: the preview draws with view values derived for the render. - Image::region_get replaces the region export's own pixel copy. - Selecting layer frames focuses their spritesheet (Document::frame_references_set) instead of the spritesheet editor forcing it every frame. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
37 lines
920 B
C++
37 lines
920 B
C++
#pragma once
|
|
|
|
#include <cstdint>
|
|
#include <filesystem>
|
|
|
|
#include "audio_stream.hpp"
|
|
#include "canvas_view.hpp"
|
|
#include "manager.hpp"
|
|
#include "recorder.hpp"
|
|
#include "resources.hpp"
|
|
#include "settings.hpp"
|
|
|
|
namespace anm2ed::imgui
|
|
{
|
|
class AnimationPreview : public CanvasView
|
|
{
|
|
MIX_Mixer* mixer = MIX_CreateMixerDevice(SDL_AUDIO_DEVICE_DEFAULT_PLAYBACK, nullptr);
|
|
AudioStream audioStream = AudioStream(mixer);
|
|
bool wasPlaybackPlaying{};
|
|
bool isPreviewHovered{};
|
|
bool isMoveDragging{};
|
|
glm::vec2 moveOffset{};
|
|
glm::vec2 nullRectScaleAnchor{};
|
|
Recorder recorder{};
|
|
glm::vec2 recordSize{};
|
|
glm::vec2 recordPan{};
|
|
float recordZoom{};
|
|
|
|
void recording_start(Manager&, Settings&, Document&, const model::Animation*);
|
|
void recording_stop(Manager&, Document&);
|
|
|
|
public:
|
|
void tick(Manager&, Settings&, float);
|
|
void update(Manager&, Settings&, Resources&);
|
|
};
|
|
}
|