MediaLibrary.hpp 2.79 KB
Newer Older
Hugo Beauzée-Luyssen's avatar
Hugo Beauzée-Luyssen committed
1 2 3 4 5 6
/*****************************************************************************
 * libvlc_MediaLibrary.hpp: MediaLibrary API
 *****************************************************************************
 * Copyright © 2014 the VideoLAN team
 *
 * Authors: Alexey Sokolov <alexey@alexeysokolov.co.cc>
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_MEDIALIBRARY_H
#define LIBVLC_CXX_MEDIALIBRARY_H

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

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

33
class VLCPP_API MediaLibrary : public Internal<libvlc_media_library_t>
Hugo Beauzée-Luyssen's avatar
Hugo Beauzée-Luyssen committed
34 35
{
public:
36 37 38 39 40
    /**
     * Create an new Media Library object
     *
     * \param p_instance  the libvlc instance
     */
41
    MediaLibrary(Instance & p_instance);
Hugo Beauzée-Luyssen's avatar
Hugo Beauzée-Luyssen committed
42 43 44 45 46 47 48 49 50 51 52
    /**
     * Copy libvlc_media_library_t from another to new MediaLibrary object.
     * \param another existing MediaLibrary
     */
    MediaLibrary(const MediaLibrary& another);

    /**
     * Copy libvlc_media_library_t from another MediaLibrary
     * to this MediaLibrary
     * \param another existing MediaLibrary
     */
53
    MediaLibrary& operator=(const MediaLibrary& another);
Hugo Beauzée-Luyssen's avatar
Hugo Beauzée-Luyssen committed
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71

    /**
     * Check if 2 MediaLibrary objects contain the same libvlc_media_library_t.
     * \param another another MediaLibrary
     * \return true if they contain the same libvlc_media_library_t
     */
    bool operator==(const MediaLibrary& another) const;

    ~MediaLibrary();

    /**
     * Load media library.
     *
     * \return 0 on success, -1 on error
     */
    int load();

private:
72
    explicit MediaLibrary(InternalPtr ptr);
Hugo Beauzée-Luyssen's avatar
Hugo Beauzée-Luyssen committed
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91
    /**
     * Release media library object. This functions decrements the reference
     * count of the media library object. If it reaches 0, then the object
     * will be released.
     */
    void release();

    /**
     * Retain a reference to a media library object. This function will
     * increment the reference counting for this object. Use
     * MediaLibrary::release() to decrement the reference count.
     */
    void retain();
};

} // namespace VLC

#endif