![]() |
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_MEDIA_H_ 00020 #define VLCQT_MEDIA_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 00031 struct libvlc_event_t; 00032 struct libvlc_event_manager_t; 00033 struct libvlc_media_t; 00034 00042 class VLCQT_CORE_EXPORT VlcMedia : public QObject 00043 { 00044 Q_OBJECT 00045 public: 00055 explicit VlcMedia(const QString &location, 00056 const bool &localFile, 00057 VlcInstance *instance); 00058 00068 explicit VlcMedia(const QString &location, 00069 VlcInstance *instance); 00070 00078 VlcMedia(libvlc_media_t *media); 00079 00083 ~VlcMedia(); 00084 00089 libvlc_media_t *core(); 00090 00096 QString currentLocation() const; 00097 00109 QString duplicate(const QString &name, 00110 const QString &path, 00111 const Vlc::Mux &mux); 00112 00126 QString duplicate(const QString &name, 00127 const QString &path, 00128 const Vlc::Mux &mux, 00129 const Vlc::AudioCodec &audioCodec, 00130 const Vlc::VideoCodec &videoCodec); 00131 00149 QString duplicate(const QString &name, 00150 const QString &path, 00151 const Vlc::Mux &mux, 00152 const Vlc::AudioCodec &audioCodec, 00153 const Vlc::VideoCodec &videoCodec, 00154 const int &bitrate, 00155 const int &fps, 00156 const int &scale); 00157 00158 00169 QString merge(const QString &name, 00170 const QString &path, 00171 const Vlc::Mux &mux); 00172 00184 QString record(const QString &name, 00185 const QString &path, 00186 const Vlc::Mux &mux, 00187 const bool &duplicate = false); 00188 00202 QString record(const QString &name, 00203 const QString &path, 00204 const Vlc::Mux &mux, 00205 const Vlc::AudioCodec &audioCodec, 00206 const Vlc::VideoCodec &videoCodec, 00207 const bool &duplicate = false); 00208 00226 QString record(const QString &name, 00227 const QString &path, 00228 const Vlc::Mux &mux, 00229 const Vlc::AudioCodec &audioCodec, 00230 const Vlc::VideoCodec &videoCodec, 00231 const int &bitrate, 00232 const int &fps, 00233 const int &scale, 00234 const bool &duplicate = false); 00235 00240 void setOption(const QString &option); 00241 00246 void setOptions(const QStringList &options); 00247 00252 Vlc::TrackType trackType(); 00253 00254 00255 signals: 00260 void metaChanged(const Vlc::Meta &); 00261 00266 void subitemAdded(libvlc_media_t *); 00267 00272 void durationChanged(const int &); 00273 00278 void parsedChanged(const int &); 00279 00284 void freed(libvlc_media_t *); 00285 00290 void stateChanged(const Vlc::State &); 00291 00292 00293 private: 00294 void initMedia(const QString &location, 00295 const bool &localFile, 00296 VlcInstance *instance); 00297 00298 static void libvlc_callback(const libvlc_event_t *event, 00299 void *data); 00300 00301 void createCoreConnections(); 00302 void removeCoreConnections(); 00303 00304 libvlc_media_t * _vlcMedia; 00305 libvlc_event_manager_t *_vlcEvents; 00306 00307 QString _currentLocation; 00308 }; 00309 00310 #endif // VLCQT_MEDIA_H_