Commit 45628c0a authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

EventManager: Add missing onParsedStatus

parent 3a33b06c
......@@ -27,6 +27,7 @@
#include "common.hpp"
#include "Internal.hpp"
#include "Media.hpp"
#include <algorithm>
#include <functional>
......@@ -307,6 +308,17 @@ class MediaEventManager : public EventManager
});
}
template <typename Func>
RegisteredEvent onParsedStatus( Func&& f )
{
EXPECT_SIGNATURE( void(Media::ParseStatus) );
return handle(libvlc_MediaParsedStatus, std::forward<Func>( f ), [](const libvlc_event_t* e, void* data)
{
auto callback = static_cast<DecayPtr<Func>>(data);
(*callback)( static_cast<Media::ParseStatus>( e->u.media_parsed_status.new_status ) );
});
}
/**
* \brief onFreed Registers an event called when the media reaches a refcount of 0
* \param f A std::function<void(MediaPtr)> (or an equivalent Callable type)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment