VLC-Qt 0.8.0- (Different version)
MediaList.h
00001 /****************************************************************************
00002 * VLC-Qt - Qt and libvlc connector library
00003 * Copyright (C) 2012 Tadej Novak <tadej@tano.si>
00004 *
00005 * This library is free software: you can redistribute it and/or modify
00006 * it under the terms of the GNU Lesser General Public License as published
00007 * by the Free Software Foundation, either version 3 of the License, or
00008 * (at your option) any later version.
00009 *
00010 * This library is distributed in the hope that it will be useful,
00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00013 * GNU Lesser General Public License for more details.
00014 *
00015 * You should have received a copy of the GNU Lesser General Public License
00016 * along with this library. If not, see <http://www.gnu.org/licenses/>.
00017 *****************************************************************************/
00018 
00019 #ifndef VLCQT_MEDIALIST_H_
00020 #define VLCQT_MEDIALIST_H_
00021 
00022 #include <QtCore/QObject>
00023 #include <QtCore/QString>
00024 #include <QtCore/QUrl>
00025 
00026 #include "Enums.h"
00027 #include "SharedExportCore.h"
00028 
00029 class VlcInstance;
00030 class VlcMedia;
00031 
00032 struct libvlc_event_t;
00033 struct libvlc_event_manager_t;
00034 struct libvlc_media_t;
00035 struct libvlc_media_list_t;
00036 
00043 class VLCQT_CORE_EXPORT VlcMediaList : public QObject
00044 {
00045 Q_OBJECT
00046 public:
00054     explicit VlcMediaList(VlcInstance *instance);
00055 
00059     ~VlcMediaList();
00060 
00065     libvlc_media_list_t *core();
00066 
00071     void addMedia(VlcMedia *media);
00072 
00078     VlcMedia *at(const int &index);
00079 
00084     int count();
00085 
00091     int indexOf(VlcMedia *media);
00092 
00098     int indexOf(libvlc_media_t *media);
00099 
00105     void insertMedia(VlcMedia *media,
00106                      const int &index);
00107 
00112     void removeMedia(const int &index);
00113 
00114 
00115 signals:
00121     void itemAdded(libvlc_media_t *,
00122                    const int &);
00123 
00129     void willAddItem(libvlc_media_t *,
00130                      const int &);
00131 
00137     void itemDeleted(libvlc_media_t *,
00138                      const int &);
00139 
00145     void willDeleteItem(libvlc_media_t *,
00146                         const int &);
00147 
00148 
00149 private:
00150     void lock();
00151     void unlock();
00152 
00153     static void libvlc_callback(const libvlc_event_t *event,
00154                                 void *data);
00155 
00156     void createCoreConnections();
00157     void removeCoreConnections();
00158 
00159     libvlc_media_list_t * _vlcMediaList;
00160     libvlc_event_manager_t *_vlcEvents;
00161 
00162     QList<VlcMedia *> _list;
00163 };
00164 
00165 #endif // VLCQT_MEDIALIST_H_
 All Classes Namespaces Functions Enumerations