mirror of
https://github.com/brunoherbelin/vimix.git
synced 2025-12-14 03:39:57 +01:00
Implementation of OSC targets Position, Size, Angle and Seek
Creation of SourceCallback to seek in MediaSource
This commit is contained in:
@@ -19,6 +19,8 @@
|
||||
|
||||
#include "defines.h"
|
||||
#include "Source.h"
|
||||
#include "MediaSource.h"
|
||||
#include "MediaPlayer.h"
|
||||
#include "UpdateCallback.h"
|
||||
#include "Visitor.h"
|
||||
#include "Log.h"
|
||||
@@ -458,6 +460,38 @@ SourceCallback *RePlay::clone() const
|
||||
}
|
||||
|
||||
|
||||
Seek::Seek(float time) : SourceCallback(), target_time_(time)
|
||||
{
|
||||
}
|
||||
|
||||
void Seek::update(Source *s, float dt)
|
||||
{
|
||||
SourceCallback::update(s, dt);
|
||||
|
||||
// perform seek when ready
|
||||
if ( status_ == READY ){
|
||||
|
||||
// access media player if target source is a media source
|
||||
MediaSource *ms = dynamic_cast<MediaSource *>(s);
|
||||
if (ms != nullptr)
|
||||
ms->mediaplayer()->seek( GST_SECOND * target_time_ );
|
||||
|
||||
status_ = FINISHED;
|
||||
}
|
||||
}
|
||||
|
||||
SourceCallback *Seek::clone() const
|
||||
{
|
||||
return new Seek(target_time_);
|
||||
}
|
||||
|
||||
void Seek::accept(Visitor& v)
|
||||
{
|
||||
SourceCallback::accept(v);
|
||||
v.visit(*this);
|
||||
}
|
||||
|
||||
|
||||
SetGeometry::SetGeometry(const Group *g, float ms, bool revert) : SourceCallback(),
|
||||
duration_(ms), bidirectional_(revert)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user