playlistbrowseritem.h

来自「Amarok是一款在LINUX或其他类UNIX操作系统中运行的音频播放器软件。 」· C头文件 代码 · 共 638 行 · 第 1/2 页

H
638
字号
        void startAnimation();        void stopAnimation();        void updatePixmap();        QListViewItem *m_parent;           //podcast channel it belongs to        PodcastEpisodeBundle m_bundle;        KURL        m_localUrl;        bool        m_fetching;        QTimer      m_animationTimer;        uint        m_iconCounter;        KIO::StoredTransferJob* m_podcastEpisodeJob;        QString m_filename;        bool        m_downloaded;       //marked as downloaded in cached xml        bool        m_onDisk;};/// Stored in the databaseclass PodcastChannel : public PlaylistBrowserEntry{        Q_OBJECT    public:        PodcastChannel( QListViewItem *parent, QListViewItem *after, const KURL &url,                        const QDomNode &channelSettings );        PodcastChannel( QListViewItem *parent, QListViewItem *after, const KURL &url );        PodcastChannel( QListViewItem *parent, QListViewItem *after, const KURL &url,                        const QDomNode &channelSettings, const QDomDocument &xml );        PodcastChannel( QListViewItem *parent, QListViewItem *after, const PodcastChannelBundle &pcb );        enum MediaFetch{ STREAM=0, AUTOMATIC=1 };        void  setNew( const bool n = true );        bool  hasNew() const { return m_new; }        // iterate over all children and explicitly check if there are any episodes which have not been listened        // to.  Mark the channel as new/listened after doing this.        void  checkAndSetNew();        void  setListened( const bool n = true ); // over rides each child so it has been listened        void  setOpen( bool open ); // if !m_polished, load the children. Lazy loading to improve start times        void  load();        const bool isPolished() const { return m_polished; }        void  configure();        void  fetch();        void  rescan();        const KURL   &url()         const { return m_url; }        const KURL    link()        const { return m_bundle.link(); }        const QString title()       const { return m_bundle.title(); }        const QString description() const { return m_bundle.description(); }        const QString copyright()   const { return m_bundle.copyright(); }        const bool autoscan()     const { return m_bundle.autoscan(); }        const bool autotransfer() const { return m_bundle.autotransfer(); }        const int  fetchType()    const { return m_bundle.fetchType(); }        const bool hasPurge()     const { return m_bundle.hasPurge(); }        const int  purgeCount()   const { return m_bundle.purgeCount(); }        const QString &saveLocation() const { return m_bundle.saveLocation(); }        PodcastSettings *getSettings() const        {            return new PodcastSettings( title(), saveLocation(),                                        autoscan(), fetchType(), autotransfer(),                                        hasPurge(), purgeCount() );        }        void setParent( PlaylistCategory *newParent );        void setSettings( PodcastSettings *settings );        void setXml( const QDomNode &xml, const int feedType );        virtual void  updateInfo();        int rtti() const { return RTTI; }        static const int RTTI = 1006;              //podcastchannel    public slots:        virtual void slotDoubleClicked();        virtual void slotRenameItem() { /* Do nothing */ };        virtual void showContextMenu( const QPoint & );    private slots:        void abortFetch();        void downloadChildQueue();        void fetchResult( KIO::Job* job );        void slotAnimation();    private:        enum FeedType{ RSS=0, ATOM=1 };        static const int EPISODE_LIMIT = 10; //Maximum number of episodes initially shown        bool containsItem( QDomElement xml );        void downloadChildren();        const bool episodeExists( const QDomNode &xml, const int feedType );        void purge();        void restorePurged();        void removeChildren();        void setDOMSettings( const QDomNode &channelSettings );        void startAnimation();        void stopAnimation();        PodcastChannelBundle     m_bundle;        /// loading all of the podcast episodes during startup can be very inefficient.        /// When the user expands the podcast for the first time, we load up the episodes.        bool                     m_polished;        KURL                     m_url;            //remote xml url        bool                     m_fetching;        bool                     m_updating;        QTimer                   m_animationTimer;        uint                     m_iconCounter;        bool                     m_new;        bool                     m_hasProblem;        KIO::TransferJob        *m_podcastJob;        PlaylistCategory        *m_parent;        // category it belongs to        QString                  m_podcastCurrentUrl;        QPtrList<PodcastEpisode> m_podcastDownloadQueue;        bool                     m_settingsValid;};class StreamEntry : public PlaylistBrowserEntry{    Q_OBJECT    public:        StreamEntry( QListViewItem *parent, QListViewItem *after, const KURL &, const QString &t );        StreamEntry( QListViewItem *parent, QListViewItem *after, const QDomElement &xmlDefinition );        ~StreamEntry() { };        void  setURL  ( KURL u )    { m_url = u; }        void  setTitle( QString t ) { m_title = t; }        void  setup();        void  paintCell( QPainter*, const QColorGroup&, int, int, int );        const KURL    &url()   const { return m_url; }        const QString &title() const { return m_title; }        virtual QDomElement xml() const;        virtual void updateInfo();        int    rtti() const { return RTTI; }        static const int RTTI = 1003;    //stream item    public slots:        virtual void slotDoubleClicked();        virtual void showContextMenu( const QPoint & );    protected:        QString m_title;        KURL    m_url;};class LastFmEntry : public StreamEntry{    Q_OBJECT    public:        LastFmEntry( QListViewItem *parent, QListViewItem *after, const KURL &u, const QString &t )            : StreamEntry( parent, after, u, t ) { }        LastFmEntry( QListViewItem *parent, QListViewItem *after, const QDomElement &xmlDefinition )            : StreamEntry( parent, after, xmlDefinition ) { }        virtual QDomElement xml() const;    public slots:        virtual void slotRenameItem() { /* Do nothing */ }    public:        int    rtti() const { return RTTI; }        static const int RTTI = 1008;    //lastfm item};class StreamEditor : public KDialogBase{    public:        StreamEditor( QWidget *parent, const QString &title, const QString &url, bool readonly = false );        KURL    url()  const { return KURL( m_urlLineEdit->text() ); }        QString name() const { return m_nameLineEdit->text().replace( "\n", " " ); }    private:        KLineEdit *m_urlLineEdit;        KLineEdit *m_nameLineEdit;};class SmartPlaylist : public PlaylistBrowserEntry{    Q_OBJECT    public:        SmartPlaylist( QListViewItem *parent, QListViewItem *after, const QString &name, const QString &query );        SmartPlaylist( QListViewItem *parent, QListViewItem *after, const QString &name,                         const QString &urls, const QString &tags );        SmartPlaylist( QListViewItem *parent, QListViewItem *after, const QDomElement &xmlDefinition );        bool        isDynamic()     const { return m_dynamic; }        bool        isEditable()    const { return !m_xml.isNull(); }        bool        isTimeOrdered(); //returns yes if the ordering is based on a time attribute        QString     query();        QString     title()         const { return m_title; }        virtual QDomElement xml()   const { return m_xml;   }        int   length();        void  setDynamic( bool );        void  setXml( const QDomElement &xml );        int   rtti() const { return RTTI; }        static const int RTTI = 1004;    //smart playlist item    public slots:        virtual void slotDoubleClicked();        virtual void slotPostRenameItem( const QString newName );        virtual void showContextMenu( const QPoint & );    private:        // for xml playlists, this member is computed on demand        QString         m_sqlForTags;        QString         m_title;        QDomElement     m_xml;        QListViewItem  *m_after;        bool            m_dynamic;        // Build the query for a given xml object. If \p for expand is true,        // insert (*ExpandString*) as placeholders for childrens' filters        static QString xmlToQuery( const QDomElement &xml, bool forExpand = false );};//this class is used to store information of a playlist trackclass TrackItemInfo{    public:        TrackItemInfo( const MetaBundle &mb );        ~TrackItemInfo() {}        const KURL    &url()    const { return m_url;    }        const QString &album()  const { return m_album; }        const QString &artist() const { return m_artist;  }        const QString &title()  const { return m_title;  }        const int     length()  const { return m_length; }    private:        KURL    m_url;        QString m_artist;        QString m_album;        QString m_title;        int     m_length;};/*!    @brief Implement a shoutcast playlist category    On open, download the shoutcast genre XML file.    Process the file and add each genre as a ShoutcastGenre    style PlaylistCategory*/class ShoutcastBrowser : public PlaylistCategory{        Q_OBJECT    public:        ShoutcastBrowser( PlaylistCategory* parent );        void setOpen( bool open );    public slots:        virtual void slotDoubleClicked();    private slots:        void doneGenreDownload( KIO::Job *job, const KURL &from, const KURL &to, bool directory, bool renamed );        void jobFinished( KIO::Job *job );        void slotAnimation();    private:        bool          m_downloading;        KIO::CopyJob *m_cj;        QPixmap      *m_loading1, *m_loading2;    //icons for loading animation        QTimer        m_animationTimer;};/*!    @brief Implement a shoutcast genre category    On open, download the shoutcast station list XML file.    Process the file and add each station as a StreamEntry*/class ShoutcastGenre : public PlaylistCategory{        Q_OBJECT    public:        ShoutcastGenre( ShoutcastBrowser *browser, QListViewItem *after, QString genre );        void setOpen( bool open );        void appendAlternateGenre( QString alternateGenre ) { m_alternateGenres << alternateGenre; }    public slots:        virtual void slotDoubleClicked();    private slots:        void doneListDownload( KIO::Job *job, const KURL &from, const KURL &to, bool directory, bool renamed );        void jobFinished( KIO::Job *job );        void slotAnimation();    private:        void          startGenreDownload( QString genre, QString tmppath );        bool          m_downloading;        QString       m_genre;        QPixmap      *m_loading1, *m_loading2;    //icons for loading animation        QTimer        m_animationTimer;        QStringList   m_alternateGenres;        QStringList   m_stations;        int           m_totalJobs;        int           m_completedJobs;};#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?