mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-03 15:41:41 +00:00
VIDEO: Implement row and column navigation methods
This commit is contained in:
parent
2a095e6c87
commit
19647ff996
@ -671,6 +671,55 @@ void QuickTimeDecoder::handleMouseButton(bool isDown, int16 x, int16 y) {
|
||||
}
|
||||
}
|
||||
|
||||
void QuickTimeDecoder::setCurrentRow(int row) {
|
||||
VideoTrackHandler *track = (VideoTrackHandler *)_nextVideoTrack;
|
||||
|
||||
int currentColumn = track->getCurFrame() % _nav.columns;
|
||||
int newFrame = row * _nav.columns + currentColumn;
|
||||
|
||||
if (newFrame >= 0 && newFrame < track->getFrameCount()) {
|
||||
track->setCurFrame(newFrame);
|
||||
}
|
||||
}
|
||||
|
||||
void QuickTimeDecoder::setCurrentColumn(int column) {
|
||||
VideoTrackHandler *track = (VideoTrackHandler *)_nextVideoTrack;
|
||||
|
||||
int currentRow = track->getCurFrame() / _nav.columns;
|
||||
int newFrame = currentRow * _nav.columns + column;
|
||||
|
||||
if (newFrame >= 0 && newFrame < track->getFrameCount()) {
|
||||
track->setCurFrame(newFrame);
|
||||
}
|
||||
}
|
||||
|
||||
void QuickTimeDecoder::nudge(const Common::String &direction) {
|
||||
VideoTrackHandler *track = (VideoTrackHandler *)_nextVideoTrack;
|
||||
|
||||
int curFrame = track->getCurFrame();
|
||||
int currentRow = curFrame / _nav.columns;
|
||||
int currentRowStart = currentRow * _nav.columns;
|
||||
int newFrame = curFrame;
|
||||
|
||||
if (direction.equalsIgnoreCase("left")) {
|
||||
newFrame = (curFrame - 1 - currentRowStart) % _nav.columns + currentRowStart;
|
||||
} else if (direction.equalsIgnoreCase("right")) {
|
||||
newFrame = (curFrame + 1 - currentRowStart) % _nav.columns + currentRowStart;
|
||||
} else if (direction.equalsIgnoreCase("top")) {
|
||||
newFrame = curFrame - _nav.columns;
|
||||
if (newFrame < 0)
|
||||
return;
|
||||
} else if (direction.equalsIgnoreCase("bottom")) {
|
||||
newFrame = curFrame + _nav.columns;
|
||||
if (newFrame >= track->getFrameCount())
|
||||
return;
|
||||
} else {
|
||||
error("QuickTimeDecoder::nudge(): Invald direction: ('%s')!", direction.c_str());
|
||||
}
|
||||
|
||||
track->setCurFrame(newFrame);
|
||||
}
|
||||
|
||||
QuickTimeDecoder::NodeData QuickTimeDecoder::getNodeData(uint32 nodeID) {
|
||||
for (const auto &sample : _panoTrack->panoSamples) {
|
||||
if (sample.hdr.nodeID == nodeID) {
|
||||
|
@ -83,6 +83,13 @@ public:
|
||||
float getFOV() const { return ((VideoTrackHandler *)_nextVideoTrack)->getFOV(); }
|
||||
void setFOV(float fov) { ((VideoTrackHandler *)_nextVideoTrack)->setFOV(fov); }
|
||||
|
||||
int getCurrentRow() { return _nextVideoTrack->getCurFrame() / _nav.columns; }
|
||||
void setCurrentRow(int row);
|
||||
int getCurrentColumn() { return _nextVideoTrack->getCurFrame() % _nav.columns; }
|
||||
void setCurrentColumn(int column);
|
||||
|
||||
void nudge(const Common::String &direction);
|
||||
|
||||
bool isVR() const { return _isVR; }
|
||||
QTVRType getQTVRType() const { return _qtvrType; }
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user