Improved OSC sync

Accept OSC request to sync source by name or id. Changed OSC seek request to be by percent target
This commit is contained in:
Bruno Herbelin
2022-08-17 19:11:21 +02:00
parent d62004eadf
commit dd92f2dccb
3 changed files with 14 additions and 7 deletions

View File

@@ -460,7 +460,7 @@ SourceCallback *RePlay::clone() const
}
Seek::Seek(float time) : SourceCallback(), target_time_(time)
Seek::Seek(float time) : SourceCallback(), target_(time)
{
}
@@ -473,8 +473,10 @@ void Seek::update(Source *s, float dt)
// 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_ );
if (ms != nullptr) {
GstClockTime duration = ms->mediaplayer()->timeline()->duration();
ms->mediaplayer()->seek( target_ * duration );
}
status_ = FINISHED;
}
@@ -482,7 +484,7 @@ void Seek::update(Source *s, float dt)
SourceCallback *Seek::clone() const
{
return new Seek(target_time_);
return new Seek(target_);
}
void Seek::accept(Visitor& v)