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

cppcx: Move to new parsing api

parent 754d495a
......@@ -61,7 +61,7 @@ namespace libVLCX
public delegate void MediaListItemDeleted(Media^, int);
public delegate void MediaListWillDeleteItem(Media^, int);
public delegate void ParsedChanged(bool);
public delegate void ParsedStatus(ParseStatus);
ref class EventManager;
private ref class EventRemover sealed
......@@ -467,12 +467,12 @@ namespace libVLCX
VLC::MediaEventManager& m_em;
public:
event ParsedChanged^ OnParsedChanged
event ParsedStatus^ OnParsedStatus
{
Windows::Foundation::EventRegistrationToken add(ParsedChanged^ handler)
Windows::Foundation::EventRegistrationToken add(ParsedStatus^ handler)
{
auto h = m_em.onParsedChanged([handler](bool b) {
handler(b);
auto h = m_em.onParsedStatus([handler](VLC::Media::ParseStatus s) {
handler((ParseStatus)s);
});
m_events.push_back(h);
return Windows::Foundation::EventRegistrationToken{ (int64)h };
......
......@@ -98,9 +98,9 @@ namespace libVLCX
m_media.parseWithOptions(static_cast<VLC::Media::ParseFlags>( flags ) );
}
bool Media::isParsed()
ParseStatus Media::parseStatus()
{
return m_media.parseStatus() == VLC::Media::ParseStatus::Done;
return (ParseStatus)m_media.parseStatus();
}
Windows::Foundation::Collections::IVector<MediaTrack^>^ Media::tracks()
......
......@@ -99,6 +99,14 @@ namespace libVLCX
Interact = 0x08,
};
public enum class ParseStatus
{
Init = VLC::Media::ParseStatus::Init,
Skipped = VLC::Media::ParseStatus::Skipped,
Failed = VLC::Media::ParseStatus::Failed,
Done = VLC::Media::ParseStatus::Done,
};
public enum class FromType
{
FromPath,
......@@ -272,7 +280,7 @@ namespace libVLCX
*/
void Media::parseWithOptions(ParseFlags flags);
bool isParsed();
ParseStatus parseStatus();
/**
* Get media descriptor's elementary streams description
......
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