Includes, comments and bugfixes
- Fix includes - Use common regex (Song::kCoverRemoveDisc) for removing Disc/CD from album - Remove Disc/CD from album when creating hash - Make imobiledevice support compile - Fix setting device on windows
This commit is contained in:
@@ -21,11 +21,18 @@
|
||||
#ifndef PARSERBASE_H
|
||||
#define PARSERBASE_H
|
||||
|
||||
#include "config.h"
|
||||
#include <stdbool.h>
|
||||
|
||||
#include <QtGlobal>
|
||||
#include <QObject>
|
||||
#include <QIODevice>
|
||||
#include <QDir>
|
||||
#include <QByteArray>
|
||||
#include <QString>
|
||||
#include <QStringList>
|
||||
#include <QUrl>
|
||||
|
||||
#include "config.h"
|
||||
#include "core/song.h"
|
||||
#include "playlist/playlist.h"
|
||||
|
||||
@@ -44,29 +51,23 @@ class ParserBase : public QObject {
|
||||
virtual bool TryMagic(const QByteArray &data) const = 0;
|
||||
|
||||
// Loads all songs from playlist found at path 'playlist_path' in directory 'dir'.
|
||||
// The 'device' argument is an opened and ready to read from represantation of
|
||||
// this playlist.
|
||||
// This method might not return all of the songs found in the playlist. Any playlist
|
||||
// parser may decide to leave out some entries if it finds them incomplete or invalid.
|
||||
// This means that the final resulting SongList should be considered valid (at least
|
||||
// from the parser's point of view).
|
||||
// The 'device' argument is an opened and ready to read from represantation of this playlist.
|
||||
// This method might not return all of the songs found in the playlist.
|
||||
// Any playlist parser may decide to leave out some entries if it finds them incomplete or invalid.
|
||||
// This means that the final resulting SongList should be considered valid (at least from the parser's point of view).
|
||||
virtual SongList Load(QIODevice *device, const QString &playlist_path = "", const QDir &dir = QDir()) const = 0;
|
||||
virtual void Save(const SongList &songs, QIODevice *device, const QDir &dir = QDir(), Playlist::Path path_type = Playlist::Path_Automatic) const = 0;
|
||||
|
||||
protected:
|
||||
// Loads a song. If filename_or_url is a URL (with a scheme other than
|
||||
// "file") then it is set on the song and the song marked as a stream.
|
||||
// If it is a filename or a file:// URL then it is made absolute and canonical
|
||||
// and set as a file:// url on the song. Also sets the song's metadata by
|
||||
// searching in the Collection, or loading from the file as a fallback.
|
||||
// Loads a song. If filename_or_url is a URL (with a scheme other than "file") then it is set on the song and the song marked as a stream.
|
||||
// If it is a filename or a file:// URL then it is made absolute and canonical and set as a file:// url on the song.
|
||||
// Also sets the song's metadata by searching in the Collection, or loading from the file as a fallback.
|
||||
// This function should always be used when loading a playlist.
|
||||
Song LoadSong(const QString &filename_or_url, qint64 beginning, const QDir &dir) const;
|
||||
void LoadSong(const QString &filename_or_url, qint64 beginning, const QDir &dir, Song *song) const;
|
||||
|
||||
// If the URL is a file:// URL then returns its path, absolute or relative to
|
||||
// the directory depending on the path_type option.
|
||||
// Otherwise returns the URL as is.
|
||||
// This function should always be used when saving a playlist.
|
||||
// If the URL is a file:// URL then returns its path, absolute or relative to the directory depending on the path_type option.
|
||||
// Otherwise returns the URL as is. This function should always be used when saving a playlist.
|
||||
QString URLOrFilename(const QUrl &url, const QDir &dir, Playlist::Path path_type) const;
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user