mirror of
https://github.com/brunoherbelin/vimix.git
synced 2025-12-11 18:34:58 +01:00
New SourcePlayer
Work in progress; Sources now have play/pause and associated play functions. Media player can play all playable sources, and adapts to control a media player when possible. Selection of play groups (to finalize)
This commit is contained in:
@@ -108,12 +108,38 @@ void MediaSource::setActive (bool on)
|
||||
{
|
||||
bool was_active = active_;
|
||||
|
||||
// try to activate (may fail if source is cloned)
|
||||
Source::setActive(on);
|
||||
|
||||
// change status of media player (only if status changed)
|
||||
if ( active_ != was_active ) {
|
||||
if ( active_ != was_active )
|
||||
mediaplayer_->enable(active_);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool MediaSource::playing () const
|
||||
{
|
||||
return mediaplayer_->isPlaying();
|
||||
}
|
||||
|
||||
void MediaSource::play (bool on)
|
||||
{
|
||||
mediaplayer_->play(on);
|
||||
}
|
||||
|
||||
bool MediaSource::playable () const
|
||||
{
|
||||
return !mediaplayer_->isImage();
|
||||
}
|
||||
|
||||
void MediaSource::replay ()
|
||||
{
|
||||
mediaplayer_->rewind();
|
||||
}
|
||||
|
||||
guint64 MediaSource::playtime () const
|
||||
{
|
||||
return mediaplayer_->position();
|
||||
}
|
||||
|
||||
void MediaSource::update(float dt)
|
||||
|
||||
Reference in New Issue
Block a user