libvlcpp | branch: master | Thomas Nigro <[email protected]> | Wed Jul 1 18:24:54 2015 +0200| [6ec7a0d9a3ab005ef63b19130f7d6c62ea2db118] | committer: Hugo Beauzée-Luyssen
Use Title/ChapterDescription following API Changes Signed-off-by: Hugo Beauzée-Luyssen <[email protected]> > http://git.videolan.org/gitweb.cgi/libvlcpp.git/?a=commit;h=6ec7a0d9a3ab005ef63b19130f7d6c62ea2db118 --- cppcx/MediaPlayerCX.cpp | 8 +++--- cppcx/MediaPlayerCX.hpp | 4 +-- cppcx/StructuresCX.cpp | 68 ++++++++++++++++++++++++++++++++++++++++++----- cppcx/StructuresCX.hpp | 39 +++++++++++++++++++++++++++ 4 files changed, 107 insertions(+), 12 deletions(-) diff --git a/cppcx/MediaPlayerCX.cpp b/cppcx/MediaPlayerCX.cpp index 0ce5e11..aa98af6 100644 --- a/cppcx/MediaPlayerCX.cpp +++ b/cppcx/MediaPlayerCX.cpp @@ -417,14 +417,14 @@ namespace libVLCX return m_mp.setSpuDelay(i_delay); } - Windows::Foundation::Collections::IVector<TrackDescription^>^ MediaPlayer::titleDescription() + Windows::Foundation::Collections::IVector<TitleDescription^>^ MediaPlayer::titleDescription() { - return MarshallVector<TrackDescription, VLC::TrackDescription>(m_mp.titleDescription()); + return MarshallVector<TitleDescription, VLC::TitleDescription>(m_mp.titleDescription()); } - Windows::Foundation::Collections::IVector<TrackDescription^>^ MediaPlayer::chapterDescription(int i_title) + Windows::Foundation::Collections::IVector<ChapterDescription^>^ MediaPlayer::chapterDescription(int i_title) { - return MarshallVector<TrackDescription, VLC::TrackDescription>(m_mp.chapterDescription(i_title)); + return MarshallVector<ChapterDescription, VLC::ChapterDescription>(m_mp.chapterDescription(i_title)); } Platform::String^ MediaPlayer::cropGeometry() diff --git a/cppcx/MediaPlayerCX.hpp b/cppcx/MediaPlayerCX.hpp index a4d1be8..9d45910 100644 --- a/cppcx/MediaPlayerCX.hpp +++ b/cppcx/MediaPlayerCX.hpp @@ -897,7 +897,7 @@ namespace libVLCX * * \return list containing description of available titles */ - Windows::Foundation::Collections::IVector<TrackDescription^>^ titleDescription(); + Windows::Foundation::Collections::IVector<TitleDescription^>^ titleDescription(); /** * Get the description of available chapters for specific title. @@ -907,7 +907,7 @@ namespace libVLCX * \return list containing description of available chapter for title * i_title */ - Windows::Foundation::Collections::IVector<TrackDescription^>^ chapterDescription(int i_title); + Windows::Foundation::Collections::IVector<ChapterDescription^>^ chapterDescription(int i_title); /** * Get current crop filter geometry. diff --git a/cppcx/StructuresCX.cpp b/cppcx/StructuresCX.cpp index 6bf83fe..5c6d6bd 100644 --- a/cppcx/StructuresCX.cpp +++ b/cppcx/StructuresCX.cpp @@ -179,20 +179,76 @@ namespace libVLCX m_device = ToPlatformString(desc.device().c_str()); m_description = ToPlatformString(desc.description().c_str()); } - - + // TrackDescription int TrackDescription::id() { - return m_id; + return m_id; } + Platform::String^ TrackDescription::name() { - return m_name; + return m_name; } TrackDescription::TrackDescription(const VLC::TrackDescription& desc) { - m_id = desc.id(); - m_name = ToPlatformString(desc.name().c_str()); + m_id = desc.id(); + m_name = ToPlatformString(desc.name().c_str()); + } + + // TitleDescription + int64_t TitleDescription::duration() + { + return m_duration; + } + + int TitleDescription::id() + { + return m_id; + } + + Platform::String^ TitleDescription::name() + { + return m_name; + } + + bool TitleDescription::isMenu() + { + return m_menu; + } + + TitleDescription::TitleDescription(const VLC::TitleDescription& desc) + { + m_menu = desc.isMenu(); + m_duration = desc.duration(); + m_name = ToPlatformString(desc.name().c_str()); + } + + // Chapter decription + int ChapterDescription::id() + { + return m_id; + } + + int64_t ChapterDescription::startTime() + { + return m_startTime; + } + + int64_t ChapterDescription::duration() + { + return m_duration; + } + + Platform::String^ ChapterDescription::name() + { + return m_name; + } + + ChapterDescription::ChapterDescription(const VLC::ChapterDescription& desc) + { + m_duration = desc.duration(); + m_startTime = desc.starttime(); + m_name = ToPlatformString(desc.name().c_str()); } } diff --git a/cppcx/StructuresCX.hpp b/cppcx/StructuresCX.hpp index b14611f..40749a8 100644 --- a/cppcx/StructuresCX.hpp +++ b/cppcx/StructuresCX.hpp @@ -150,4 +150,43 @@ namespace libVLCX int m_id; Platform::String^ m_name; }; + + + + + public ref class TitleDescription sealed + { + public: + int64_t duration(); + int id(); + Platform::String^ name(); + bool isMenu(); + + internal: + explicit TitleDescription(const VLC::TitleDescription& desc); + + private: + int m_id; + Platform::String^ m_name; + int64_t m_duration; + bool m_menu; + }; + + public ref class ChapterDescription sealed + { + public: + int id(); + int64_t startTime(); + int64_t duration(); + Platform::String^ name(); + + internal: + explicit ChapterDescription(const VLC::ChapterDescription& desc); + + private: + int m_id; + Platform::String^ m_name; + int64_t m_duration; + int64_t m_startTime; + }; } \ No newline at end of file _______________________________________________ vlc-commits mailing list [email protected] https://mailman.videolan.org/listinfo/vlc-commits
