RhythmGame 1.4.3
Loading...
Searching...
No Matches
Bga.h
Go to the documentation of this file.
1//
2// Created by bobini on 10.10.23.
3//
4
5#ifndef RHYTHMGAME_BGA_H
6#define RHYTHMGAME_BGA_H
7
8#include <QVideoSink>
9#include <QMediaPlayer>
10#include <QPixmap>
11#include <QVideoFrame>
12#include <qpointer.h>
13
17namespace qml_components {
18
26class Bga : public QObject
27{
28 Q_OBJECT
29
36 Q_PROPERTY(QVideoSink* videoSink READ getVideoSink WRITE setVideoSink NOTIFY
38 Q_PROPERTY(bool bitmapOnly READ isBitmapOnly CONSTANT)
39 QPointer<QVideoSink> videoSink = nullptr;
40 std::vector<std::pair<std::chrono::nanoseconds, QMediaPlayer*>> videoFiles;
41 decltype(videoFiles)::iterator currentVideoFile = videoFiles.begin();
42 std::vector<std::pair<std::chrono::nanoseconds, QVideoFrame*>> images;
43 decltype(images)::iterator currentImage = images.begin();
44 QMediaPlayer* playedVideo = nullptr;
45 QVideoFrame displayedFrame;
46
47 public:
48 explicit Bga(
49 std::vector<std::pair<std::chrono::nanoseconds, QMediaPlayer*>>
50 videoFiles,
51 std::vector<std::pair<std::chrono::nanoseconds, QVideoFrame*>> images,
52 QObject* parent = nullptr);
53 auto isBitmapOnly() const -> bool { return videoFiles.empty(); }
54 auto getVideoSink() const -> QVideoSink*;
55 void setVideoSink(QVideoSink* newVideoSink);
56 void update(std::chrono::nanoseconds offsetFromStart);
57
58 signals:
60};
61
62class BgaContainer : public QObject
63{
64 Q_OBJECT
65
66 Q_PROPERTY(QList<Bga*> layers READ getLayers CONSTANT)
67 QList<Bga*> layers;
68
69 std::vector<QMediaPlayer*> videoFiles;
70 std::vector<std::unique_ptr<QVideoFrame>> images;
71
72 public:
73 BgaContainer(QList<Bga*> layers,
74 std::vector<QMediaPlayer*> videoFiles,
75 std::vector<std::unique_ptr<QVideoFrame>> images,
76 QObject* parent = nullptr);
77
78 auto getLayers() const -> const QList<Bga*>&;
79 void update(std::chrono::nanoseconds offsetFromStart);
80};
81} // namespace qml_components
82
83#endif // RHYTHMGAME_BGA_H
int64_t offsetFromStart
Definition BmsReplayData.cpp:38
Definition Bga.h:63
A single BGA layer.
Definition Bga.h:27
auto isBitmapOnly() const -> bool
Definition Bga.h:53
void update(std::chrono::nanoseconds offsetFromStart)
Definition Bga.cpp:57
QVideoSink * videoSink
The video sink to output the BGA to.
Definition Bga.h:37
auto getVideoSink() const -> QVideoSink *
Definition Bga.cpp:39
void setVideoSink(QVideoSink *newVideoSink)
Definition Bga.cpp:44
bool bitmapOnly
Definition Bga.h:38
Contains classes that wrap some functionality for use in QML.
Definition ProfileArenaIdentityProvider.h:9