![]() |
VLC-Qt 0.8.0- (Different version)
|
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_MEDIALISTPLAYER_H_ 00020 #define VLCQT_MEDIALISTPLAYER_H_ 00021 00022 #include <QtCore/QObject> 00023 #include <QtCore/QString> 00024 00025 #include "Enums.h" 00026 #include "SharedExportCore.h" 00027 00028 class VlcInstance; 00029 class VlcMediaList; 00030 class VlcMediaPlayer; 00031 00032 struct libvlc_event_t; 00033 struct libvlc_event_manager_t; 00034 struct libvlc_media_t; 00035 struct libvlc_media_list_player_t; 00036 00045 class VLCQT_CORE_EXPORT VlcMediaListPlayer : public QObject 00046 { 00047 Q_OBJECT 00048 public: 00056 explicit VlcMediaListPlayer(VlcInstance *instance); 00057 00066 explicit VlcMediaListPlayer(VlcMediaPlayer *player, 00067 VlcInstance *instance); 00068 00072 ~VlcMediaListPlayer(); 00073 00078 libvlc_media_list_player_t *core(); 00079 00084 VlcMediaList *currentMediaList(); 00085 00090 VlcMediaPlayer *mediaPlayer(); 00091 00096 Vlc::PlaybackMode playbackMode() const; 00097 00102 void setMediaList(VlcMediaList *list); 00103 00108 void setPlaybackMode(const Vlc::PlaybackMode &mode); 00109 00110 00111 public slots: 00116 void itemAt(const int &index); 00117 00121 void next(); 00122 00126 void play(); 00127 00131 void previous(); 00132 00136 void stop(); 00137 00138 00139 signals: 00143 void played(); 00144 00149 void nextItemSet(libvlc_media_t *); 00150 00154 void stopped(); 00155 00156 00157 private: 00158 static void libvlc_callback(const libvlc_event_t *event, 00159 void *data); 00160 00161 void createCoreConnections(); 00162 void removeCoreConnections(); 00163 00164 libvlc_media_list_player_t *_vlcMediaListPlayer; 00165 libvlc_event_manager_t *_vlcEvents; 00166 00167 VlcMediaList *_list; 00168 VlcMediaPlayer *_player; 00169 00170 Vlc::PlaybackMode _mode; 00171 }; 00172 00173 #endif // VLCQT_MEDIALISTPLAYER_H_