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

cppcx: Upgrade to the latest libvlcpp

parent 3e4e6c7f
......@@ -22,152 +22,18 @@
#include "EventManagerCX.hpp"
#include "MediaCX.hpp"
#include <vlcpp/vlc.hpp>
namespace libVLCX
{
MediaPlayerEventCb::MediaPlayerEventCb(EventManager^ em)
: m_em(em)
{
}
void MediaPlayerEventCb::mediaChanged(const VLC::Media& media)
{
m_em->OnMediaChanged(ref new Media(media));
}
void MediaPlayerEventCb::nothingSpecial()
{
}
void MediaPlayerEventCb::opening()
{
m_em->OnOpening();
}
void MediaPlayerEventCb::buffering(float percent)
{
m_em->OnBuffering(percent);
}
void MediaPlayerEventCb::playing()
{
m_em->OnPlaying();
}
void MediaPlayerEventCb::paused()
{
m_em->OnPaused();
}
void MediaPlayerEventCb::stopped()
{
m_em->OnStopped();
}
void MediaPlayerEventCb::forward()
{
m_em->OnForward();
}
void MediaPlayerEventCb::backward()
{
m_em->OnBackward();
}
void MediaPlayerEventCb::endReached()
{
m_em->OnEndReached();
}
void MediaPlayerEventCb::encounteredError()
{
m_em->OnEncounteredError();
}
void MediaPlayerEventCb::timeChanged(libvlc_time_t time)
{
m_em->OnTimeChanged(time);
}
void MediaPlayerEventCb::positionChanged(float pos)
{
m_em->OnPositionChanged(pos);
}
void MediaPlayerEventCb::seekableChanged(bool val)
{
m_em->OnSeekableChanged(val);
}
void MediaPlayerEventCb::pausableChanged(bool val)
{
m_em->OnPausableChanged(val);
}
void MediaPlayerEventCb::titleChanged(int title)
{
m_em->OnTitleChanged(title);
}
void MediaPlayerEventCb::snapshotTaken(const std::string& str)
{
m_em->OnSnapshotTaken(ToPlatformString(str));
}
void MediaPlayerEventCb::lengthChanged(libvlc_time_t length)
{
m_em->OnLengthChanged(length);
}
void MediaPlayerEventCb::vout(int nbVout)
{
m_em->OnVoutCountChanged(nbVout);
}
void MediaPlayerEventCb::scrambledChanged(int val)
MediaPlayerEventManager::MediaPlayerEventManager(VLC::MediaPlayerEventManager& em)
: m_em(em)
{
m_em->OnScrambledChanged(val);
}
void MediaPlayerEventCb::eSAdded(libvlc_track_type_t type, int trackId)
{
m_em->OnTrackAdded((TrackType) type, trackId);
}
void MediaPlayerEventCb::eSDeleted(libvlc_track_type_t type, int trackId)
{
m_em->OnTrackDeleted((TrackType) type, trackId);
}
void MediaPlayerEventCb::eSSelected(libvlc_track_type_t type, int trackId)
{
m_em->OnTrackSelected((TrackType) type, trackId);
}
EventManager::EventManager(VLC::EventManager& em)
MediaEventManager::MediaEventManager(VLC::MediaEventManager& em)
: m_em(em)
, m_cb(new MediaPlayerEventCb(this))
{
em.attach(libvlc_MediaPlayerMediaChanged, m_cb.get());
em.attach(libvlc_MediaPlayerNothingSpecial, m_cb.get());
em.attach(libvlc_MediaPlayerOpening, m_cb.get());
em.attach(libvlc_MediaPlayerBuffering, m_cb.get());
em.attach(libvlc_MediaPlayerPlaying, m_cb.get());
em.attach(libvlc_MediaPlayerPaused, m_cb.get());
em.attach(libvlc_MediaPlayerStopped, m_cb.get());
em.attach(libvlc_MediaPlayerForward, m_cb.get());
em.attach(libvlc_MediaPlayerBackward, m_cb.get());
em.attach(libvlc_MediaPlayerEndReached, m_cb.get());
em.attach(libvlc_MediaPlayerEncounteredError, m_cb.get());
em.attach(libvlc_MediaPlayerTimeChanged, m_cb.get());
em.attach(libvlc_MediaPlayerPositionChanged, m_cb.get());
em.attach(libvlc_MediaPlayerSeekableChanged, m_cb.get());
em.attach(libvlc_MediaPlayerPausableChanged, m_cb.get());
em.attach(libvlc_MediaPlayerTitleChanged, m_cb.get());
em.attach(libvlc_MediaPlayerSnapshotTaken, m_cb.get());
em.attach(libvlc_MediaPlayerLengthChanged, m_cb.get());
em.attach(libvlc_MediaPlayerVout, m_cb.get());
em.attach(libvlc_MediaPlayerScrambledChanged, m_cb.get());
em.attach(libvlc_MediaPlayerESAdded, m_cb.get());
em.attach(libvlc_MediaPlayerESDeleted, m_cb.get());
em.attach(libvlc_MediaPlayerESSelected, m_cb.get());
}
}
\ No newline at end of file
This diff is collapsed.
......@@ -41,7 +41,7 @@ namespace libVLCX
c_argv[i++] = _strdup((const char*) VLCString(arg));
}
InitializeHack(c_argv, i);
m_instance = VLC::Instance::create(argv->Size + extraArgs, c_argv);
m_instance = VLC::Instance(argv->Size + extraArgs, c_argv);
for (i = 0; i < argv->Size + extraArgs; ++i)
free(c_argv[i]);
delete [] c_argv;
......
......@@ -23,8 +23,8 @@
#pragma once
#include "StructuresCX.hpp"
#include "Instance.hpp"
#include <collection.h>
#include <vlcpp/vlc.hpp>
//<ugly>
#include "DirectXManager.h"
......
......@@ -29,8 +29,8 @@
namespace libVLCX
{
Media::Media(Instance^ instance, Platform::String^ location)
: m_media(VLC::Media( instance->m_instance, VLCString(location), VLC::Media::FromLocation ) )
{
m_media = VLC::Media::fromLocation(instance->m_instance, VLCString(location));
}
void Media::addOption(Platform::String^ options)
......@@ -50,7 +50,7 @@ namespace libVLCX
Media^ Media::duplicate()
{
return ref new Media(m_media.duplicate());
return ref new Media(*m_media.duplicate().get());
}
Platform::String^ Media::meta(MediaMeta e_meta)
......@@ -75,10 +75,10 @@ namespace libVLCX
//bool Media::stats(libvlc_media_stats_t * p_stats);
EventManager^ Media::eventManager()
MediaEventManager^ Media::eventManager()
{
if (m_eventManager == nullptr)
m_eventManager = ref new EventManager(m_media.eventManager());
m_eventManager = ref new MediaEventManager(m_media.eventManager());
return m_eventManager;
}
......
......@@ -23,12 +23,12 @@
#pragma once
#include "structuresCX.hpp"
#include "Media.hpp"
#include <collection.h>
#include <vlcpp/vlc.hpp>
namespace libVLCX
{
ref class EventManager;
ref class MediaEventManager;
ref class Instance;
public enum class MediaState
......@@ -193,7 +193,7 @@ namespace libVLCX
*
* \return event manager object
*/
EventManager^ eventManager();
MediaEventManager^ eventManager();
/**
* Get duration (in ms) of media descriptor object item.
......@@ -267,7 +267,7 @@ namespace libVLCX
VLC::Media m_media;
private:
EventManager^ m_eventManager;
MediaEventManager^ m_eventManager;
};
} // namespace libVLCX
......
......@@ -30,13 +30,13 @@
namespace libVLCX
{
MediaPlayer::MediaPlayer(Instance^ instance)
: m_mp(VLC::MediaPlayer(instance->m_instance))
{
m_mp = VLC::MediaPlayer::create(instance->m_instance);
}
MediaPlayer::MediaPlayer(Media^ md)
: m_mp(VLC::MediaPlayer(md->m_media))
{
m_mp = VLC::MediaPlayer::fromMedia(md->m_media);
}
void MediaPlayer::setMedia(Media^ md)
......@@ -46,13 +46,13 @@ namespace libVLCX
Media^ MediaPlayer::media()
{
return ref new Media(m_mp.media());
return ref new Media(*m_mp.media().get());
}
EventManager^ MediaPlayer::eventManager()
MediaPlayerEventManager^ MediaPlayer::eventManager()
{
if (m_eventManager == nullptr)
m_eventManager = ref new EventManager(m_mp.eventManager());
m_eventManager = ref new MediaPlayerEventManager(m_mp.eventManager());
return m_eventManager;
}
......
......@@ -24,12 +24,12 @@
#include <collection.h>
#include "StructuresCX.hpp"
#include "MediaPlayer.hpp"
#include "MediaCX.hpp"
#include <vlcpp/vlc.hpp>
namespace libVLCX
{
ref class EventManager;
ref class MediaPlayerEventManager;
ref class AudioOutputDeviceDescription;
ref class TrackDescription;
ref class Instance;
......@@ -83,7 +83,7 @@ namespace libVLCX
*
* \return the event manager associated with p_mi
*/
EventManager^ eventManager();
MediaPlayerEventManager^ eventManager();
/**
* is_playing
......@@ -1120,7 +1120,7 @@ namespace libVLCX
private:
VLC::MediaPlayer m_mp;
EventManager^ m_eventManager;
MediaPlayerEventManager^ m_eventManager;
};
......
......@@ -22,7 +22,7 @@
#pragma once
#include "structures.hpp"
#include <vlcpp/vlc.hpp>
#include "Helpers.h"
namespace libVLCX
......
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