aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/Input/flac/flacmetadatamodel.cpp
Commit message (Collapse)AuthorAgeFilesLines
* removed Q_OBJECT from MetaDataModeltrialuser022018-09-141-1/+1
| | | | git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@8289 90c681e8-e032-0410-971d-27865f9a5e38
* changed TagModel apitrialuser022018-08-051-2/+2
| | | | git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@8230 90c681e8-e032-0410-971d-27865f9a5e38
* fixed remaing pluginstrialuser022018-08-051-32/+16
| | | | git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@8229 90c681e8-e032-0410-971d-27865f9a5e38
* copy 1.2 branch to trunktrialuser022017-11-251-12/+9
| | | | git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@7772 90c681e8-e032-0410-971d-27865f9a5e38
* changed contact informationtrialuser022017-10-071-1/+1
| | | | git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@7514 90c681e8-e032-0410-971d-27865f9a5e38
* improved cover cachetrialuser022016-10-061-5/+3
| | | | git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@6773 90c681e8-e032-0410-971d-27865f9a5e38
* flac: fixed windows supporttrialuser022016-04-261-44/+34
| | | | git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@6268 90c681e8-e032-0410-971d-27865f9a5e38
* fixed previous committrialuser022016-04-251-3/+3
| | | | git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@6267 90c681e8-e032-0410-971d-27865f9a5e38
* fixed QString to TagLib::FileName conversion (#852)trialuser022016-04-251-2/+2
| | | | git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@6266 90c681e8-e032-0410-971d-27865f9a5e38
* removed useless codetrialuser022015-05-011-4/+0
| | | | git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@4886 90c681e8-e032-0410-971d-27865f9a5e38
* added 'album artist' field support (patch by Dmitry Misharov)trialuser022014-09-221-0/+10
| | | | git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@4509 90c681e8-e032-0410-971d-27865f9a5e38
* fixed case-sensitive bug again (Thanks to Ryota Shimamoto)(Fixes issue 628)trialuser022013-12-241-2/+2
| | | | git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@3981 90c681e8-e032-0410-971d-27865f9a5e38
* fixed case sensitivitytrialuser022013-10-151-2/+2
| | | | git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@3788 90c681e8-e032-0410-971d-27865f9a5e38
* fixed FSF headerstrialuser022012-07-311-1/+1
| | | | git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@2845 90c681e8-e032-0410-971d-27865f9a5e38
* fixed FSF address (trunk)trialuser022012-07-311-1/+1
| | | | git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@2844 90c681e8-e032-0410-971d-27865f9a5e38
* flac/wavpack plugin: fixed windows supporttrialuser022012-01-281-5/+3
| | | | git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@2571 90c681e8-e032-0410-971d-27865f9a5e38
* updated copyrightstrialuser022012-01-231-1/+1
| | | | git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@2563 90c681e8-e032-0410-971d-27865f9a5e38
* added win32 patchestrialuser022012-01-171-2/+2
| | | | git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@2537 90c681e8-e032-0410-971d-27865f9a5e38
* cue parser: fixed problem with paths which contains colontrialuser022011-02-011-0/+1
| | | | git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@2032 90c681e8-e032-0410-971d-27865f9a5e38
* removed obsolete memberstrialuser022010-03-111-3/+3
| | | | git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@1619 90c681e8-e032-0410-971d-27865f9a5e38
* added ogg flac supporttrialuser022010-02-161-13/+53
| | | | git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@1558 90c681e8-e032-0410-971d-27865f9a5e38
* flac plugin: added support for picture blocktrialuser022010-01-011-1/+16
| | | | git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@1464 90c681e8-e032-0410-971d-27865f9a5e38
* fixed problems with embedded cue, updated translation filestrialuser022009-10-201-2/+28
| | | | git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@1334 90c681e8-e032-0410-971d-27865f9a5e38
* enabled flac plugintrialuser022009-09-221-0/+155
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@1246 90c681e8-e032-0410-971d-27865f9a5e38
ialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> 2007-08-21 19:13:47 +0000 committer trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> 2007-08-21 19:13:47 +0000 added shoutcast title update' href='/qmmp/commit/lib/downloader.h?id=ed3828f0df1bcef66b036ce1831a0aed87ed5482'>ed3828f0d
c2a2cbd07
8d949130a




c6d40b3e6

8d949130a
3df482395

d14349242
c6d40b3e6

8d949130a
c6d40b3e6
3df482395
ed3828f0d
d80498e56
8beff974f
e394c172c

8d949130a
d14349242


8d949130a
c6d40b3e6
8d949130a





c6d40b3e6
8d949130a


c6d40b3e6


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
                                                                            
                                                                            














                                                                            
                                                                            
                                                                             

                          
 


                    
                 
                  
                
                  
                      


                 
 
                 

                     
 


                                               
                     

              
                  

                         
                                    

                       
  
 
             
                                               
   
                                         
 
            
       
                                                              
 
                                
 












                                   
                          


                             
                       
               

        
                 




                                          

        
                 

                                                 
                                                   

                   
                            
                  
                    
                    
                 
                     

                        
                             


                            
  
 





                                             
 


                               


      
/***************************************************************************
 *   Copyright (C) 2006-2012 by Ilya Kotov                                 *
 *   forkotov02@hotmail.ru                                                 *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 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 General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU 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.         *
 ***************************************************************************/
#ifndef HTTPSTREAMREADER_H
#define HTTPSTREAMREADER_H

#include <QObject>
#include <QIODevice>
#include <QUrl>
#include <QMutex>
#include <QString>
#include <QHash>
#include <QThread>
#include <curl/curl.h>
#ifdef WITH_ENCA
#include <enca.h>
#endif

class QTextCodec;
class QFileInfo;
class DownloadThread;

/*! @internal
 *   @author Ilya Kotov <forkotov02@hotmail.ru>
 */
struct HttpStreamData
{
    char *buf;
    long buf_fill;
    QString content_type;
    bool aborted;
    QHash <QString, QString> header;
    bool icy_meta_data;
    int icy_metaint;
};

/*! @internal
 *   @author Ilya Kotov <forkotov02@hotmail.ru>
 */
class HttpStreamReader : public QIODevice
{
    Q_OBJECT
public:
    HttpStreamReader(const QString &url, QObject *parent = 0);

    virtual ~HttpStreamReader();

    /**
     *  QIODevice API
     */
    bool atEnd () const;
    qint64 bytesAvailable () const;
    qint64 bytesToWrite () const;
    void close ();
    bool isSequential () const;
    bool open (OpenMode mode);
    bool seek (qint64 pos);
    /**
     *  helper functions
     */
    QString contentType();
    void downloadFile();
    QMutex *mutex();
    HttpStreamData *stream();
    void checkBuffer();
    void run();

signals:
    void ready();
    void error();

protected:
    qint64 readData(char*, qint64);
    qint64 writeData(const char*, qint64);

private:
    void abort();
    qint64 readBuffer(char* data, qint64 maxlen);
    void readICYMetaData();
    void parseICYMetaData(char *data, qint64 size);
    CURL *m_handle;
    QMutex m_mutex;
    HttpStreamData m_stream;
    QString m_url;
    int m_metacount;
    QString m_title;
    bool m_ready;
    bool m_meta_sent;
    long m_buffer_size;
    QTextCodec *m_codec;
    DownloadThread *m_thread;
#ifdef WITH_ENCA
    EncaAnalyser m_analyser;
#endif
};

class DownloadThread : public QThread
{
    Q_OBJECT
public:
    DownloadThread(HttpStreamReader *parent);
    virtual ~DownloadThread ();

private:
    virtual void run();
    HttpStreamReader *m_parent;
};

#endif