Beispiel #1
0
void VlcMedia::initMedia(const QString &location,
                         const bool &localFile,
                         VlcInstance *instance)
{
    _currentLocation = location;
    QString l = location;
#if defined(Q_OS_WIN32)
    if (localFile)
        l.replace("/", "\\");
#endif

    // Create a new libvlc media descriptor from location
    if (localFile)
        _vlcMedia = libvlc_media_new_path(instance->core(), l.toLocal8Bit().data());
    else
        _vlcMedia = libvlc_media_new_location(instance->core(), l.toLocal8Bit().data());

    _vlcEvents = libvlc_media_event_manager(_vlcMedia);

    createCoreConnections();

    VlcError::errmsg();

    qDebug() << "libvlc" << "Media:" << location << "Local:" << localFile;
}
Beispiel #2
0
VlcMediaPlayer::VlcMediaPlayer(VlcInstance *instance)
    : QObject(instance)
{
    _vlcMediaPlayer = libvlc_media_player_new(instance->core());
    _vlcEvents = libvlc_media_player_event_manager(_vlcMediaPlayer);

    /* Disable mouse and keyboard events */
    libvlc_video_set_key_input(_vlcMediaPlayer, false);
    libvlc_video_set_mouse_input(_vlcMediaPlayer, false);

    VlcError::showErrmsg();

    _vlcAudio = new VlcAudio(this);
    _vlcVideo = new VlcVideo(this);
#if LIBVLC_VERSION >= 0x020200
    _vlcEqualizer = new VlcEqualizer(this);
#endif

    _videoWidget = 0;
    _media = 0;

    createCoreConnections();

    VlcError::showErrmsg();
}
Beispiel #3
0
VlcMediaList::VlcMediaList(VlcInstance *instance)
    : QObject(instance)
{
    _vlcMediaList = libvlc_media_list_new(instance->core());
    _vlcEvents = libvlc_media_list_event_manager(_vlcMediaList);

    createCoreConnections();

    VlcError::errmsg();
}
RadioPlayer::RadioPlayer()
{
    char ** args = NULL;
    _instance =  libvlc_new(0, args);
    libvlc_set_user_agent(_instance, "RadioPlayer Widget 0.1", "RadioPlayer/0.1");

    _mediaListPlayer = libvlc_media_list_player_new(_instance);
    createCoreConnections();

	_propagateEvents = true;
    qDebug() << "RadioPlayer: Crated.";
}
VlcMediaListPlayer::VlcMediaListPlayer(VlcInstance *instance)
    : QObject(instance),
      _list(0),
      _mode(Vlc::DefaultPlayback)
{
    _player = new VlcMediaPlayer(instance);

    _vlcMediaListPlayer = libvlc_media_list_player_new(instance->core());
    _vlcEvents = libvlc_media_list_player_event_manager(_vlcMediaListPlayer);
    libvlc_media_list_player_set_media_player(_vlcMediaListPlayer, _player->core());

    createCoreConnections();

    VlcError::errmsg();
}
Beispiel #6
0
void VlcMedia::initMedia(const QString &location,
                         bool localFile,
                         VlcInstance *instance)
{
    _currentLocation = location;
    QString l = location;
    if (localFile)
        l = QDir::toNativeSeparators(l);

    // Create a new libvlc media descriptor from location
    if (localFile)
        _vlcMedia = libvlc_media_new_path(instance->core(), l.toUtf8().data());
    else
        _vlcMedia = libvlc_media_new_location(instance->core(), l.toUtf8().data());

    _vlcEvents = libvlc_media_event_manager(_vlcMedia);

    createCoreConnections();

    VlcError::errmsg();

    qDebug() << "libvlc" << "Media:" << location << "Local:" << localFile;
}