<commit_before>/*****************************************************************************
 * VLC backend for the Phonon library                                        *
 * Copyright (C) 2007-2008 <NAME> <<EMAIL>>               *
 * Copyright (C) 2008 <NAME> <<EMAIL>>                *
 * Copyright (C) 2009 <NAME> <<EMAIL>>                            *
 *                                                                           *
 * This program is free software; you can redistribute it and/or             *
 * modify it under the terms of the GNU Lesser General Public                *
 * License as published by the Free Software Foundation; either              *
 * version 3 of the License, or (at your option) any later version.          *
 *                                                                           *
 * This program is distributed in the hope that it will be useful,           *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of            *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU         *
 * Lesser General Public License for more details.                           *
 *                                                                           *
 * You should have received a copy of the GNU Lesser General Public          *
 * License along with this package; if not, write to the Free Software       *
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA *
 *****************************************************************************/

#ifndef PHONON_VLC_VLCMEDIAOBJECT_H
#define PHONON_VLC_VLCMEDIAOBJECT_H

#include "vlcmediacontroller.h"

#include "mediaobject.h"

#include <phonon/mediaobjectinterface.h>
#include <phonon/addoninterface.h>

#include <QtCore/QObject>
#include <QtCore/QString>
#include <QtCore/QMultiMap>

namespace Phonon
{
namespace VLC {

/**
 * VLC MediaObject.
 *
 * This is the "brain" of the VLC backend.
 * VLCMediaObject uses libvlc in order to send commands and receive events from the VLC.
 *
 * Encapsulates VLC specific code.
 * Take care of libvlc events via libvlc_callback()
 *
 * @see MediaObject
 */
class VLCMediaObject : public MediaObject, public VLCMediaController
{
    Q_OBJECT
    Q_INTERFACES(Phonon::MediaObjectInterface  Phonon::AddonInterface)
    friend class SinkNode;

public:

    VLCMediaObject(QObject * parent);
    ~VLCMediaObject();

    void pause();
    void stop();

    bool hasVideo() const;
    bool isSeekable() const;

    qint64 totalTime() const;

    QString errorString() const;

signals:

    // MediaController signals
    void availableSubtitlesChanged();
    void availableAudioChannelsChanged();

//    void availableChaptersChanged();
//    void availableTitlesChanged();
    void availableChaptersChanged(int);
    void availableTitlesChanged(int);

    void availableAnglesChanged(int availableAngles);
    void angleChanged(int angleNumber);
    void chapterChanged(int chapterNumber);
    void titleChanged(int titleNumber);
    void metaDataNeedsRefresh();

    /**
     * New widget size computed by VLC.
     *
     * It should be applied to the widget that contains the VLC video.
     */
    void videoWidgetSizeChanged(int i_width, int i_height);

protected:

    void loadMediaInternal(const QString & filename);
    void playInternal();
    void seekInternal(qint64 milliseconds);

    qint64 currentTimeInternal() const;

private:

    /**
     * Connect libvlc_callback() to all vlc events.
     *
     * @see libvlc_callback()
     */
    void connectToMediaVLCEvents();
    void connectToPlayerVLCEvents();

    /**
     * Retrieve meta data of a file (i.e ARTIST, TITLE, ALBUM, etc...).
     */
    void updateMetaData();

    /**
     * Libvlc callback.
     *
     * Receive all vlc events.
     *
     * Warning: owned by libvlc thread.
     *
     * @see connectToAllVLCEvents()
     * @see libvlc_event_attach()
     */
    static void libvlc_callback(const libvlc_event_t *p_event, void *p_user_data);

    void unloadMedia();

    void setVLCWidgetId();

    // MediaPlayer
//    libvlc_media_player_t * p_vlc_media_player;
    libvlc_event_manager_t * p_vlc_media_player_event_manager;

    // Media
    libvlc_media_t * p_vlc_media;
    libvlc_event_manager_t * p_vlc_media_event_manager;

    // MediaDiscoverer
    libvlc_media_discoverer_t * p_vlc_media_discoverer;
    libvlc_event_manager_t * p_vlc_media_discoverer_event_manager;

    qint64 i_total_time;
    QString p_current_file;

    bool b_has_video;

    bool b_seekable;
};

}
} // Namespace Phonon::VLC

#endif
<commit_msg>Fix slot mis-specification<commit_after>/*****************************************************************************
 * VLC backend for the Phonon library                                        *
 * Copyright (C) 2007-2008 <NAME> <<EMAIL>>               *
 * Copyright (C) 2008 <NAME> <<EMAIL>>                *
 * Copyright (C) 2009 <NAME> <<EMAIL>>                            *
 *                                                                           *
 * This program is free software; you can redistribute it and/or             *
 * modify it under the terms of the GNU Lesser General Public                *
 * License as published by the Free Software Foundation; either              *
 * version 3 of the License, or (at your option) any later version.          *
 *                                                                           *
 * This program is distributed in the hope that it will be useful,           *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of            *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU         *
 * Lesser General Public License for more details.                           *
 *                                                                           *
 * You should have received a copy of the GNU Lesser General Public          *
 * License along with this package; if not, write to the Free Software       *
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA *
 *****************************************************************************/

#ifndef PHONON_VLC_VLCMEDIAOBJECT_H
#define PHONON_VLC_VLCMEDIAOBJECT_H

#include "vlcmediacontroller.h"

#include "mediaobject.h"

#include <phonon/mediaobjectinterface.h>
#include <phonon/addoninterface.h>

#include <QtCore/QObject>
#include <QtCore/QString>
#include <QtCore/QMultiMap>

namespace Phonon
{
namespace VLC {

/**
 * VLC MediaObject.
 *
 * This is the "brain" of the VLC backend.
 * VLCMediaObject uses libvlc in order to send commands and receive events from the VLC.
 *
 * Encapsulates VLC specific code.
 * Take care of libvlc events via libvlc_callback()
 *
 * @see MediaObject
 */
class VLCMediaObject : public MediaObject, public VLCMediaController
{
    Q_OBJECT
    Q_INTERFACES(Phonon::MediaObjectInterface  Phonon::AddonInterface)
    friend class SinkNode;

public:

    VLCMediaObject(QObject * parent);
    ~VLCMediaObject();

    void pause();
    void stop();

    bool hasVideo() const;
    bool isSeekable() const;

    qint64 totalTime() const;

    QString errorString() const;

signals:

    // MediaController signals
    void availableSubtitlesChanged();
    void availableAudioChannelsChanged();

//    void availableChaptersChanged();
//    void availableTitlesChanged();
    void availableChaptersChanged(int);
    void availableTitlesChanged(int);

    void availableAnglesChanged(int availableAngles);
    void angleChanged(int angleNumber);
    void chapterChanged(int chapterNumber);
    void titleChanged(int titleNumber);
    void metaDataNeedsRefresh();

    /**
     * New widget size computed by VLC.
     *
     * It should be applied to the widget that contains the VLC video.
     */
    void videoWidgetSizeChanged(int i_width, int i_height);

protected:

    void loadMediaInternal(const QString & filename);
    void playInternal();
    void seekInternal(qint64 milliseconds);

    qint64 currentTimeInternal() const;

private slots:
    /**
    * Retrieve meta data of a file (i.e ARTIST, TITLE, ALBUM, etc...).
    */
    void updateMetaData();

private:

    /**
     * Connect libvlc_callback() to all vlc events.
     *
     * @see libvlc_callback()
     */
    void connectToMediaVLCEvents();
    void connectToPlayerVLCEvents();

    /**
     * Libvlc callback.
     *
     * Receive all vlc events.
     *
     * Warning: owned by libvlc thread.
     *
     * @see connectToAllVLCEvents()
     * @see libvlc_event_attach()
     */
    static void libvlc_callback(const libvlc_event_t *p_event, void *p_user_data);

    void unloadMedia();

    void setVLCWidgetId();

    // MediaPlayer
//    libvlc_media_player_t * p_vlc_media_player;
    libvlc_event_manager_t * p_vlc_media_player_event_manager;

    // Media
    libvlc_media_t * p_vlc_media;
    libvlc_event_manager_t * p_vlc_media_event_manager;

    // MediaDiscoverer
    libvlc_media_discoverer_t * p_vlc_media_discoverer;
    libvlc_event_manager_t * p_vlc_media_discoverer_event_manager;

    qint64 i_total_time;
    QString p_current_file;

    bool b_has_video;

    bool b_seekable;
};

}
} // Namespace Phonon::VLC

#endif

{'fraction_non_alphanumeric': 0.11082194751680763, 'fraction_numerical': 0.007807417046193884, 'mean_word_length': 2.4777526395173455, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 31, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 20, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7109895', 'n_tokens_mistral': 2680, 'n_tokens_neox': 2544, 'n_words': 748}