libvlc_MediaList.cpp 4.05 KB
Newer Older
Hugo Beauzée-Luyssen's avatar
Hugo Beauzée-Luyssen committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177
/*****************************************************************************
 * libvlc_MediaList.cpp: MediaList implementation
 *****************************************************************************
 * Copyright © 2014 the VideoLAN team
 *
 * Authors: Alexey Sokolov <alexey@alexeysokolov.co.cc>
 *
 * 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.
 *****************************************************************************/

/* This file is autogenerated */


#include <vlc.hpp>

namespace VLC {

MediaList::MediaList(const MediaList& another) 
{
    m_obj = another.m_obj;
    retain();
}

const MediaList& MediaList::operator=(const MediaList& another) 
{
    if (this == &another) 
    {
        return *this;
    }
    release();
    m_obj = another.m_obj;
    retain();
    return *this;
}

bool MediaList::operator==(const MediaList& another) const 
{
    return m_obj == another.m_obj;
}

MediaList::~MediaList() 
{
    release();
}


MediaList::MediaList(Media & p_md) 
{
    m_obj = libvlc_media_subitems(p_md.get_c_object());
    if (!m_obj) 
    {
        throw Exception("Can't construct MediaList");
    }
}

MediaList::MediaList(MediaDiscoverer & p_mdis) 
{
    m_obj = libvlc_media_discoverer_media_list(p_mdis.get_c_object());
    if (!m_obj) 
    {
        throw Exception("Can't construct MediaList");
    }
}

MediaList::MediaList(MediaLibrary & p_mlib) 
{
    m_obj = libvlc_media_library_media_list(p_mlib.get_c_object());
    if (!m_obj) 
    {
        throw Exception("Can't construct MediaList");
    }
}

MediaList::MediaList(Instance & p_instance) 
{
    m_obj = libvlc_media_list_new(p_instance.get_c_object());
    if (!m_obj) 
    {
        throw Exception("Can't construct MediaList");
    }
}

void MediaList::setMedia(Media & p_md) 
{
    libvlc_media_list_set_media(m_obj, p_md.get_c_object());
}

int MediaList::addMedia(Media & p_md) 
{
    int c_result = libvlc_media_list_add_media(m_obj, p_md.get_c_object());
    int result = c_result;
    return result;
}

int MediaList::insertMedia(Media & p_md, int i_pos) 
{
    int c_result = libvlc_media_list_insert_media(m_obj, p_md.get_c_object(), i_pos);
    int result = c_result;
    return result;
}

int MediaList::removeIndex(int i_pos) 
{
    int c_result = libvlc_media_list_remove_index(m_obj, i_pos);
    int result = c_result;
    return result;
}

int MediaList::count() 
{
    int c_result = libvlc_media_list_count(m_obj);
    int result = c_result;
    return result;
}

Media MediaList::itemAtIndex(int i_pos) 
{
    libvlc_media_t * c_result = libvlc_media_list_item_at_index(m_obj, i_pos);
    Media result = c_result;
    return result;
}

int MediaList::indexOfItem(Media & p_md) 
{
    int c_result = libvlc_media_list_index_of_item(m_obj, p_md.get_c_object());
    int result = c_result;
    return result;
}

bool MediaList::isReadonly() 
{
    int c_result = libvlc_media_list_is_readonly(m_obj);
    bool result = c_result;
    return result;
}

void MediaList::lock() 
{
    libvlc_media_list_lock(m_obj);
}

void MediaList::unlock() 
{
    libvlc_media_list_unlock(m_obj);
}

libvlc_event_manager_t * MediaList::eventManager() 
{
    libvlc_event_manager_t * c_result = libvlc_media_list_event_manager(m_obj);
    libvlc_event_manager_t * result = c_result;
    return result;
}

void MediaList::release() 
{
    libvlc_media_list_release(m_obj);
}

void MediaList::retain() 
{
    libvlc_media_list_retain(m_obj);
}

} // namespace VLC