File indexing completed on 2024-05-05 04:59:18

0001 /*
0002     This file is part of the KDE project
0003     Copyright (C) 2011 Ernesto Rodriguez Ortiz <eortiz@uci.cu>
0004 
0005     This program is free software: you can redistribute it and/or modify
0006     it under the terms of the GNU General Public License as published by
0007     the Free Software Foundation, either version 3 of the License, or
0008     (at your option) any later version.
0009 
0010     This program is distributed in the hope that it will be useful,
0011     but WITHOUT ANY WARRANTY; without even the implied warranty of
0012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0013     GNU General Public License for more details.
0014 
0015     You should have received a copy of the GNU General Public License
0016     along with this program.  If not, see <http://www.gnu.org/licenses/>.
0017 
0018 */
0019 
0020 #ifndef MMSTHREAD_HPP
0021 #define MMSTHREAD_HPP
0022 #include <QFile>
0023 #include <QMutex>
0024 #include <QThread>
0025 #include <libmms/mmsx.h>
0026 
0027 using namespace std;
0028 
0029 class MmsThread : public QThread
0030 {
0031     Q_OBJECT
0032 public:
0033     MmsThread(const QString &url, const QString &name, int begin, int end);
0034     void run() override;
0035     void stop();
0036 
0037 private:
0038     QString m_sourceUrl;
0039     QString m_fileName;
0040     int m_begin;
0041     int m_end;
0042     QMutex m_locker;
0043     bool m_download;
0044 
0045 Q_SIGNALS:
0046     void signReading(int data, int m_end, int m_begin);
0047     void signIsConnected(bool connected);
0048 };
0049 
0050 #endif // MMSTHREAD_HPP