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

Remove VLM event binding

The actual API wasn't exposed, so let's not bother with having the event
available for 3.0
parent 57b762eb
......@@ -945,215 +945,6 @@ class MediaDiscovererEventManager : public EventManager
};
#endif
/**
* @brief The VLMEventManager class allows one to register VLM related events
*/
class VLMEventManager : public EventManager
{
public:
VLMEventManager(InternalPtr ptr) : EventManager(ptr) {}
/**
* \brief onMediaAdded Registers an event called when a media gets added
* \param f A std::function<void(std::string)> (or an equivalent Callable type)
* The given string is the name of the added media
*/
template <typename Func>
RegisteredEvent onMediaAdded( Func&& f )
{
EXPECT_SIGNATURE(void(std::string));
return handle(libvlc_VlmMediaAdded, std::forward<Func>( f ), [](const libvlc_event_t* e, void* data)
{
auto callback = static_cast<DecayPtr<Func>>( data );
(*callback)( e->u.vlm_media_event.psz_media_name ? e->u.vlm_media_event.psz_media_name : "" );
});
}
/**
* \brief onMediaRemoved Registers an event called when a media gets removed
* \param f A std::function<void(std::string)> (or an equivalent Callable type)
* The given string is the name of the removed media
*/
template <typename Func>
RegisteredEvent onMediaRemoved( Func&& f )
{
EXPECT_SIGNATURE(void(std::string));
return handle(libvlc_VlmMediaRemoved, std::forward<Func>( f ), [](const libvlc_event_t* e, void* data)
{
auto callback = static_cast<DecayPtr<Func>>( data );
(*callback)( e->u.vlm_media_event.psz_media_name ? e->u.vlm_media_event.psz_media_name : "" );
});
}
/**
* \brief onMediaChanged Registers an event called when a media changes
* \param f A std::function<void(std::string)> (or an equivalent Callable type)
* The given string is the name of the changed media
*/
template <typename Func>
RegisteredEvent onMediaChanged( Func&& f )
{
EXPECT_SIGNATURE(void(std::string));
return handle(libvlc_VlmMediaChanged, std::forward<Func>( f ), [](const libvlc_event_t* e, void* data)
{
auto callback = static_cast<DecayPtr<Func>>( data );
(*callback)( e->u.vlm_media_event.psz_media_name ? e->u.vlm_media_event.psz_media_name : "" );
});
}
/**
* \brief onMediaInstanceStarted Registers an event called when a media instance starts
* \param f A std::function<void(std::string, std::string)> (or an equivalent Callable type)
* Parameters are:
* - The media name
* - The instance name
*/
template <typename Func>
RegisteredEvent onMediaInstanceStarted( Func&& f )
{
EXPECT_SIGNATURE(void(std::string, std::string));
return handle(libvlc_VlmMediaInstanceStarted, std::forward<Func>( f ), [](const libvlc_event_t* e, void* data)
{
auto callback = static_cast<DecayPtr<Func>>( data );
(*callback)( e->u.vlm_media_event.psz_media_name ? e->u.vlm_media_event.psz_media_name : "",
e->u.vlm_media_event.psz_instance_name ? e->u.vlm_media_event.psz_instance_name : "" );
});
}
/**
* \brief onMediaInstanceStopped Registers an event called when a media instance stops
* \param f A std::function<void(std::string, std::string)> (or an equivalent Callable type)
* Parameters are:
* - The media name
* - The instance name
*/
template <typename Func>
RegisteredEvent onMediaInstanceStopped( Func&& f )
{
EXPECT_SIGNATURE(void(std::string, std::string));
return handle(libvlc_VlmMediaInstanceStopped, std::forward<Func>( f ), [](const libvlc_event_t* e, void* data)
{
auto callback = static_cast<DecayPtr<Func>>( data );
(*callback)( e->u.vlm_media_event.psz_media_name ? e->u.vlm_media_event.psz_media_name : "",
e->u.vlm_media_event.psz_instance_name ? e->u.vlm_media_event.psz_instance_name : "" );
});
}
/**
* \brief onMediaInstanceStatusInit Registers an event called when a media instance is initializing
* \param f A std::function<void(std::string, std::string)> (or an equivalent Callable type)
* Parameters are:
* - The media name
* - The instance name
*/
template <typename Func>
RegisteredEvent onMediaInstanceStatusInit( Func&& f )
{
EXPECT_SIGNATURE(void(std::string, std::string));
return handle(libvlc_VlmMediaInstanceStatusInit, std::forward<Func>( f ), [](const libvlc_event_t* e, void* data)
{
auto callback = static_cast<DecayPtr<Func>>( data );
(*callback)( e->u.vlm_media_event.psz_media_name ? e->u.vlm_media_event.psz_media_name : "",
e->u.vlm_media_event.psz_instance_name ? e->u.vlm_media_event.psz_instance_name : "" );
});
}
/**
* \brief onMediaInstanceStatusOpening Registers an event called when a media instance is opening
* \param f A std::function<void(std::string, std::string)> (or an equivalent Callable type)
* Parameters are:
* - The media name
* - The instance name
*/
template <typename Func>
RegisteredEvent onMediaInstanceStatusOpening( Func&& f )
{
EXPECT_SIGNATURE(void(std::string, std::string));
return handle(libvlc_VlmMediaInstanceStatusOpening, std::forward<Func>( f ), [](const libvlc_event_t* e, void* data)
{
auto callback = static_cast<DecayPtr<Func>>( data );
(*callback)( e->u.vlm_media_event.psz_media_name ? e->u.vlm_media_event.psz_media_name : "",
e->u.vlm_media_event.psz_instance_name ? e->u.vlm_media_event.psz_instance_name : "" );
});
}
/**
* \brief onMediaInstanceStatusPlaying Registers an event called when a media instance reaches playing state
* \param f A std::function<void(std::string, std::string)> (or an equivalent Callable type)
* Parameters are:
* - The media name
* - The instance name
*/
template <typename Func>
RegisteredEvent onMediaInstanceStatusPlaying( Func&& f )
{
EXPECT_SIGNATURE(void(std::string, std::string));
return handle(libvlc_VlmMediaInstanceStatusPlaying, std::forward<Func>( f ), [](const libvlc_event_t* e, void* data)
{
auto callback = static_cast<DecayPtr<Func>>( data );
(*callback)( e->u.vlm_media_event.psz_media_name ? e->u.vlm_media_event.psz_media_name : "",
e->u.vlm_media_event.psz_instance_name ? e->u.vlm_media_event.psz_instance_name : "" );
});
}
/**
* \brief onMediaInstanceStatusPause Registers an event called when a media instance gets paused
* \param f A std::function<void(std::string, std::string)> (or an equivalent Callable type)
* Parameters are:
* - The media name
* - The instance name
*/
template <typename Func>
RegisteredEvent onMediaInstanceStatusPause( Func&& f )
{
EXPECT_SIGNATURE(void(std::string, std::string));
return handle(libvlc_VlmMediaInstanceStatusPause, std::forward<Func>( f ), [](const libvlc_event_t* e, void* data)
{
auto callback = static_cast<DecayPtr<Func>>( data );
(*callback)( e->u.vlm_media_event.psz_media_name ? e->u.vlm_media_event.psz_media_name : "",
e->u.vlm_media_event.psz_instance_name ? e->u.vlm_media_event.psz_instance_name : "" );
});
}
/**
* \brief onMediaInstanceStatusEnd Registers an event called when a media instance ends
* \param f A std::function<void(std::string, std::string)> (or an equivalent Callable type)
* Parameters are:
* - The media name
* - The instance name
*/
template <typename Func>
RegisteredEvent onMediaInstanceStatusEnd( Func&& f )
{
EXPECT_SIGNATURE(void(std::string, std::string));
return handle(libvlc_VlmMediaInstanceStatusEnd, std::forward<Func>( f ), [](const libvlc_event_t* e, void* data)
{
auto callback = static_cast<DecayPtr<Func>>( data );
(*callback)( e->u.vlm_media_event.psz_media_name ? e->u.vlm_media_event.psz_media_name : "",
e->u.vlm_media_event.psz_instance_name ? e->u.vlm_media_event.psz_instance_name : "" );
});
}
/**
* \brief onMediaInstanceStatusError Registers an event called when a media instance encouters an error
* \param f A std::function<void(std::string, std::string)> (or an equivalent Callable type)
* Parameters are:
* - The media name
* - The instance name
*/
template <typename Func>
RegisteredEvent onMediaInstanceStatusError( Func&& f )
{
EXPECT_SIGNATURE(void(std::string, std::string));
return handle(libvlc_VlmMediaInstanceStatusError, std::forward<Func>( f ), [](const libvlc_event_t* e, void* data)
{
auto callback = static_cast<DecayPtr<Func>>( data );
(*callback)( e->u.vlm_media_event.psz_media_name ? e->u.vlm_media_event.psz_media_name : "",
e->u.vlm_media_event.psz_instance_name ? e->u.vlm_media_event.psz_instance_name : "" );
});
}
};
#if LIBVLC_VERSION_INT >= LIBVLC_VERSION(3, 0, 0, 0)
/*
......
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