MediaDiscoverer.hpp 2.65 KB
Newer Older
Hugo Beauzée-Luyssen's avatar
Hugo Beauzée-Luyssen committed
1 2 3 4 5 6
/*****************************************************************************
 * libvlc_MediaDiscoverer.hpp: MediaDiscoverer API
 *****************************************************************************
 * Copyright © 2014 the VideoLAN team
 *
 * Authors: Alexey Sokolov <alexey@alexeysokolov.co.cc>
Hugo Beauzée-Luyssen's avatar
Hugo Beauzée-Luyssen committed
7
 *          Hugo Beauzée-Luyssen <hugo@beauzee.fr>
Hugo Beauzée-Luyssen's avatar
Hugo Beauzée-Luyssen committed
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
 *
 * 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 2.1 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 program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
 *****************************************************************************/

#ifndef LIBVLC_CXX_MEDIADISCOVERER_H
#define LIBVLC_CXX_MEDIADISCOVERER_H

27
#include "common.hpp"
Hugo Beauzée-Luyssen's avatar
Hugo Beauzée-Luyssen committed
28
#include "Internal.hpp"
29
#include <string>
Hugo Beauzée-Luyssen's avatar
Hugo Beauzée-Luyssen committed
30

31
namespace VLC
Hugo Beauzée-Luyssen's avatar
Hugo Beauzée-Luyssen committed
32 33
{

34
class EventManager;
Hugo Beauzée-Luyssen's avatar
Hugo Beauzée-Luyssen committed
35

36
class VLCPP_API MediaDiscoverer : public Internal<libvlc_media_discoverer_t>
Hugo Beauzée-Luyssen's avatar
Hugo Beauzée-Luyssen committed
37 38 39 40 41 42 43 44 45 46 47
{
public:
    ~MediaDiscoverer();

    // libvlc_media_discoverer_new_from_name
    /**
     * Discover media service by name.
     *
     * \param p_inst  libvlc instance
     *
     * \param psz_name  service name
48 49
     * \warning This is returned as a pointer, as this is not refcounter by VLC, and is
     *          fairly expensive to instantiate.
Hugo Beauzée-Luyssen's avatar
Hugo Beauzée-Luyssen committed
50
     */
51
    MediaDiscoverer(Instance & inst, const std::string& name);
Hugo Beauzée-Luyssen's avatar
Hugo Beauzée-Luyssen committed
52 53 54 55 56 57 58 59 60 61 62 63 64

    /**
     * Get media service discover object its localized name.
     *
     * \return localized name
     */
    std::string localizedName();

    /**
     * Get event manager from media service discover object.
     *
     * \return event manager object.
     */
65
    EventManager& eventManager();
Hugo Beauzée-Luyssen's avatar
Hugo Beauzée-Luyssen committed
66 67 68 69 70 71 72 73 74

    /**
     * Query if media service discover object is running.
     *
     * \return true if running, false if not
     */
    bool isRunning();

private:
75
    explicit MediaDiscoverer(InternalPtr ptr);
Hugo Beauzée-Luyssen's avatar
Hugo Beauzée-Luyssen committed
76 77 78 79 80 81 82
    /**
     * Release media discover object. If the reference count reaches 0, then
     * the object will be released.
     */
    void release();

    MediaDiscoverer(const MediaDiscoverer& another);
83
    MediaDiscoverer& operator=(const MediaDiscoverer& another);
84 85 86

private:
    EventManager* m_eventManager;
Hugo Beauzée-Luyssen's avatar
Hugo Beauzée-Luyssen committed
87 88 89 90 91 92
};

} // namespace VLC

#endif