File indexing completed on 2025-01-19 04:24:39

0001 /****************************************************************************************
0002  * Copyright (c) 2007 Maximilian Kossick <maximilian.kossick@googlemail.com>            *
0003  *                                                                                      *
0004  * This program is free software; you can redistribute it and/or modify it under        *
0005  * the terms of the GNU General Public License as published by the Free Software        *
0006  * Foundation; either version 2 of the License, or (at your option) any later           *
0007  * version.                                                                             *
0008  *                                                                                      *
0009  * This program is distributed in the hope that it will be useful, but WITHOUT ANY      *
0010  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A      *
0011  * PARTICULAR PURPOSE. See the GNU General Public License for more details.             *
0012  *                                                                                      *
0013  * You should have received a copy of the GNU General Public License along with         *
0014  * this program.  If not, see <http://www.gnu.org/licenses/>.                           *
0015  ****************************************************************************************/
0016 
0017 #ifndef AMAROK_STREAM_H
0018 #define AMAROK_STREAM_H
0019 
0020 #include "amarok_export.h"
0021 #include "core/meta/Meta.h"
0022 
0023 namespace MetaStream
0024 {
0025     class AMAROK_EXPORT Track : public Meta::Track
0026     {
0027         public:
0028             class Private;
0029 
0030             explicit Track( const QUrl &url );
0031             ~Track() override;
0032 
0033         // methods inherited from Meta::Base
0034             QString name() const override;
0035 
0036         // methods inherited from Meta::Track
0037             QUrl playableUrl() const override;
0038             QString prettyUrl() const override;
0039             QString uidUrl() const override;
0040             QString notPlayableReason() const override;
0041 
0042             Meta::AlbumPtr album() const override;
0043             Meta::ArtistPtr artist() const override;
0044             Meta::GenrePtr genre() const override;
0045             Meta::ComposerPtr composer() const override;
0046             Meta::YearPtr year() const override;
0047 
0048             qreal bpm() const override;
0049             QString comment() const override;
0050             int trackNumber() const override;
0051             int discNumber() const override;
0052 
0053             qint64 length() const override;
0054             int filesize() const override;
0055             int sampleRate() const override;
0056             int bitrate() const override;
0057 
0058             void finishedPlaying( double playedFraction ) override;
0059 
0060             QString type() const override;
0061 
0062         // MetaStream::Track methods, used to restore initial stream info
0063 
0064             /**
0065              * Set initial values to display before more accurate info can be fetched.
0066              * This method doesn't call notifyObservers(), it is the caller's
0067              * responsibility; it also doesn't overwrite already filled entries.
0068              *
0069              * @param artist track artist
0070              * @param album track album
0071              * @param title track title
0072              * @param length is in milliseconds
0073              * @param trackNumber track number
0074              */
0075             void setInitialInfo( const QString &artist, const QString &album,
0076                                  const QString &title, qint64 length, int trackNumber );
0077 
0078         private:
0079             Private * const d;
0080     };
0081 
0082 }
0083 
0084 #endif