Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • videolan/libvlcpp
  • robUx4/libvlcpp
  • stolyarchuk/libvlcpp
  • hacker1024/libvlcpp
  • mfkl/libvlcpp
  • The-personified-devil/libvlcpp
  • chouquette/libvlcpp
  • aillean/libvlcpp
  • adtadas19/libvlcpp
  • aad9805066254/libvlcpp
  • asenat/libvlcpp
  • rovenmaburak/libvlcpp
  • mstorsjo/libvlcpp
  • ranjuranjith/libvlcpp
  • tguillem/libvlcpp
  • akbaralisalar/libvlcpp
  • king7532/libvlcpp
  • Skantes/libvlcpp
  • f45431082/libvlcpp
  • alexandre-janniaux/libvlcpp
  • deyayush6/libvlcpp
21 results
Show changes
Commits on Source (2)
......@@ -105,6 +105,10 @@ int main(int ac, char** av)
auto lFunc = std::function<void(float)>{ l };
auto h1 = mp.eventManager().onTimeChanged(lFunc);
auto h2 = mp.eventManager().onPositionChanged(lFunc);
mp.eventManager().onTitleSelectionChanged(
[](const VLC::TitleDescription& t, int idx ) {
std::cout << "New title selected: " << t.name() << " at index " << idx << std::endl;
});
std::this_thread::sleep_for( std::chrono::seconds( 2 ) );
......
......@@ -612,6 +612,35 @@ class MediaPlayerEventManager : public EventManager
});
}
#if LIBVLC_VERSION_INT >= LIBVLC_VERSION(4, 0, 0, 0)
/**
* \brief onTitleListChanged Registers an event called when the list of titles changes
* \param f A std::function<void(void)> (or an equivalent Callable type)
*
* The updated list can be obtained by calling MediaPlayer::titleDescription()
*/
template <typename Func>
RegisteredEvent onTitleListChanged( Func&& f )
{
return handle( libvlc_MediaPlayerTitleListChanged, std::forward<Func>( f ) );
}
/**
* \brief onTitleSelectionChanged Registers an event called when the title selection changes
* \param f A std::function<void(const TitleDescription&, int)> (or an equivalent callable type)
*/
template <typename Func>
RegisteredEvent onTitleSelectionChanged( Func&& f )
{
EXPECT_SIGNATURE(void(const TitleDescription&, int));
return handle( libvlc_MediaPlayerTitleSelectionChanged, std::forward<Func>( f ), [](const libvlc_event_t* e, void* data)
{
auto callback = static_cast<DecayPtr<Func>>( data );
(*callback)( TitleDescription{ e->u.media_player_title_selection_changed.title },
e->u.media_player_title_selection_changed.index );
});
}
#else
/**
* \brief onTitleChanged Registers an event called when the current title changes
* \param f A std::function<void(int)> (or an equivalent Callable type)
......@@ -629,6 +658,7 @@ class MediaPlayerEventManager : public EventManager
(*callback)( e->u.media_player_title_changed.new_title );
});
}
#endif
#if LIBVLC_VERSION_INT >= LIBVLC_VERSION(3, 0, 0, 0)
/**
......
......@@ -562,7 +562,7 @@ public:
return ( m_flags & libvlc_title_interactive ) != 0;
}
explicit TitleDescription( libvlc_title_description_t* c )
explicit TitleDescription( const libvlc_title_description_t* c )
: m_duration( c->i_duration ), m_flags( c->i_flags )
{
if ( c->psz_name != nullptr )
......