diff --git a/3rdparty/mauikit2/src/utils/editor/KSyntaxHighlighting/KSyntaxHighlighting/AbstractHighlighter b/3rdparty/mauikit2/src/utils/editor/KSyntaxHighlighting/KSyntaxHighlighting/AbstractHighlighter deleted file mode 100644 index b787873..0000000 --- a/3rdparty/mauikit2/src/utils/editor/KSyntaxHighlighting/KSyntaxHighlighting/AbstractHighlighter +++ /dev/null @@ -1 +0,0 @@ -#include "abstracthighlighter.h" diff --git a/3rdparty/mauikit2/src/utils/editor/KSyntaxHighlighting/KSyntaxHighlighting/Definition b/3rdparty/mauikit2/src/utils/editor/KSyntaxHighlighting/KSyntaxHighlighting/Definition deleted file mode 100644 index 2c3241f..0000000 --- a/3rdparty/mauikit2/src/utils/editor/KSyntaxHighlighting/KSyntaxHighlighting/Definition +++ /dev/null @@ -1 +0,0 @@ -#include "definition.h" diff --git a/3rdparty/mauikit2/src/utils/editor/KSyntaxHighlighting/KSyntaxHighlighting/DefinitionDownloader b/3rdparty/mauikit2/src/utils/editor/KSyntaxHighlighting/KSyntaxHighlighting/DefinitionDownloader deleted file mode 100644 index 2a82740..0000000 --- a/3rdparty/mauikit2/src/utils/editor/KSyntaxHighlighting/KSyntaxHighlighting/DefinitionDownloader +++ /dev/null @@ -1 +0,0 @@ -#include "definitiondownloader.h" diff --git a/3rdparty/mauikit2/src/utils/editor/KSyntaxHighlighting/KSyntaxHighlighting/FoldingRegion b/3rdparty/mauikit2/src/utils/editor/KSyntaxHighlighting/KSyntaxHighlighting/FoldingRegion deleted file mode 100644 index 005b829..0000000 --- a/3rdparty/mauikit2/src/utils/editor/KSyntaxHighlighting/KSyntaxHighlighting/FoldingRegion +++ /dev/null @@ -1 +0,0 @@ -#include "foldingregion.h" diff --git a/3rdparty/mauikit2/src/utils/editor/KSyntaxHighlighting/KSyntaxHighlighting/Format b/3rdparty/mauikit2/src/utils/editor/KSyntaxHighlighting/KSyntaxHighlighting/Format deleted file mode 100644 index b0d6a10..0000000 --- a/3rdparty/mauikit2/src/utils/editor/KSyntaxHighlighting/KSyntaxHighlighting/Format +++ /dev/null @@ -1 +0,0 @@ -#include "format.h" diff --git a/3rdparty/mauikit2/src/utils/editor/KSyntaxHighlighting/KSyntaxHighlighting/Repository b/3rdparty/mauikit2/src/utils/editor/KSyntaxHighlighting/KSyntaxHighlighting/Repository deleted file mode 100644 index 189dbc2..0000000 --- a/3rdparty/mauikit2/src/utils/editor/KSyntaxHighlighting/KSyntaxHighlighting/Repository +++ /dev/null @@ -1 +0,0 @@ -#include "repository.h" diff --git a/3rdparty/mauikit2/src/utils/editor/KSyntaxHighlighting/KSyntaxHighlighting/State b/3rdparty/mauikit2/src/utils/editor/KSyntaxHighlighting/KSyntaxHighlighting/State deleted file mode 100644 index e148d70..0000000 --- a/3rdparty/mauikit2/src/utils/editor/KSyntaxHighlighting/KSyntaxHighlighting/State +++ /dev/null @@ -1 +0,0 @@ -#include "state.h" diff --git a/3rdparty/mauikit2/src/utils/editor/KSyntaxHighlighting/KSyntaxHighlighting/SyntaxHighlighter b/3rdparty/mauikit2/src/utils/editor/KSyntaxHighlighting/KSyntaxHighlighting/SyntaxHighlighter deleted file mode 100644 index b429824..0000000 --- a/3rdparty/mauikit2/src/utils/editor/KSyntaxHighlighting/KSyntaxHighlighting/SyntaxHighlighter +++ /dev/null @@ -1 +0,0 @@ -#include "syntaxhighlighter.h" diff --git a/3rdparty/mauikit2/src/utils/editor/KSyntaxHighlighting/KSyntaxHighlighting/Theme b/3rdparty/mauikit2/src/utils/editor/KSyntaxHighlighting/KSyntaxHighlighting/Theme deleted file mode 100644 index 34a3e98..0000000 --- a/3rdparty/mauikit2/src/utils/editor/KSyntaxHighlighting/KSyntaxHighlighting/Theme +++ /dev/null @@ -1 +0,0 @@ -#include "theme.h" diff --git a/3rdparty/mauikit2/src/utils/editor/KSyntaxHighlighting/KSyntaxHighlighting/abstracthighlighter.h b/3rdparty/mauikit2/src/utils/editor/KSyntaxHighlighting/KSyntaxHighlighting/abstracthighlighter.h deleted file mode 100644 index 2b88729..0000000 --- a/3rdparty/mauikit2/src/utils/editor/KSyntaxHighlighting/KSyntaxHighlighting/abstracthighlighter.h +++ /dev/null @@ -1,195 +0,0 @@ -/* - Copyright (C) 2016 Volker Krause - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be included - in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#ifndef KSYNTAXHIGHLIGHTING_ABSTRACTHIGHLIGHTERM_H -#define KSYNTAXHIGHLIGHTING_ABSTRACTHIGHLIGHTERM_H - -#include "ksyntaxhighlighting_export.h" - -#include - -#include - -QT_BEGIN_NAMESPACE -class QString; -QT_END_NAMESPACE - -namespace KSyntaxHighlighting { - -class AbstractHighlighterPrivate; -class Definition; -class FoldingRegion; -class Format; -class State; -class Theme; - -/** - * Abstract base class for highlighters. - * - * @section abshl_intro Introduction - * - * The AbstractHighlighter provides an interface to highlight text. - * - * The SyntaxHighlighting framework already ships with one implementation, - * namely the SyntaxHighlighter, which also derives from QSyntaxHighlighter, - * meaning that it can be used to highlight a QTextDocument or a QML TextEdit. - * In order to use the SyntaxHighlighter, just call setDefinition() and - * setTheme(), and the associated documents will automatically be highlighted. - * - * However, if you want to use the SyntaxHighlighting framework to implement - * your own syntax highlighter, you need to sublcass from AbstractHighlighter. - * - * @section abshl_impl Implementing your own Syntax Highlighter - * - * In order to implement your own syntax highlighter, you need to inherit from - * AbstractHighlighter. Then, pass each text line that needs to be highlighted - * in order to highlightLine(). Internally, highlightLine() uses the Definition - * initially set through setDefinition() and the State of the previous text line - * to parse and highlight the given text line. For each visual highlighting - * change, highlightLine() will call applyFormat(). Therefore, reimplement - * applyFormat() to get notified of the Format that is valid in the range - * starting at the given offset with the specified length. Similarly, for each - * text part that starts or ends a code folding region, highlightLine() will - * call applyFolding(). Therefore, if you are interested in code folding, - * reimplement applyFolding() to get notified of the starting and ending code - * folding regions, again specified in the range starting at the given offset - * with the given length. - * - * The Format class itself depends on the current Theme. A theme must be - * initially set once such that the Format%s instances can be queried for - * concrete colors. - * - * Optionally, you can also reimplement setTheme() and setDefinition() to get - * notified whenever the Definition or the Theme changes. - * - * @see SyntaxHighlighter - * @since 5.28 - */ -class KSYNTAXHIGHLIGHTING_EXPORT AbstractHighlighter -{ -public: - virtual ~AbstractHighlighter(); - - /** - * Returns the syntax definition used for highlighting. - * - * @see setDefinition() - */ - Definition definition() const; - - /** - * Sets the syntax definition used for highlighting. - * - * Subclasses can re-implement this method to e.g. trigger - * re-highlighting or clear internal data structures if needed. - */ - virtual void setDefinition(const Definition &def); - - /** - * Returns the currently selected theme for highlighting. - * - * @note If no Theme was set through setTheme(), the returned Theme will be - * invalid, see Theme::isValid(). - */ - Theme theme() const; - - /** - * Sets the theme used for highlighting. - * - * Subclasses can re-implement this method to e.g. trigger - * re-highlighing or to do general palette color setup. - */ - virtual void setTheme(const Theme &theme); - -protected: - AbstractHighlighter(); - AbstractHighlighter(AbstractHighlighterPrivate *dd); - - // TODO KF6: add an optional void* context argument that is passed through - // to the applyX() calls, so highlighters dealing with some form of line object - // (such as QSyntaxHighlighter or KTextEditor) can avoid some ugly hacks to have - // this context available in their applyX methods - /** - * Highlight the given line. Call this from your derived class - * where appropriate. This will result in any number of applyFormat() - * and applyFolding() calls as a result. - * @param text A string containing the text of the line to highlight. - * @param state The highlighting state handle returned by the call - * to highlightLine() for the previous line. For the very first line, - * just pass a default constructed State(). - * @returns The state of the highlighing engine after processing the - * given line. This needs to passed into highlightLine() for the - * next line. You can store the state for efficient partial - * re-highlighting for example during editing. - * - * @see applyFormat(), applyFolding() - */ - State highlightLine(const QString &text, const State &state); - - /** - * Reimplement this to apply formats to your output. The provided @p format - * is valid for the interval [@p offset, @p offset + @p length). - * - * @param offset The start column of the interval for which @p format matches - * @param length The length of the matching text - * @param format The Format that applies to the range [offset, offset + length) - * - * @note Make sure to set a valid Definition, otherwise the parameter - * @p format is invalid for the entire line passed to highlightLine() - * (cf. Format::isValid()). - * - * @see applyFolding(), highlightLine() - */ - virtual void applyFormat(int offset, int length, const Format &format) = 0; - - /** - * Reimplement this to apply folding to your output. The provided - * FoldingRegion @p region either stars or ends a code folding region in the - * interval [@p offset, @p offset + @p length). - * - * @param offset The start column of the FoldingRegion - * @param length The length of the matching text that starts / ends a - * folding region - * @param region The FoldingRegion that applies to the range [offset, offset + length) - * - * @note The FoldingRegion @p region is @e always either of type - * FoldingRegion::Type::Begin or FoldingRegion::Type::End. - * - * @see applyFormat(), highlightLine(), FoldingRegion - */ - virtual void applyFolding(int offset, int length, FoldingRegion region); - -protected: - AbstractHighlighterPrivate *d_ptr; - -private: - Q_DECLARE_PRIVATE(AbstractHighlighter) - Q_DISABLE_COPY(AbstractHighlighter) -}; -} - -QT_BEGIN_NAMESPACE -Q_DECLARE_INTERFACE(KSyntaxHighlighting::AbstractHighlighter, "org.kde.SyntaxHighlighting.AbstractHighlighter") -QT_END_NAMESPACE - -#endif // KSYNTAXHIGHLIGHTING_ABSTRACTHIGHLIGHTERM_H diff --git a/3rdparty/mauikit2/src/utils/editor/KSyntaxHighlighting/KSyntaxHighlighting/definition.h b/3rdparty/mauikit2/src/utils/editor/KSyntaxHighlighting/KSyntaxHighlighting/definition.h deleted file mode 100644 index 6f0dba9..0000000 --- a/3rdparty/mauikit2/src/utils/editor/KSyntaxHighlighting/KSyntaxHighlighting/definition.h +++ /dev/null @@ -1,400 +0,0 @@ -/* - Copyright (C) 2016 Volker Krause - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be included - in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#ifndef KSYNTAXHIGHLIGHTING_DEFINITION_H -#define KSYNTAXHIGHLIGHTING_DEFINITION_H - -#include "ksyntaxhighlighting_export.h" - -#include -#include - -#include - -QT_BEGIN_NAMESPACE -class QChar; -class QString; -class QStringList; -template class QVector; -QT_END_NAMESPACE - -namespace KSyntaxHighlighting { - -class Context; -class Format; -class KeywordList; - -class DefinitionData; - -/** - * Defines the insert position when commenting code. - * @since 5.50 - * @see Definition::singleLineCommentPosition() - */ -enum class CommentPosition -{ - //! The comment marker is inserted at the beginning of a line at column 0 - StartOfLine = 0, - //! The comment marker is inserted after leading whitespaces right befire - //! the first non-whitespace character. - AfterWhitespace -}; - -/** - * Represents a syntax definition. - * - * @section def_intro Introduction to Definitions - * - * A Definition is the short term for a syntax highlighting definition. It - * typically is defined in terms of an XML syntax highlighting file, containing - * all information about a particular syntax highlighting. This includes the - * highlighting of keywords, information about code folding regions, and - * indentation preferences. - * - * @section def_info General Header Data - * - * Each Definition contains a non-translated unique name() and a section(). - * In addition, for putting this information e.g. into menus, the functions - * translatedName() and translatedSection() are provided. However, if isHidden() - * returns @e true, the Definition should not be visible in the UI. The location - * of the Definition can be obtained through filePath(), which either is the - * location on disk or a path to a compiled-in Qt resource. - * - * The supported files of a Definition are defined by the list of extensions(), - * and additionally by the list of mimeTypes(). Note, that extensions() returns - * wildcards that need to be matched against the filename of the file that - * requires highlighting. If multiple Definition%s match the file, then the one - * with higher priority() wins. - * - * @section def_metadata Advanced Definition Data - * - * Advanced text editors such as Kate require additional information from a - * Definition. For instance, foldingEnabled() defines whether a Definition has - * code folding regions that can be shown in a code folding pane. Or - * singleLineCommentMarker() and multiLineCommentMarker() provide comment - * markers that can be used for commenting/uncommenting code. Similarly, - * formats() returns a list of Format items defined by this Definition (which - * equal the itemDatas of a highlighing definition file). includedDefinitions() - * returns a list of all included Definition%s referenced by this Definition via - * the rule IncludeRules, which is useful for displaying all Format items for - * color configuration in the user interface. - * - * @see Repository - * @since 5.28 - */ -class KSYNTAXHIGHLIGHTING_EXPORT Definition -{ -public: - /** - * Default constructor, creating an empty (invalid) Definition instance. - * isValid() for this instance returns @e false. - * - * Use the Repository instead to obtain valid instances. - */ - Definition(); - - /** - * Copy constructor. - * Both this definition as well as @p other share the Definition data. - */ - Definition(const Definition &other); - - /** - * Destructor. - */ - ~Definition(); - - /** - * Assignment operator. - * Both this definition as well as @p rhs share the Definition data. - */ - Definition& operator=(const Definition &rhs); - - /** - * Checks two definitions for equality. - */ - bool operator==(const Definition &other) const; - - /** - * Checks two definitions for inequality. - */ - bool operator!=(const Definition &other) const; - - /** - * @name General Header Data - * - * @{ - */ - - /** - * Checks whether this object refers to a valid syntax definition. - */ - bool isValid() const; - - /** - * Returns the full path to the definition XML file containing - * the syntax definition. Note that this can be a path to QRC content. - */ - QString filePath() const; - - /** Name of the syntax. - * Used for internal references, prefer translatedName() for display. - */ - QString name() const; - - /** - * Translated name for display. - */ - QString translatedName() const; - - /** - * The group this syntax definition belongs to. - * For display, consider translatedSection(). - */ - QString section() const; - - /** - * Translated group name for display. - */ - QString translatedSection() const; - - /** - * Mime types associated with this syntax definition. - */ - QVector mimeTypes() const; - - /** - * File extensions associated with this syntax definition. - * The returned list contains wildcards. - */ - QVector extensions() const; - - /** - * Returns the definition version. - */ - int version() const; - - /** - * Returns the definition priority. - * A Definition with higher priority wins over Definitions with lower priorities. - */ - int priority() const; - - /** - * Returns @c true if this is an internal definition that should not be - * displayed to the user. - */ - bool isHidden() const; - - /** - * Generalized language style, used for indentation. - */ - QString style() const; - - /** - * Indentation style to be used for this syntax. - */ - QString indenter() const; - - /** - * Name and email of the author of this syntax definition. - */ - QString author() const; - - /** - * License of this syntax definition. - */ - QString license() const; - - /** - * @} - * - * @name Advanced Definition Data - */ - - /** - * Returns whether the character @p c is a word delimiter. - * A delimiter defines whether a characters is a word boundary. Internally, - * delimiters are used for matching keyword lists. As example, typically the - * dot '.' is a word delimiter. However, if you have a keyword in a keyword - * list that contains a dot, you have to add the dot to the - * @e weakDeliminator attribute of the @e general section in your - * highlighting definition. Similarly, sometimes additional delimiters are - * required, which can be specified in @e additionalDeliminator. - * - * Checking whether a character is a delimiter is useful for instance if - * text is selected with double click. Typically, the whole word should be - * selected in this case. Similarly to the example above, the dot '.' - * usually acts as word delimiter. However, using this function you can - * implement text selection in such a way that keyword lists are correctly - * selected. - * - * @note By default, the list of delimiters contains the following - * characters: \\t !%&()*+,-./:;<=>?[\\]^{|}~ - * - * @since 5.50 - * @see isWordWrapDelimiter() - */ - bool isWordDelimiter(QChar c) const; - - /** - * Returns whether it is safe to break a line at before the character @c. - * This is useful when wrapping a line e.g. by applying static word wrap. - * - * As example, consider the LaTeX code - * @code - * \command1\command2 - * @endcode - * Applying static word wrap could lead to the following code: - * @code - * \command1\ - * command2 - * @endcode - * command2 without a leading backslash is invalid in LaTeX. If '\\' is set - * as word wrap delimiter, isWordWrapDelimiter('\\') then returns true, - * meaning that it is safe to break the line before @c. The resulting code - * then would be - * @code - * \command1 - * \command2 - * @endcode - * - * @note By default, the word wrap delimiters are equal to the word - * delimiters in isWordDelimiter(). - * - * @since 5.50 - * @see isWordDelimiter() - */ - bool isWordWrapDelimiter(QChar c) const; - - /** - * Returns whether the highlighting supports code folding. - * Code folding is supported either if the highlighting defines code folding - * regions or if indentationBasedFoldingEnabled() returns @e true. - * @since 5.50 - * @see indentationBasedFoldingEnabled() - */ - bool foldingEnabled() const; - - /** - * Returns whether indentation-based folding is enabled. - * An example for indentation-based folding is Python. - * When indentation-based folding is enabled, make sure to also check - * foldingIgnoreList() for lines that should be treated as empty. - * - * @see foldingIgnoreList(), State::indentationBasedFoldingEnabled() - */ - bool indentationBasedFoldingEnabled() const; - - /** - * If indentationBasedFoldingEnabled() returns @c true, this function returns - * a list of regular expressions that represent empty lines. That is, all - * lines matching entirely one of the regular expressions should be treated - * as empty lines when calculating the indentation-based folding ranges. - * - * @note This list is only of relevance, if indentationBasedFoldingEnabled() - * returns @c true. - * - * @see indentationBasedFoldingEnabled() - */ - QStringList foldingIgnoreList() const; - - /** - * Returns the section names of keywords. - * @since 5.49 - * @see keywordList() - */ - QStringList keywordLists() const; - - /** - * Returns the list of keywords for the keyword list @p name. - * @since 5.49 - * @see keywordLists() - */ - QStringList keywordList(const QString& name) const; - - /** - * Returns a list of all Format items used by this definition. - * The order of the Format items equals the order of the itemDatas in the xml file. - * @since 5.49 - */ - QVector formats() const; - - /** - * Returns a list of Definitions that are referenced with the IncludeRules rule. - * The returned list does not include this Definition. In case no other - * Definitions are referenced via IncludeRules, the returned list is empty. - * - * @since 5.49 - */ - QVector includedDefinitions() const; - - /** - * Returns the marker that starts a single line comment. - * For instance, in C++ the single line comment marker is "//". - * @since 5.50 - * @see singleLineCommentPosition(); - */ - QString singleLineCommentMarker() const; - - /** - * Returns the insert position of the comment marker for sinle line - * comments. - * @since 5.50 - * @see singleLineCommentMarker(); - */ - CommentPosition singleLineCommentPosition() const; - - /** - * Returns the markers that start and end multiline comments. - * For instance, in XML this is defined as "". - * @since 5.50 - */ - QPair multiLineCommentMarker() const; - - /** - * Returns a list of character/string mapping that can be used for spell - * checking. This is useful for instance when spell checking LaTeX, where - * the string \"{A} represents the character Ä. - * @since 5.50 - */ - QVector> characterEncodings() const; - - /** - * @} - */ - -private: - friend class DefinitionData; - friend class DefinitionRef; - explicit Definition(const std::shared_ptr &dd); - std::shared_ptr d; -}; - -} - -QT_BEGIN_NAMESPACE -Q_DECLARE_TYPEINFO(KSyntaxHighlighting::Definition, Q_MOVABLE_TYPE); -QT_END_NAMESPACE - -#endif diff --git a/3rdparty/mauikit2/src/utils/editor/KSyntaxHighlighting/KSyntaxHighlighting/definitiondownloader.h b/3rdparty/mauikit2/src/utils/editor/KSyntaxHighlighting/KSyntaxHighlighting/definitiondownloader.h deleted file mode 100644 index 06e28f6..0000000 --- a/3rdparty/mauikit2/src/utils/editor/KSyntaxHighlighting/KSyntaxHighlighting/definitiondownloader.h +++ /dev/null @@ -1,113 +0,0 @@ -/* - Copyright (C) 2016 Volker Krause - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be included - in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#ifndef KSYNTAXHIGHLIGHTING_DEFINITIONDOWNLOADER_H -#define KSYNTAXHIGHLIGHTING_DEFINITIONDOWNLOADER_H - -#include "ksyntaxhighlighting_export.h" - -#include -#include - -namespace KSyntaxHighlighting { - -class DefinitionDownloaderPrivate; -class Repository; - -/** - * Helper class to download definition file updates. - * - * With the DefinitionDownloader you can download new and update existing - * syntax highlighting definition files (xml files). - * - * An example that updates the highlighting Definition%s and prints the current - * update progress to the console may look as follows: - * - * @code - * auto downloader = new DefinitionDownloader(repo); // repo is a pointer to a Repository - * - * // print update progress to console - * QObject::connect(downloader, &DefinitionDownloader::informationMessage, [](const QString &msg) { - * std::cout << qPrintable(msg) << std::endl; - * }); - * - * // connect to signal done to delete the downloader later - * QObject::connect(downloader, &DefinitionDownloader::done, - * downloader, &DefinitionDownloader::deleteLater); - * downloader->start(); - * @endcode - * - * @see Repository, Definition - * @since 5.28 - */ -class KSYNTAXHIGHLIGHTING_EXPORT DefinitionDownloader : public QObject -{ - Q_OBJECT -public: - /** - * Constructor. - * The Repository @p repo is used as reference to compare the versions of - * the existing Definition%s with the ones that are available online. - * - * Optionally, @p parent is a pointer to the owner of this instance. - */ - explicit DefinitionDownloader(Repository *repo, QObject *parent = nullptr); - - /** - * Destructor. - */ - ~DefinitionDownloader(); - - /** - * Starts the update procedure. - * Once no more updates are available (i.e. either the local definition files - * are up-to-date, or all updates have been downloaded), the signal done() - * is emitted. - * - * During the update process, the signal informationMessage() can be used - * to display the current update progress to the user. - * - * @see done(), informationMessage() - */ - void start(); - -Q_SIGNALS: - /** - * Prints the information about the current state of the definition files. - * If all files are up-to-date, this signal is emitted informing you that - * all highlighting files are up-to-date. If there are updates, this signal - * is emitted for each update being downloaded. - */ - void informationMessage(const QString &msg); - - /** - * This signal is emitted when there are no pending downloads anymore. - */ - void done(); - -private: - std::unique_ptr d; -}; -} - -#endif // KSYNTAXHIGHLIGHTING_DEFINITIONDOWNLOADER_H diff --git a/3rdparty/mauikit2/src/utils/editor/KSyntaxHighlighting/KSyntaxHighlighting/foldingregion.h b/3rdparty/mauikit2/src/utils/editor/KSyntaxHighlighting/KSyntaxHighlighting/foldingregion.h deleted file mode 100644 index 074b947..0000000 --- a/3rdparty/mauikit2/src/utils/editor/KSyntaxHighlighting/KSyntaxHighlighting/foldingregion.h +++ /dev/null @@ -1,108 +0,0 @@ -/* - Copyright (C) 2016 Volker Krause - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be included - in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#ifndef KSYNTAXHIGHLIGHTING_FOLDINGREGION_H -#define KSYNTAXHIGHLIGHTING_FOLDINGREGION_H - -#include "ksyntaxhighlighting_export.h" - -#include - -namespace KSyntaxHighlighting { - -/** Represents a begin or end of a folding region. - * @since 5.28 */ -class KSYNTAXHIGHLIGHTING_EXPORT FoldingRegion -{ -public: - /** - * Defines whether a FoldingRegion starts or ends a folding region. - */ - enum Type { - //! Used internally as indicator for invalid FoldingRegion%s. - None, - //! Indicates the start of a FoldingRegion. - Begin, - //! Indicates the end of a FoldingRegion. - End - }; - - /** - * Constructs an invalid folding region, meaning that isValid() returns @e false. - * To obtain valid instances, see AbstractHighlighter::applyFolding(). - */ - FoldingRegion(); - - /** Compares two FoldingRegion instances for equality. */ - bool operator==(const FoldingRegion &other) const; - - /** - * Returns @c true if this is a valid folding region. - * A valid FoldingRegion is defined by a type() other than Type::None. - * - * @note The FoldingRegion%s passed in AbstractHighlighter::applyFolding() - * are always valid. - */ - bool isValid() const; - - /** - * Returns a unique identifier for this folding region. - * - * As example, the C/C++ highlighter starts and ends a folding region for - * scopes, e.g.: - * \code - * void foo() { // '{' starts a folding region - * if (bar()) { // '{' starts a (nested) folding region - * } // '}' ends the (nested) folding region - * } // '}' ends the outer folding region - * \endcode - * In this example, all braces '{' and '}' have the same id(), meaning that - * if you want to find the matching closing region for the first opening - * brace, you need to do kind of a reference counting to find the correct - * closing brace. - */ - quint16 id() const; - - /** - * Returns whether this is the begin or end of a region. - * - * @note The FoldingRegion%s passed in AbstractHighlighter::applyFolding() - * are always valid, i.e. either Type::Begin or Type::End. - */ - Type type() const; - -private: - friend class Rule; - FoldingRegion(Type type, quint16 id); - - quint16 m_type : 2; - quint16 m_id: 14; -}; - -} - -QT_BEGIN_NAMESPACE -Q_DECLARE_TYPEINFO(KSyntaxHighlighting::FoldingRegion, Q_PRIMITIVE_TYPE); -QT_END_NAMESPACE - -#endif diff --git a/3rdparty/mauikit2/src/utils/editor/KSyntaxHighlighting/KSyntaxHighlighting/format.h b/3rdparty/mauikit2/src/utils/editor/KSyntaxHighlighting/KSyntaxHighlighting/format.h deleted file mode 100644 index 24c58e7..0000000 --- a/3rdparty/mauikit2/src/utils/editor/KSyntaxHighlighting/KSyntaxHighlighting/format.h +++ /dev/null @@ -1,152 +0,0 @@ -/* - Copyright (C) 2016 Volker Krause - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be included - in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#ifndef KSYNTAXHIGHLIGHTING_FORMAT_H -#define KSYNTAXHIGHLIGHTING_FORMAT_H - -#include "ksyntaxhighlighting_export.h" -#include "theme.h" - -#include -#include - -QT_BEGIN_NAMESPACE -class QColor; -class QString; -class QXmlStreamReader; -QT_END_NAMESPACE - -namespace KSyntaxHighlighting { - -class DefinitionRef; -class FormatPrivate; - -/** Describes the format to be used for a specific text fragment. - * The actual format used for displaying is merged from the format information - * in the syntax definition file, and a theme. - * - * @see Theme - * @since 5.28 - */ -class KSYNTAXHIGHLIGHTING_EXPORT Format -{ -public: - /** Creates an empty/invalid format. */ - Format(); - Format(const Format &other); - ~Format(); - - Format& operator=(const Format &other); - - /** Returns @c true if this is a valid format, ie. one that - * was read from a syntax definition file. - */ - bool isValid() const; - - /** The name of this format as used in the syntax definition file. */ - QString name() const; - - /** Returns a unique identifier of this format. - * This is useful for efficient storing of formats in a text line. The - * identifier is unique per Repository instance, but will change when - * the repository is reloaded (which also invalidatess the corresponding - * Definition anyway). - */ - quint16 id() const; - - /** Returns the underlying TextStyle of this Format. - * Every Theme::TextStyle is visually defined by a Theme. A Format uses one - * of the Theme::TextStyle%s and on top allows modifications such as setting - * a different foreground color etc. - * @see Theme::TextStyle - * @since 5.49 - */ - Theme::TextStyle textStyle() const; - - /** Returns @c true if the combination of this format and the theme @p theme - * do not change the default text format in any way. - * This is useful for output formats where changing formatting implies cost, - * and thus benefit from optimizing the default case of not having any format - * applied. If you make use of this, make sure to set the default text style - * to what the corresponding theme sets for Theme::Normal. - */ - bool isDefaultTextStyle(const Theme &theme) const; - - /** Returns @c true if the combination of this format and the theme @p theme - * change the foreground color compared to the default format. - */ - bool hasTextColor(const Theme &theme) const; - /** Returns the foreground color of the combination of this format and the - * given theme. - */ - QColor textColor(const Theme &theme) const; - /** Returns the foreground color for selected text of the combination of - * this format and the given theme. - */ - QColor selectedTextColor(const Theme &theme) const; - /** Returns @c true if the combination of this format and the theme @p theme - * change the background color compared to the default format. - */ - bool hasBackgroundColor(const Theme &theme) const; - /** Returns the background color of the combination of this format and the - * given theme. - */ - QColor backgroundColor(const Theme &theme) const; - /** Returns the background color of selected text of the combination of - * this format and the given theme. - */ - QColor selectedBackgroundColor(const Theme &theme) const; - - /** Returns @c true if the combination of this format and the given theme - * results in bold text formatting. - */ - bool isBold(const Theme &theme) const; - /** Returns @c true if the combination of this format and the given theme - * results in italic text formatting. - */ - bool isItalic(const Theme &theme) const; - /** Returns @c true if the combination of this format and the given theme - * results in underlined text. - */ - bool isUnderline(const Theme &theme) const; - /** Returns @c true if the combination of this format and the given theme - * results in struck through text. - */ - bool isStrikeThrough(const Theme &theme) const; - - /** - * Returns whether characters with this format should be spell checked. - */ - bool spellCheck() const; - -private: - friend class FormatPrivate; - QExplicitlySharedDataPointer d; -}; -} - -QT_BEGIN_NAMESPACE -Q_DECLARE_TYPEINFO(KSyntaxHighlighting::Format, Q_MOVABLE_TYPE); -QT_END_NAMESPACE - -#endif // KSYNTAXHIGHLIGHTING_FORMAT_H diff --git a/3rdparty/mauikit2/src/utils/editor/KSyntaxHighlighting/KSyntaxHighlighting/ksyntaxhighlighting_export.h b/3rdparty/mauikit2/src/utils/editor/KSyntaxHighlighting/KSyntaxHighlighting/ksyntaxhighlighting_export.h deleted file mode 100644 index 96ac5b6..0000000 --- a/3rdparty/mauikit2/src/utils/editor/KSyntaxHighlighting/KSyntaxHighlighting/ksyntaxhighlighting_export.h +++ /dev/null @@ -1,42 +0,0 @@ - -#ifndef KSYNTAXHIGHLIGHTING_EXPORT_H -#define KSYNTAXHIGHLIGHTING_EXPORT_H - -#ifdef KSYNTAXHIGHLIGHTING_STATIC_DEFINE -# define KSYNTAXHIGHLIGHTING_EXPORT -# define KSYNTAXHIGHLIGHTING_NO_EXPORT -#else -# ifndef KSYNTAXHIGHLIGHTING_EXPORT -# ifdef KF5SyntaxHighlighting_EXPORTS - /* We are building this library */ -# define KSYNTAXHIGHLIGHTING_EXPORT __attribute__((visibility("default"))) -# else - /* We are using this library */ -# define KSYNTAXHIGHLIGHTING_EXPORT __attribute__((visibility("default"))) -# endif -# endif - -# ifndef KSYNTAXHIGHLIGHTING_NO_EXPORT -# define KSYNTAXHIGHLIGHTING_NO_EXPORT __attribute__((visibility("hidden"))) -# endif -#endif - -#ifndef KSYNTAXHIGHLIGHTING_DEPRECATED -# define KSYNTAXHIGHLIGHTING_DEPRECATED __attribute__ ((__deprecated__)) -#endif - -#ifndef KSYNTAXHIGHLIGHTING_DEPRECATED_EXPORT -# define KSYNTAXHIGHLIGHTING_DEPRECATED_EXPORT KSYNTAXHIGHLIGHTING_EXPORT KSYNTAXHIGHLIGHTING_DEPRECATED -#endif - -#ifndef KSYNTAXHIGHLIGHTING_DEPRECATED_NO_EXPORT -# define KSYNTAXHIGHLIGHTING_DEPRECATED_NO_EXPORT KSYNTAXHIGHLIGHTING_NO_EXPORT KSYNTAXHIGHLIGHTING_DEPRECATED -#endif - -#if 0 /* DEFINE_NO_DEPRECATED */ -# ifndef KSYNTAXHIGHLIGHTING_NO_DEPRECATED -# define KSYNTAXHIGHLIGHTING_NO_DEPRECATED -# endif -#endif - -#endif /* KSYNTAXHIGHLIGHTING_EXPORT_H */ diff --git a/3rdparty/mauikit2/src/utils/editor/KSyntaxHighlighting/KSyntaxHighlighting/repository.h b/3rdparty/mauikit2/src/utils/editor/KSyntaxHighlighting/KSyntaxHighlighting/repository.h deleted file mode 100644 index 2bc6696..0000000 --- a/3rdparty/mauikit2/src/utils/editor/KSyntaxHighlighting/KSyntaxHighlighting/repository.h +++ /dev/null @@ -1,273 +0,0 @@ -/* - Copyright (C) 2016 Volker Krause - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be included - in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#ifndef KSYNTAXHIGHLIGHTING_REPOSITORY_H -#define KSYNTAXHIGHLIGHTING_REPOSITORY_H - -#include "ksyntaxhighlighting_export.h" - -#include -#include - -QT_BEGIN_NAMESPACE -class QString; -template class QVector; -QT_END_NAMESPACE - -/** - * @namespace KSyntaxHighlighting - * - * Syntax highlighting engine for Kate syntax definitions. - * In order to access the syntax highlighting Definition files, use the - * class Repository. - * - * @see Repository - */ -namespace KSyntaxHighlighting { - -class Definition; -class RepositoryPrivate; -class Theme; - -/** - * @brief Syntax highlighting repository. - * - * @section repo_intro Introduction - * - * The Repository gives access to all syntax Definitions available on the - * system, typically described in *.xml files. The Definition files are read - * from the resource that is compiled into the executable, and from the file - * system. If a Definition exists in the resource and on the file system, - * then the one from the file system is chosen. - * - * @section repo_access Definitions and Themes - * - * Typically, only one instance of the Repository is needed. This single - * instance can be thought of as a singleton you keep alive throughout the - * lifetime of your application. Then, either call definitionForName() with the - * given language name (e.g. "QML" or "Java"), or definitionForFileName() to - * obtain a Definition based on the filename/mimetype of the file. The - * function definitions() returns a list of all available syntax Definition%s. - * - * In addition to Definitions, the Repository also provides a list of Themes. - * A Theme is defined by a set of default text style colors as well as editor - * colors. These colors together provide all required colros for drawing all - * primitives of a text editor. All available Theme%s can be queried through - * themes(), and a Theme with a specific name is obtained through theme(). - * Additionally, defaultTheme() provides a way to obtain a default theme for - * either a light or a black color theme. - * - * @section repo_search_paths Search Paths - * - * All highlighting Definition and Theme files are compiled into the shared - * KSyntaxHighlighting library by using the Qt resource system. Loading - * additional files from disk is supported as well. - * - * Loading syntax Definition files works as follows: - * - * -# First, all syntax highlighting files are loaded that are located in - * QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QStringLiteral("org.kde.syntax-highlighting/syntax"), QStandardPaths::LocateDirectory); - * Under Unix, this uses $XDG_DATA_HOME and $XDG_DATA_DIRS, which could - * map to $HOME/.local5/share/org.kde.syntax-highlighting/syntax and - * /usr/share/org.kde.syntax-highlighting/syntax. - * - * -# Next, for backwards compatibility with Kate, all syntax highlighting - * files are loaded that are located in - * QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QStringLiteral("katepart5/syntax"), QStandardPaths::LocateDirectory); - * Again, under Unix, this uses $XDG_DATA_HOME and $XDG_DATA_DIRS, which - * could map to $HOME/.local5/share/katepart5/syntax and - * /usr/share/katepart5/syntax. - * - * -# Then, all files compiled into the library through resources are loaded. - * The internal resource path is ":/org.kde.syntax-highlighting/syntax". - * This path should never be touched by other applications. - * - * -# Finally, the search path can be extended by calling addCustomSearchPath(). - * A custom search path can either be a path on disk or again a path to - * a Qt resource. - * - * Similarly, loading Theme files works as follows: - * - * -# First, all Theme files are loaded that are located in - * QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QStringLiteral("org.kde.syntax-highlighting/themes"), QStandardPaths::LocateDirectory); - * Under Unix, this uses $XDG_DATA_HOME and $XDG_DATA_DIRS, which could - * map to $HOME/.local5/share/org.kde.syntax-highlighting/themes and - * /usr/share/org.kde.syntax-highlighting/themes. - * - * -# Then, all files compiled into the library through resources are loaded. - * The internal resource path is ":/org.kde.syntax-highlighting/themes". - * This path should never be touched by other applications. - * - * -# Finally, all Theme%s located in the paths added addCustomSearchPath() - * are loaded. - * - * @note Whenever a Definition or a Theme exists twice, the variant with - * higher version is used. - * - * @note The QStandardPaths lookup can be disabled by compiling the framework with the -DNO_STANDARD_PATHS define. - * - * @see Definition, Theme, AbstractHighlighter - * @since 5.28 - */ -class KSYNTAXHIGHLIGHTING_EXPORT Repository -{ -public: - /** - * Create a new syntax definition repository. - * This will read the meta data information of all available syntax - * definition, which is a moderately expensive operation, it's therefore - * recommended to keep a single instance of Repository around as long - * as you need highlighting in your application. - */ - Repository(); - ~Repository(); - - /** - * Returns the Definition named @p defName. - * - * If no Definition is found, Definition::isValid() of the returned instance - * returns false. - * - * @note This uses case sensitive, untranslated names. For instance, - * the javascript.xml definition file sets its name to @e JavaScript. - * Therefore, only the string "JavaScript" will return a valid - * Definition file. - */ - Definition definitionForName(const QString &defName) const; - - /** - * Returns the best matching Definition for the file named @p fileName. - * The match is performed based on the \e extensions and @e mimetype of - * the definition files. If multiple matches are found, the one with the - * highest priority is returned. - * - * If no match is found, Definition::isValid() of the returned instance - * returns false. - */ - Definition definitionForFileName(const QString &fileName) const; - - /** - * Returns all Definition%s for the file named @p fileName sorted by priority. - * The match is performed based on the \e extensions and @e mimetype of - * the definition files. - * - * @since 5.56 - */ - QVector definitionsForFileName(const QString &fileName) const; - - /** - * Returns the best matching Definition to the type named @p mimeType - * - * If no match is found, Definition::isValid() of the returned instance - * returns false. - * - * @since 5.50 - */ - Definition definitionForMimeType(const QString &mimeType) const; - - /** - * Returns all Definition%s to the type named @p mimeType sorted by priority - * - * @since 5.56 - */ - QVector definitionsForMimeType(const QString &mimeType) const; - - /** - * Returns all available Definition%s. - * Definition%ss are ordered by translated section and translated names, - * for consistent displaying. - */ - QVector definitions() const; - - /** - * Returns all available color themes. - * The returned list should never be empty. - */ - QVector themes() const; - - /** - * Returns the theme called @p themeName. - * If the requested theme cannot be found, the retunred Theme is invalid, - * see Theme::isValid(). - */ - Theme theme(const QString &themeName) const; - - /** - * Built-in default theme types. - * @see defaultTheme() - */ - enum DefaultTheme { - //! Theme with a light background color. - LightTheme, - //! Theme with a dark background color. - DarkTheme - }; - - /** - * Returns a default theme instance of the given type. - * The returned Theme is guaranteed to be a valid theme. - */ - Theme defaultTheme(DefaultTheme t = LightTheme); - - /** - * Reloads the repository. - * This is a moderately expensive operations and should thus only be - * triggered when the installed syntax definition files changed. - */ - void reload(); - - /** - * Add a custom search path to the repository. - * This path will be searched in addition to the usual locations for syntax - * and theme definition files. Both locations on disk as well as Qt - * resource paths are supported. - * - * @note Internally, the two sub-folders @p path/syntax as well as - * @p path/themes are searched for additional Definition%s and - * Theme%s. Do not append @e syntax or @e themes to @p path - * yourself. - * - * @note Calling this triggers a reload() of the repository. - * - * @since 5.39 - */ - void addCustomSearchPath(const QString &path); - - /** - * Returns the list of custom search paths added to the repository. - * By default, this list is empty. - * - * @see addCustomSearchPath() - * @since 5.39 - */ - QVector customSearchPaths() const; - -private: - Q_DISABLE_COPY(Repository) - friend class RepositoryPrivate; - std::unique_ptr d; -}; - -} - -#endif // KSYNTAXHIGHLIGHTING_REPOSITORY_H diff --git a/3rdparty/mauikit2/src/utils/editor/KSyntaxHighlighting/KSyntaxHighlighting/state.h b/3rdparty/mauikit2/src/utils/editor/KSyntaxHighlighting/KSyntaxHighlighting/state.h deleted file mode 100644 index fce4bc7..0000000 --- a/3rdparty/mauikit2/src/utils/editor/KSyntaxHighlighting/KSyntaxHighlighting/state.h +++ /dev/null @@ -1,86 +0,0 @@ -/* - Copyright (C) 2016 Volker Krause - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be included - in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#ifndef KSYNTAXHIGHLIGHTING_STATE_H -#define KSYNTAXHIGHLIGHTING_STATE_H - -#include "ksyntaxhighlighting_export.h" - -#include -#include - -namespace KSyntaxHighlighting { - -class StateData; - -/** Opaque handle to the state of the highlighting engine. - * This needs to be fed into AbstractHighlighter for every line of text - * and allows concrete highlighter implementations to store state per - * line for fast re-highlighting of specific lines (e.g. during editing). - * - * @since 5.28 - */ -class KSYNTAXHIGHLIGHTING_EXPORT State -{ -public: - /** Creates an initial state, ie. what should be used for the first line - * in a document. - */ - State(); - State(const State &other); - ~State(); - State& operator=(const State &rhs); - - /** Compares two states for equality. - * For two equal states and identical text input, AbstractHighlighter - * guarantees to produce equal results. This can be used to only - * re-highlight as many lines as necessary during editing. - */ - bool operator==(const State &other) const; - /** Compares two states for inequality. - * This is the opposite of operator==(). - */ - bool operator!=(const State &other) const; - - /** - * Returns whether or not indentation-based folding is enabled in this state. - * When using a Definition with indentation-based folding, use - * this method to check if indentation-based folding has been - * suspended in the current line. - * - * @see Definition::indentationBasedFoldingEnabled() - */ - bool indentationBasedFoldingEnabled() const; - -private: - friend class StateData; - QExplicitlySharedDataPointer d; -}; - -} - -QT_BEGIN_NAMESPACE -Q_DECLARE_TYPEINFO(KSyntaxHighlighting::State, Q_MOVABLE_TYPE); -QT_END_NAMESPACE - -#endif // KSYNTAXHIGHLIGHTING_STATE_H diff --git a/3rdparty/mauikit2/src/utils/editor/KSyntaxHighlighting/KSyntaxHighlighting/syntaxhighlighter.h b/3rdparty/mauikit2/src/utils/editor/KSyntaxHighlighting/KSyntaxHighlighting/syntaxhighlighter.h deleted file mode 100644 index f5d2a5e..0000000 --- a/3rdparty/mauikit2/src/utils/editor/KSyntaxHighlighting/KSyntaxHighlighting/syntaxhighlighter.h +++ /dev/null @@ -1,85 +0,0 @@ -/* - Copyright (C) 2016 Volker Krause - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be included - in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#ifndef KSYNTAXHIGHLIGHTING_QSYNTAXHIGHLIGHTER_H -#define KSYNTAXHIGHLIGHTING_QSYNTAXHIGHLIGHTER_H - -#include "ksyntaxhighlighting_export.h" - -#include "abstracthighlighter.h" - -#include - -namespace KSyntaxHighlighting { - -class SyntaxHighlighterPrivate; - -/** A QSyntaxHighlighter implementation for use with QTextDocument. - * This supports partial re-highlighting during editing and - * tracks syntax-based code folding regions. - * - * @since 5.28 - */ -class KSYNTAXHIGHLIGHTING_EXPORT SyntaxHighlighter : public QSyntaxHighlighter, public AbstractHighlighter -{ - Q_OBJECT -public: - explicit SyntaxHighlighter(QObject *parent = nullptr); - explicit SyntaxHighlighter(QTextDocument *document); - ~SyntaxHighlighter() override; - - void setDefinition(const Definition &def) override; - - /** Returns whether there is a folding region beginning at @p startBlock. - * This only considers syntax-based folding regions, - * not indention-based ones as e.g. found in Python. - * - * @see findFoldingRegionEnd - */ - bool startsFoldingRegion(const QTextBlock &startBlock) const; - - /** Finds the end of the folding region starting at @p startBlock. - * If multiple folding regions begin at @p startBlock, the end of - * the last/innermost one is returned. - * This returns an invalid block if no folding region end is found, - * which typically indicates an unterminated region and thus folding - * until the document end. - * This method performs a sequential search starting at @p startBlock - * for the matching folding region end, which is a potentially expensive - * operation. - * - * @see startsFoldingRegion - */ - QTextBlock findFoldingRegionEnd(const QTextBlock &startBlock) const; - -protected: - void highlightBlock(const QString & text) override; - void applyFormat(int offset, int length, const Format &format) override; - void applyFolding(int offset, int length, FoldingRegion region) override; - -private: - Q_DECLARE_PRIVATE_D(AbstractHighlighter::d_ptr, SyntaxHighlighter) -}; -} - -#endif // KSYNTAXHIGHLIGHTING_QSYNTAXHIGHLIGHTER_H diff --git a/3rdparty/mauikit2/src/utils/editor/KSyntaxHighlighting/KSyntaxHighlighting/theme.h b/3rdparty/mauikit2/src/utils/editor/KSyntaxHighlighting/KSyntaxHighlighting/theme.h deleted file mode 100644 index adb8431..0000000 --- a/3rdparty/mauikit2/src/utils/editor/KSyntaxHighlighting/KSyntaxHighlighting/theme.h +++ /dev/null @@ -1,378 +0,0 @@ -/* - Copyright (C) 2016 Volker Krause - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be included - in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#ifndef KSYNTAXHIGHLIGHTING_THEME_H -#define KSYNTAXHIGHLIGHTING_THEME_H - -#include "ksyntaxhighlighting_export.h" - -#include -#include -#include -#include - -namespace KSyntaxHighlighting { - -class ThemeData; -class RepositoryPrivate; - -/** - * Color theme definition used for highlighting. - * - * @section theme_intro Introduction - * - * The Theme provides a full color theme for painting the highlighted text. - * One Theme is defined either as a *.theme file on disk, or as a file compiled - * into the SyntaxHighlighting library by using Qt's resource system. Each - * Theme has a unique name(), including a translatedName() if put into the UI. - * Themes shipped by default are typically read-only, see isReadOnly(). - * - * A Theme defines two sets of colors: - * - Text colors, including foreground and background colors, colors for - * selected text, and properties such as bold and italic. These colors are - * used e.g. by the SyntaxHighlighter. - * - Editor colors, including a background color for the entire editor widget, - * the line number color, code folding colors, etc. - * - * @section theme_text_colors Text Colors and the Class Format - * - * The text colors are used for syntax highlighting. - * // TODO: elaborate more and explain relation to Format class - * - * @section theme_editor_colors Editor Colors - * - * If you want to use the SyntaxHighlighting framework to write your own text - * editor, you also need to paint the background of the editing widget. In - * addition, the editor may support showing line numbers, a folding bar, a - * highlight for the current text line, and similar features. All these colors - * are defined in terms of the "editor colors" and accessible by calling - * editorColor() with the desired enum EditorColorRole. - * - * @section theme_access Accessing a Theme - * - * All available Theme%s are accessed through the Repository. These themes are - * typically valid themes. If you create a Theme on your own, isValid() will - * return @e false, and all colors provided by this Theme are in fact invalid - * and therefore unusable. - * - * @see Format - * @since 5.28 - */ -class KSYNTAXHIGHLIGHTING_EXPORT Theme -{ - Q_GADGET -public: - - // TODO KF6: - // - make TextStyle an enum class - // - move out of Theme into KSyntaxHighlighting - // - do the same for EditorColorRole - - /** - * Default styles that can be referenced from syntax definition XML files. - * Make sure to choose readable colors with good contrast especially in - * combination with the EditorColorRole%s. - */ - enum TextStyle { - //! Default text style for normal text and source code without - //! special highlighting. - Normal = 0, - //! Text style for language keywords. - Keyword, - //! Text style for function definitions and function calls. - Function, - //! Text style for variables, if applicable. For instance, variables in - //! PHP typically start with a '$', so all identifiers following the - //! pattern $foo are highlighted as variable. - Variable, - //! Text style for control flow highlighting, such as @e if, @e then, - //! @e else, @e return, or @e continue. - ControlFlow, - //! Text style for operators such as +, -, *, / and :: etc. - Operator, - //! Text style for built-in language classes and functions. - BuiltIn, - //! Text style for well-known extensions, such as Qt or boost. - Extension, - //! Text style for preprocessor statements. - Preprocessor, - //! Text style for attributes of functions or objects, e.g. \@override - //! in Java, or __declspec(...) and __attribute__((...)) in C++. - Attribute, - //! Text style for single characters such as 'a'. - Char, - //! Text style for escaped characters in strings, such as "hello\n". - SpecialChar, - //! Text style for strings, for instance "hello world". - String, - //! Text style for verbatim strings such as HERE docs. - VerbatimString, - //! Text style for special strings such as regular expressions in - //! ECMAScript or the LaTeX math mode. - SpecialString, - //! Text style for includes, imports, modules, or LaTeX packages. - Import, - //! Text style for data types such as int, char, float etc. - DataType, - //! Text style for decimal values. - DecVal, - //! Text style for numbers with base other than 10. - BaseN, - //! Text style for floating point numbers. - Float, - //! Text style for language constants, e.g. True, False, None in Python - //! or nullptr in C/C++. - Constant, - //! Text style for normal comments. - Comment, - //! Text style for comments that reflect API documentation, such as - //! doxygen /** */ comments. - Documentation, - //! Text style for annotations in comments, such as \@param in Doxygen - //! or JavaDoc. - Annotation, - //! Text style that refers to variables in a comment, such as after - //! \@param \ in Doxygen or JavaDoc. - CommentVar, - //! Text style for region markers, typically defined by BEGIN/END. - RegionMarker, - //! Text style for information, such as the keyword \@note in Doxygen. - Information, - //! Text style for warnings, such as the keyword \@warning in Doxygen. - Warning, - //! Text style for comment specials such as TODO and WARNING in - //! comments. - Alert, - //! Text style indicating wrong syntax. - Error, - //! Text style for attributes that do not match any of the other default - //! styles. - Others - }; - Q_ENUM(TextStyle) - - /** - * Editor color roles, used to paint line numbers, editor background etc. - * The colors typically should have good contrast with the colors used - * in the TextStyle%s. - */ - enum EditorColorRole { - //! Background color for the editing area. - BackgroundColor = 0, - //! Background color for selected text. - TextSelection, - //! Background color for the line of the current text cursor. - CurrentLine, - //! Background color for matching text while searching. - SearchHighlight, - //! Background color for replaced text for a search & replace action. - ReplaceHighlight, - //! Background color for matching bracket pairs (including quotes) - BracketMatching, - //! Foreground color for visualizing tabs and trailing spaces. - TabMarker, - //! Color used to underline spell check errors. - SpellChecking, - //! Color used to draw vertical indentation levels, typically a line. - IndentationLine, - //! Background color for the icon border. - IconBorder, - //! Background colors for code folding regions in the text area, as well - //! as code folding indicators in the code folding border. - CodeFolding, - //! Foreground color for drawing the line numbers. This should have a - //! good contrast with the IconBorder background color. - LineNumbers, - //! Foreground color for drawing the current line number. This should - //! have a good contrast with the IconBorder background color. - CurrentLineNumber, - //! Color used in the icon border to indicate dynamically wrapped lines. - //! This color should have a good contrast with the IconBorder - //! background color. - WordWrapMarker, - //! Color used to draw a vertical line for marking changed lines. - ModifiedLines, - //! Color used to draw a vertical line for marking saved lines. - SavedLines, - //! Line color used to draw separator lines, e.g. at column 80 in the - //! text editor area. - Separator, - //! Background color for bookmarks. - MarkBookmark, - //! Background color for active breakpoints. - MarkBreakpointActive, - //! Background color for a reached breakpoint. - MarkBreakpointReached, - //! Background color for inactive (disabled) breakpoints. - MarkBreakpointDisabled, - //! Background color for marking the current execution position. - MarkExecution, - //! Background color for general warning marks. - MarkWarning, - //! Background color for general error marks. - MarkError, - //! Background color for text templates (snippets). - TemplateBackground, - //! Background color for all editable placeholders in text templates. - TemplatePlaceholder, - //! Background color for the currently active placeholder in text - //! templates. - TemplateFocusedPlaceholder, - //! Background color for read-only placeholders in text templates. - TemplateReadOnlyPlaceholder - }; - Q_ENUM(EditorColorRole) - - /** - * Default constructor, creating an invalid Theme, see isValid(). - */ - Theme(); - - /** - * Copy constructor, sharing the Theme data with @p copy. - */ - Theme(const Theme ©); - - /** - * Destructor. - */ - ~Theme(); - - /** - * Assignment operator, sharing the Theme data with @p other. - */ - Theme &operator=(const Theme &other); - - /** - * Returns @c true if this is a valid Theme. - * If the theme is invalid, none of the returned colors are well-defined. - */ - bool isValid() const; - - /** - * Returns the unique name of this Theme. - * @see translatedName() - */ - QString name() const; - - /** - * Returns the translated name of this Theme. The translated name can be - * used in the user interface. - */ - QString translatedName() const; - - /** - * Returns @c true if this Theme is read-only. - * - * A Theme is read-only, if the filePath() points to a non-writable file. - * This is typically the case for Themes that are compiled into the executable - * as resource file, as well as for theme files that are installed in read-only - * system locations (e.g. /usr/share/). - */ - bool isReadOnly() const; - - /** - * Returns the full path and file name to this Theme. - * Themes from the Qt resource return the Qt resource path. - * Themes from disk return the local path. - * - * If the theme is invalid (isValid()), an empty string is returned. - */ - QString filePath() const; - - /** - * Returns the text color to be used for @p style. - * @c 0 is returned for styles that do not specify a text color, - * use the default text color in that case. - */ - QRgb textColor(TextStyle style) const; - - /** - * Returns the selected text color to be used for @p style. - * @c 0 is returned for styles that do not specify a selected text color, - * use the default textColor() in that case. - */ - QRgb selectedTextColor(TextStyle style) const; - - /** - * Returns the background color to be used for @p style. - * @c 0 is returned for styles that do not specify a background color, - * use the default background color in that case. - */ - QRgb backgroundColor(TextStyle style) const; - - /** - * Returns the background color to be used for selected text for @p style. - * @c 0 is returned for styles that do not specify a background color, - * use the default backgroundColor() in that case. - */ - QRgb selectedBackgroundColor(TextStyle style) const; - - /** - * Returns whether the given style should be shown in bold. - */ - bool isBold(TextStyle style) const; - - /** - * Returns whether the given style should be shown in italic. - */ - bool isItalic(TextStyle style) const; - - /** - * Returns whether the given style should be shown underlined. - */ - bool isUnderline(TextStyle style) const; - - /** - * Returns whether the given style should be shown struck through. - */ - bool isStrikeThrough(TextStyle style) const; - -public: - /** - * Returns the editor color for the requested @p role. - */ - QRgb editorColor(EditorColorRole role) const; - -private: - /** - * Constructor taking a shared ThemeData instance. - */ - explicit Theme(ThemeData* data); - friend class RepositoryPrivate; - friend class ThemeData; - -private: - /** - * Shared data holder. - */ - QExplicitlySharedDataPointer m_data; -}; - -} - -QT_BEGIN_NAMESPACE -Q_DECLARE_TYPEINFO(KSyntaxHighlighting::Theme, Q_MOVABLE_TYPE); -QT_END_NAMESPACE - -#endif // KSYNTAXHIGHLIGHTING_THEME_H diff --git a/3rdparty/mauikit2/src/utils/model_template/mauilist.cpp b/3rdparty/mauikit2/src/utils/model_template/mauilist.cpp deleted file mode 100644 index 3cc44b8..0000000 --- a/3rdparty/mauikit2/src/utils/model_template/mauilist.cpp +++ /dev/null @@ -1,27 +0,0 @@ -/* - * - * Copyright (C) 2019 camilo - * - * 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 3 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, see . - */ - -#include "mauilist.h" - -MauiList::MauiList(QObject *parent) : QObject(parent) -{ -} - -MauiList::~MauiList() -{ -} diff --git a/3rdparty/mauikit2/src/utils/model_template/mauilist.h b/3rdparty/mauikit2/src/utils/model_template/mauilist.h deleted file mode 100644 index 6b6ea6c..0000000 --- a/3rdparty/mauikit2/src/utils/model_template/mauilist.h +++ /dev/null @@ -1,71 +0,0 @@ -/* - * - * Copyright (C) 2019 camilo - * - * 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 3 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, see . - */ - -#ifndef MAUILIST_H -#define MAUILIST_H - -#include "fmh.h" - -#ifndef STATIC_MAUIKIT -#include "mauikit_export.h" -#endif - -#include - -/** - * @todo write docs - */ -#include - -#ifdef STATIC_MAUIKIT -class MauiList : public QObject, public QQmlParserStatus -#else -class MAUIKIT_EXPORT MauiList : public QObject, public QQmlParserStatus -#endif -{ - Q_INTERFACES(QQmlParserStatus) - - Q_OBJECT - Q_PROPERTY(int count READ getCount NOTIFY countChanged) - -public: - /** - * Default constructor - */ - explicit MauiList(QObject *parent = nullptr); - ~MauiList(); - - virtual FMH::MODEL_LIST items() const = 0; - virtual void classBegin() override {} - virtual void componentComplete() override {} - int getCount() const {return items().size(); } ; - -signals: - void preItemAppended(); - void postItemAppended(); - void preItemAppendedAt(int index); - void preItemRemoved(int index); - void postItemRemoved(); - void updateModel(int index, QVector roles); - void preListChanged(); - void postListChanged(); - - void countChanged(); -}; - -#endif // MAUILIST_H diff --git a/3rdparty/mauikit2/src/utils/model_template/mauimodel.cpp b/3rdparty/mauikit2/src/utils/model_template/mauimodel.cpp deleted file mode 100644 index 0ed4daf..0000000 --- a/3rdparty/mauikit2/src/utils/model_template/mauimodel.cpp +++ /dev/null @@ -1,209 +0,0 @@ -/* - * - * Copyright (C) 2019 camilo - * - * 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 3 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, see . - */ - -#include "mauimodel.h" -#include "mauilist.h" - - -MauiModel::MauiModel(QObject *parent) -: QSortFilterProxyModel(parent), m_model(new PrivateAbstractListModel(this)) -{ - this->setSourceModel(this->m_model); - this->setDynamicSortFilter(true); -} - -MauiModel::~MauiModel() {} - -void MauiModel::setFilterString(const QString& string) -{ - this->setFilterCaseSensitivity(Qt::CaseInsensitive); - this->setFilterFixedString(string); - // this->setFilterRegExp(QRegExp(string, Qt::CaseInsensitive)); -} - -void MauiModel::setSortOrder(const int &sortOrder) -{ - this->sort(0, static_cast(sortOrder)); -} - -QVariantMap MauiModel::get(const int& index) -{ - QVariantMap res; - if(index >= this->rowCount() || index < 0) - return res; - - for(const auto &role : this->roleNames()) - res.insert(role, this->index(index, 0).data(FMH::MODEL_NAME_KEY[role]).toString()); - - return res; -} - -QVariantList MauiModel::getAll() -{ - QVariantList res; - for(auto i = 0; i < this->rowCount(); i++) - res << this->get(i); - - return res; -} - -bool MauiModel::filterAcceptsRow(int sourceRow, const QModelIndex& sourceParent) const -{ - if(this->filterRole() != Qt::DisplayRole) - { - QModelIndex index = sourceModel()->index(sourceRow, 0, sourceParent); - const auto data = this->sourceModel()->data(index, this->filterRole()).toString(); - return data.contains(this->filterRegExp()); - } - - for(const auto role : this->sourceModel()->roleNames()) - { - QModelIndex index = sourceModel()->index(sourceRow, 0, sourceParent); - const auto data = this->sourceModel()->data(index, FMH::MODEL_NAME_KEY[role]).toString(); - if(data.contains(this->filterRegExp())) - return true; - else continue; - } - - return false; -} - -MauiList *MauiModel::getList() const -{ - return this->m_model->getList(); -} - -MauiList * MauiModel::PrivateAbstractListModel::getList() const -{ - return this->list; -} - -void MauiModel::PrivateAbstractListModel::setList(MauiList* value) -{ - beginResetModel(); - - if(this->list) - this->list->disconnect(this); - - this->list = value; - - if(this->list) - { - connect(this->list, &MauiList::preItemAppendedAt, this, [=](int index) - { - beginInsertRows(QModelIndex(), index, index); - }); - - connect(this->list, &MauiList::preItemAppended, this, [=]() - { - const int index = this->list->items().size(); - beginInsertRows(QModelIndex(), index, index); - }); - - connect(this->list, &MauiList::postItemAppended, this, [=]() - { - emit this->list->countChanged(); - endInsertRows(); - }); - - connect(this->list, &MauiList::preItemRemoved, this, [=](int index) - { - beginRemoveRows(QModelIndex(), index, index); - }); - - connect(this->list, &MauiList::postItemRemoved, this, [=]() - { - emit this->list->countChanged(); - endRemoveRows(); - }); - - connect(this->list, &MauiList::updateModel, this, [=](int index, QVector roles) - { - emit this->dataChanged(this->index(index), this->index(index), roles); - }); - - connect(this->list, &MauiList::preListChanged, this, [=]() - { - beginResetModel(); - }); - - connect(this->list, &MauiList::postListChanged, this, [=]() - { - emit this->list->countChanged(); - endResetModel(); - }); - } - - endResetModel(); -} - - -void MauiModel::setList(MauiList *value) -{ - this->m_model->setList(value); -} - -MauiModel::PrivateAbstractListModel::PrivateAbstractListModel(QObject *parent) -: QAbstractListModel(parent), list(nullptr) {} - -MauiModel::PrivateAbstractListModel::~PrivateAbstractListModel() -{} - -int MauiModel::PrivateAbstractListModel::rowCount(const QModelIndex &parent) const -{ - if (parent.isValid() || !list) - return 0; - - return list->items().size(); -} - -QVariant MauiModel::PrivateAbstractListModel::data(const QModelIndex &index, int role) const -{ - if (!index.isValid() || !list) - return QVariant(); - - return list->items().at(index.row())[static_cast(role)]; -} - -bool MauiModel::PrivateAbstractListModel::setData(const QModelIndex &index, const QVariant &value, int role) -{ - Q_UNUSED(index); - Q_UNUSED(value); - Q_UNUSED(role); - - return false; -} - -Qt::ItemFlags MauiModel::PrivateAbstractListModel::flags(const QModelIndex &index) const -{ - if (!index.isValid()) - return Qt::NoItemFlags; - - return Qt::ItemIsEditable; // FIXME: Implement me! -} - -QHash MauiModel::PrivateAbstractListModel::roleNames() const -{ - QHash names; - - for(auto key : FMH::MODEL_NAME.keys()) - names[key] = QString(FMH::MODEL_NAME[key]).toUtf8(); - - return names; -} - diff --git a/3rdparty/mauikit2/src/utils/model_template/mauimodel.h b/3rdparty/mauikit2/src/utils/model_template/mauimodel.h deleted file mode 100644 index 93a59f4..0000000 --- a/3rdparty/mauikit2/src/utils/model_template/mauimodel.h +++ /dev/null @@ -1,93 +0,0 @@ -/* - * - * Copyright (C) 2019 camilo - * - * 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 3 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, see . - */ - -#ifndef MAUIMODEL_H -#define MAUIMODEL_H - -#include -#include -#include -#include - -class MauiList; - -#ifndef STATIC_MAUIKIT -#include "mauikit_export.h" -#endif - -#ifdef STATIC_MAUIKIT -class MauiModel : public QSortFilterProxyModel -#else -class MAUIKIT_EXPORT MauiModel : public QSortFilterProxyModel -#endif -{ - Q_OBJECT - Q_PROPERTY(MauiList *list READ getList WRITE setList) - - class PrivateAbstractListModel; - -public: - MauiModel(QObject *parent = nullptr); - ~MauiModel(); - - MauiList* getList() const; - void setList(MauiList *value); - -protected: - bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override; - -private: - PrivateAbstractListModel *m_model; - -public slots: - void setFilterString(const QString &string); - void setSortOrder(const int &sortOrder); - - QVariantMap get(const int &index); - QVariantList getAll(); - -signals: - void listChanged(); -}; - -class MauiModel::PrivateAbstractListModel : public QAbstractListModel -{ - Q_OBJECT -public: - PrivateAbstractListModel(QObject *parent = nullptr); - ~PrivateAbstractListModel(); - int rowCount(const QModelIndex &parent = QModelIndex()) const override; - - QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; - - // Editable: - bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override; - - Qt::ItemFlags flags(const QModelIndex& index) const override; - - virtual QHash roleNames() const override; - - MauiList* getList() const; - void setList(MauiList *value); - -private: - MauiList *list; - -}; - -#endif // MAUIMODEL_H diff --git a/3rdparty/mauikit2/src/utils/models/pathlist.cpp b/3rdparty/mauikit2/src/utils/models/pathlist.cpp deleted file mode 100644 index 7566b87..0000000 --- a/3rdparty/mauikit2/src/utils/models/pathlist.cpp +++ /dev/null @@ -1,190 +0,0 @@ -/* - * - * Copyright (C) 2019 camilo - * - * 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 3 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, see . - */ - -#include "pathlist.h" - -PathList::PathList(QObject *parent) : MauiList(parent) {} - -PathList::~PathList() {} - -QVariantMap PathList::get(const int& index) const -{ - if(this->list.isEmpty() || index >= this->list.size() || index < 0) - { - return QVariantMap(); - } - - const auto model = this->list.at(index); - return FMH::toMap(model); -} - -QString PathList::getPath() const -{ - return this->m_path; -} - -FMH::MODEL_LIST PathList::items() const -{ - return this->list; -} - -void PathList::popPaths(const QString &path) -{ - const int index = [m_path = this->m_path, path]() -> const int - { - int i = 0; - for(const auto &c : m_path) - { - if(i < path.length()) - { - if(c != path[i]) - break; - i++; - } - } - return i; - }(); - - if(index == 0) - { - emit this->preListChanged(); - this->list.clear(); - this->list << PathList::splitPath(path); - emit this->postListChanged(); - return; - } - - auto _url = QString(this->m_path).left(index); - - while(_url.endsWith("/")) - _url.chop(1); - - removePaths(_url); - this->m_path = _url; - appendPaths(path); -} - -void PathList::appendPaths(const QString &path) -{ - const auto _url = QString(path).replace(this->m_path, ""); - for(auto &item : splitPath(_url)) - { - emit this->preItemAppended(); - item[FMH::MODEL_KEY::PATH] = this->m_path + item[FMH::MODEL_KEY::PATH]; - this->list << item; - emit this->postItemAppended(); - } -} - -void PathList::removePaths(const QString &path) -{ - auto _url = QString(this->m_path).replace(path, ""); - - while(_url.endsWith("/")) - _url.chop(1); - - while(_url.startsWith("/")) - _url.remove(0,1); - - _url.insert(0, "/"); - const auto count = _url.count("/"); - - if(count < this->list.size()) - { - for(auto i = 0; i < count; i++) - { - emit this->preItemRemoved(this->list.size()-1); - this->list.removeAt(this->list.size()-1); - emit this->postItemRemoved(); - } - } -} - -void PathList::setPath(const QString& path) -{ - auto _url = path; - - while(_url.endsWith("/")) - _url.chop(1); - - while(_url.startsWith("/")) - _url.remove(0,1); - - if(_url == this->m_path) - return; - - if(!this->list.isEmpty() && _url.startsWith(this->m_path)) - { - appendPaths(_url); - } - else if(!this->list.isEmpty() && this->m_path.startsWith(_url)) - { - removePaths(_url); - } - else - { - popPaths(_url); - } - - this->m_path = _url; - emit this->pathChanged(); -} - -FMH::MODEL_LIST PathList::splitPath(const QString& path) -{ - FMH::MODEL_LIST res; - - QString _url = path; - - while(_url.endsWith("/")) - _url.chop(1); - - _url += "/"; - - const auto count = _url.count("/"); - - for(auto i = 0; i< count; i++) - { - _url = QString(_url).left(_url.lastIndexOf("/")) ; - auto label = QString(_url).right(_url.length() - _url.lastIndexOf("/")-1); - - if(label.isEmpty()) - continue; - - if(label.contains(":") && i == count -1) - { - res << FMH::MODEL - { - {FMH::MODEL_KEY::LABEL, "/"}, - {FMH::MODEL_KEY::PATH, _url+"/"} - }; - break; - } - - res << FMH::MODEL - { - {FMH::MODEL_KEY::LABEL, label}, - {FMH::MODEL_KEY::PATH, _url} - }; - } - std::reverse(res.begin(), res.end()); - - - return res; -} - diff --git a/3rdparty/mauikit2/src/utils/models/pathlist.h b/3rdparty/mauikit2/src/utils/models/pathlist.h deleted file mode 100644 index eb4f4db..0000000 --- a/3rdparty/mauikit2/src/utils/models/pathlist.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * - * Copyright (C) 2019 camilo - * - * 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 3 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, see . - */ - -#ifndef PATHLIST_H -#define PATHLIST_H -#include "mauilist.h" - -/** - * @todo write docs - */ -class PathList : public MauiList -{ - Q_OBJECT - - Q_PROPERTY(QString path READ getPath WRITE setPath NOTIFY pathChanged) - -public: - PathList(QObject *parent = nullptr); - ~PathList(); - - FMH::MODEL_LIST items() const override; - - void setPath(const QString &path); - QString getPath() const; - -private: - FMH::MODEL_LIST list; - QString m_path; - - static FMH::MODEL_LIST splitPath(const QString &path); - void appendPaths(const QString &path); - void removePaths(const QString &path); - void popPaths(const QString &path); - -public slots: - QVariantMap get(const int &index) const; - -signals: - void pathChanged(); -}; - -#endif // PATHLIST_H diff --git a/3rdparty/mauikit2/src/utils/store/providers.xml b/3rdparty/mauikit2/src/utils/store/providers.xml deleted file mode 100644 index 6ee50fd..0000000 --- a/3rdparty/mauikit2/src/utils/store/providers.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - opendesktopcc - https://opendesktop.cc/ocs/v1/ - openDesktop.cc - - https://opendesktop.cc/terms/ - https://opendesktop.cc/usermanager/new.php - - - - - - - - - - - - - - opendesktop - https://api.opendesktop.org/v1/ - openDesktop.org - - https://opendesktop.org/terms/ - https://opendesktop.org/usermanager/new.php - - - - - - - - - - - - diff --git a/3rdparty/mauikit2/src/utils/store/store.cpp b/3rdparty/mauikit2/src/utils/store/store.cpp deleted file mode 100644 index 3c67642..0000000 --- a/3rdparty/mauikit2/src/utils/store/store.cpp +++ /dev/null @@ -1,387 +0,0 @@ -/* - * - * Copyright (C) 2018 camilo - * - * 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 3 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, see . - */ - -#include "store.h" -#include "fmh.h" -#include -#include - -Store::Store(QObject *parent) : QObject(parent) -{ - -} - -Store::~Store() -{ -} - -void Store::start() -{ - qDebug()<< "Setting up Store backend"; - - if(!FMH::fileExists(FMH::DataPath+"/Store/providers.xml")) - { - QDir store_dir(FMH::DataPath+"/Store/"); - if (!store_dir.exists()) - store_dir.mkpath("."); - - QFile providersFile(":/store/providers.xml"); - providersFile.copy(FMH::DataPath+"/Store/providers.xml"); - - } - connect(&m_manager, SIGNAL(defaultProvidersLoaded()), SLOT(providersChanged())); - // qDebug()<< "provider local file exists?"<< FMH::fileExists(FMH::DataPath+"/Store/providers.xml"); - m_manager.addProviderFile(QUrl::fromLocalFile(FMH::DataPath+"/Store/providers.xml")); - m_manager.addProviderFile(QUrl("https://autoconfig.kde.org/ocs/providers.xml")); - m_manager.addProviderFile(QUrl("https://share.krita.org/ocs/providers.xml")); - // m_manager.loadDefaultProviders(); -} - -void Store::setProvider(const STORE::PROVIDER &provider) -{ - this->provider = provider; -} - -void Store::setCategory(const STORE::CATEGORY_KEY& categoryKey) -{ - qDebug()<< "SETTING CATEGORY OFR STORE"; - this->m_category = categoryKey; - this->listCategories(); -} - -void Store::searchFor(const STORE::CATEGORY_KEY& categoryKey, const QString &query, const int &limit, const int &page, const Attica::Provider::SortMode &sortBy) -{ - this->query = query; - this->limit = limit; - this->page = page; - this->sortBy = sortBy; - -// qDebug() << "CATEGORY LIST" << STORE::CATEGORIES[this->m_category]; - // if(this->m_category == categoryKey) - // { - // qDebug()<< "SEARCHIGN WITHIN SAME CATEGORY" << this->m_category; - // this->perfomSearch(); - // return; - // } - // - connect(this, &Store::categoryIDsReady, this, &Store::perfomSearch); - this->setCategory(categoryKey); -} - -void Store::perfomSearch() -{ - Attica::Category::List categories; - qDebug()<< "GOT THE CATEGORY IDS" << this->categoryID; - - for(auto key : this->categoryID.keys()) - { - Attica::Category category; - category.setId(this->categoryID[key]); - category.setName(key); - category.setDisplayName(key); - categories << category; - qDebug()<< category.name() << this->categoryID[key]; - } - - Attica::ListJob *job = this->m_provider.searchContents(categories, this->query, this->sortBy, this->page, this->limit); - - connect(job, SIGNAL(finished(Attica::BaseJob*)), SLOT(contentListResult(Attica::BaseJob*))); - job->start(); -} - - -void Store::contentListResult(Attica::BaseJob* j) -{ - qDebug() << "Content list job returned"; - - FMH::MODEL_LIST list; - - if (j->metadata().error() == Attica::Metadata::NoError) - { - Attica::ListJob *listJob = static_cast *>(j); - - foreach (const Attica::Content &p, listJob->itemList()) - { - const auto att = p.attributes(); - list << FMH::MODEL { - {FMH::MODEL_KEY::ID, p.id()}, - {FMH::MODEL_KEY::URL, att[STORE::ATTRIBUTE[STORE::ATTRIBUTE_KEY::DOWNLOAD_LINK]]}, - {FMH::MODEL_KEY::THUMBNAIL, att[STORE::ATTRIBUTE[STORE::ATTRIBUTE_KEY::PREVIEW_SMALL_1]]}, - {FMH::MODEL_KEY::THUMBNAIL_1, att[STORE::ATTRIBUTE[STORE::ATTRIBUTE_KEY::PREVIEW_1]]}, - {FMH::MODEL_KEY::THUMBNAIL_2, att[STORE::ATTRIBUTE[STORE::ATTRIBUTE_KEY::PREVIEW_2]]}, - {FMH::MODEL_KEY::THUMBNAIL_3, att[STORE::ATTRIBUTE[STORE::ATTRIBUTE_KEY::DOWNLOAD_LINK]]}, - {FMH::MODEL_KEY::LABEL, p.name()}, - {FMH::MODEL_KEY::OWNER, p.author()}, - {FMH::MODEL_KEY::LICENSE, p.license()}, - {FMH::MODEL_KEY::DESCRIPTION, p.description()}, - {FMH::MODEL_KEY::RATE, QString::number(p.rating())}, - {FMH::MODEL_KEY::DATE, p.created().toString()}, - {FMH::MODEL_KEY::MODIFIED, p.updated().toString()}, - {FMH::MODEL_KEY::TAG, p.tags().join(",")}, - {FMH::MODEL_KEY::COUNT, QString::number(p.downloads())}, - {FMH::MODEL_KEY::SOURCE, p.detailpage().toString()} - }; - } - - emit this->contentReady(list); - - if (listJob->itemList().isEmpty()) - { - emit this->warning(QLatin1String("No Content found.")); - } - - } else if (j->metadata().error() == Attica::Metadata::OcsError) - { - emit this->warning(QString(QLatin1String("OCS Error: %1")).arg(j->metadata().message())); - - } else if (j->metadata().error() == Attica::Metadata::NetworkError) - { - emit this->warning(QString(QLatin1String("Network Error: %1")).arg(j->metadata().message())); - } else - { - emit this->warning(QString(QLatin1String("Unknown Error: %1")).arg(j->metadata().message())); - } -} - -void Store::providersChanged() -{ - if (!m_manager.providers().isEmpty()) - { - qDebug()<< "Providers names:"; - for(auto prov : m_manager.providers()) - qDebug() << prov.name() << prov.baseUrl(); - - this->m_provider = m_manager.providerByUrl(QUrl(this->provider)); -// this->m_provider = m_manager.providerByUrl(QUrl(STORE::OPENDESKTOP_API)); - - if (!this->m_provider.isValid()) - { - qDebug() << "Could not find "<< this->provider << "provider."; - return; - - }else - { - qDebug()<< "Found the Store provider for" << m_provider.name(); - qDebug()<< "Has content service" << m_provider.hasContentService(); - emit this->storeReady(); - } - - }else qDebug() << "Could not find any provider."; - -} - -void Store::categoryListResult(Attica::BaseJob* j) -{ - qDebug() << "Category list job returned"; - - if (j->metadata().error() == Attica::Metadata::NoError) - { - Attica::ListJob *listJob = static_cast *>(j); - qDebug() << "Yay, no errors ..."; - QStringList projectIds; - - foreach (const Attica::Category &p, listJob->itemList()) - { - if(STORE::CATEGORIES[this->m_category].contains(p.name())) - this->categoryID[p.name()] = p.id(); - projectIds << p.id(); - - qDebug()<< p.name() << p.id(); - } - - if (listJob->itemList().isEmpty()) - { - emit this->warning(QLatin1String("No Categories found.")); - } - - } else if (j->metadata().error() == Attica::Metadata::OcsError) - { - emit this->warning(QString(QLatin1String("OCS Error: %1")).arg(j->metadata().message())); - - } else if (j->metadata().error() == Attica::Metadata::NetworkError) - { - emit this->warning(QString(QLatin1String("Network Error: %1")).arg(j->metadata().message())); - } else - { - emit this->warning(QString(QLatin1String("Unknown Error: %1")).arg(j->metadata().message())); - } - - qDebug()<< "CATEGORY IDS " << this->categoryID; - emit this->categoryIDsReady(); -} - -void Store::getPersonInfo(const QString& nick) -{ - Attica::ItemJob* job = m_provider.requestPerson(nick); - // connect that job - connect(job, &Attica::BaseJob::finished, [](Attica::BaseJob* doneJob) - { - Attica::ItemJob *personJob = static_cast< Attica::ItemJob * >( doneJob ); - // check if the request actually worked - if( personJob->metadata().error() == Attica::Metadata::NoError ) - { - // use the data to fill the labels - Attica::Person p(personJob->result()); - qDebug() << (p.firstName() + ' ' + p.lastName()); - qDebug() << p.city(); - } else - { - qDebug() << ("Could not fetch information."); - } - - }); - // start the job - job->start(); -} - -void Store::listProjects() -{ - if(!this->m_provider.isValid()) - return; - - Attica::ListJob *job = m_provider.requestProjects(); - connect(job, SIGNAL(finished(Attica::BaseJob*)), SLOT(projectListResult(Attica::BaseJob*))); - job->start(); -} - -void Store::listCategories() -{ - if(!this->m_provider.isValid()) - return; - - Attica::ListJob *job = m_provider.requestCategories(); - connect(job, SIGNAL(finished(Attica::BaseJob*)), SLOT(categoryListResult(Attica::BaseJob*))); - job->start(); - -} - -void Store::download(const QString& id) -{ - if(!this->m_provider.isValid()) - return; - - Attica::ItemJob *job = m_provider.downloadLink(id); - connect(job, SIGNAL(finished(Attica::BaseJob*)), SLOT(contentDownloadReady(Attica::BaseJob*))); - job->start(); -} - -void Store::download(const FMH::MODEL &item) -{ - this->downloadLink(item[FMH::MODEL_KEY::URL], item[FMH::MODEL_KEY::LABEL]); -} - -void Store::contentDownloadReady(Attica::BaseJob* j) -{ - if (j->metadata().error() == Attica::Metadata::NoError) - { - Attica::ItemJob *res = static_cast *>(j); - auto job = res->result(); - auto url = job.url().toString(); - auto fileName = job.packageName(); - - this->downloadLink(url, fileName); - - } else if (j->metadata().error() == Attica::Metadata::OcsError) - { - emit this->warning(QString(QLatin1String("OCS Error: %1")).arg(j->metadata().message())); - - } else if (j->metadata().error() == Attica::Metadata::NetworkError) - { - emit this->warning(QString(QLatin1String("Network Error: %1")).arg(j->metadata().message())); - } else - { - emit this->warning(QString(QLatin1String("Unknown Error: %1")).arg(j->metadata().message())); - } -} - -void Store::downloadLink(const QString& url, const QString &fileName) -{ - const auto downloader = new FMH::Downloader; -// QString _fileName = fileName; - - qDebug()<< "DOWNLOADING CONTENT FROM "<< url << fileName; - - - QStringList filePathList = url.split('/'); - auto _fileName = filePathList.at(filePathList.count() - 1); - - - connect(downloader, &FMH::Downloader::warning, [this](const QString &warning) - { - emit this->warning(warning); - }); - - connect(downloader, &FMH::Downloader::fileSaved, [this](const QString &fileName) - { - emit this->downloadReady(FMH::getFileInfoModel(fileName)); - }); - - connect(downloader, &FMH::Downloader::done, [=]() - { - downloader->deleteLater(); - }); - -// connect(downloader, &FMH::Downloader::downloadReady, [this]() -// { -// -// }); -// - downloader->setFile(url, FMH::DownloadsPath + "/" + _fileName); -} - -void Store::projectListResult(Attica::BaseJob *j) -{ - qDebug() << "Project list job returned"; - QString output = QLatin1String("Projects:"); - - if (j->metadata().error() == Attica::Metadata::NoError) - { - Attica::ListJob *listJob = static_cast *>(j); - qDebug() << "Yay, no errors ..."; - QStringList projectIds; - - foreach (const Attica::Project &p, listJob->itemList()) - { - qDebug() << "New project:" << p.id() << p.name(); - output.append(QString(QLatin1String("
%1 (%2)")).arg(p.name(), p.id())); - projectIds << p.id(); - // TODO: start project jobs here - } - if (listJob->itemList().isEmpty()) - { - output.append(QLatin1String("No Projects found.")); - } - } else if (j->metadata().error() == Attica::Metadata::OcsError) - { - output.append(QString(QLatin1String("OCS Error: %1")).arg(j->metadata().message())); - } else if (j->metadata().error() == Attica::Metadata::NetworkError) - { - output.append(QString(QLatin1String("Network Error: %1")).arg(j->metadata().message())); - } else - { - output.append(QString(QLatin1String("Unknown Error: %1")).arg(j->metadata().message())); - } - qDebug() << output; -} - -QHash Store::getCategoryIDs() -{ - return this->categoryID; -} - -// #include "store.moc" diff --git a/3rdparty/mauikit2/src/utils/store/store.h b/3rdparty/mauikit2/src/utils/store/store.h deleted file mode 100644 index 141f53f..0000000 --- a/3rdparty/mauikit2/src/utils/store/store.h +++ /dev/null @@ -1,268 +0,0 @@ -/* - * - * Copyright (C) 2018 camilo - * - * 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 3 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, see . - */ - -#ifndef STORE_H -#define STORE_H - -#include -#include "fmh.h" - -#ifdef STATIC_MAUIKIT -//#include "providermanager.h" -//#include "provider.h" -//#include "category.h" -//#include "content.h" -//#include "listjob.h" -//#include "person.h" -//#include "project.h" -//#include "downloaditem.h" -#include -#include -#include -#include -#include -#include -#include -#include - -#else -#include -#include -#include -#include -#include -#include -#include -#include -#include -#endif - -namespace STORE -{ - - typedef QString PROVIDER; - - const PROVIDER OPENDESKTOP_API = "https://api.opendesktop.org/v1/"; - const PROVIDER KDELOOK_API = "https://api.kde-look.org/ocs/v1/"; - const PROVIDER KRITA_API = "https://share.krita.org/ocs/v1/"; - const PROVIDER OPENDESKTOPCC_API = "https://pling.cc/ocs/v1/"; - - enum CATEGORY_KEY : uint - { - WALLPAPERS, - IMAGES, - COMICS, - AUDIO, - ART, - CLIPS, - MOVIES, - EBOOKS, - NONE - }; - - enum ATTRIBUTE_KEY : uint - { - PREVIEW_1, - PREVIEW_2, - PREVIEW_SMALL_1, - PREVIEW_SMALL_2, - DOWNLOAD_LINK, - XDG_TYPE - }; - - static const QHash ATTRIBUTE= - { - {STORE::ATTRIBUTE_KEY::PREVIEW_1, QString("previewpic1")}, - {STORE::ATTRIBUTE_KEY::PREVIEW_2, QString("previewpic2")}, - {STORE::ATTRIBUTE_KEY::PREVIEW_SMALL_1, QString("smallpreviewpic1")}, - {STORE::ATTRIBUTE_KEY::PREVIEW_SMALL_2, QString("smallpreviewpic2")}, - {STORE::ATTRIBUTE_KEY::DOWNLOAD_LINK, QString("downloadlink1")}, - {STORE::ATTRIBUTE_KEY::XDG_TYPE, QString("xdg_type")} - }; - - const QStringList WALLPAPERS_LIST = QStringList - { - "wallpapers", - "wallpapers", - "Wallpaper", - "Wallpapers", - "Wallpaper 800x600", - "Wallpaper 1024x768", - "Wallpaper 1280x1024", - "Wallpaper 1440x900", - "Wallpaper 1600x1200", - "Wallpaper (other)", - "KDE Wallpaper 800x600", - "KDE Wallpaper 1024x768", - "KDE Wallpaper 1280x1024", - "KDE Wallpaper 1440x900", - "KDE Wallpaper 1600x1200", - "KDE Wallpaper (other)" - }; - - const QStringList COMICS_LIST = QStringList - { - "comics", - "Comics", - "comic", - "Comic" - }; - - const QStringList ART_LIST = QStringList - { - "art", - "drawings", - "Art", - "Wallpapers", - "Drawings", - "Paintings", - "paintings", - "Drawings/Paintings" - }; - - const QStringList EBOOKS_LIST = QStringList - { - "Books", - "Books/ Arts & Photography", - "Books/ Biographies & Memoirs", - "Books/ Business & Investing", - "Books/ Calendars", - "Books/ Comics & Graphic Novels", - "Books/ Computers & Technology", - "Books/ Cookbooks, Food & Wine", - "Books/ Fun", - "Books/ Gutenberg", - "Gutenberg/ Adventure", - "Gutenberg/ African American Writers", - "Gutenberg/ American Revolutionary War", - "Gutenberg/ Arthurian Legends", - "Gutenberg/ Banned Books from Anne Haight's list", - "Gutenberg/ Best Books Ever Listings", - "Gutenberg/ Bestsellers, American, 1895-1923", - "Gutenberg/ Canada", - "Gutenberg/ Children's Literature", - "Gutenberg/ Christianity", - "Gutenberg/ Christmas", - "Gutenberg/ CIA World Factbooks" - "Gutenberg/ Contemporary Reviews", - "Gutenberg/ Fantasy", - "Gutenberg/ Gothic Fiction", - "Gutenberg/ Harvard Classics", - "Gutenberg/ Historical Fiction", - "Gutenberg/ Horror" "137", - "Gutenberg/ Latter Day Saints", - "Gutenberg/ Mathematics", - "Gutenberg/ Movie Books", - "Gutenberg/ Native America", - "Gutenberg/ No Category", - "Gutenberg/ Opera", - "Gutenberg/ Philosophy", - "Gutenberg/ Plays", - "Gutenberg/ Poetry", - "Gutenberg/ Politics", - "Gutenberg/ Precursors of Science Fiction", - "Gutenberg/ Reference", - "Gutenberg/ Science Fiction", - "Gutenberg/ Science Fiction by Women", - "Gutenberg/ Slavery", - "Gutenberg/ United States", - "Gutenberg/ United States Law", - "Gutenberg/ US Civil War", - "Books/ Health, Fitness & Dieting", - "Books/ Literature & Fiction", - "Books/ Mystery, Thriller & Suspense", - "Books/ Sports & Outdoors", - "Books/ Travel" - - }; - - static const QHash CATEGORIES = - { - {CATEGORY_KEY::WALLPAPERS, QStringList() << STORE::WALLPAPERS_LIST}, - - {CATEGORY_KEY::COMICS, QStringList() << STORE::COMICS_LIST}, - - {CATEGORY_KEY::ART, QStringList () << STORE::ART_LIST}, - - {CATEGORY_KEY::EBOOKS, QStringList () << STORE::EBOOKS_LIST}, - - {CATEGORY_KEY::IMAGES, QStringList () << STORE::WALLPAPERS_LIST << STORE::COMICS_LIST << STORE::ART_LIST} - }; -} - -class Store : public QObject -{ - Q_OBJECT - -public: -// Q_ENUM(STORE::CATEGORY_KEY); - - Store(QObject *parent = nullptr); - ~Store(); - - void start(); - void setProvider(const STORE::PROVIDER &provider); - void setCategory(const STORE::CATEGORY_KEY &categoryKey); - - void searchFor(const STORE::CATEGORY_KEY& categoryKey, const QString &query = QString(), const int &limit = 10, const int &page = 1, const Attica::Provider::SortMode &sortBy = Attica::Provider::SortMode::Rating); - void listProjects(); - void listCategories(); - - void download(const QString &id); - void download(const FMH::MODEL &item); - - QHash getCategoryIDs(); - -public slots: - void providersChanged(); - void categoryListResult(Attica::BaseJob* j); - void projectListResult(Attica::BaseJob *j); - void contentListResult(Attica::BaseJob *j); - void contentDownloadReady(Attica::BaseJob *j); - void getPersonInfo(const QString &nick); - - void perfomSearch(); - -private: - Attica::ProviderManager m_manager; - Attica::Provider m_provider; - QHash categoryID; - STORE::CATEGORY_KEY m_category = STORE::CATEGORY_KEY::NONE; - - STORE::PROVIDER provider = STORE::KDELOOK_API; - - QString query; - int limit = 10; - int page = 0; - - Attica::Provider::SortMode sortBy = Attica::Provider::SortMode::Rating; - - void downloadLink(const QString &url, const QString &fileName); - -signals: - void storeReady(); - void contentReady(FMH::MODEL_LIST list); - void downloadReady(FMH::MODEL item); - void warning(QString warning); - void categoryIDsReady(); -}; - - - - -#endif // STORE_H diff --git a/3rdparty/mauikit2/src/utils/store/store.qrc b/3rdparty/mauikit2/src/utils/store/store.qrc deleted file mode 100644 index 4aa129e..0000000 --- a/3rdparty/mauikit2/src/utils/store/store.qrc +++ /dev/null @@ -1,5 +0,0 @@ - - - providers.xml - - diff --git a/3rdparty/mauikit2/src/utils/store/storelist.cpp b/3rdparty/mauikit2/src/utils/store/storelist.cpp deleted file mode 100644 index 2f31ada..0000000 --- a/3rdparty/mauikit2/src/utils/store/storelist.cpp +++ /dev/null @@ -1,334 +0,0 @@ -/* - * - * Copyright (C) 2018 camilo - * - * 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 3 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, see . - */ - -#include "storelist.h" -#include "fm.h" - -StoreList::StoreList(QObject *parent) : QObject(parent) -{ - this->store = new Store(this); - this->store->setProvider(STORE::KDELOOK_API); - this->store->start(); - - connect(this->store, &Store::contentReady, [this](const FMH::MODEL_LIST &list) - { - emit this->preListChanged(); - this->list = list; - this->sortList(); - qDebug()<< "STORE LIST READY" << list; - emit this->postListChanged(); - - this->contentReady = true; - emit this->contentReadyChanged(); - - this->contentEmpty = this->list.isEmpty(); - emit this->contentEmptyChanged(); - }); - - connect(this->store, &Store::warning, [this](const QString warning) - { - emit this->warning(warning); - }); - - connect(this->store, &Store::downloadReady, [this] (const FMH::MODEL &item) - { - emit this->downloadReady(FMH::toMap(item)); - }); - - connect(this->store, &Store::storeReady, this, &StoreList::setList); -} - -QVariantMap StoreList::get(const int& index) const -{ - if(index >= this->list.size() || index < 0) - return QVariantMap(); - - QVariantMap res; - const auto model = this->list.at(index); - - for(auto key : model.keys()) - res.insert(FMH::MODEL_NAME[key], model[key]); - - return res; -} - -void StoreList::download(const int& index) -{ - if(index >= this->list.size() || index < 0) - return; - - // this->store->download(this->list[index][FMH::MODEL_KEY::ID]); - this->store->download(this->list[index]); -} - -FMH::MODEL_LIST StoreList::items() const -{ - return this->list; -} - -void StoreList::getPersonInfo(const QString& nick) -{ - this->store->getPersonInfo(nick); -} - -void StoreList::setList() -{ - emit this->preListChanged(); - this->list.clear(); - emit this->postListChanged(); - - this->contentEmpty = this->list.isEmpty(); - emit this->contentEmptyChanged(); - - this->contentReady = false; - emit this->contentReadyChanged(); - - this->store->searchFor(static_cast(this->category), this->query, this->limit, this->page, static_cast(this->sortBy)); -} - -StoreList::CATEGORY StoreList::getCategory() const -{ - return this->category; -} - -void StoreList::setCategory(const StoreList::CATEGORY& value) -{ - if(this->category == value) - return; - - this->category = value; - emit this->categoryChanged(); - this->setList(); -} - -int StoreList::getLimit() const -{ - return this->limit; -} - -void StoreList::setLimit(const int& value) -{ - if(this->limit == value) - return; - - this->limit = value; - emit this->limitChanged(); - this->setList(); -} - -int StoreList::getPage() const -{ - return this->page; -} - -void StoreList::setPage(const int& value) -{ - if(this->page == value) - return; - - this->page = value; - emit this->pageChanged(); - this->setList(); -} - -StoreList::ORDER StoreList::getOrder() const -{ - return this->order; -} - -void StoreList::setOrder(const StoreList::ORDER& value) -{ - if(this->order == value) - return; - - this->order = value; - emit this->orderChanged(); -} - -QString StoreList::getQuery() const -{ - return this->query; -} - -void StoreList::setQuery(const QString& value) -{ - if(this->query == value) - return; - - this->query = value; - emit this->queryChanged(); - - this->page = 0; - emit this->pageChanged(); - - this->setList(); -} - -QVariantList StoreList::getCategoryList() -{ - QVariantList res; - auto data = STORE::CATEGORIES[static_cast(this->category)]; - - for(auto category : data) - res << QVariantMap {{FMH::MODEL_NAME[FMH::MODEL_KEY::LABEL], category}}; - - return res; -} - -bool StoreList::getContentReady() const -{ - return this->contentReady; -} - -bool StoreList::getContentEmpty() const -{ - return this->contentEmpty; -} - -StoreList::SORTBY StoreList::getSortBy() const -{ - return this->sortBy; -} - -void StoreList::setSortBy(const StoreList::SORTBY& key) -{ - if(this->sortBy == key) - return; - - this->sortBy = key; - - emit this->sortByChanged(); - this->setList(); -} - -void StoreList::sortList() -{ - qDebug()<< "TRYING TO SORT LIST" << this->list.size(); - qSort(this->list.begin(), this->list.begin(), [this](const FMH::MODEL& e1, const FMH::MODEL& e2) -> bool - { - qDebug()<< "TRYIT LIST"; - - auto role = static_cast(this->sortBy);; - - switch(role) - { - case FMH::MODEL_KEY::RATE: - case FMH::MODEL_KEY::COUNT: - { - if(e1[role].toDouble() > e2[role].toDouble()) - return true; - break; - } - - case FMH::MODEL_KEY::MODIFIED: - case FMH::MODEL_KEY::DATE: - { - auto currentTime = QDateTime::currentDateTime(); - - auto date1 = QDateTime::fromString(e1[role], Qt::TextDate); - auto date2 = QDateTime::fromString(e2[role], Qt::TextDate); - - if(date1.secsTo(currentTime) < date2.secsTo(currentTime)) - return true; - - break; - } - - case FMH::MODEL_KEY::LABEL: - case FMH::MODEL_KEY::USER: - case FMH::MODEL_KEY::OWNER: - { - const auto str1 = QString(e1[role]).toLower(); - const auto str2 = QString(e2[role]).toLower(); - - if(str1 < str2) - return true; - break; - } - - default: - if(e1[role] < e2[role]) - return true; - } - - return false; - }); -} - -StoreList::PROVIDER StoreList::getProvider() const -{ - return this->provider; -} - -void StoreList::setProvider(const StoreList::PROVIDER &key) -{ - if(this->provider == key) - return; - - this->provider = key; - STORE::PROVIDER value; - - switch(this->provider) - { - case StoreList::PROVIDER::KDELOOK: - value = STORE::KDELOOK_API; - break; - case StoreList::PROVIDER::OPENDESKTOP: - value = STORE::OPENDESKTOP_API; - break; - case StoreList::PROVIDER::OPENDESKTOPCC: - value = STORE::OPENDESKTOPCC_API; - break; - case StoreList::PROVIDER::KRITA: - value = STORE::KRITA_API; - break; - } - - this->store->setProvider(value); - emit this->providerChanged(); -} - -bool StoreList::fileExists(const int &index) -{ - if(index >= this->list.size() || index < 0) - return false; - - const auto url = this->list[index][FMH::MODEL_KEY::URL]; - - const QStringList filePathList = url.split('/'); - const auto fileName = filePathList.at(filePathList.count() - 1); - - qDebug() << "Check if file exists" << FMH::DownloadsPath+"/"+fileName; - - return FMH::fileExists(FMH::DownloadsPath+"/"+fileName); - -} - -QString StoreList::itemLocalPath(const int &index) -{ - if(!this->fileExists(index)) - return QString(); - - const auto url = this->list[index][FMH::MODEL_KEY::URL]; - - const QStringList filePathList = url.split('/'); - const auto fileName = filePathList.at(filePathList.count() - 1); - - return FMH::DownloadsPath+"/"+fileName; -} - diff --git a/3rdparty/mauikit2/src/utils/store/storelist.h b/3rdparty/mauikit2/src/utils/store/storelist.h deleted file mode 100644 index 09769a1..0000000 --- a/3rdparty/mauikit2/src/utils/store/storelist.h +++ /dev/null @@ -1,155 +0,0 @@ -/* - * - * Copyright (C) 2018 camilo - * - * 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 3 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, see . - */ - -#ifndef STORELIST_H -#define STORELIST_H - -#include -#include "fmh.h" -#include "store.h" - -class StoreList : public QObject -{ - Q_OBJECT - Q_PROPERTY(StoreList::CATEGORY category READ getCategory WRITE setCategory NOTIFY categoryChanged) - Q_PROPERTY(int limit READ getLimit WRITE setLimit NOTIFY limitChanged) - Q_PROPERTY(int page READ getPage WRITE setPage NOTIFY pageChanged) - Q_PROPERTY(QString query READ getQuery WRITE setQuery NOTIFY queryChanged) - Q_PROPERTY(StoreList::ORDER order READ getOrder WRITE setOrder NOTIFY orderChanged) - Q_PROPERTY(bool contentReady READ getContentReady NOTIFY contentReadyChanged) - Q_PROPERTY(bool contentEmpty READ getContentEmpty NOTIFY contentEmptyChanged) - Q_PROPERTY(StoreList::SORTBY sortBy READ getSortBy WRITE setSortBy NOTIFY sortByChanged()) - Q_PROPERTY(StoreList::PROVIDER provider READ getProvider WRITE setProvider NOTIFY providerChanged) - -public: - StoreList(QObject *parent = nullptr); - FMH::MODEL_LIST items() const; - - enum PROVIDER : uint_fast8_t - { - OPENDESKTOP, - KDELOOK, - KRITA, - OPENDESKTOPCC - };Q_ENUM(PROVIDER) - - enum SORTBY : uint_fast8_t - { - RATE = Attica::Provider::SortMode::Rating, - DATE = Attica::Provider::SortMode::Newest, - LABEL = Attica::Provider::SortMode::Alphabetical, - COUNT = Attica::Provider::SortMode::Downloads - }; Q_ENUM(SORTBY) - - enum CATEGORY : uint_fast8_t - { - WALLPAPERS = STORE::CATEGORY_KEY::WALLPAPERS, - IMAGES = STORE::CATEGORY_KEY::IMAGES, - COMICS = STORE::CATEGORY_KEY::COMICS, - AUDIO = STORE::CATEGORY_KEY::AUDIO, - ART = STORE::CATEGORY_KEY::ART, - CLIPS = STORE::CATEGORY_KEY::CLIPS, - MOVIES= STORE::CATEGORY_KEY::MOVIES, - EBOOKS = STORE::CATEGORY_KEY::EBOOKS, - NONE= STORE::CATEGORY_KEY::NONE - }; Q_ENUM(CATEGORY) - - enum ORDER : uint_fast8_t - { - Newest = Attica::Provider::SortMode::Newest, - Alphabetical = Attica::Provider::SortMode::Alphabetical, - Rating = Attica::Provider::SortMode::Rating, - Downloads = Attica::Provider::SortMode::Downloads - };Q_ENUM(ORDER) - - void setCategory(const StoreList::CATEGORY &value); - StoreList::CATEGORY getCategory() const; - - void setLimit(const int &value); - int getLimit() const; - - void setPage(const int &value); - int getPage() const; - - void setQuery(const QString &value); - QString getQuery() const; - - void setOrder(const StoreList::ORDER &value); - StoreList::ORDER getOrder() const; - - bool getContentReady() const; - bool getContentEmpty() const; - - StoreList::SORTBY getSortBy() const; - void setSortBy(const StoreList::SORTBY &key); - - StoreList::PROVIDER getProvider() const; - void setProvider(const StoreList::PROVIDER &key); - -public slots: - void getPersonInfo(const QString &nick); - QVariantList getCategoryList(); - - QVariantMap get(const int &index) const; - void download(const int &index); - - bool fileExists(const int &index); - QString itemLocalPath(const int &index); - -private: - FMH::MODEL_LIST list; - Store *store; - - void setList(); - void sortList(); - - StoreList::CATEGORY category; - int limit = 10; - int page = 0; - QString query; - StoreList::ORDER order; - bool contentReady = false; - bool contentEmpty = true; - StoreList::SORTBY sortBy = StoreList::SORTBY::DATE; - StoreList::PROVIDER provider = StoreList::PROVIDER::KDELOOK; - -signals: - void preItemAppended(); - void postItemAppended(); - void preItemRemoved(int index); - void postItemRemoved(); - void updateModel(int index, QVector roles); - void preListChanged(); - void postListChanged(); - - void categoryChanged(); - void limitChanged(); - void queryChanged(); - void orderChanged(); - void pageChanged(); - void contentReadyChanged(); - void contentEmptyChanged(); - void sortByChanged(); - void providerChanged(); - - void warning(QString warning); - void downloadReady(QVariantMap item); - -}; - -#endif // STORELIST_H diff --git a/3rdparty/mauikit2/src/utils/store/storemodel.cpp b/3rdparty/mauikit2/src/utils/store/storemodel.cpp deleted file mode 100644 index 456397c..0000000 --- a/3rdparty/mauikit2/src/utils/store/storemodel.cpp +++ /dev/null @@ -1,122 +0,0 @@ -/* - * - * Copyright (C) 2018 camilo - * - * 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 3 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, see . - */ - -#include "storemodel.h" -#include "storelist.h" -#include "fmh.h" - -StoreModel::StoreModel(QObject *parent) -: QAbstractListModel(parent), -mList(nullptr) -{} - -int StoreModel::rowCount(const QModelIndex &parent) const -{ - if (parent.isValid() || !mList) - return 0; - - return mList->items().size(); -} - -QVariant StoreModel::data(const QModelIndex &index, int role) const -{ - if (!index.isValid() || !mList) - return QVariant(); - - return mList->items().at(index.row())[static_cast(role)]; -} - -bool StoreModel::setData(const QModelIndex &index, const QVariant &value, int role) -{ - - return false; -} - -Qt::ItemFlags StoreModel::flags(const QModelIndex &index) const -{ - if (!index.isValid()) - return Qt::NoItemFlags; - - return Qt::ItemIsEditable; // FIXME: Implement me! -} - -QHash StoreModel::roleNames() const -{ - QHash names; - - for(auto key : FMH::MODEL_NAME.keys()) - names[key] = QString(FMH::MODEL_NAME[key]).toUtf8(); - - return names; -} - -StoreList *StoreModel::getList() const -{ - return this->mList; -} - -void StoreModel::setList(StoreList *value) -{ - beginResetModel(); - - if(mList) - mList->disconnect(this); - - mList = value; - - if(mList) - { - connect(this->mList, &StoreList::preItemAppended, this, [=]() - { - const int index = mList->items().size(); - beginInsertRows(QModelIndex(), index, index); - }); - - connect(this->mList, &StoreList::postItemAppended, this, [=]() - { - endInsertRows(); - }); - - connect(this->mList, &StoreList::preItemRemoved, this, [=](int index) - { - beginRemoveRows(QModelIndex(), index, index); - }); - - connect(this->mList, &StoreList::postItemRemoved, this, [=]() - { - endRemoveRows(); - }); - - connect(this->mList, &StoreList::updateModel, this, [=](int index, QVector roles) - { - emit this->dataChanged(this->index(index), this->index(index), roles); - }); - - connect(this->mList, &StoreList::preListChanged, this, [=]() - { - beginResetModel(); - }); - - connect(this->mList, &StoreList::postListChanged, this, [=]() - { - endResetModel(); - }); - } - - endResetModel(); -} diff --git a/3rdparty/mauikit2/src/utils/store/storemodel.h b/3rdparty/mauikit2/src/utils/store/storemodel.h deleted file mode 100644 index 2a0bb9b..0000000 --- a/3rdparty/mauikit2/src/utils/store/storemodel.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * - * Copyright (C) 2018 camilo - * - * 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 3 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, see . - */ - -#ifndef STOREMODEL_H -#define STOREMODEL_H - -#include -#include -#include - -class StoreList; -class StoreModel : public QAbstractListModel -{ - Q_OBJECT - Q_PROPERTY(StoreList *list READ getList WRITE setList) - -public: - explicit StoreModel(QObject *parent = nullptr); - - // Basic functionality: - int rowCount(const QModelIndex &parent = QModelIndex()) const override; - - QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; - - // Editable: - bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override; - - Qt::ItemFlags flags(const QModelIndex& index) const override; - - virtual QHash roleNames() const override; - - StoreList* getList() const; - void setList(StoreList *value); - -private: - StoreList *mList; - -signals: - void listChanged(); - -}; - -#endif // STOREMODEL_H diff --git a/3rdparty/mauikit2/src/utils/syncing/libwebdavclient/.gitignore b/3rdparty/mauikit2/src/utils/syncing/libwebdavclient/.gitignore deleted file mode 100644 index 0b4a1be..0000000 --- a/3rdparty/mauikit2/src/utils/syncing/libwebdavclient/.gitignore +++ /dev/null @@ -1,46 +0,0 @@ -# Prerequisites -*.d - -# Compiled Object files -*.slo -*.lo -*.o -*.obj - -# Precompiled Headers -*.gch -*.pch - -# Compiled Dynamic libraries -*.so -*.dylib -*.dll - -# Fortran module files -*.mod -*.smod - -# Compiled Static libraries -*.lai -*.la -*.a -*.lib - -# Executables -*.out -*.app - -############ - -CMakeCache.txt -CMakeFiles -CMakeScripts -Testing -Makefile -cmake_install.cmake -install_manifest.txt -compile_commands.json -CTestTestfile.cmake - -build -CMakeLists.txt.user diff --git a/3rdparty/mauikit2/src/utils/syncing/libwebdavclient/.travis.yml b/3rdparty/mauikit2/src/utils/syncing/libwebdavclient/.travis.yml deleted file mode 100644 index 5c72961..0000000 --- a/3rdparty/mauikit2/src/utils/syncing/libwebdavclient/.travis.yml +++ /dev/null @@ -1,32 +0,0 @@ -language: cpp -compiler: gcc -dist: xenial -sudo: required - -notifications: - email: false - -before_install: - - sudo add-apt-repository -y ppa:beineri/opt-qt-5.11.1-xenial - - sudo apt-get update -y - -install: - - sudo apt-get -y install wget curl qt511base qt511declarative qt511xmlpatterns - - . /opt/qt511/bin/qt511-env.sh - - wget https://cmake.org/files/v3.13/cmake-3.13.0-rc2-Linux-x86_64.sh -q - - sudo sh cmake-3.13.0-rc2-Linux-x86_64.sh --prefix=/usr/local --exclude-subdir - -script: - - cmake . - - make -j$(nproc) - - make -j$(nproc) package - - mv webdavclient-*.deb libwebdavclient.deb - -after_success: - - wget -c https://github.com/probonopd/uploadtool/raw/master/upload.sh - - bash upload.sh libwebdavclient.deb - -branches: - except: - - # Do not build tags that we create when we upload to GitHub Releases - - /^(?i:continuous)$/ diff --git a/3rdparty/mauikit2/src/utils/syncing/libwebdavclient/CMakeLists.txt b/3rdparty/mauikit2/src/utils/syncing/libwebdavclient/CMakeLists.txt deleted file mode 100644 index 8dc35f5..0000000 --- a/3rdparty/mauikit2/src/utils/syncing/libwebdavclient/CMakeLists.txt +++ /dev/null @@ -1,52 +0,0 @@ -cmake_minimum_required(VERSION 3.9) -enable_testing() - -file(STRINGS ./VERSION PROJECT_VERSION) - -project( - webdavclient - VERSION ${PROJECT_VERSION} - DESCRIPTION "A WebDAV Client library to connect to WebDAV Servers built with QT" -) - -# Set Flags -set(CMAKE_INCLUDE_CURRENT_DIR ON) -set(CMAKE_AUTOMOC ON) -set(CMAKE_CXX_STANDARD 11) -set(CMAKE_CXX_STANDARD_REQUIRED ON) -set(CMAKE_INSTALL_PREFIX /usr) -### - -# Miscellaneous -include(FeatureSummary) - -add_definitions(-DPROJECT_NAME="${PROJECT_NAME}") -add_definitions(-DPROJECT_VERSION="${PROJECT_VERSION}") -### - -# Include SubDirectories -add_subdirectory(lib) -add_subdirectory(lib/tests) -### - -# CPack Configuration -include(InstallRequiredSystemLibraries) - -set(CPACK_GENERATOR "DEB") -set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON) -set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Anupam Basak") -set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "A WebDAV Client library to connect to WebDAV Servers built with QT") -set(CPACK_PACKAGE_VENDOR "Anupam Basak") -set(CPACK_PACKAGE_CONTACT "Anupam Basak ") -#set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/ReadMe.txt") -#set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt") -set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR}) -set(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR}) -set(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH}) -set(CPACK_PACKAGE_INSTALL_DIRECTORY "CMake ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}") -set(CPACK_SOURCE_STRIP_FILES "") - -include(CPack) -### - -feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES) diff --git a/3rdparty/mauikit2/src/utils/syncing/libwebdavclient/VERSION b/3rdparty/mauikit2/src/utils/syncing/libwebdavclient/VERSION deleted file mode 100644 index 6e8bf73..0000000 --- a/3rdparty/mauikit2/src/utils/syncing/libwebdavclient/VERSION +++ /dev/null @@ -1 +0,0 @@ -0.1.0 diff --git a/3rdparty/mauikit2/src/utils/syncing/libwebdavclient/lib/CMakeLists.txt b/3rdparty/mauikit2/src/utils/syncing/libwebdavclient/lib/CMakeLists.txt deleted file mode 100644 index c46c766..0000000 --- a/3rdparty/mauikit2/src/utils/syncing/libwebdavclient/lib/CMakeLists.txt +++ /dev/null @@ -1,64 +0,0 @@ -include(GNUInstallDirs) - -# Check Qt Packages -find_package( - Qt5 - - COMPONENTS - Core - Network - Xml - - REQUIRED -) -### - -# Set Custom Variables -set(HEADERS_INSTALL_DIR ${CMAKE_INSTALL_INCLUDEDIR}/lib${PROJECT_NAME}) -### - -# Add Source Files -set( - CPP_SOURCES - - WebDAVClient.cpp - - dto/WebDAVItem.cpp - - utils/NetworkHelper.cpp - utils/WebDAVReply.cpp - utils/XMLHelper.cpp - utils/Environment.cpp -) -### - -# Create and Link Executable -add_library( - ${PROJECT_NAME} - SHARED - - ${CPP_SOURCES} -) -target_link_libraries( - ${PROJECT_NAME} - - Qt5::Core - Qt5::Network - Qt5::Xml -) -### - -# Set Flags for Library -set_target_properties(${PROJECT_NAME} PROPERTIES VERSION ${PROJECT_VERSION}) -set_target_properties(${PROJECT_NAME} PROPERTIES - PUBLIC_HEADER "WebDAVClient.hpp;dto/WebDAVItem.hpp;utils/WebDAVReply.hpp" -) -### - -# Set Installables -install( - TARGETS ${PROJECT_NAME} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - PUBLIC_HEADER DESTINATION ${HEADERS_INSTALL_DIR} -) -### diff --git a/3rdparty/mauikit2/src/utils/syncing/libwebdavclient/lib/WebDAVClient.cpp b/3rdparty/mauikit2/src/utils/syncing/libwebdavclient/lib/WebDAVClient.cpp deleted file mode 100644 index 6a8231b..0000000 --- a/3rdparty/mauikit2/src/utils/syncing/libwebdavclient/lib/WebDAVClient.cpp +++ /dev/null @@ -1,232 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "WebDAVClient.hpp" -#include "utils/NetworkHelper.hpp" -#include "utils/WebDAVReply.hpp" - -WebDAVClient::WebDAVClient(QString host, QString username, QString password) { - this->networkHelper = new NetworkHelper(host, username, password); - this->xmlHelper = new XMLHelper(); - - // TODO: Check for Timeout error in case of wrong host -} - -WebDAVReply* WebDAVClient::listDir(QString path) { - return this->listDir(path, ListDepthEnum::Infinity); -} - -WebDAVReply* WebDAVClient::listDir(QString path, ListDepthEnum depth) { - WebDAVReply* reply = new WebDAVReply(); - QString depthVal; - QMap headers; - QNetworkReply* listDirReply; - - switch (depth) { - case ListDepthEnum::Zero: - depthVal = "0"; - break; - - case ListDepthEnum::One: - depthVal = "1"; - break; - - case ListDepthEnum::Two: - depthVal = "2"; - break; - - case ListDepthEnum::Infinity: - depthVal = "infinity"; - break; - - default: - break; - } - - headers.insert("Depth", depthVal); - - listDirReply = - this->networkHelper->makeRequest(QString("PROPFIND"), path, headers); - - connect(listDirReply, &QNetworkReply::finished, [=]() { - reply->sendListDirResponseSignal( - listDirReply, - this->xmlHelper->parseListDirResponse(this, listDirReply->readAll())); - }); - connect(listDirReply, - QOverload::of(&QNetworkReply::error), - [=](QNetworkReply::NetworkError err) { - this->errorReplyHandler(reply, err); - }); - - return reply; -} - -WebDAVReply* WebDAVClient::downloadFrom(QString path) { - return this->downloadFrom(path, 0, -1); -} - -WebDAVReply* WebDAVClient::downloadFrom(QString path, qint64 startByte, - qint64 endByte) { - WebDAVReply* reply = new WebDAVReply(); - QString rangeVal; - QTextStream stream(&rangeVal); - QMap headers; - QNetworkReply* downloadReply; - - stream << "bytes=" << startByte << "-" << endByte; - - headers.insert("Range", rangeVal); - - downloadReply = this->networkHelper->makeRequest("GET", path, headers); - - connect(downloadReply, &QNetworkReply::finished, - [=]() { reply->sendDownloadResponseSignal(downloadReply); }); - connect( - downloadReply, &QNetworkReply::downloadProgress, - [=](qint64 bytesReceived, qint64 bytesTotal) { - if (bytesTotal == -1) { - QString contentRange = QString(downloadReply->rawHeader( - QByteArray::fromStdString("Content-Range"))); - QRegularExpression re("bytes (\\d*)-(\\d*)/(\\d*)"); - QRegularExpressionMatch match = re.match(contentRange); - qint64 contentSize = - match.captured(2).toInt() - match.captured(1).toInt(); - - reply->sendDownloadProgressResponseSignal(bytesReceived, contentSize); - } else { - reply->sendDownloadProgressResponseSignal(bytesReceived, bytesTotal); - } - }); - connect(downloadReply, - QOverload::of(&QNetworkReply::error), - [=](QNetworkReply::NetworkError err) { - this->errorReplyHandler(reply, err); - }); - - return reply; -} - -WebDAVReply* WebDAVClient::uploadTo(QString path, QString filename, - QIODevice* file) { - WebDAVReply* reply = new WebDAVReply(); - QMap headers; - QNetworkReply* uploadReply; - - uploadReply = - this->networkHelper->makePutRequest(path + "/" + filename, headers, file); - - connect(uploadReply, &QNetworkReply::finished, - [=]() { reply->sendUploadFinishedResponseSignal(uploadReply); }); - - connect(uploadReply, - QOverload::of(&QNetworkReply::error), - [=](QNetworkReply::NetworkError err) { - this->errorReplyHandler(reply, err); - }); - - return reply; -} - -WebDAVReply* WebDAVClient::createDir(QString path, QString dirName) { - WebDAVReply* reply = new WebDAVReply(); - QMap headers; - QNetworkReply* createDirReply; - - createDirReply = - this->networkHelper->makeRequest("MKCOL", path + "/" + dirName, headers); - - connect(createDirReply, &QNetworkReply::finished, - [=]() { reply->sendDirCreatedResponseSignal(createDirReply); }); - - connect(createDirReply, - QOverload::of(&QNetworkReply::error), - [=](QNetworkReply::NetworkError err) { - this->errorReplyHandler(reply, err); - }); - - return reply; -} - -WebDAVReply* WebDAVClient::copy(QString source, QString destination) { - WebDAVReply* reply = new WebDAVReply(); - QMap headers; - QNetworkReply* copyReply; - - headers.insert("Destination", destination); - - copyReply = this->networkHelper->makeRequest("COPY", source, headers); - - connect(copyReply, &QNetworkReply::finished, - [=]() { reply->sendCopyResponseSignal(copyReply); }); - - connect(copyReply, - QOverload::of(&QNetworkReply::error), - [=](QNetworkReply::NetworkError err) { - this->errorReplyHandler(reply, err); - }); - - return reply; -} - -WebDAVReply* WebDAVClient::move(QString source, QString destination, - bool overwrite) { - WebDAVReply* reply = new WebDAVReply(); - QMap headers; - QNetworkReply* moveReply; - QString overwriteVal = overwrite ? "T" : "F"; - - headers.insert("Destination", destination); - headers.insert("Overwrite", overwriteVal); - - moveReply = this->networkHelper->makeRequest("MOVE", source, headers); - - connect(moveReply, &QNetworkReply::finished, - [=]() { reply->sendMoveResponseSignal(moveReply); }); - - connect(moveReply, - QOverload::of(&QNetworkReply::error), - [=](QNetworkReply::NetworkError err) { - this->errorReplyHandler(reply, err); - }); - - return reply; -} - -WebDAVReply* WebDAVClient::remove(QString path) { - WebDAVReply* reply = new WebDAVReply(); - QMap headers; - QNetworkReply* removeReply; - - removeReply = this->networkHelper->makeRequest("DELETE", path, headers); - - connect(removeReply, &QNetworkReply::finished, - [=]() { reply->sendRemoveResponseSignal(removeReply); }); - - connect(removeReply, - QOverload::of(&QNetworkReply::error), - [=](QNetworkReply::NetworkError err) { - this->errorReplyHandler(reply, err); - }); - - return reply; -} - -void WebDAVClient::errorReplyHandler(WebDAVReply* reply, - QNetworkReply::NetworkError err) { - reply->sendError(err); -} - -WebDAVClient::~WebDAVClient() { - this->networkHelper->deleteLater(); - delete this->xmlHelper; -} diff --git a/3rdparty/mauikit2/src/utils/syncing/libwebdavclient/lib/WebDAVClient.hpp b/3rdparty/mauikit2/src/utils/syncing/libwebdavclient/lib/WebDAVClient.hpp deleted file mode 100644 index d9a0440..0000000 --- a/3rdparty/mauikit2/src/utils/syncing/libwebdavclient/lib/WebDAVClient.hpp +++ /dev/null @@ -1,58 +0,0 @@ -#ifndef WEBDAVCLIENT_HPP -#define WEBDAVCLIENT_HPP - -#include -#include -#include -#include -#include -#include - -#ifndef STATIC_MAUIKIT -#include "mauikit_export.h" -#endif - -#include "utils/NetworkHelper.hpp" -#include "utils/WebDAVReply.hpp" -#include "utils/XMLHelper.hpp" - -enum ListDepthEnum { Zero, One, Two, Infinity }; - -#ifdef STATIC_MAUIKIT -class WebDAVClient : public QObject -#else -class MAUIKIT_EXPORT WebDAVClient : public QObject -#endif -{ - Q_OBJECT - - public: - WebDAVClient(QString host, QString username, QString password); - - WebDAVReply* listDir(QString path = "/"); - WebDAVReply* listDir(QString path, ListDepthEnum depth); - - WebDAVReply* downloadFrom(QString path); - WebDAVReply* downloadFrom(QString path, qint64 startByte, qint64 endByte); - - WebDAVReply* uploadTo(QString path, QString filename, QIODevice* file); - - WebDAVReply* createDir(QString path, QString dirName); - - WebDAVReply* copy(QString source, QString destination); - - WebDAVReply* move(QString source, QString destination, - bool overwrite = false); - - WebDAVReply* remove(QString path); - - ~WebDAVClient(); - - private: - NetworkHelper* networkHelper; - XMLHelper* xmlHelper; - - void errorReplyHandler(WebDAVReply* reply, QNetworkReply::NetworkError err); -}; - -#endif diff --git a/3rdparty/mauikit2/src/utils/syncing/libwebdavclient/lib/dto/WebDAVItem.cpp b/3rdparty/mauikit2/src/utils/syncing/libwebdavclient/lib/dto/WebDAVItem.cpp deleted file mode 100644 index 45f1456..0000000 --- a/3rdparty/mauikit2/src/utils/syncing/libwebdavclient/lib/dto/WebDAVItem.cpp +++ /dev/null @@ -1,83 +0,0 @@ -#include -#include -#include -#include -#include - -#include "../WebDAVClient.hpp" -#include "../utils/WebDAVReply.hpp" -#include "WebDAVItem.hpp" - -WebDAVItem::WebDAVItem(WebDAVClient* webdavClient, QString href, - QString creationDate, QString lastModified, - QString displayName, QString contentType, - QString contentLength, bool isCollection) { - this->webdavClient = webdavClient; - this->href = href; - this->creationDate = - QDateTime::fromString(creationDate, Qt::DateFormat::ISODate); - this->lastModified = lastModified; - this->displayName = displayName; - this->contentType = contentType; - this->contentLength = contentLength.toInt(); - this->flagIsCollection = isCollection; -} - -bool WebDAVItem::isCollection() { return this->flagIsCollection; } - -bool WebDAVItem::isFile() { return !this->flagIsCollection; } - -WebDAVReply* WebDAVItem::download() { - return this->webdavClient->downloadFrom(this->href); -} - -WebDAVReply* WebDAVItem::upload(QString filename, QIODevice* file) { - return this->webdavClient->uploadTo(this->href, filename, file); -} - -WebDAVReply* WebDAVItem::createDir(QString dirName) { - return this->webdavClient->createDir(this->href, dirName); -} - -WebDAVReply* WebDAVItem::copy(QString destination) { - return this->webdavClient->copy(this->href, destination); -} - -WebDAVReply* WebDAVItem::move(QString destination, bool overwrite) { - return this->webdavClient->move(this->href, destination, overwrite); -} - -WebDAVReply* WebDAVItem::remove() { - return this->webdavClient->remove(this->href); -} - -WebDAVReply* WebDAVItem::listDir() { - return this->webdavClient->listDir(this->href); -} - -QString WebDAVItem::toString() { - QString s; - QTextStream out(&s); - - out << "HREF : " << this->href << "," << endl - << "CREATION_DATE : " << this->creationDate.toString() << "," << endl - << "LAST_MODIFIED : " << this->lastModified << "," << endl - << "DISPLAY_NAME : " << this->displayName << "," << endl - << "CONTENT_TYPE : " << this->contentType << "," << endl - << "CONTENT_LENGTH : " << this->contentLength << "," << endl - << "IS_COLLECTION : " << this->flagIsCollection; - - return s; -} - -QString WebDAVItem::getHref() { return this->href; } - -QDateTime WebDAVItem::getCreationDate() { return this->creationDate; } - -QString WebDAVItem::getLastModified() { return this->lastModified; } - -QString WebDAVItem::getDisplayName() { return this->displayName; } - -QString WebDAVItem::getContentType() { return this->contentType; } - -int WebDAVItem::getContentLength() { return this->contentLength; } diff --git a/3rdparty/mauikit2/src/utils/syncing/libwebdavclient/lib/dto/WebDAVItem.hpp b/3rdparty/mauikit2/src/utils/syncing/libwebdavclient/lib/dto/WebDAVItem.hpp deleted file mode 100644 index 232763c..0000000 --- a/3rdparty/mauikit2/src/utils/syncing/libwebdavclient/lib/dto/WebDAVItem.hpp +++ /dev/null @@ -1,50 +0,0 @@ -#ifndef DTO_WEBDAVITEM_HPP -#define DTO_WEBDAVITEM_HPP - -#include -#include -#include - -class WebDAVClient; -class WebDAVReply; - -class WebDAVItem -{ - public: - WebDAVItem(WebDAVClient* webdavClient, QString href, QString creationDate, - QString lastModified, QString displayName, QString contentType, - QString contentLength, bool isCollection); - - bool isCollection(); - bool isFile(); - - WebDAVReply* download(); - WebDAVReply* listDir(); - WebDAVReply* upload(QString filename, QIODevice* file); - WebDAVReply* createDir(QString dirName); - WebDAVReply* copy(QString destination); - WebDAVReply* move(QString destination, bool overwrite = false); - WebDAVReply* remove(); - - QString toString(); - - QString getHref(); - QDateTime getCreationDate(); - QString getLastModified(); - QString getDisplayName(); - QString getContentType(); - int getContentLength(); - - private: - WebDAVClient* webdavClient; - QString href; - QDateTime creationDate; - QString lastModified; - QString displayName; - QString contentType; - int contentLength; - - bool flagIsCollection; -}; - -#endif diff --git a/3rdparty/mauikit2/src/utils/syncing/libwebdavclient/lib/tests/CMakeLists.txt b/3rdparty/mauikit2/src/utils/syncing/libwebdavclient/lib/tests/CMakeLists.txt deleted file mode 100644 index 9ba3c2c..0000000 --- a/3rdparty/mauikit2/src/utils/syncing/libwebdavclient/lib/tests/CMakeLists.txt +++ /dev/null @@ -1,48 +0,0 @@ -find_package( - Qt5 - REQUIRED - - COMPONENTS - Test - Network - Xml -) - -set(CMAKE_AUTOMOC ON) -set(CMAKE_INCLUDE_CURRENT_DIR ON) - -set( - CPP_SOURCES - - ../WebDAVClient.cpp - - ../dto/WebDAVItem.cpp - - ../utils/NetworkHelper.cpp - ../utils/WebDAVReply.cpp - ../utils/XMLHelper.cpp - ../utils/Environment.cpp -) - -set( - TEST_SOURCES - - TestWebDAVClient.cpp -) - -add_executable( - ${PROJECT_NAME}_test - - ${TEST_SOURCES} - ${CPP_SOURCES} -) - -target_link_libraries( - ${PROJECT_NAME}_test - - Qt5::Test - Qt5::Network - Qt5::Xml -) - -add_test(${PROJECT_NAME}_test ${PROJECT_NAME}_test) diff --git a/3rdparty/mauikit2/src/utils/syncing/libwebdavclient/lib/tests/TestWebDAVClient.cpp b/3rdparty/mauikit2/src/utils/syncing/libwebdavclient/lib/tests/TestWebDAVClient.cpp deleted file mode 100644 index 5dbf57c..0000000 --- a/3rdparty/mauikit2/src/utils/syncing/libwebdavclient/lib/tests/TestWebDAVClient.cpp +++ /dev/null @@ -1,247 +0,0 @@ -#ifndef TEST_TESTWEBDAVCLIENT -#define TEST_TESTWEBDAVCLIENT - -#include -#include -#include -#include - -#include "../WebDAVClient.hpp" -#include "../dto/WebDAVItem.hpp" -#include "../utils/Environment.hpp" -#include "../utils/WebDAVReply.hpp" - -class TestWebDAVClient : public QObject { - Q_OBJECT - - private: - QCoreApplication *app; - WebDAVClient *client; - - void listDirOutputHandler(WebDAVReply *reply) { - connect(reply, &WebDAVReply::listDirResponse, - [=](QNetworkReply *listDirReply, QList items) { - qDebug() << "URL :" << listDirReply->url(); - qDebug() << "Received List of" << items.length() << "items"; - qDebug() << endl << "---------------------------------------"; - - for (WebDAVItem item : items) { - qDebug().noquote() << endl << item.toString(); - qDebug() << endl << "---------------------------------------"; - } - - QCoreApplication::exit(0); - }); - connect(reply, &WebDAVReply::error, [=](QNetworkReply::NetworkError err) { - qDebug() << err; - QCoreApplication::exit(1); - }); - } - - private slots: - void initTestCase() { - int argc = 1; - char *argv[] = {"test"}; - - this->app = new QCoreApplication(argc, argv); - this->client = - new WebDAVClient(Environment::get("LIBWEBDAV_TEST_HOST"), - Environment::get("LIBWEBDAV_TEST_USER"), - Environment::get("LIBWEBDAV_TEST_PASSWORD")); - } - - void testListDir() { - this->listDirOutputHandler( - this->client->listDir(Environment::get("LIBWEBDAV_TEST_PATH"))); - this->app->exec(); - } - - void testListDirWithDepth() { - this->listDirOutputHandler(this->client->listDir( - Environment::get("LIBWEBDAV_TEST_PATH"), ListDepthEnum::One)); - - this->app->exec(); - } - - void testDownload() { - QString url = "/remote.php/webdav/Nextcloud%20Manual.pdf"; - - WebDAVReply *reply = this->client->downloadFrom(url); - - connect(reply, &WebDAVReply::downloadResponse, [=](QNetworkReply *reply) { - if (!reply->error()) { - qDebug() << "\nDownload Success" - << "\nURL :" << reply->url() << "\nSize :" << reply->size(); - } else { - qDebug() << "ERROR(DOWNLOAD)" << reply->error(); - } - QCoreApplication::exit(0); - }); - connect(reply, &WebDAVReply::downloadProgressResponse, - [=](qint64 bytesReceived, qint64 bytesTotal) { - int percent = ((float)bytesReceived / bytesTotal) * 100; - - qDebug() << "\nReceived : " << bytesReceived - << "\nTotal : " << bytesTotal - << "\nPercent : " << percent; - }); - connect(reply, &WebDAVReply::error, [=](QNetworkReply::NetworkError err) { - qDebug() << "ERROR" << err; - QCoreApplication::exit(1); - }); - - this->app->exec(); - } - - void testUpload() { - QString url = Environment::get("LIBWEBDAV_TEST_PATH"); - QFile file("/home/anupam/libwebdav/lib/WebDAVClient.cpp"); - file.open(QIODevice::ReadOnly); - - WebDAVReply *reply = this->client->uploadTo(url, "tttt.cpp", &file); - - connect(reply, &WebDAVReply::uploadFinished, [=](QNetworkReply *reply) { - if (!reply->error()) { - qDebug() << "\nUpload Success" - << "\nURL :" << reply->url() << "\nSize :" << reply->size(); - } else { - qDebug() << "ERROR(UPLOAD)" << reply->error(); - } - QCoreApplication::exit(0); - }); - - connect(reply, &WebDAVReply::error, [=](QNetworkReply::NetworkError err) { - qDebug() << "ERROR" << err; - QCoreApplication::exit(1); - }); - - this->app->exec(); - } - - void testCreateDir() { - QString dirName = QDate::currentDate().toString(Qt::DateFormat::ISODate); - WebDAVReply *reply = this->client->createDir( - Environment::get("LIBWEBDAV_TEST_PATH"), dirName); - - connect(reply, &WebDAVReply::createDirFinished, [=](QNetworkReply *reply) { - if (!reply->error()) { - qDebug() << "\nDir Created" - << "\nURL :" << reply->url(); - } else { - qDebug() << "ERROR(CREATE DIR)" << reply->error(); - } - QCoreApplication::exit(0); - }); - - connect(reply, &WebDAVReply::error, [=](QNetworkReply::NetworkError err) { - qDebug() << "ERROR" << err; - QCoreApplication::exit(1); - }); - - this->app->exec(); - } - - void testCopyDir() { - QString dirName = QDate::currentDate().toString(Qt::DateFormat::ISODate); - WebDAVReply *reply = this->client->copy( - Environment::get("LIBWEBDAV_TEST_PATH") + "/tttt.cpp", - Environment::get("LIBWEBDAV_TEST_PATH") + "/" + dirName + - "/tttt-copy.cpp"); - - connect(reply, &WebDAVReply::copyFinished, [=](QNetworkReply *reply) { - if (!reply->error()) { - qDebug() << "\nItem Copied" - << "\nURL :" << reply->url(); - } else { - qDebug() << "ERROR(COPY)" << reply->error(); - } - QCoreApplication::exit(0); - }); - - connect(reply, &WebDAVReply::error, [=](QNetworkReply::NetworkError err) { - qDebug() << "ERROR" << err; - QCoreApplication::exit(1); - }); - - this->app->exec(); - } - - void testMoveDir() { - QString dirName = QDate::currentDate().toString(Qt::DateFormat::ISODate); - WebDAVReply *reply = this->client->move( - Environment::get("LIBWEBDAV_TEST_PATH") + "/tttt.cpp", - Environment::get("LIBWEBDAV_TEST_PATH") + "/" + dirName + "/tttt.cpp", - true); - - connect(reply, &WebDAVReply::moveFinished, [=](QNetworkReply *reply) { - if (!reply->error()) { - qDebug() << "\nItem Moved" - << "\nURL :" << reply->url(); - } else { - qDebug() << "ERROR(MOVE DIR)" << reply->error(); - } - QCoreApplication::exit(0); - }); - - connect(reply, &WebDAVReply::error, [=](QNetworkReply::NetworkError err) { - qDebug() << "ERROR" << err; - QCoreApplication::exit(1); - }); - - this->app->exec(); - } - - void testRemove() { - QString dirName = QDate::currentDate().toString(Qt::DateFormat::ISODate); - - WebDAVReply *reply = this->client->remove( - Environment::get("LIBWEBDAV_TEST_PATH") + "/" + dirName + "/tttt.cpp"); - - connect(reply, &WebDAVReply::removeFinished, [=](QNetworkReply *reply) { - if (!reply->error()) { - qDebug() << "\nItem Removed" - << "\nURL :" << reply->url(); - } else { - qDebug() << "ERROR(REMOVE File)" << reply->error(); - } - QCoreApplication::exit(0); - }); - - connect(reply, &WebDAVReply::error, [=](QNetworkReply::NetworkError err) { - qDebug() << "ERROR" << err; - QCoreApplication::exit(1); - }); - - this->app->exec(); - } - - void testRemoveDir() { - QString dirName = QDate::currentDate().toString(Qt::DateFormat::ISODate); - WebDAVReply *reply = this->client->remove( - Environment::get("LIBWEBDAV_TEST_PATH") + "/" + dirName); - - connect(reply, &WebDAVReply::removeFinished, [=](QNetworkReply *reply) { - if (!reply->error()) { - qDebug() << "\nItem Removed" - << "\nURL :" << reply->url(); - } else { - qDebug() << "ERROR(REMOVE Dir)" << reply->error(); - } - QCoreApplication::exit(0); - }); - - connect(reply, &WebDAVReply::error, [=](QNetworkReply::NetworkError err) { - qDebug() << "ERROR" << err; - QCoreApplication::exit(1); - }); - - this->app->exec(); - } - - void cleanupTestCase() { delete this->app; } -}; - -QTEST_MAIN(TestWebDAVClient) -#include "TestWebDAVClient.moc" - -#endif diff --git a/3rdparty/mauikit2/src/utils/syncing/libwebdavclient/lib/utils/Environment.cpp b/3rdparty/mauikit2/src/utils/syncing/libwebdavclient/lib/utils/Environment.cpp deleted file mode 100644 index 8ee3d34..0000000 --- a/3rdparty/mauikit2/src/utils/syncing/libwebdavclient/lib/utils/Environment.cpp +++ /dev/null @@ -1,8 +0,0 @@ -#include - -#include "Environment.hpp" - -QString Environment::get(QString key) { - char* val = getenv(key.toStdString().c_str()); - return val == NULL ? QString("") : QString(val); -} diff --git a/3rdparty/mauikit2/src/utils/syncing/libwebdavclient/lib/utils/Environment.hpp b/3rdparty/mauikit2/src/utils/syncing/libwebdavclient/lib/utils/Environment.hpp deleted file mode 100644 index a5042df..0000000 --- a/3rdparty/mauikit2/src/utils/syncing/libwebdavclient/lib/utils/Environment.hpp +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef UTILS_ENVIRONMENT_HPP -#define UTILS_ENVIRONMENT_HPP - -#include - -class Environment { -public: - static QString get(QString key); -}; - -#endif diff --git a/3rdparty/mauikit2/src/utils/syncing/libwebdavclient/lib/utils/NetworkHelper.cpp b/3rdparty/mauikit2/src/utils/syncing/libwebdavclient/lib/utils/NetworkHelper.cpp deleted file mode 100644 index 1dfd52a..0000000 --- a/3rdparty/mauikit2/src/utils/syncing/libwebdavclient/lib/utils/NetworkHelper.cpp +++ /dev/null @@ -1,61 +0,0 @@ -#include -#include -#include -#include -#include - -#include "NetworkHelper.hpp" - -NetworkHelper::NetworkHelper(QString host, QString username, QString password) { - this->host = host; - this->username = username; - this->password = password; - - this->networkManager = new QNetworkAccessManager(this); -} - -QNetworkReply* NetworkHelper::makeRequest(QString method, QString path, - QMap headers) { - QNetworkRequest request(QUrl(this->host + "/" + path)); - - this->setRequestAuthHeader(&request); - this->setRequestHeaders(&request, headers); - - QNetworkReply* reply = this->networkManager->sendCustomRequest( - request, QByteArray::fromStdString(method.toStdString())); - - return reply; -} - -QNetworkReply* NetworkHelper::makePutRequest(QString path, - QMap headers, - QIODevice* file) { - QNetworkRequest request(QUrl(this->host + "/" + path)); - - this->setRequestAuthHeader(&request); - this->setRequestHeaders(&request, headers); - - QNetworkReply* reply = this->networkManager->put(request, file); - - return reply; -} - -void NetworkHelper::setRequestAuthHeader(QNetworkRequest* request) { - QString authData = this->username + ":" + this->password; - QByteArray data = authData.toLocal8Bit().toBase64(); - QString headerData = "Basic " + data; - - request->setRawHeader("Authorization", headerData.toLocal8Bit()); -} - -void NetworkHelper::setRequestHeaders(QNetworkRequest* request, - QMap headers) { - QMapIterator headersIterator(headers); - - while (headersIterator.hasNext()) { - headersIterator.next(); - request->setRawHeader( - QByteArray::fromStdString(headersIterator.key().toStdString()), - QByteArray::fromStdString(headersIterator.value().toStdString())); - } -} diff --git a/3rdparty/mauikit2/src/utils/syncing/libwebdavclient/lib/utils/NetworkHelper.hpp b/3rdparty/mauikit2/src/utils/syncing/libwebdavclient/lib/utils/NetworkHelper.hpp deleted file mode 100644 index 8acbddb..0000000 --- a/3rdparty/mauikit2/src/utils/syncing/libwebdavclient/lib/utils/NetworkHelper.hpp +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef UTILS_NETWORKHELPER_HPP -#define UTILS_NETWORKHELPER_HPP - -#include -#include -#include -#include -#include -#include - -class NetworkHelper : public QObject { - Q_OBJECT - - private: - QString host; - QString username; - QString password; - QNetworkAccessManager* networkManager; - - void setRequestAuthHeader(QNetworkRequest* request); - void setRequestHeaders(QNetworkRequest* request, - QMap headers); - - public: - NetworkHelper(QString host, QString username, QString password); - - QNetworkReply* makeRequest(QString method, QString path, - QMap headers); - QNetworkReply* makePutRequest(QString path, QMap headers, - QIODevice* file); -}; - -#endif diff --git a/3rdparty/mauikit2/src/utils/syncing/libwebdavclient/lib/utils/WebDAVReply.cpp b/3rdparty/mauikit2/src/utils/syncing/libwebdavclient/lib/utils/WebDAVReply.cpp deleted file mode 100644 index 46a647e..0000000 --- a/3rdparty/mauikit2/src/utils/syncing/libwebdavclient/lib/utils/WebDAVReply.cpp +++ /dev/null @@ -1,44 +0,0 @@ -#include -#include -#include -#include - -#include "WebDAVReply.hpp" - -void WebDAVReply::sendListDirResponseSignal(QNetworkReply* listDirReply, - QList items) { - emit listDirResponse(listDirReply, items); -} - -void WebDAVReply::sendDownloadResponseSignal(QNetworkReply* downloadReply) { - emit downloadResponse(downloadReply); -} - -void WebDAVReply::sendDownloadProgressResponseSignal(qint64 bytesReceived, - qint64 bytesTotal) { - emit downloadProgressResponse(bytesReceived, bytesTotal); -} - -void WebDAVReply::sendUploadFinishedResponseSignal(QNetworkReply* uploadReply) { - emit uploadFinished(uploadReply); -} - -void WebDAVReply::sendDirCreatedResponseSignal(QNetworkReply* createDirReply) { - emit createDirFinished(createDirReply); -} - -void WebDAVReply::sendCopyResponseSignal(QNetworkReply* copyReply) { - emit copyFinished(copyReply); -} - -void WebDAVReply::sendMoveResponseSignal(QNetworkReply* moveReply) { - emit moveFinished(moveReply); -} - -void WebDAVReply::sendRemoveResponseSignal(QNetworkReply* removeReply) { - emit removeFinished(removeReply); -} - -void WebDAVReply::sendError(QNetworkReply::NetworkError err) { - emit error(err); -} diff --git a/3rdparty/mauikit2/src/utils/syncing/libwebdavclient/lib/utils/WebDAVReply.hpp b/3rdparty/mauikit2/src/utils/syncing/libwebdavclient/lib/utils/WebDAVReply.hpp deleted file mode 100644 index 547d36f..0000000 --- a/3rdparty/mauikit2/src/utils/syncing/libwebdavclient/lib/utils/WebDAVReply.hpp +++ /dev/null @@ -1,48 +0,0 @@ -#ifndef UTILS_WEBDAVREPLY_HPP -#define UTILS_WEBDAVREPLY_HPP - -#include -#include -#include -#include - -#ifndef STATIC_MAUIKIT -#include "mauikit_export.h" -#endif - -#include "../dto/WebDAVItem.hpp" - -#ifdef STATIC_MAUIKIT -class WebDAVReply : public QObject -#else -class MAUIKIT_EXPORT WebDAVReply : public QObject -#endif - { - Q_OBJECT - - public: - void sendListDirResponseSignal(QNetworkReply* listDirReply, - QList items); - void sendDownloadResponseSignal(QNetworkReply* downloadReply); - void sendDownloadProgressResponseSignal(qint64 bytesReceived, - qint64 bytesTotal); - void sendUploadFinishedResponseSignal(QNetworkReply* uploadReply); - void sendDirCreatedResponseSignal(QNetworkReply* createDirReply); - void sendCopyResponseSignal(QNetworkReply* copyReply); - void sendMoveResponseSignal(QNetworkReply* moveReply); - void sendRemoveResponseSignal(QNetworkReply* removeReply); - void sendError(QNetworkReply::NetworkError err); - - signals: - void listDirResponse(QNetworkReply* listDirReply, QList items); - void downloadResponse(QNetworkReply* downloadReply); - void downloadProgressResponse(qint64 bytesReceived, qint64 bytesTotal); - void uploadFinished(QNetworkReply* uploadReply); - void createDirFinished(QNetworkReply* createDirReply); - void copyFinished(QNetworkReply* copyReply); - void moveFinished(QNetworkReply* moveReply); - void removeFinished(QNetworkReply* removeReply); - void error(QNetworkReply::NetworkError err); -}; - -#endif diff --git a/3rdparty/mauikit2/src/utils/syncing/libwebdavclient/lib/utils/XMLHelper.cpp b/3rdparty/mauikit2/src/utils/syncing/libwebdavclient/lib/utils/XMLHelper.cpp deleted file mode 100644 index ee81608..0000000 --- a/3rdparty/mauikit2/src/utils/syncing/libwebdavclient/lib/utils/XMLHelper.cpp +++ /dev/null @@ -1,65 +0,0 @@ -#include -#include -#include -#include - -#include "../dto/WebDAVItem.hpp" -#include "XMLHelper.hpp" - -QList XMLHelper::parseListDirResponse(WebDAVClient *webdavClient, - QByteArray xml) { - QList items; - QString webdavNS = "DAV:"; - QDomDocument doc; - doc.setContent(xml, true); - - QDomNodeList responses = doc.elementsByTagNameNS(webdavNS, "response"); - - for (int i = 0; i < responses.length(); i++) { - QDomElement response = responses.at(i).toElement(); - - QString href = - response.elementsByTagNameNS(webdavNS, "href").at(0).toElement().text(); - QString creationDate = - response.elementsByTagNameNS(webdavNS, "creationdate") - .at(0) - .toElement() - .text(); - QString lastModified = - response.elementsByTagNameNS(webdavNS, "getlastmodified") - .at(0) - .toElement() - .text(); - QString displayName = response.elementsByTagNameNS(webdavNS, "displayname") - .at(0) - .toElement() - .text(); - QString contentType = - response.elementsByTagNameNS(webdavNS, "getcontenttype") - .at(0) - .toElement() - .text(); - QString contentLength = - response.elementsByTagNameNS(webdavNS, "getcontentlength") - .at(0) - .toElement() - .text(); - bool isCollection; - - if (response.elementsByTagNameNS(webdavNS, "resourcetype") - .at(0) - .toElement() - .elementsByTagNameNS(webdavNS, "collection") - .size() == 1) { - isCollection = true; - } else { - isCollection = false; - } - - items.append(WebDAVItem(webdavClient, href, creationDate, lastModified, - displayName, contentType, contentLength, - isCollection)); - } - - return items; -} diff --git a/3rdparty/mauikit2/src/utils/syncing/libwebdavclient/lib/utils/XMLHelper.hpp b/3rdparty/mauikit2/src/utils/syncing/libwebdavclient/lib/utils/XMLHelper.hpp deleted file mode 100644 index dfcab16..0000000 --- a/3rdparty/mauikit2/src/utils/syncing/libwebdavclient/lib/utils/XMLHelper.hpp +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef UTILS_XMLHELPER_HPP -#define UTILS_XMLHELPER_HPP - -#include -#include - -#include "../dto/WebDAVItem.hpp" - -class WebDAVClient; - -class XMLHelper { - public: - QList parseListDirResponse(WebDAVClient *webdavClient, - QByteArray xml); -}; - -#endif diff --git a/3rdparty/mauikit2/src/utils/syncing/libwebdavclient/webdavclient.pri b/3rdparty/mauikit2/src/utils/syncing/libwebdavclient/webdavclient.pri deleted file mode 100644 index 6bf3e89..0000000 --- a/3rdparty/mauikit2/src/utils/syncing/libwebdavclient/webdavclient.pri +++ /dev/null @@ -1,30 +0,0 @@ -VERSION = $$cat($$PWD/VERSION) - -QT *= \ - core \ - xml \ - network \ - testlib - -CONFIG += c++11 - -HEADERS += \ - $$PWD/lib/WebDAVClient.hpp \ - $$PWD/lib/utils/XMLHelper.hpp \ - $$PWD/lib/utils/WebDAVReply.hpp \ - $$PWD/lib/utils/NetworkHelper.hpp \ - $$PWD/lib/utils/Environment.hpp \ - $$PWD/lib/dto/WebDAVItem.hpp - -SOURCES += \ - $$PWD/lib/WebDAVClient.cpp \ - $$PWD/lib/utils/NetworkHelper.cpp \ - $$PWD/lib/utils/Environment.cpp \ - $$PWD/lib/utils/XMLHelper.cpp \ - $$PWD/lib/utils/WebDAVReply.cpp \ - $$PWD/lib/dto/WebDAVItem.cpp - -INCLUDEPATH += \ - $$PWD/lib \ - $$PWD/lib/utils \ - $$PWD/lib/dto diff --git a/3rdparty/mauikit2/src/utils/syncing/syncing.cpp b/3rdparty/mauikit2/src/utils/syncing/syncing.cpp deleted file mode 100644 index 2cc5411..0000000 --- a/3rdparty/mauikit2/src/utils/syncing/syncing.cpp +++ /dev/null @@ -1,406 +0,0 @@ -#include "syncing.h" -#include "fm.h" - -#include -#include -#include - -#include "WebDAVClient.hpp" -#include "WebDAVItem.hpp" -#include "WebDAVReply.hpp" - -Syncing::Syncing(QObject *parent) : QObject(parent) -{ - this->setCredentials(this->host, this->user, this->password); -} - -void Syncing::listContent(const QUrl &path, const QStringList &filters, const int &depth) -{ - this->currentPath = path; - - auto url = QUrl(path).path().replace(user, ""); - this->listDirOutputHandler(this->client->listDir(url, static_cast(depth)), filters); -} - -void Syncing::setCredentials(const QString &server, const QString &user, const QString &password) -{ - this->host = server; - this->user = user; - this->password = password; - - this->client = new WebDAVClient(this->host, this->user, this->password); -} - -void Syncing::listDirOutputHandler(WebDAVReply *reply, const QStringList &filters) -{ - connect(reply, &WebDAVReply::listDirResponse, [=](QNetworkReply *listDirReply, QList items) - { -// qDebug() << "URL :" << listDirReply->url(); -// qDebug() << "Received List of" << items.length() << "items"; -// qDebug() << endl << "---------------------------------------"; - FMH::MODEL_LIST list; - for (WebDAVItem item : items) - { - const auto url = QUrl(item.getHref()).toString(); - - auto path = QString(FMH::PATHTYPE_URI[FMH::PATHTYPE_KEY::CLOUD_PATH]+this->user+"/")+QString(url).replace("/remote.php/webdav/", ""); - - auto displayName = item.getContentType().isEmpty() ? QString(url).replace("/remote.php/webdav/", "").replace("/", "") : QString(path).right(path.length()-path.lastIndexOf("/")-1); - - // qDebug()<< "PATHS:" << path << this->currentPath; - - if(QString(url).replace("/remote.php/webdav/", "").isEmpty() || path == this->currentPath.toString()) - continue; - - // qDebug()<< "FILTERING "<< filters << QString(displayName).right(displayName.length() - displayName.lastIndexOf(".")); - if(!filters.isEmpty() && !filters.contains("*"+QString(displayName).right(displayName.length() - displayName.lastIndexOf(".")))) - continue; - - list << FMH::MODEL { {FMH::MODEL_KEY::LABEL, displayName}, - {FMH::MODEL_KEY::NAME, item.getDisplayName()}, - {FMH::MODEL_KEY::DATE, item.getCreationDate().toString(Qt::TextDate)}, - {FMH::MODEL_KEY::MODIFIED, item.getLastModified()}, - {FMH::MODEL_KEY::MIME, item.getContentType().isEmpty() ? "inode/directory" : item.getContentType()}, - {FMH::MODEL_KEY::ICON, FMH::getIconName(url)}, - {FMH::MODEL_KEY::SIZE, QString::number(item.getContentLength())}, - {FMH::MODEL_KEY::PATH, path}, - {FMH::MODEL_KEY::URL, url}, - {FMH::MODEL_KEY::THUMBNAIL, item.getContentType().isEmpty() ? url : this->getCacheFile(url).toString()} - }; - } - emit this->listReady(list, this->currentPath); - - }); - connect(reply, &WebDAVReply::error, [=](QNetworkReply::NetworkError err) { -// qDebug() << "ERROR" << err; - this->emitError(err); - }); -} - -QUrl Syncing::getCacheFile(const QUrl &path) -{ - const auto directory = FM::resolveUserCloudCachePath(this->host, this->user); - const auto file = directory + path.toString().replace("remote.php/webdav/", ""); - - qDebug()<< "resolving file"<< file; - - if(FMH::fileExists(file)) - return file; - else return path; -} - -void Syncing::download(const QUrl &path) -{ - QString url = QString(path.toString()).replace("remote.php/webdav/", ""); - - WebDAVReply *reply = this->client->downloadFrom(url); - qDebug()<< "CURRENT CREDENTIALS"<< this->host << this->user; - connect(reply, &WebDAVReply::downloadResponse, [=](QNetworkReply *reply) - { - if (!reply->error()) - { - qDebug() << "\nDownload Success" - << "\nURL :" << reply->url() << "\nSize :" << reply->size(); - auto file = reply->readAll(); - const auto directory = FMH::CloudCachePath+"opendesktop/"+this->user; - - QDir dir(directory); - - if (!dir.exists()) - dir.mkpath("."); - - this->saveTo(file, directory+url); - } else - { - qDebug() << "ERROR(DOWNLOAD)" << reply->error() << reply->url() <error(reply->errorString()); - } - }); - - connect(reply, &WebDAVReply::downloadProgressResponse, [=](qint64 bytesReceived, qint64 bytesTotal) - { - int percent = ((float)bytesReceived / bytesTotal) * 100; - - qDebug() << "\nReceived : " << bytesReceived - << "\nTotal : " << bytesTotal - << "\nPercent : " << percent; - - emit this->progress(percent); - }); - - connect(reply, &WebDAVReply::error, [=](QNetworkReply::NetworkError err) { - qDebug() << "ERROR" << err; - }); -} - -void Syncing::upload(const QUrl &path, const QUrl &filePath) -{ - - if(!FMH::fileExists(filePath)) - return; - - qDebug()<< "Copy to cloud. File exists" << path << filePath; - - this->mFile.setFileName(filePath.toString()); - - if(this->mFile.open(QIODevice::ReadOnly)) - { - qDebug()<< "Copy to cloud. File could be opened"; - - WebDAVReply *reply = this->client->uploadTo(path.toString(), QFileInfo(filePath.toString()).fileName(), &this->mFile); - - connect(reply, &WebDAVReply::uploadFinished, [=](QNetworkReply *reply) - { - if (!reply->error()) - { - qDebug() << "\nUpload Success" - << "\nURL :" << reply->url() << "\nSize :" << reply->size(); - - auto cachePath = this->saveToCache(filePath.toString(), path); - - auto item = FMH::getFileInfoModel(cachePath); -// item[FMH::MODEL_KEY::PATH] = this->currentPath+"/"+QFileInfo(filePath).fileName()+"/"; - - emit this->uploadReady(item, this->currentPath); - } else - { - qDebug() << "ERROR(UPLOAD)" << reply->error(); - emit this->error(reply->errorString()); - } - - if(!this->uploadQueue.isEmpty()) - { - qDebug()<<"UPLOAD QUEUE" << this->uploadQueue; - this->upload(path, this->uploadQueue.takeLast()); - } - }); - - connect(reply, &WebDAVReply::error, [=](QNetworkReply::NetworkError err) - { - qDebug() << "ERROR" << err; - this->emitError(err); - });} -} - -void Syncing::createDir(const QUrl &path, const QString &name) -{ - WebDAVReply *reply = this->client->createDir(path.toString(), name); - - connect(reply, &WebDAVReply::createDirFinished, [=](QNetworkReply *reply) - { - if (!reply->error()) - { - qDebug() << "\nDir Created" - << "\nURL :" << reply->url(); - FMH::MODEL dir = { - {FMH::MODEL_KEY::LABEL, name}, - {FMH::MODEL_KEY::DATE, QDateTime::currentDateTime().toString(Qt::TextDate)}, - {FMH::MODEL_KEY::MIME, "inode/directory"}, - {FMH::MODEL_KEY::ICON, "folder"}, - {FMH::MODEL_KEY::PATH, this->currentPath.toString()+"/"+name+"/"} - }; - emit this->dirCreated(dir, this->currentPath); - } else - { - qDebug() << "ERROR(CREATE DIR)" << reply->error(); - emit this->error(reply->errorString()); - } - }); - - connect(reply, &WebDAVReply::error, [=](QNetworkReply::NetworkError err) - { - qDebug() << "ERROR" << err; - this->emitError(err); - }); -} - -void Syncing::emitError(const QNetworkReply::NetworkError &err) -{ - - switch(err) - { - case QNetworkReply::AuthenticationRequiredError: - emit this->error("The remote server requires authentication to serve the content but the credentials provided were not accepted (if any)"); - break; - - case QNetworkReply::ConnectionRefusedError: - emit this->error("the remote server refused the connection (the server is not accepting requests)"); - break; - - case QNetworkReply::RemoteHostClosedError: - emit this->error("the remote server closed the connection prematurely, before the entire reply was received and processed"); - break; - - case QNetworkReply::HostNotFoundError: - emit this->error("the remote host name was not found (invalid hostname)"); - break; - - case QNetworkReply::TimeoutError: - emit this->error("the connection to the remote server timed out"); - break; - - case QNetworkReply::OperationCanceledError: - emit this->error("the operation was canceled via calls to abort() or close() before it was finished."); - break; - - case QNetworkReply::SslHandshakeFailedError: - emit this->error("the SSL/TLS handshake failed and the encrypted channel could not be established. The sslErrors() signal should have been emitted."); - break; - - case QNetworkReply::TemporaryNetworkFailureError: - emit this->error("the connection was broken due to disconnection from the network, however the system has initiated roaming to another access point. The request should be resubmitted and will be processed as soon as the connection is re-established."); - break; - - case QNetworkReply::NetworkSessionFailedError: - emit this->error("the connection was broken due to disconnection from the network or failure to start the network."); - break; - - case QNetworkReply::BackgroundRequestNotAllowedError: - emit this->error("the background request is not currently allowed due to platform policy."); - break; - - case QNetworkReply::TooManyRedirectsError: - emit this->error("while following redirects, the maximum limit was reached. The limit is by default set to 50 or as set by QNetworkRequest::setMaxRedirectsAllowed(). (This value was introduced in 5.6.)"); - break; - - case QNetworkReply::InsecureRedirectError: - emit this->error("while following redirects, the network access API detected a redirect from a encrypted protocol (https) to an unencrypted one (http)."); - break; - - case QNetworkReply::ProxyConnectionRefusedError: - emit this->error("the connection to the proxy server was refused (the proxy server is not accepting requests)"); - break; - - case QNetworkReply::ProxyConnectionClosedError: - emit this->error("the proxy server closed the connection prematurely, before the entire reply was received and processed"); - break; - - case QNetworkReply::ProxyNotFoundError: - emit this->error("the proxy host name was not found (invalid proxy hostname)"); - break; - - case QNetworkReply::ProxyTimeoutError: - emit this->error("the connection to the proxy timed out or the proxy did not reply in time to the request sent"); - break; - - case QNetworkReply::ProxyAuthenticationRequiredError: - emit this->error("the proxy requires authentication in order to honour the request but did not accept any credentials offered (if any)"); - break; - - case QNetworkReply::ContentAccessDenied: - emit this->error("the access to the remote content was denied (similar to HTTP error 403)"); - break; - - case QNetworkReply::ContentOperationNotPermittedError: - emit this->error("the operation requested on the remote content is not permitted"); - break; - - case QNetworkReply::ContentNotFoundError: - emit this->error("the remote content was not found at the server (similar to HTTP error 404)"); - break; - - case QNetworkReply::ContentReSendError: - emit this->error("the request needed to be sent again, but this failed for example because the upload data could not be read a second time."); - break; - - case QNetworkReply::ServiceUnavailableError: - emit this->error("the server is unable to handle the request at this time."); - break; - - default: emit this->error("There was an unknown error with the remote server or your internet connection."); - } -} - - -void Syncing::saveTo(const QByteArray &array, const QUrl &path) -{ - QFile file(path.toLocalFile()); - - if(!file.exists()) - { - QDir dir; - uint cut = path.toString().length()- path.toString().lastIndexOf("/") -1; - auto newPath = path.toString().right(cut); - dir.mkdir(path.toString().replace(newPath, "")); - qDebug()<< newPath << cut; - - }else file.remove(); - - file.open(QIODevice::WriteOnly); - file.write(array); - file.close(); - - emit this->itemReady(FMH::getFileInfoModel(path), this->currentPath, this->signalType); - // emit this->itemReady(FMH::getFileInfoModel(path)); -} - -QString Syncing::saveToCache(const QString& file, const QUrl &where) -{ - const auto directory = FMH::CloudCachePath+"opendesktop/"+this->user+"/"+where.toString(); - - QDir dir(directory); - - if (!dir.exists()) - dir.mkpath("."); - - const auto newPath = directory+"/"+QFileInfo(file).fileName(); - - if(QFile::copy(file, newPath)) - return newPath; - - return QString(); -} - -void Syncing::resolveFile(const FMH::MODEL& item, const Syncing::SIGNAL_TYPE &signalType) -{ - this->signalType = signalType; - - const auto url = item[FMH::MODEL_KEY::URL]; - const auto file = this->getCacheFile(url); - - if(FMH::fileExists(file)) - { - const auto cacheFile = FMH::getFileInfoModel(file); - - const auto dateCacheFile = QDateTime::fromString(cacheFile[FMH::MODEL_KEY::DATE], Qt::TextDate); - const auto dateCloudFile = QDateTime::fromString(QString(item[FMH::MODEL_KEY::MODIFIED]).replace("GMT", "").simplified(), "ddd, dd MMM yyyy hh:mm:ss"); - - qDebug()<<"FILE EXISTS ON CACHE" << dateCacheFile << dateCloudFile<< QString(item[FMH::MODEL_KEY::MODIFIED]).replace("GMT", "").simplified()<< file; - - if(dateCloudFile > dateCacheFile) - this->download(url); - else - emit this->itemReady(cacheFile, this->currentPath, this->signalType); - - } else - this->download(url); -} - -void Syncing::setCopyTo(const QUrl &path) -{ - if(this->copyTo == path) - return; - - this->copyTo = path; -} - -QUrl Syncing::getCopyTo() const -{ - return this->copyTo; -} - -QString Syncing::getUser() const -{ - return this->user; -} - -void Syncing::setUploadQueue(const QStringList& list) -{ - this->uploadQueue = list; -} - -QString Syncing::localToAbstractCloudPath(const QString& url) -{ - return QString(url).replace(FMH::CloudCachePath+"opendesktop", FMH::PATHTYPE_URI[FMH::PATHTYPE_KEY::CLOUD_PATH]); -} - diff --git a/3rdparty/mauikit2/src/utils/syncing/syncing.h b/3rdparty/mauikit2/src/utils/syncing/syncing.h deleted file mode 100644 index 188d393..0000000 --- a/3rdparty/mauikit2/src/utils/syncing/syncing.h +++ /dev/null @@ -1,88 +0,0 @@ -#ifndef SYNCING_H -#define SYNCING_H - -#include -#include -#include "fmh.h" - -#ifndef STATIC_MAUIKIT -#include "mauikit_export.h" -#endif - -class WebDAVClient; -class WebDAVReply; - -#ifdef STATIC_MAUIKIT -class Syncing : public QObject -#else -class MAUIKIT_EXPORT Syncing : public QObject -#endif -{ - Q_OBJECT - -public: - enum SIGNAL_TYPE : uint_fast8_t - { - OPEN, - DOWNLOAD, - COPY, - SAVE, - CUT, - DELETE, - RENAME, - MOVE, - UPLOAD - }; - - QStringList uploadQueue; - - - explicit Syncing(QObject *parent = nullptr); - void listContent(const QUrl &path, const QStringList &filters, const int &depth = 1); - void setCredentials(const QString &server, const QString &user, const QString &password); - void download(const QUrl &path); - void upload(const QUrl &path, const QUrl &filePath); - void createDir(const QUrl &path, const QString &name); - void resolveFile(const FMH::MODEL &item, const Syncing::SIGNAL_TYPE &signalType); - void setCopyTo(const QUrl &path); - QUrl getCopyTo() const; - - QString getUser() const; - - void setUploadQueue(const QStringList &list); - - QString localToAbstractCloudPath(const QString &url); - -private: - WebDAVClient *client; - QString host = "https://cloud.opendesktop.cc/remote.php/webdav/"; - QString user = "mauitest"; - QString password = "mauitest"; - void listDirOutputHandler(WebDAVReply *reply, const QStringList &filters = QStringList()); - - void saveTo(const QByteArray &array, const QUrl& path); - QString saveToCache(const QString& file, const QUrl &where); - QUrl getCacheFile(const QUrl &path); - - QUrl currentPath; - QUrl copyTo; - - void emitError(const QNetworkReply::NetworkError &err); - - SIGNAL_TYPE signalType; - - QFile mFile; - - -signals: - void listReady(FMH::MODEL_LIST data, QUrl url); - void itemReady(FMH::MODEL item, QUrl url, Syncing::SIGNAL_TYPE &signalType); - void dirCreated(FMH::MODEL item, QUrl url); - void uploadReady(FMH::MODEL item, QUrl url); - void error(QString message); - void progress(int percent); - -public slots: -}; - -#endif // SYNCING_H diff --git a/3rdparty/mauikit2/src/utils/syncing/syncinglist.cpp b/3rdparty/mauikit2/src/utils/syncing/syncinglist.cpp deleted file mode 100644 index 78650de..0000000 --- a/3rdparty/mauikit2/src/utils/syncing/syncinglist.cpp +++ /dev/null @@ -1,64 +0,0 @@ -#include "syncinglist.h" -#include "fm.h" - -SyncingList::SyncingList(QObject *parent) : QObject(parent), fm(new FM(this)) -{ - this->setList(); -} - -void SyncingList::setList() -{ - emit this->preListChanged(); - - this->list = this->fm->getCloudAccounts(); - qDebug()<< "SYNCIGN LIST"<< list; - - emit this->postListChanged(); -} - -QVariantMap SyncingList::get(const int &index) const -{ - if(index >= this->list.size() || index < 0) - return QVariantMap(); - - return FMH::toMap(this->list.at(index)); -} - -void SyncingList::refresh() -{ - this->setList(); -} - -void SyncingList::insert(const QVariantMap& data) -{ - auto model = FMH::toModel(data); - - if(this->fm->addCloudAccount(model[FMH::MODEL_KEY::SERVER], model[FMH::MODEL_KEY::USER], model[FMH::MODEL_KEY::PASSWORD])) - { - this->setList(); - } -} - -void SyncingList::removeAccount(const QString &server, const QString &user) -{ - if(this->fm->removeCloudAccount(server, user)) - { - this->refresh(); - } -} - -void SyncingList::removeAccountAndFiles(const QString &server, const QString &user) -{ - if(this->fm->removeCloudAccount(server, user)) - { - this->refresh(); - } - - this->fm->removeDir(FM::resolveUserCloudCachePath(server, user)); -} - -FMH::MODEL_LIST SyncingList::items() const -{ - return this->list; -} - diff --git a/3rdparty/mauikit2/src/utils/syncing/syncinglist.h b/3rdparty/mauikit2/src/utils/syncing/syncinglist.h deleted file mode 100644 index 81b58ec..0000000 --- a/3rdparty/mauikit2/src/utils/syncing/syncinglist.h +++ /dev/null @@ -1,41 +0,0 @@ -#ifndef SYNCINGLIST_H -#define SYNCINGLIST_H - -#include -#include "fmh.h" - -class FM; -class SyncingList : public QObject -{ - Q_OBJECT - -public: - explicit SyncingList(QObject *parent = nullptr); - FMH::MODEL_LIST items() const; - -private: - FMH::MODEL_LIST list; - void setList(); - FM *fm; - -protected: - -signals: - void preItemAppended(); - void postItemAppended(); - void preItemRemoved(int index); - void postItemRemoved(); - void updateModel(int index, QVector roles); - void preListChanged(); - void postListChanged(); - -public slots: - QVariantMap get(const int &index) const; - void insert(const QVariantMap &data); - void removeAccount(const QString &server, const QString &user); - void removeAccountAndFiles(const QString &server, const QString &user); - void refresh(); - -}; - -#endif // SYNCINGLIST_H diff --git a/3rdparty/mauikit2/src/utils/tagging/README.md b/3rdparty/mauikit2/src/utils/tagging/README.md deleted file mode 100644 index f0aa766..0000000 --- a/3rdparty/mauikit2/src/utils/tagging/README.md +++ /dev/null @@ -1,7 +0,0 @@ -# Tagging -Maui shared tagging system - -Tagging is a tagging system that is shared between the Maui set of apps. -It will work across different platforms and devices allowing to sync your tags between devices and applications. - -It forms part of the MauiKit diff --git a/3rdparty/mauikit2/src/utils/tagging/script.sql b/3rdparty/mauikit2/src/utils/tagging/script.sql deleted file mode 100644 index db23d8c..0000000 --- a/3rdparty/mauikit2/src/utils/tagging/script.sql +++ /dev/null @@ -1,83 +0,0 @@ -CREATE TABLE IF NOT EXISTS USERS ( -mac TEXT PRIMARY KEY, -name TEXT, -addDate DATE, -lastSync DATE, -device TEXT -); - -CREATE TABLE IF NOT EXISTS APPS ( -app TEXT, -uri TEXT, -version TEXT, -addDate DATE, -comment TEXT, -PRIMARY KEY(app, uri) -); - -CREATE TABLE IF NOT EXISTS TAGS ( -tag TEXT PRIMARY KEY, -color TEXT, -addDate DATE, -comment TEXT -); - -CREATE TABLE IF NOT EXISTS TAGS_USERS ( -tag TEXT, -mac TEXT, -PRIMARY KEY(tag, mac), -FOREIGN KEY(tag) REFERENCES TAGS(tag), -FOREIGN KEY(mac) REFERENCES USERS(mac) -); - -CREATE TABLE IF NOT EXISTS TAGS_URLS ( -url TEXT, -tag TEXT, -title TEXT, -comment TEXT, -mime TEXT, -addDate DATE, -PRIMARY KEY(url, tag), -FOREIGN KEY(tag) REFERENCES TAGS(tag) -); - -CREATE TABLE IF NOT EXISTS APPS_USERS ( -mac TEXT, -app TEXT, -uri TEXT, -addDate DATE, -PRIMARY KEY(mac, app, uri), -FOREIGN KEY(mac) REFERENCES USERS(mac), -FOREIGN KEY(app) REFERENCES APPS(app), -FOREIGN KEY(uri) REFERENCES APPS(uri) -); - -CREATE TABLE IF NOT EXISTS ABSTRACT ( -app TEXT, -uri TEXT, -key TEXT, -lot TEXT, -addDate DATE, -comment TEXT, -PRIMARY KEY(app, key, lot), -FOREIGN KEY(app) REFERENCES APPS(app), -FOREIGN KEY(uri) REFERENCES APPS(uri) -); - -CREATE TABLE IF NOT EXISTS TAGS_ABSTRACT ( -app TEXT, -uri TEXT, -tag TEXT, -key TEXT, -lot TEXT, -comment TEXT, -addDate DATE, -PRIMARY KEY(app, uri, tag, key, lot), -FOREIGN KEY(app) REFERENCES APPS(app), -FOREIGN KEY(uri) REFERENCES APPS(uri), -FOREIGN KEY(key) REFERENCES ABSTRACT(key), -FOREIGN KEY(lot) REFERENCES ABSTRACT(lot), -FOREIGN KEY(tag) REFERENCES TAGS(tag) -); - -COMMIT; diff --git a/3rdparty/mauikit2/src/utils/tagging/tag.h b/3rdparty/mauikit2/src/utils/tagging/tag.h deleted file mode 100644 index b6c8632..0000000 --- a/3rdparty/mauikit2/src/utils/tagging/tag.h +++ /dev/null @@ -1,129 +0,0 @@ -/* - * Copyright 2018 Camilo Higuita - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Library General Public License as - * published by the Free Software Foundation; either version 2, 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 Library 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 TAG_H -#define TAG_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace TAG -{ - enum class TABLE : uint8_t - { - USERS, - TAGS_USERS, - APPS_USERS, - TAGS, - TAGS_URLS, - APPS, - ABSTRACT, - TAGS_ABSTRACT, - NONE - }; - - static const QMap TABLEMAP = - { - {TABLE::TAGS, "tags"}, - {TABLE::TAGS_URLS,"tags_urls"}, - {TABLE::USERS, "users"}, - {TABLE::TAGS_USERS,"tags_users"}, - {TABLE::APPS, "apps"}, - {TABLE::ABSTRACT,"abstract"}, - {TABLE::TAGS_ABSTRACT, "tags_abstract"}, - {TABLE::APPS_USERS,"apps_users"} - }; - - enum KEYS : uint_fast8_t - { - URL, - APP, - URI, - MAC, - LAST_SYNC, - NAME, - VERSION, - LOT, - TAG, - COLOR, - ADD_DATE, - COMMENT, - MIME, - TITLE, - DEVICE, - KEY - };/* Q_ENUM_NS(KEYS);*/ - - typedef QMap DB; - typedef QList DB_LIST; - - static const DB KEYMAP = - { - {TAG::KEYS::URL, "url"}, - {TAG::KEYS::TAG, "tag"}, - {TAG::KEYS::COLOR, "color"}, - {TAG::KEYS::ADD_DATE, "addDate"}, - {TAG::KEYS::COMMENT, "comment"}, - {TAG::KEYS::MIME, "mime"}, - {TAG::KEYS::TITLE, "title"}, - {TAG::KEYS::NAME, "name"}, - {TAG::KEYS::DEVICE, "device"}, - {TAG::KEYS::MAC, "mac"}, - {TAG::KEYS::LAST_SYNC, "lastSync"}, - {TAG::KEYS::LOT, "lot"}, - {TAG::KEYS::KEY, "key"}, - {TAG::KEYS::NAME, "name"}, - {TAG::KEYS::APP, "app"}, - {TAG::KEYS::URI, "uri"}, - {TAG::KEYS::VERSION, "version"} - }; - - static const QMap MAPKEY = - { - {TAG::KEYMAP[KEYS::URL], KEYS::URL}, - {TAG::KEYMAP[KEYS::TAG], KEYS::TAG}, - {TAG::KEYMAP[KEYS::COLOR], KEYS::TAG}, - {TAG::KEYMAP[KEYS::ADD_DATE], KEYS::ADD_DATE}, - {TAG::KEYMAP[KEYS::COMMENT], KEYS::COMMENT}, - {TAG::KEYMAP[KEYS::MIME], KEYS::MIME}, - {TAG::KEYMAP[KEYS::TITLE], KEYS::TITLE}, - {TAG::KEYMAP[KEYS::NAME], KEYS::NAME}, - {TAG::KEYMAP[KEYS::DEVICE], KEYS::DEVICE}, - {TAG::KEYMAP[KEYS::MAC], KEYS::MAC}, - {TAG::KEYMAP[KEYS::LAST_SYNC], KEYS::LAST_SYNC}, - {TAG::KEYMAP[KEYS::LOT], KEYS::LOT}, - {TAG::KEYMAP[KEYS::KEY], KEYS::LOT}, - {TAG::KEYMAP[KEYS::NAME], KEYS::NAME}, - {TAG::KEYMAP[KEYS::APP], KEYS::APP}, - {TAG::KEYMAP[KEYS::URI], KEYS::URI}, - {TAG::KEYMAP[KEYS::VERSION], KEYS::VERSION} - }; - - const QString TaggingPath = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation)+"/maui/tagging/"; - const QString DBName = "tagging.db"; -} - -#endif // TAG_H diff --git a/3rdparty/mauikit2/src/utils/tagging/tagdb.cpp b/3rdparty/mauikit2/src/utils/tagging/tagdb.cpp deleted file mode 100644 index 2a809b6..0000000 --- a/3rdparty/mauikit2/src/utils/tagging/tagdb.cpp +++ /dev/null @@ -1,235 +0,0 @@ -/* - * Copyright 2018 Camilo Higuita - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Library General Public License as - * published by the Free Software Foundation; either version 2, 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 Library 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. - */ - -#include "tagdb.h" -#include - -TAGDB::TAGDB(QObject *parent) : QObject(parent) -{ - QDir collectionDBPath_dir(TAG::TaggingPath); - if (!collectionDBPath_dir.exists()) - collectionDBPath_dir.mkpath("."); - - this->name = QUuid::createUuid().toString(); - if(!UTIL::fileExists(TAG::TaggingPath + TAG::DBName)) - { - this->openDB(this->name); - qDebug()<<"Collection doesn't exists, trying to create it" << TAG::TaggingPath + TAG::DBName; - this->prepareCollectionDB(); - }else this->openDB(this->name); -} - -TAGDB::~TAGDB() -{ - this->m_db.close(); -} - -void TAGDB::openDB(const QString &name) -{ - if(!QSqlDatabase::contains(name)) - { - this->m_db = QSqlDatabase::addDatabase(QStringLiteral("QSQLITE"), name); - this->m_db.setDatabaseName(TAG::TaggingPath + TAG::DBName); - } - - if (!this->m_db.isOpen()) - { - if(!this->m_db.open()) - qDebug()<<"ERROR OPENING DB"<m_db.lastError().text()<getQuery("PRAGMA synchronous=OFF"); - query.exec(); -} - -void TAGDB::prepareCollectionDB() const -{ - QSqlQuery query(this->m_db); - - QFile file(":/script.sql"); - - if (!file.exists()) - { - QString log = QStringLiteral("Fatal error on build database. The file '"); - log.append(file.fileName() + QStringLiteral("' for database and tables creation query cannot be not found!")); - qDebug()<checkExistance(queryStr); -} - -bool TAGDB::checkExistance(const QString &queryStr) -{ - qDebug()<< "CHECKIGN QUERY TAG" << queryStr; - auto query = this->getQuery(queryStr); - - if (query.exec()) - { - if (query.next()) return true; - }else qDebug()<m_db); - return query; -} - -bool TAGDB::insert(const QString &tableName, const QVariantMap &insertData) -{ - if (tableName.isEmpty()) - { - qDebug()<m_db); - query.prepare(sqlQueryString); - - int k = 0; - foreach (const QVariant &value, values) - query.bindValue(k++, value); - - return query.exec(); -} - -bool TAGDB::update(const QString &tableName, const TAG::DB &updateData, const QVariantMap &where) -{ - if (tableName.isEmpty()) - { - qDebug()<getQuery(sqlQueryString); - qDebug()<getQuery(queryStr); - return query.exec(); -} - -bool TAGDB::remove(const QString &tableName, const TAG::DB &removeData) -{ - if (tableName.isEmpty()) - { - qDebug()< 1 && igetQuery(sqlQueryString).exec(); -} diff --git a/3rdparty/mauikit2/src/utils/tagging/tagdb.h b/3rdparty/mauikit2/src/utils/tagging/tagdb.h deleted file mode 100644 index 560c902..0000000 --- a/3rdparty/mauikit2/src/utils/tagging/tagdb.h +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright 2018 Camilo Higuita - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Library General Public License as - * published by the Free Software Foundation; either version 2, 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 Library 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 TAGDB_H -#define TAGDB_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "tag.h" -#include "utils.h" - - -class TAGDB : public QObject -{ - Q_OBJECT -private: - QString name; - QSqlDatabase m_db; - -public: - /* utils*/ - Q_INVOKABLE bool checkExistance(const QString &tableName, const QString &searchId, const QString &search); - Q_INVOKABLE bool checkExistance(const QString &queryStr); - -protected: - TAGDB(QObject *parent = nullptr); - ~ TAGDB(); - - QSqlQuery getQuery(const QString &queryTxt); - void openDB(const QString &name); - void prepareCollectionDB() const; - - bool insert(const QString &tableName, const QVariantMap &insertData); - bool update(const QString &tableName, const TAG::DB &updateData, const QVariantMap &where); - bool update(const QString &table, const QString &column, const QVariant &newValue, const QVariant &op, const QString &id); - bool remove(const QString &tableName, const TAG::DB &removeData); - -signals: - -public slots: -}; - - -#endif // DB_H diff --git a/3rdparty/mauikit2/src/utils/tagging/tagging.cpp b/3rdparty/mauikit2/src/utils/tagging/tagging.cpp deleted file mode 100644 index cc1cab8..0000000 --- a/3rdparty/mauikit2/src/utils/tagging/tagging.cpp +++ /dev/null @@ -1,367 +0,0 @@ -/* - * Copyright 2018 Camilo Higuita - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Library General Public License as - * published by the Free Software Foundation; either version 2, 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 Library 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. - */ - -#include "tagging.h" -#include -#include - -#include "utils.h" - -Tagging::Tagging(QObject *parent) : TAGDB(parent) -{ - this->setApp(); -} - -Tagging::~Tagging() -{ -// delete this->instance; -} - -Tagging *Tagging::instance = nullptr; -Tagging *Tagging::getInstance() -{ - if(!instance) - { - instance = new Tagging(); - qDebug() << "getInstance(): First instance\n"; - return instance; - } else - { - qDebug()<< "getInstance(): previous instance\n"; - return instance; - } -} - -QVariantList Tagging::get(const QString &queryTxt) -{ - QVariantList mapList; - - auto query = this->getQuery(queryTxt); - - if(query.exec()) - { - while(query.next()) - { - QVariantMap data; - for(auto key : TAG::KEYMAP.keys()) - if(query.record().indexOf(TAG::KEYMAP[key]) > -1) - data[TAG::KEYMAP[key]] = query.value(TAG::KEYMAP[key]).toString(); - - mapList<< data; - - } - - }else qDebug()<< query.lastError()<< query.lastQuery(); - - return mapList; -} - -bool Tagging::tagExists(const QString &tag, const bool &strict) -{ - return !strict ? this->checkExistance(TAG::TABLEMAP[TAG::TABLE::TAGS], TAG::KEYMAP[TAG::KEYS::TAG], tag) : - this->checkExistance(QString("select t.tag from TAGS t inner join TAGS_USERS tu on t.tag = tu.tag inner join APPS_USERS au on au.mac = tu.mac " - "where au.app = '%1' and au.uri = '%2' and t.tag = '%3'").arg(this->application, this->uri, tag)); -} - -bool Tagging::urlTagExists(const QString &url,const QString &tag, const bool &strict) -{ - return !strict ? this->checkExistance(QString("select * from TAGS_URLS where url = '%1' and tag = '%2'").arg(url, tag)) : - this->checkExistance(QString("select t.tag from TAGS t inner join TAGS_USERS tu on t.tag = tu.tag inner join APPS_USERS au on au.mac = tu.mac " - "where au.app = '%1' and au.uri = '%2' and t.tag = '%3'").arg(this->application, this->uri, tag)); -} - -void Tagging::setApp() -{ - this->application = UTIL::app->applicationName(); - this->version = UTIL::app->applicationVersion(); - this->comment = QString(); - this->uri = UTIL::app->organizationDomain().isEmpty() ? QString("org.maui.%1").arg(this->application) : UTIL::app->organizationDomain(); - this->app(); -} - -bool Tagging::tag(const QString &tag, const QString &color, const QString &comment) -{ - if(tag.isEmpty()) return false; - - QVariantMap tag_map - { - {TAG::KEYMAP[TAG::KEYS::TAG], tag}, - {TAG::KEYMAP[TAG::KEYS::COLOR], color}, - {TAG::KEYMAP[TAG::KEYS::ADD_DATE], QDateTime::currentDateTime().toString(Qt::TextDate)}, - {TAG::KEYMAP[TAG::KEYS::COMMENT], comment}, - }; - - this->insert(TAG::TABLEMAP[TAG::TABLE::TAGS], tag_map); - - QVariantMap tag_user_map - { - {TAG::KEYMAP[TAG::KEYS::TAG], tag}, - {TAG::KEYMAP[TAG::KEYS::MAC], this->id()} - }; - - if(this->insert(TAG::TABLEMAP[TAG::TABLE::TAGS_USERS], tag_user_map)) - { - emit this->tagged(tag); - return true; - } - - return false; -} - -bool Tagging::tagUrl(const QString &url, const QString &tag, const QString &color, const QString &comment) -{ - auto myTag = tag.trimmed(); - - this->tag(myTag, color, comment); - - QMimeDatabase mimedb; - auto mime = mimedb.mimeTypeForFile(url); - - QVariantMap tag_url_map - { - {TAG::KEYMAP[TAG::KEYS::URL], url}, - {TAG::KEYMAP[TAG::KEYS::TAG], myTag}, - {TAG::KEYMAP[TAG::KEYS::TITLE], QFileInfo(url).baseName()}, - {TAG::KEYMAP[TAG::KEYS::MIME], mime.name()}, - {TAG::KEYMAP[TAG::KEYS::ADD_DATE], QDateTime::currentDateTime()}, - {TAG::KEYMAP[TAG::KEYS::COMMENT], comment} - }; - - emit this->urlTagged(url, myTag); - return this->insert(TAG::TABLEMAP[TAG::TABLE::TAGS_URLS], tag_url_map); -} - -bool Tagging::tagAbstract(const QString &tag, const QString &key, const QString &lot, const QString &color, const QString &comment) -{ - this->abstract(key, lot, comment); - this->tag(tag, color, comment); - - QVariantMap tag_abstract_map - { - {TAG::KEYMAP[TAG::KEYS::APP], this->application}, - {TAG::KEYMAP[TAG::KEYS::URI], this->uri}, - {TAG::KEYMAP[TAG::KEYS::TAG], tag}, - {TAG::KEYMAP[TAG::KEYS::KEY], key}, - {TAG::KEYMAP[TAG::KEYS::LOT], lot}, - {TAG::KEYMAP[TAG::KEYS::ADD_DATE], QDateTime::currentDateTime()}, - {TAG::KEYMAP[TAG::KEYS::COMMENT], comment}, - }; - - emit this->abstractTagged(key, lot, tag); - return this->insert(TAG::TABLEMAP[TAG::TABLE::TAGS_ABSTRACT], tag_abstract_map); -} - -bool Tagging::updateUrlTags(const QString &url, const QStringList &tags) -{ - this->removeUrlTags(url); - for(const auto &tag : tags) - this->tagUrl(url, tag); - - return true; -} - -bool Tagging::updateUrl(const QString& url, const QString& newUrl) -{ - return this->update(TAG::TABLEMAP[TAG::TABLE::TAGS_URLS], {{TAG::KEYS::URL, newUrl}}, {{TAG::KEYMAP[TAG::KEYS::URL], url}}); -} - -bool Tagging::updateAbstractTags(const QString &key, const QString &lot, const QStringList &tags) -{ - this->removeAbstractTags(key, lot); - - for(const auto &tag : tags) - this->tagAbstract(tag, key, lot); - - return true; -} - -QVariantList Tagging::getUrlsTags(const bool &strict) -{ - const auto query = QString("select distinct t.* from TAGS t inner join TAGS_USERS tu on t.tag = tu.tag " - "inner join APPS_USERS au on au.mac = tu.mac " - "inner join TAGS_URLS turl on turl.tag = t.tag " - "where au.app = '%1' and au.uri = '%2'").arg(this->application, this->uri); - - - return !strict ? this->get("select distinct t.* from tags t inner join TAGS_URLS turl on turl.tag = t.tag") : - this->get(query); -} - -QVariantList Tagging::getAbstractsTags(const bool &strict) -{ - return !strict ? this->get("select t.* from tags t inner join TAGS_ABSTRACT tab on tab.tag = t.tag") : - this->get(QString("select t.* from TAGS t inner join TAGS_USERS tu on t.tag = tu.tag " - "inner join APPS_USERS au on au.mac = tu.mac " - "inner join TAGS_ABSTRACT tab on tab.tag = t.tag " - "where au.app = '%1' and au.uri = '%2'").arg(this->application, this->uri)); -} - -QVariantList Tagging::getAllTags(const bool &strict) -{ - return !strict ? this->get("select * from tags") : - this->get(QString("select t.* from TAGS t inner join TAGS_USERS tu on t.tag = tu.tag inner join APPS_USERS au on au.mac = tu.mac " - "where au.app = '%1' and au.uri = '%2'").arg(this->application, this->uri)); - -} - -QVariantList Tagging::getUrls(const QString &tag, const bool &strict) -{ - return !strict ? this->get(QString("select turl.*, t.color, t.comment as tagComment from TAGS t inner join TAGS_URLS turl on turl.tag = t.tag where t.tag = '%1'").arg(tag)): - this->get(QString("select distinct turl.*, t.color, t.comment as tagComment from TAGS t " - "inner join TAGS_USERS tu on t.tag = tu.tag " - "inner join APPS_USERS au on au.mac = tu.mac " - "inner join TAGS_URLS turl on turl.tag = t.tag " - "where au.app = '%1' and au.uri = '%2' " - "and t.tag = '%3'").arg(this->application, this->uri, tag)); -} - -QVariantList Tagging::getUrlTags(const QString &url, const bool &strict) -{ - - return !strict ? this->get(QString("select turl.*, t.color, t.comment as tagComment from tags t inner join TAGS_URLS turl on turl.tag = t.tag where turl.url = '%1'").arg(url)) : - this->get(QString("select distinct t.* from TAGS t inner join TAGS_USERS tu on t.tag = tu.tag inner join APPS_USERS au on au.mac = tu.mac inner join TAGS_URLS turl on turl.tag = t.tag " - "where au.app = '%1' and au.uri = '%2' and turl.url = '%3'").arg(this->application, this->uri, url)); -} - -QVariantList Tagging::getAbstractTags(const QString &key, const QString &lot, const bool &strict) -{ - return !strict ? this->get(QString("select t.* from TAGS t inner join TAGS_ABSTRACT ta on ta.tag = t.tag where ta.key = '%1' and ta.lot = '%2'").arg(key, lot)) : - this->get(QString("select distinct t.* from TAGS t inner join TAGS_ABSTRACT ta on ta.tag = t.tag " - "inner join TAGS_USERS tu on t.tag = tu.tag " - "inner join APPS_USERS au on au.mac = tu.mac " - "where au.app = '%1' and au.uri = '%2' and ta.key = '%3' and ta.lot = '%4'").arg(this->application, this->uri, key, lot)); -} - -bool Tagging::removeAbstractTag(const QString& key, const QString& lot, const QString &tag) -{ - TAG::DB data {{TAG::KEYS::KEY, key}, {TAG::KEYS::LOT, lot}, {TAG::KEYS::TAG, tag}}; - return this->remove(TAG::TABLEMAP[TAG::TABLE::TAGS_ABSTRACT], data); -} - -bool Tagging::removeAbstractTags(const QString& key, const QString& lot) -{ - for(const auto &map : this->getAbstractTags(key, lot)) - { - auto tag = map.toMap().value(TAG::KEYMAP[TAG::KEYS::TAG]).toString(); - this->removeAbstractTag(key, lot, tag); - } - - return true; -} - -bool Tagging::removeUrlTags(const QString &url) -{ - for(const auto &map : this->getUrlTags(url)) - { - auto tag = map.toMap().value(TAG::KEYMAP[TAG::KEYS::TAG]).toString(); - this->removeUrlTag(url, tag); - } - - return true; -} - -bool Tagging::removeUrlTag(const QString& url, const QString& tag) -{ - TAG::DB data {{TAG::KEYS::URL, url}, {TAG::KEYS::TAG, tag}}; - return this->remove(TAG::TABLEMAP[TAG::TABLE::TAGS_URLS], data); -} - -QString Tagging::mac() -{ - QNetworkInterface mac; - qDebug()<< "MAC ADDRES:"<< mac.hardwareAddress(); - return mac.hardwareAddress(); -} - -QString Tagging::device() -{ - return QSysInfo::prettyProductName(); -} - -QString Tagging::id() -{ - return QSysInfo::machineHostName(); - - // qDebug()<< "VERSION IS LES THAN "<< QT_VERSION; - - //#if QT_VERSION < QT_VERSION_CHECK(5, 1, 1) - // return QSysInfo::machineHostName(); - //#else - // return QString(QSysInfo::machineUniqueId()); - //#endif -} - -bool Tagging::app() -{ - qDebug()<<"REGISTER APP" << this->application<< this->uri<< this->version<< this->comment; - QVariantMap app_map - { - {TAG::KEYMAP[TAG::KEYS::APP], this->application}, - {TAG::KEYMAP[TAG::KEYS::URI], this->uri}, - {TAG::KEYMAP[TAG::KEYS::VERSION], this->version}, - {TAG::KEYMAP[TAG::KEYS::ADD_DATE], QDateTime::currentDateTime()}, - {TAG::KEYMAP[TAG::KEYS::COMMENT], this->comment}, - }; - - this->insert(TAG::TABLEMAP[TAG::TABLE::APPS], app_map); - - this->user(); - - QVariantMap users_apps_map - { - {TAG::KEYMAP[TAG::KEYS::APP], this->application}, - {TAG::KEYMAP[TAG::KEYS::URI], this->uri}, - {TAG::KEYMAP[TAG::KEYS::MAC], this->id()}, - {TAG::KEYMAP[TAG::KEYS::ADD_DATE], QDateTime::currentDateTime()}, - }; - - return this->insert(TAG::TABLEMAP[TAG::TABLE::APPS_USERS], users_apps_map); - -} - -bool Tagging::user() -{ - QVariantMap user_map - { - {TAG::KEYMAP[TAG::KEYS::MAC], this->id()}, - {TAG::KEYMAP[TAG::KEYS::NAME], UTIL::whoami()}, - {TAG::KEYMAP[TAG::KEYS::LAST_SYNC], QDateTime::currentDateTime()}, - {TAG::KEYMAP[TAG::KEYS::ADD_DATE], QDateTime::currentDateTime()}, - {TAG::KEYMAP[TAG::KEYS::DEVICE], this->device()}, - }; - - return this->insert(TAG::TABLEMAP[TAG::TABLE::USERS], user_map); -} - -bool Tagging::abstract(const QString &key, const QString &lot, const QString &comment) -{ - QVariantMap abstract_map - { - {TAG::KEYMAP[TAG::KEYS::APP], this->application}, - {TAG::KEYMAP[TAG::KEYS::URI], this->uri}, - {TAG::KEYMAP[TAG::KEYS::KEY], key}, - {TAG::KEYMAP[TAG::KEYS::LOT], lot}, - {TAG::KEYMAP[TAG::KEYS::ADD_DATE], QDateTime::currentDateTime()}, - {TAG::KEYMAP[TAG::KEYS::COMMENT], comment}, - }; - - return this->insert(TAG::TABLEMAP[TAG::TABLE::ABSTRACT], abstract_map); -} - - diff --git a/3rdparty/mauikit2/src/utils/tagging/tagging.h b/3rdparty/mauikit2/src/utils/tagging/tagging.h deleted file mode 100644 index c2e47ec..0000000 --- a/3rdparty/mauikit2/src/utils/tagging/tagging.h +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright 2018 Camilo Higuita - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Library General Public License as - * published by the Free Software Foundation; either version 2, 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 Library 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 TAGGING_H -#define TAGGING_H - -#include -#include -#include "tagdb.h" - -#ifndef STATIC_MAUIKIT -#include "mauikit_export.h" -#endif - -#ifdef STATIC_MAUIKIT -class Tagging : public TAGDB -#else -class MAUIKIT_EXPORT Tagging : public TAGDB -#endif -{ - Q_OBJECT -public: - static Tagging *getInstance(); - - Q_INVOKABLE QVariantList get(const QString &query); - - Q_INVOKABLE bool tagExists(const QString &tag, const bool &strict = false); - Q_INVOKABLE bool urlTagExists(const QString &url, const QString &tag, const bool &strict = false); - - /* INSERTIIONS */ - - Q_INVOKABLE bool tag(const QString &tag, const QString &color=QString(), const QString &comment=QString()); - Q_INVOKABLE bool tagUrl(const QString &url, const QString &tag, const QString &color=QString(), const QString &comment=QString()); - Q_INVOKABLE bool tagAbstract(const QString &tag, const QString &key, const QString &lot, const QString &color = QString(), const QString &comment=QString()); - - /* UPDATES */ - Q_INVOKABLE bool updateUrlTags(const QString &url, const QStringList &tags); - Q_INVOKABLE bool updateUrl(const QString &url, const QString &newUrl); - - Q_INVOKABLE bool updateAbstractTags(const QString &key, const QString &lot, const QStringList &tags); - - /* QUERIES */ - - Q_INVOKABLE QVariantList getUrlsTags(const bool &strict = true); - Q_INVOKABLE QVariantList getAbstractsTags(const bool &strict = true); - Q_INVOKABLE QVariantList getAllTags(const bool &strict = true); - Q_INVOKABLE QVariantList getUrls(const QString &tag, const bool &strict = true); - Q_INVOKABLE QVariantList getUrlTags(const QString &url, const bool &strict = true); - Q_INVOKABLE QVariantList getAbstractTags(const QString &key, const QString &lot, const bool &strict = true); - - /* DELETES */ - Q_INVOKABLE bool removeAbstractTag(const QString &key, const QString &lot, const QString &tag); - Q_INVOKABLE bool removeAbstractTags(const QString &key, const QString &lot); - - Q_INVOKABLE bool removeUrlTags(const QString &url); - Q_INVOKABLE bool removeUrlTag(const QString &url, const QString &tag); - - /*STATIC METHODS*/ - - static QString mac(); - static QString device(); - static QString id(); - -private: - Tagging(QObject *parent = nullptr); - ~Tagging(); - static Tagging* instance; - void setApp(); - - QString application = QString(); - QString version = QString(); - QString comment = QString(); - QString uri = QString(); - - bool app(); - bool user(); - -protected: - bool abstract(const QString &key, const QString &lot, const QString &comment); - -signals: - void urlTagged(const QString &url, const QString &tag); - void abstractTagged(const QString &key, const QString &lot, const QString &tag); - void tagged(const QString &tag); - -public slots: -}; - -#endif // TAGGING_H diff --git a/3rdparty/mauikit2/src/utils/tagging/tagging.pri b/3rdparty/mauikit2/src/utils/tagging/tagging.pri deleted file mode 100644 index 2d33b5d..0000000 --- a/3rdparty/mauikit2/src/utils/tagging/tagging.pri +++ /dev/null @@ -1,28 +0,0 @@ -QT *= \ - sql \ - network - -HEADERS += \ - $$PWD/tagging.h \ - $$PWD/tagdb.h \ - $$PWD/tag.h \ - $$PWD/tagsmodel.h \ - $$PWD/tagslist.h - -SOURCES += \ - $$PWD/tagging.cpp \ - $$PWD/tagdb.cpp \ - $$PWD/tagsmodel.cpp \ - $$PWD/tagslist.cpp - -DEPENDPATH += \ - $$PWD - -INCLUDEPATH += \ - $$PWD - -DISTFILES += \ - $$PWD/script.sql \ - -RESOURCES += \ - $$PWD/tagging.qrc diff --git a/3rdparty/mauikit2/src/utils/tagging/tagging.qrc b/3rdparty/mauikit2/src/utils/tagging/tagging.qrc deleted file mode 100644 index 2c704aa..0000000 --- a/3rdparty/mauikit2/src/utils/tagging/tagging.qrc +++ /dev/null @@ -1,5 +0,0 @@ - - - script.sql - - diff --git a/3rdparty/mauikit2/src/utils/tagging/tagslist.cpp b/3rdparty/mauikit2/src/utils/tagging/tagslist.cpp deleted file mode 100644 index 51372ac..0000000 --- a/3rdparty/mauikit2/src/utils/tagging/tagslist.cpp +++ /dev/null @@ -1,387 +0,0 @@ -#include "tagslist.h" -#include "tagging.h" - -TagsList::TagsList(QObject *parent) : QObject(parent) -{ - this->tag = Tagging::getInstance(); - this->setList(); -} - -TAG::DB_LIST TagsList::toModel(const QVariantList& data) -{ - TAG::DB_LIST res; - for(auto item : data) - { - const auto map = item.toMap(); - TAG::DB model; - for(auto key : map.keys()) - model.insert(TAG::MAPKEY[key], map[key].toString()); - - res << model; - } - - return res; -} - -void TagsList::setList() -{ - emit this->preListChanged(); - - if(this->abstract) - { - if(this->lot.isEmpty() || this->key.isEmpty()) - this->list = this->toModel(this->tag->getAbstractsTags(this->strict)); - else - this->list = this->toModel(this->tag->getAbstractTags(this->key, this->lot, this->strict)); - - }else - { - if(this->urls.isEmpty()) - this->list = this->toModel(this->tag->getAllTags(this->strict)); - else - { - this->list.clear(); - for(const auto &url : this->urls) - this->list << this->toModel(this->tag->getUrlTags(url, this->strict)); - } - } - - this->sortList(); - emit this->postListChanged(); -} - -void TagsList::sortList() -{ - const auto key = static_cast(this->sortBy); - qSort(this->list.begin(), this->list.end(), [key](const TAG::DB & e1, const TAG::DB & e2) -> bool - { - auto role = key; - - switch(role) - { - case TAG::KEYS::ADD_DATE: - { - auto currentTime = QDateTime::currentDateTime(); - - auto date1 = QDateTime::fromString(e1[role], Qt::TextDate); - auto date2 = QDateTime::fromString(e2[role], Qt::TextDate); - - if(date1.secsTo(currentTime) < date2.secsTo(currentTime)) - return true; - - break; - } - - case TAG::KEYS::TAG: - { - const auto str1 = QString(e1[role]).toLower(); - const auto str2 = QString(e2[role]).toLower(); - - if(str1 < str2) - return true; - break; - } - - default: - if(e1[role] < e2[role]) - return true; - } - - return false; - }); -} - -QVariantMap TagsList::get(const int &index) const -{ - if(index >= this->list.size() || index < 0) - return QVariantMap(); - - const auto folder = this->list.at(index); - - QVariantMap res; - for(auto key : folder.keys()) - res.insert(TAG::KEYMAP[key], folder[key]); - - return res; -} - -void TagsList::refresh() -{ - this->setList(); -} - -bool TagsList::contains(const QString& tag) -{ - return this->indexOf(tag) >= 0; -} - -int TagsList::indexOf(const QString& tag) -{ - int i = 0; - for(const auto &item : this->list) - { - if(item.value(TAG::KEYS::TAG) == tag) - return i; - i++; - } - - return -1; -} - -bool TagsList::insert(const QString &tag) -{ - auto _tag = tag.trimmed(); - - if(this->tag->tag(_tag)) - { - emit this->preItemAppended(); - this->list << TAG::DB {{TAG::KEYS::TAG, _tag}}; -// this->sortList(); - emit this->postItemAppended(); - return true; - } - - return false; -} - -void TagsList::insertToUrls(const QString& tag) -{ - if(this->urls.isEmpty()) - return; - - for(const auto &url : this->urls) - this->tag->tagUrl(url, tag); - - this->refresh(); -} - -void TagsList::insertToAbstract(const QString& tag) -{ - if(this->key.isEmpty() || this->lot.isEmpty()) - return; - - if(this->tag->tagAbstract(tag, this->key, this->lot)) - this->refresh(); -} - -void TagsList::updateToUrls(const QStringList& tags) -{ - if(this->urls.isEmpty()) - return; - - for(auto url : this->urls) - this->tag->updateUrlTags(url, tags); - - this->refresh(); -} - -void TagsList::updateToAbstract(const QStringList& tags) -{ - if(this->key.isEmpty() || this->lot.isEmpty()) - return; - - this->tag->updateAbstractTags(this->key, this->lot, tags); - - this->refresh(); -} - -void TagsList::removeFromAbstract(const int& index) -{ - if(index >= this->list.size() || index < 0) - return; - - if(this->key.isEmpty() || this->lot.isEmpty()) - return; - - const auto tag = this->list[index][TAG::KEYS::TAG]; - if(this->tag->removeAbstractTag(this->key, this->lot, tag)) - { - emit this->preItemRemoved(index); - this->list.removeAt(index); - emit this->postItemRemoved(); - } -} - -void TagsList::removeFromUrls(const int& index) -{ - if(index >= this->list.size() || index < 0) - return; - - if(this->urls.isEmpty()) - return; - - const auto tag = this->list[index][TAG::KEYS::TAG]; - for(const auto &url : this->urls) - this->tag->removeUrlTag(url, tag); - - emit this->preItemRemoved(index); - this->list.removeAt(index); - emit this->postItemRemoved(); -} - -void TagsList::removeFromUrls(const QString &tag) -{ - const auto index = indexOf(tag); - removeFromUrls(index); -} - -bool TagsList::remove(const int& index) -{ - if(index >= this->list.size() || index < 0) - return false; - - emit this->preItemRemoved(index); - this->list.removeAt(index); - emit this->postItemRemoved(); - - return true; -} - -void TagsList::removeFrom(const int& index, const QString& key, const QString& lot) -{ - if(index >= this->list.size() || index < 0) - return; - - if(this->tag->removeAbstractTag(key, lot, this->list[index][TAG::KEYS::TAG])) - { - emit this->preItemRemoved(index); - this->list.removeAt(index); - emit this->postItemRemoved(); - } -} - -void TagsList::removeFrom(const int& index, const QString& url) -{ - if(index >= this->list.size() || index < 0) - return; - - if(this->tag->removeUrlTag(url, this->list[index][TAG::KEYS::TAG])) - { - emit this->preItemRemoved(index); - this->list.removeAt(index); - emit this->postItemRemoved(); - } -} - -void TagsList::erase(const int& index) -{ -} - -TAG::DB_LIST TagsList::items() const -{ - return this->list; -} - -TagsList::KEYS TagsList::getSortBy() const -{ - return this->sortBy; -} - -void TagsList::setSortBy(const TagsList::KEYS &key) -{ - if(this->sortBy == key) - return; - - this->sortBy = key; - - emit this->preListChanged(); - this->sortList(); - emit this->sortByChanged(); - emit this->postListChanged(); -} - - -bool TagsList::getAbstract() const -{ - return this->abstract; -} - -void TagsList::setAbstract(const bool& value) -{ - if(this->abstract == value) - return; - - this->abstract = value; - this->setList(); - emit this->abstractChanged(); -} - -bool TagsList::getStrict() const -{ - return this->strict; -} - -void TagsList::setStrict(const bool& value) -{ - if(this->strict == value) - return; - - this->strict = value; - this->setList(); - emit this->strictChanged(); -} - -QString TagsList::getKey() const -{ - return this->key; -} - -void TagsList::setKey(const QString& value) -{ - if(this->key == value) - return; - - this->urls.clear(); - this->key = value; - this->setList(); - emit this->keyChanged(); -} - -QString TagsList::getLot() const -{ - return this->lot; -} - -void TagsList::setLot(const QString& value) -{ - if(this->lot == value) - return; - - this->urls.clear(); - this->lot = value; - this->setList(); - emit this->lotChanged(); -} - -QStringList TagsList::getUrls() const -{ - return this->urls; -} - -void TagsList::setUrls(const QStringList& value) -{ - if(this->urls == value) - return; - - this->key.clear(); - this->lot.clear(); - - this->urls = value; - this->setList(); - emit this->urlsChanged(); -} - -void TagsList::append(const QString &tag) -{ - - if(this->contains(tag)) - return; - - if(!this->insert(tag)) - { - emit this->preItemAppended(); - this->list << TAG::DB {{TAG::KEYS::TAG, tag}}; -// this->sortList(); - emit this->postItemAppended(); - } -} diff --git a/3rdparty/mauikit2/src/utils/tagging/tagslist.h b/3rdparty/mauikit2/src/utils/tagging/tagslist.h deleted file mode 100644 index 6c2c20a..0000000 --- a/3rdparty/mauikit2/src/utils/tagging/tagslist.h +++ /dev/null @@ -1,121 +0,0 @@ -#ifndef TAGSLIST_JH -#define TAGSLIST_JH - -#include -#include "fmh.h" -#include "tag.h" - -class Tagging; -class TagsList : public QObject -{ - Q_OBJECT - Q_PROPERTY(bool abstract READ getAbstract WRITE setAbstract NOTIFY abstractChanged) - Q_PROPERTY(bool strict READ getStrict WRITE setStrict NOTIFY strictChanged) - Q_PROPERTY(QStringList urls READ getUrls WRITE setUrls NOTIFY urlsChanged) - Q_PROPERTY(QString lot READ getLot WRITE setLot NOTIFY lotChanged) - Q_PROPERTY(QString key READ getKey WRITE setKey NOTIFY keyChanged) - - Q_PROPERTY(TagsList::KEYS sortBy READ getSortBy WRITE setSortBy NOTIFY sortByChanged()) - - -public: - enum KEYS : uint_fast8_t - { - URL = TAG::URL, - APP = TAG::APP, - URI = TAG::URI, - MAC = TAG::MAC, - LAST_SYNC = TAG::LAST_SYNC, - NAME = TAG::NAME, - VERSION = TAG::VERSION, - LOT = TAG::LOT, - TAG = TAG::TAG, - COLOR = TAG::COLOR, - ADD_DATE = TAG::ADD_DATE, - COMMENT = TAG::COMMENT, - MIME = TAG::MIME, - TITLE = TAG::TITLE, - DEVICE = TAG::DEVICE, - KEY = TAG::KEY - }; Q_ENUM(KEYS) - - explicit TagsList(QObject *parent = nullptr); - TAG::DB_LIST items() const; - - TagsList::KEYS getSortBy() const; - void setSortBy(const TagsList::KEYS &key); - - bool getAbstract() const; - void setAbstract(const bool &value); - - bool getStrict() const; - void setStrict(const bool &value); - - QStringList getUrls() const; - void setUrls(const QStringList &value); - - QString getLot() const; - void setLot(const QString &value); - - QString getKey() const; - void setKey(const QString &value); - - -private: - TAG::DB_LIST list; - void setList(); - void sortList(); - Tagging *tag; - - TAG::DB_LIST toModel(const QVariantList &data); - - bool abstract = false; - bool strict = true; - QStringList urls = QStringList(); - QString lot; - QString key; - TagsList::KEYS sortBy = TagsList::KEYS::ADD_DATE; - -protected: - -signals: - void preItemAppended(); - void postItemAppended(); - void preItemRemoved(int index); - void postItemRemoved(); - void updateModel(int index, QVector roles); - void preListChanged(); - void postListChanged(); - - void abstractChanged(); - void strictChanged(); - void urlsChanged(); - void lotChanged(); - void keyChanged(); - void sortByChanged(); - -public slots: - QVariantMap get(const int &index) const; - void append(const QString &tag); - bool insert(const QString &tag); - void insertToUrls(const QString &tag); - void insertToAbstract(const QString &tag); - void updateToUrls(const QStringList &tags); - void updateToAbstract(const QStringList &tags); - - bool remove(const int &index); - void removeFrom(const int &index, const QString &url); - void removeFrom(const int &index, const QString &key, const QString &lot); - - void removeFromUrls(const int &index); - void removeFromUrls(const QString &tag); - void removeFromAbstract(const int &index); - - void erase(const int &index); - void refresh(); - - bool contains(const QString &tag); - int indexOf(const QString &tag); -}; - -#endif // SYNCINGLIST_H diff --git a/3rdparty/mauikit2/src/utils/tagging/tagsmodel.cpp b/3rdparty/mauikit2/src/utils/tagging/tagsmodel.cpp deleted file mode 100644 index 46923b7..0000000 --- a/3rdparty/mauikit2/src/utils/tagging/tagsmodel.cpp +++ /dev/null @@ -1,105 +0,0 @@ -#include "tagsmodel.h" -#include "tagslist.h" - -#include "tag.h" - -TagsModel::TagsModel(QObject *parent) - : QAbstractListModel(parent), - mList(nullptr) -{} - -int TagsModel::rowCount(const QModelIndex &parent) const -{ - if (parent.isValid() || !mList) - return 0; - - return mList->items().size(); -} - -QVariant TagsModel::data(const QModelIndex &index, int role) const -{ - if (!index.isValid() || !mList) - return QVariant(); - - return this->mList->items().at(index.row())[static_cast(role)]; -} - -bool TagsModel::setData(const QModelIndex &index, const QVariant &value, int role) -{ - - return false; -} - -Qt::ItemFlags TagsModel::flags(const QModelIndex &index) const -{ - if (!index.isValid()) - return Qt::NoItemFlags; - - return Qt::ItemIsEditable; // FIXME: Implement me! -} - -QHash TagsModel::roleNames() const -{ - QHash names; - - for(auto key : TAG::KEYMAP.keys()) - names[key] = QString(TAG::KEYMAP[key]).toUtf8(); - - return names; -} - -TagsList *TagsModel::getList() const -{ - return this->mList; -} - -void TagsModel::setList(TagsList *value) -{ - beginResetModel(); - - if(mList) - mList->disconnect(this); - - mList = value; - - if(mList) - { - connect(this->mList, &TagsList::preItemAppended, this, [=]() - { - const int index = mList->items().size(); - beginInsertRows(QModelIndex(), index, index); - }); - - connect(this->mList, &TagsList::postItemAppended, this, [=]() - { - endInsertRows(); - }); - - connect(this->mList, &TagsList::preItemRemoved, this, [=](int index) - { - beginRemoveRows(QModelIndex(), index, index); - }); - - connect(this->mList, &TagsList::postItemRemoved, this, [=]() - { - endRemoveRows(); - }); - - connect(this->mList, &TagsList::updateModel, this, [=](int index, QVector roles) - { - emit this->dataChanged(this->index(index), this->index(index), roles); - }); - - connect(this->mList, &TagsList::preListChanged, this, [=]() - { - beginResetModel(); - }); - - connect(this->mList, &TagsList::postListChanged, this, [=]() - { - endResetModel(); - }); - } - - endResetModel(); -} diff --git a/3rdparty/mauikit2/src/utils/tagging/tagsmodel.h b/3rdparty/mauikit2/src/utils/tagging/tagsmodel.h deleted file mode 100644 index c6392c4..0000000 --- a/3rdparty/mauikit2/src/utils/tagging/tagsmodel.h +++ /dev/null @@ -1,37 +0,0 @@ -#ifndef TAGSMODEL_H -#define TAGSMODEL_H - -#include -#include - -class TagsList; -class TagsModel : public QAbstractListModel -{ - Q_OBJECT - Q_PROPERTY(TagsList *list READ getList WRITE setList) - -public: - explicit TagsModel(QObject *parent = nullptr); - - // Basic functionality: - int rowCount(const QModelIndex &parent = QModelIndex()) const override; - - QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; - - // Editable: - bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override; - - Qt::ItemFlags flags(const QModelIndex& index) const override; - - virtual QHash roleNames() const override; - - TagsList* getList() const; - void setList(TagsList *value); - -private: - TagsList *mList; -signals: - void listChanged(); -}; - -#endif // SYNCINGMODEL_H diff --git a/3rdparty/taglib.pri b/3rdparty/taglib.pri new file mode 100644 index 0000000..392e7b2 --- /dev/null +++ b/3rdparty/taglib.pri @@ -0,0 +1,256 @@ + DEPENDPATH += $$PWD/taglib + DEPENDPATH += $$PWD/taglib/ape + DEPENDPATH += $$PWD/taglib/asf + DEPENDPATH += $$PWD/taglib/flac + DEPENDPATH += $$PWD/taglib/it + DEPENDPATH += $$PWD/taglib/mod + DEPENDPATH += $$PWD/taglib/mp4 + DEPENDPATH += $$PWD/taglib/mpc + DEPENDPATH += $$PWD/taglib/mpeg + DEPENDPATH += $$PWD/taglib/mpeg/id3v1 + DEPENDPATH += $$PWD/taglib/mpeg/id3v2 + DEPENDPATH += $$PWD/taglib/mpeg/id3v2/frames + DEPENDPATH += $$PWD/taglib/ogg + DEPENDPATH += $$PWD/taglib/ogg/flac + DEPENDPATH += $$PWD/taglib/ogg/opus + DEPENDPATH += $$PWD/taglib/ogg/speex + DEPENDPATH += $$PWD/taglib/ogg/vorbis + DEPENDPATH += $$PWD/taglib/riff + DEPENDPATH += $$PWD/taglib/riff/aiff + DEPENDPATH += $$PWD/taglib/riff/wav + DEPENDPATH += $$PWD/taglib/s3m + DEPENDPATH += $$PWD/taglib/toolkit + DEPENDPATH += $$PWD/taglib/trueaudio + DEPENDPATH += $$PWD/taglib/wavpack + DEPENDPATH += $$PWD/taglib/xm + + + INCLUDEPATH += $$PWD/taglib + INCLUDEPATH += $$PWD/taglib/ape + INCLUDEPATH += $$PWD/taglib/asf + INCLUDEPATH += $$PWD/taglib/flac + INCLUDEPATH += $$PWD/taglib/it + INCLUDEPATH += $$PWD/taglib/mod + INCLUDEPATH += $$PWD/taglib/mp4 + INCLUDEPATH += $$PWD/taglib/mpc + INCLUDEPATH += $$PWD/taglib/mpeg + INCLUDEPATH += $$PWD/taglib/mpeg/id3v1 + INCLUDEPATH += $$PWD/taglib/mpeg/id3v2 + INCLUDEPATH += $$PWD/taglib/mpeg/id3v2/frames + INCLUDEPATH += $$PWD/taglib/ogg + INCLUDEPATH += $$PWD/taglib/ogg/flac + INCLUDEPATH += $$PWD/taglib/ogg/opus + INCLUDEPATH += $$PWD/taglib/ogg/speex + INCLUDEPATH += $$PWD/taglib/ogg/vorbis + INCLUDEPATH += $$PWD/taglib/riff + INCLUDEPATH += $$PWD/taglib/riff/aiff + INCLUDEPATH += $$PWD/taglib/riff/wav + INCLUDEPATH += $$PWD/taglib/s3m + INCLUDEPATH += $$PWD/taglib/toolkit + INCLUDEPATH += $$PWD/taglib/trueaudio + INCLUDEPATH += $$PWD/taglib/wavpack + INCLUDEPATH += $$PWD/taglib/xm + +SOURCES += \ + $$PWD/taglib/ape/apefile.cpp \ + $$PWD/taglib/ape/apefooter.cpp \ + $$PWD/taglib/ape/apeitem.cpp \ + $$PWD/taglib/ape/apeproperties.cpp \ + $$PWD/taglib/ape/apetag.cpp \ + $$PWD/taglib/asf/asfattribute.cpp \ + $$PWD/taglib/asf/asffile.cpp \ + $$PWD/taglib/asf/asfpicture.cpp \ + $$PWD/taglib/asf/asfproperties.cpp \ + $$PWD/taglib/asf/asftag.cpp \ + $$PWD/taglib/flac/flacfile.cpp \ + $$PWD/taglib/flac/flacmetadatablock.cpp \ + $$PWD/taglib/flac/flacpicture.cpp \ + $$PWD/taglib/flac/flacproperties.cpp \ + $$PWD/taglib/flac/flacunknownmetadatablock.cpp \ + $$PWD/taglib/it/itfile.cpp \ + $$PWD/taglib/it/itproperties.cpp \ + $$PWD/taglib/mod/modfile.cpp \ + $$PWD/taglib/mod/modfilebase.cpp \ + $$PWD/taglib/mod/modproperties.cpp \ + $$PWD/taglib/mod/modtag.cpp \ + $$PWD/taglib/mp4/mp4atom.cpp \ + $$PWD/taglib/mp4/mp4coverart.cpp \ + $$PWD/taglib/mp4/mp4file.cpp \ + $$PWD/taglib/mp4/mp4item.cpp \ + $$PWD/taglib/mp4/mp4properties.cpp \ + $$PWD/taglib/mp4/mp4tag.cpp \ + $$PWD/taglib/mpc/mpcfile.cpp \ + $$PWD/taglib/mpc/mpcproperties.cpp \ + $$PWD/taglib/mpeg/id3v1/id3v1genres.cpp \ + $$PWD/taglib/mpeg/id3v1/id3v1tag.cpp \ + $$PWD/taglib/mpeg/id3v2/frames/attachedpictureframe.cpp \ + $$PWD/taglib/mpeg/id3v2/frames/commentsframe.cpp \ + $$PWD/taglib/mpeg/id3v2/frames/generalencapsulatedobjectframe.cpp \ + $$PWD/taglib/mpeg/id3v2/frames/ownershipframe.cpp \ + $$PWD/taglib/mpeg/id3v2/frames/popularimeterframe.cpp \ + $$PWD/taglib/mpeg/id3v2/frames/privateframe.cpp \ + $$PWD/taglib/mpeg/id3v2/frames/relativevolumeframe.cpp \ + $$PWD/taglib/mpeg/id3v2/frames/textidentificationframe.cpp \ + $$PWD/taglib/mpeg/id3v2/frames/uniquefileidentifierframe.cpp \ + $$PWD/taglib/mpeg/id3v2/frames/unknownframe.cpp \ + $$PWD/taglib/mpeg/id3v2/frames/unsynchronizedlyricsframe.cpp \ + $$PWD/taglib/mpeg/id3v2/frames/urllinkframe.cpp \ + $$PWD/taglib/mpeg/id3v2/id3v2extendedheader.cpp \ + $$PWD/taglib/mpeg/id3v2/id3v2footer.cpp \ + $$PWD/taglib/mpeg/id3v2/id3v2frame.cpp \ + $$PWD/taglib/mpeg/id3v2/id3v2framefactory.cpp \ + $$PWD/taglib/mpeg/id3v2/id3v2header.cpp \ + $$PWD/taglib/mpeg/id3v2/id3v2synchdata.cpp \ + $$PWD/taglib/mpeg/id3v2/id3v2tag.cpp \ + $$PWD/taglib/mpeg/mpegfile.cpp \ + $$PWD/taglib/mpeg/mpegheader.cpp \ + $$PWD/taglib/mpeg/mpegproperties.cpp \ + $$PWD/taglib/mpeg/xingheader.cpp \ + $$PWD/taglib/ogg/flac/oggflacfile.cpp \ + $$PWD/taglib/ogg/opus/opusfile.cpp \ + $$PWD/taglib/ogg/opus/opusproperties.cpp \ + $$PWD/taglib/ogg/speex/speexfile.cpp \ + $$PWD/taglib/ogg/speex/speexproperties.cpp \ + $$PWD/taglib/ogg/vorbis/vorbisfile.cpp \ + $$PWD/taglib/ogg/vorbis/vorbisproperties.cpp \ + $$PWD/taglib/ogg/oggfile.cpp \ + $$PWD/taglib/ogg/oggpage.cpp \ + $$PWD/taglib/ogg/oggpageheader.cpp \ + $$PWD/taglib/ogg/xiphcomment.cpp \ + $$PWD/taglib/riff/aiff/aifffile.cpp \ + $$PWD/taglib/riff/aiff/aiffproperties.cpp \ + $$PWD/taglib/riff/wav/infotag.cpp \ + $$PWD/taglib/riff/wav/wavfile.cpp \ + $$PWD/taglib/riff/wav/wavproperties.cpp \ + $$PWD/taglib/riff/rifffile.cpp \ + $$PWD/taglib/s3m/s3mfile.cpp \ + $$PWD/taglib/s3m/s3mproperties.cpp \ + $$PWD/taglib/toolkit/tbytevector.cpp \ + $$PWD/taglib/toolkit/tbytevectorlist.cpp \ + $$PWD/taglib/toolkit/tbytevectorstream.cpp \ + $$PWD/taglib/toolkit/tdebug.cpp \ + $$PWD/taglib/toolkit/tdebuglistener.cpp \ + $$PWD/taglib/toolkit/tfile.cpp \ + $$PWD/taglib/toolkit/tfilestream.cpp \ + $$PWD/taglib/toolkit/tiostream.cpp \ + $$PWD/taglib/toolkit/tpropertymap.cpp \ + $$PWD/taglib/toolkit/trefcounter.cpp \ + $$PWD/taglib/toolkit/tstring.cpp \ + $$PWD/taglib/toolkit/tstringlist.cpp \ + $$PWD/taglib/toolkit/unicode.cpp \ + $$PWD/taglib/trueaudio/trueaudiofile.cpp \ + $$PWD/taglib/trueaudio/trueaudioproperties.cpp \ + $$PWD/taglib/wavpack/wavpackfile.cpp \ + $$PWD/taglib/wavpack/wavpackproperties.cpp \ + $$PWD/taglib/xm/xmfile.cpp \ + $$PWD/taglib/xm/xmproperties.cpp \ + $$PWD/taglib/audioproperties.cpp \ + $$PWD/taglib/fileref.cpp \ + $$PWD/taglib/tag.cpp \ + $$PWD/taglib/tagunion.cpp \ + +HEADERS += \ + $$PWD/taglib/ape/apefile.h \ + $$PWD/taglib/ape/apefooter.h \ + $$PWD/taglib/ape/apeitem.h \ + $$PWD/taglib/ape/apeproperties.h \ + $$PWD/taglib/ape/apetag.h \ + $$PWD/taglib/asf/asfattribute.h \ + $$PWD/taglib/asf/asffile.h \ + $$PWD/taglib/asf/asfpicture.h \ + $$PWD/taglib/asf/asfproperties.h \ + $$PWD/taglib/asf/asftag.h \ + $$PWD/taglib/flac/flacfile.h \ + $$PWD/taglib/flac/flacmetadatablock.h \ + $$PWD/taglib/flac/flacpicture.h \ + $$PWD/taglib/flac/flacproperties.h \ + $$PWD/taglib/flac/flacunknownmetadatablock.h \ + $$PWD/taglib/it/itfile.h \ + $$PWD/taglib/it/itproperties.h \ + $$PWD/taglib/mod/modfile.h \ + $$PWD/taglib/mod/modfilebase.h \ + $$PWD/taglib/mod/modfileprivate.h \ + $$PWD/taglib/mod/modproperties.h \ + $$PWD/taglib/mod/modtag.h \ + $$PWD/taglib/mp4/mp4atom.h \ + $$PWD/taglib/mp4/mp4coverart.h \ + $$PWD/taglib/mp4/mp4file.h \ + $$PWD/taglib/mp4/mp4item.h \ + $$PWD/taglib/mp4/mp4properties.h \ + $$PWD/taglib/mp4/mp4tag.h \ + $$PWD/taglib/mpc/mpcfile.h \ + $$PWD/taglib/mpc/mpcproperties.h \ + $$PWD/taglib/mpeg/id3v1/id3v1genres.h \ + $$PWD/taglib/mpeg/id3v1/id3v1tag.h \ + $$PWD/taglib/mpeg/id3v2/frames/attachedpictureframe.h \ + $$PWD/taglib/mpeg/id3v2/frames/commentsframe.h \ + $$PWD/taglib/mpeg/id3v2/frames/generalencapsulatedobjectframe.h \ + $$PWD/taglib/mpeg/id3v2/frames/ownershipframe.h \ + $$PWD/taglib/mpeg/id3v2/frames/popularimeterframe.h \ + $$PWD/taglib/mpeg/id3v2/frames/privateframe.h \ + $$PWD/taglib/mpeg/id3v2/frames/relativevolumeframe.h \ + $$PWD/taglib/mpeg/id3v2/frames/textidentificationframe.h \ + $$PWD/taglib/mpeg/id3v2/frames/uniquefileidentifierframe.h \ + $$PWD/taglib/mpeg/id3v2/frames/unknownframe.h \ + $$PWD/taglib/mpeg/id3v2/frames/unsynchronizedlyricsframe.h \ + $$PWD/taglib/mpeg/id3v2/frames/urllinkframe.h \ + $$PWD/taglib/mpeg/id3v2/id3v2extendedheader.h \ + $$PWD/taglib/mpeg/id3v2/id3v2footer.h \ + $$PWD/taglib/mpeg/id3v2/id3v2frame.h \ + $$PWD/taglib/mpeg/id3v2/id3v2framefactory.h \ + $$PWD/taglib/mpeg/id3v2/id3v2header.h \ + $$PWD/taglib/mpeg/id3v2/id3v2synchdata.h \ + $$PWD/taglib/mpeg/id3v2/id3v2tag.h \ + $$PWD/taglib/mpeg/mpegfile.h \ + $$PWD/taglib/mpeg/mpegheader.h \ + $$PWD/taglib/mpeg/mpegproperties.h \ + $$PWD/taglib/mpeg/xingheader.h \ + $$PWD/taglib/ogg/flac/oggflacfile.h \ + $$PWD/taglib/ogg/opus/opusfile.h \ + $$PWD/taglib/ogg/opus/opusproperties.h \ + $$PWD/taglib/ogg/speex/speexfile.h \ + $$PWD/taglib/ogg/speex/speexproperties.h \ + $$PWD/taglib/ogg/vorbis/vorbisfile.h \ + $$PWD/taglib/ogg/vorbis/vorbisproperties.h \ + $$PWD/taglib/ogg/oggfile.h \ + $$PWD/taglib/ogg/oggpage.h \ + $$PWD/taglib/ogg/oggpageheader.h \ + $$PWD/taglib/ogg/xiphcomment.h \ + $$PWD/taglib/riff/aiff/aifffile.h \ + $$PWD/taglib/riff/aiff/aiffproperties.h \ + $$PWD/taglib/riff/wav/infotag.h \ + $$PWD/taglib/riff/wav/wavfile.h \ + $$PWD/taglib/riff/wav/wavproperties.h \ + $$PWD/taglib/riff/rifffile.h \ + $$PWD/taglib/s3m/s3mfile.h \ + $$PWD/taglib/s3m/s3mproperties.h \ + $$PWD/taglib/toolkit/taglib.h \ + $$PWD/taglib/toolkit/tbytevector.h \ + $$PWD/taglib/toolkit/tbytevectorlist.h \ + $$PWD/taglib/toolkit/tbytevectorstream.h \ + $$PWD/taglib/toolkit/tdebug.h \ + $$PWD/taglib/toolkit/tdebuglistener.h \ + $$PWD/taglib/toolkit/tfile.h \ + $$PWD/taglib/toolkit/tfilestream.h \ + $$PWD/taglib/toolkit/tiostream.h \ + $$PWD/taglib/toolkit/tlist.h \ + $$PWD/taglib/toolkit/tmap.h \ + $$PWD/taglib/toolkit/tpropertymap.h \ + $$PWD/taglib/toolkit/trefcounter.h \ + $$PWD/taglib/toolkit/tstring.h \ + $$PWD/taglib/toolkit/tstringlist.h \ + $$PWD/taglib/toolkit/tutils.h \ + $$PWD/taglib/toolkit/unicode.h \ + $$PWD/taglib/trueaudio/trueaudiofile.h \ + $$PWD/taglib/trueaudio/trueaudioproperties.h \ + $$PWD/taglib/wavpack/wavpackfile.h \ + $$PWD/taglib/wavpack/wavpackproperties.h \ + $$PWD/taglib/xm/xmfile.h \ + $$PWD/taglib/xm/xmproperties.h \ + $$PWD/taglib/audioproperties.h \ + $$PWD/taglib/fileref.h \ + $$PWD/taglib/tag.h \ + $$PWD/taglib/taglib_export.h \ + $$PWD/taglib/tagunion.h \ + $$PWD/taglib/config.h \ + $$PWD/taglib/taglib_config.h \ diff --git a/3rdparty/taglib/bin/taglib-config.cmd b/3rdparty/taglib/bin/taglib-config.cmd deleted file mode 100644 index 43fb33a..0000000 --- a/3rdparty/taglib/bin/taglib-config.cmd +++ /dev/null @@ -1,36 +0,0 @@ -@echo off -goto beginning - * - * It is what it is, you can do with it as you please. - * - * Just don't blame me if it teaches your computer to smoke! - * - * -Enjoy - * fh :)_~ - * -:beginning -if /i "%1#" == "--libs#" goto doit -if /i "%1#" == "--cflags#" goto doit -if /i "%1#" == "--version#" goto doit -if /i "%1#" == "--prefix#" goto doit - -echo "usage: %0 [OPTIONS]" -echo [--libs] -echo [--cflags] -echo [--version] -echo [--prefix] -goto theend - - * - * NOTE: Windows does not assume libraries are prefixed with 'lib'. - * NOTE: If '-llibtag' is the last element, it is easily appended in the users installation/makefile process - * to allow for static, shared or debug builds. - * It would be preferable if the top level CMakeLists.txt provided the library name during config. ?? -:doit -if /i "%1#" == "--libs#" echo -LC:/Users/milo/Documents/vvave/3rdparty/taglib/lib -llibtag -if /i "%1#" == "--cflags#" echo -IC:/Users/milo/Documents/vvave/3rdparty/taglib/include/taglib -if /i "%1#" == "--version#" echo 1.10 -if /i "%1#" == "--prefix#" echo C:/Users/milo/Documents/vvave/3rdparty/taglib - -:theend - diff --git a/3rdparty/taglib/include/taglib/aifffile.h b/3rdparty/taglib/include/taglib/aifffile.h deleted file mode 100644 index a79d76b..0000000 --- a/3rdparty/taglib/include/taglib/aifffile.h +++ /dev/null @@ -1,144 +0,0 @@ -/*************************************************************************** - copyright : (C) 2008 by Scott Wheeler - email : wheeler@kde.org -***************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * - * 02110-1301 USA * - * * - * Alternatively, this file is available under the Mozilla Public * - * License Version 1.1. You may obtain a copy of the License at * - * http://www.mozilla.org/MPL/ * - ***************************************************************************/ - -#ifndef TAGLIB_AIFFFILE_H -#define TAGLIB_AIFFFILE_H - -#include "rifffile.h" -#include "id3v2tag.h" -#include "aiffproperties.h" - -namespace TagLib { - - namespace RIFF { - - //! An implementation of AIFF metadata - - /*! - * This is implementation of AIFF metadata. - * - * This supports an ID3v2 tag as well as reading stream from the ID3 RIFF - * chunk as well as properties from the file. - */ - - namespace AIFF { - - //! An implementation of TagLib::File with AIFF specific methods - - /*! - * This implements and provides an interface for AIFF files to the - * TagLib::Tag and TagLib::AudioProperties interfaces by way of implementing - * the abstract TagLib::File API as well as providing some additional - * information specific to AIFF files. - */ - - class TAGLIB_EXPORT File : public TagLib::RIFF::File - { - public: - /*! - * Constructs an AIFF file from \a file. If \a readProperties is true the - * file's audio properties will also be read. - * - * \note In the current implementation, \a propertiesStyle is ignored. - */ - File(FileName file, bool readProperties = true, - Properties::ReadStyle propertiesStyle = Properties::Average); - - /*! - * Constructs an AIFF file from \a stream. If \a readProperties is true the - * file's audio properties will also be read. - * - * \note TagLib will *not* take ownership of the stream, the caller is - * responsible for deleting it after the File object. - * - * \note In the current implementation, \a propertiesStyle is ignored. - */ - File(IOStream *stream, bool readProperties = true, - Properties::ReadStyle propertiesStyle = Properties::Average); - - /*! - * Destroys this instance of the File. - */ - virtual ~File(); - - /*! - * Returns the Tag for this file. - * - * \note This always returns a valid pointer regardless of whether or not - * the file on disk has an ID3v2 tag. Use hasID3v2Tag() to check if the file - * on disk actually has an ID3v2 tag. - * - * \see hasID3v2Tag() - */ - virtual ID3v2::Tag *tag() const; - - /*! - * Implements the unified property interface -- export function. - * This method forwards to ID3v2::Tag::properties(). - */ - PropertyMap properties() const; - - void removeUnsupportedProperties(const StringList &properties); - - /*! - * Implements the unified property interface -- import function. - * This method forwards to ID3v2::Tag::setProperties(). - */ - PropertyMap setProperties(const PropertyMap &); - - /*! - * Returns the AIFF::Properties for this file. If no audio properties - * were read then this will return a null pointer. - */ - virtual Properties *audioProperties() const; - - /*! - * Saves the file. - */ - virtual bool save(); - - /*! - * Returns whether or not the file on disk actually has an ID3v2 tag. - * - * \see ID3v2Tag() - */ - bool hasID3v2Tag() const; - - private: - File(const File &); - File &operator=(const File &); - - void read(bool readProperties); - - friend class Properties; - - class FilePrivate; - FilePrivate *d; - }; - } - } -} - -#endif diff --git a/3rdparty/taglib/include/taglib/aiffproperties.h b/3rdparty/taglib/include/taglib/aiffproperties.h deleted file mode 100644 index 1d92ac8..0000000 --- a/3rdparty/taglib/include/taglib/aiffproperties.h +++ /dev/null @@ -1,166 +0,0 @@ -/*************************************************************************** - copyright : (C) 2008 by Scott Wheeler - email : wheeler@kde.org -***************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * - * 02110-1301 USA * - * * - * Alternatively, this file is available under the Mozilla Public * - * License Version 1.1. You may obtain a copy of the License at * - * http://www.mozilla.org/MPL/ * - ***************************************************************************/ - -#ifndef TAGLIB_AIFFPROPERTIES_H -#define TAGLIB_AIFFPROPERTIES_H - -#include "audioproperties.h" - -namespace TagLib { - - namespace RIFF { - - namespace AIFF { - - class File; - - //! An implementation of audio property reading for AIFF - - /*! - * This reads the data from an AIFF stream found in the AudioProperties - * API. - */ - - class TAGLIB_EXPORT Properties : public AudioProperties - { - public: - /*! - * Create an instance of AIFF::Properties with the data read from the - * ByteVector \a data. - * - * \deprecated - */ - Properties(const ByteVector &data, ReadStyle style); - - /*! - * Create an instance of AIFF::Properties with the data read from the - * AIFF::File \a file. - */ - Properties(File *file, ReadStyle style); - - /*! - * Destroys this AIFF::Properties instance. - */ - virtual ~Properties(); - - /*! - * Returns the length of the file in seconds. The length is rounded down to - * the nearest whole second. - * - * \note This method is just an alias of lengthInSeconds(). - * - * \deprecated - */ - virtual int length() const; - - /*! - * Returns the length of the file in seconds. The length is rounded down to - * the nearest whole second. - * - * \see lengthInMilliseconds() - */ - // BIC: make virtual - int lengthInSeconds() const; - - /*! - * Returns the length of the file in milliseconds. - * - * \see lengthInSeconds() - */ - // BIC: make virtual - int lengthInMilliseconds() const; - - /*! - * Returns the average bit rate of the file in kb/s. - */ - virtual int bitrate() const; - - /*! - * Returns the sample rate in Hz. - */ - virtual int sampleRate() const; - - /*! - * Returns the number of audio channels. - */ - virtual int channels() const; - - /*! - * Returns the number of bits per audio sample. - */ - int bitsPerSample() const; - - /*! - * Returns the number of bits per audio sample. - * - * \note This method is just an alias of bitsPerSample(). - * - * \deprecated - */ - int sampleWidth() const; - - /*! - * Returns the number of sample frames - */ - uint sampleFrames() const; - - /*! - * Returns true if the file is in AIFF-C format, false if AIFF format. - */ - bool isAiffC() const; - - /*! - * Returns the compression type of the AIFF-C file. For example, "NONE" for - * not compressed, "ACE2" for ACE 2-to-1. - * - * If the file is in AIFF format, always returns an empty vector. - * - * \see isAiffC() - */ - ByteVector compressionType() const; - - /*! - * Returns the concrete compression name of the AIFF-C file. - * - * If the file is in AIFF format, always returns an empty string. - * - * \see isAiffC() - */ - String compressionName() const; - - private: - Properties(const Properties &); - Properties &operator=(const Properties &); - - void read(File *file); - - class PropertiesPrivate; - PropertiesPrivate *d; - }; - } - } -} - -#endif diff --git a/3rdparty/taglib/include/taglib/apefile.h b/3rdparty/taglib/include/taglib/apefile.h deleted file mode 100644 index 1d2e5c6..0000000 --- a/3rdparty/taglib/include/taglib/apefile.h +++ /dev/null @@ -1,232 +0,0 @@ -/*************************************************************************** - copyright : (C) 2010 by Alex Novichkov - email : novichko@atnet.ru - - copyright : (C) 2006 by Lukáš Lalinský - email : lalinsky@gmail.com - (original WavPack implementation) - - copyright : (C) 2004 by Allan Sandfeld Jensen - email : kde@carewolf.org - (original MPC implementation) - ***************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * - * 02110-1301 USA * - * * - * Alternatively, this file is available under the Mozilla Public * - * License Version 1.1. You may obtain a copy of the License at * - * http://www.mozilla.org/MPL/ * - ***************************************************************************/ - -#ifndef TAGLIB_APEFILE_H -#define TAGLIB_APEFILE_H - -#include "tfile.h" -#include "taglib_export.h" -#include "apeproperties.h" - -namespace TagLib { - - class Tag; - - namespace ID3v1 { class Tag; } - namespace APE { class Tag; } - - //! An implementation of APE metadata - - /*! - * This is implementation of APE metadata. - * - * This supports ID3v1 and APE (v1 and v2) style comments as well as reading stream - * properties from the file. - */ - - namespace APE { - - //! An implementation of TagLib::File with APE specific methods - - /*! - * This implements and provides an interface for APE files to the - * TagLib::Tag and TagLib::AudioProperties interfaces by way of implementing - * the abstract TagLib::File API as well as providing some additional - * information specific to APE files. - */ - - class TAGLIB_EXPORT File : public TagLib::File - { - public: - /*! - * This set of flags is used for various operations and is suitable for - * being OR-ed together. - */ - enum TagTypes { - //! Empty set. Matches no tag types. - NoTags = 0x0000, - //! Matches ID3v1 tags. - ID3v1 = 0x0001, - //! Matches APE tags. - APE = 0x0002, - //! Matches all tag types. - AllTags = 0xffff - }; - - /*! - * Constructs an APE file from \a file. If \a readProperties is true the - * file's audio properties will also be read. - * - * \note In the current implementation, \a propertiesStyle is ignored. - */ - File(FileName file, bool readProperties = true, - Properties::ReadStyle propertiesStyle = Properties::Average); - - /*! - * Constructs an APE file from \a stream. If \a readProperties is true the - * file's audio properties will also be read. - * - * \note TagLib will *not* take ownership of the stream, the caller is - * responsible for deleting it after the File object. - * - * \note In the current implementation, \a propertiesStyle is ignored. - */ - File(IOStream *stream, bool readProperties = true, - Properties::ReadStyle propertiesStyle = Properties::Average); - - /*! - * Destroys this instance of the File. - */ - virtual ~File(); - - /*! - * Returns the Tag for this file. This will be an APE tag, an ID3v1 tag - * or a combination of the two. - */ - virtual TagLib::Tag *tag() const; - - /*! - * Implements the unified property interface -- export function. - * If the file contains both an APE and an ID3v1 tag, only APE - * will be converted to the PropertyMap. - */ - PropertyMap properties() const; - - /*! - * Removes unsupported properties. Forwards to the actual Tag's - * removeUnsupportedProperties() function. - */ - void removeUnsupportedProperties(const StringList &properties); - - /*! - * Implements the unified property interface -- import function. - * Creates an APEv2 tag if necessary. A potentially existing ID3v1 - * tag will be updated as well. - */ - PropertyMap setProperties(const PropertyMap &); - - /*! - * Returns the APE::Properties for this file. If no audio properties - * were read then this will return a null pointer. - */ - virtual Properties *audioProperties() const; - - /*! - * Saves the file. - * - * \note According to the official Monkey's Audio SDK, an APE file - * can only have either ID3V1 or APE tags, so a parameter is used here. - * - * \warning In the current implementation, it's dangerous to call save() - * repeatedly. At worst it will corrupt the file. - */ - virtual bool save(); - - /*! - * Returns a pointer to the ID3v1 tag of the file. - * - * If \a create is false (the default) this may return a null pointer - * if there is no valid ID3v1 tag. If \a create is true it will create - * an ID3v1 tag if one does not exist and returns a valid pointer. - * - * \note This may return a valid pointer regardless of whether or not the - * file on disk has an ID3v1 tag. Use hasID3v1Tag() to check if the file - * on disk actually has an ID3v1 tag. - * - * \note The Tag is still owned by the MPEG::File and should not be - * deleted by the user. It will be deleted when the file (object) is - * destroyed. - * - * \see hasID3v1Tag() - */ - ID3v1::Tag *ID3v1Tag(bool create = false); - - /*! - * Returns a pointer to the APE tag of the file. - * - * If \a create is false (the default) this may return a null pointer - * if there is no valid APE tag. If \a create is true it will create - * an APE tag if one does not exist and returns a valid pointer. - * - * \note This may return a valid pointer regardless of whether or not the - * file on disk has an APE tag. Use hasAPETag() to check if the file - * on disk actually has an APE tag. - * - * \note The Tag is still owned by the MPEG::File and should not be - * deleted by the user. It will be deleted when the file (object) is - * destroyed. - * - * \see hasAPETag() - */ - APE::Tag *APETag(bool create = false); - - /*! - * This will remove the tags that match the OR-ed together TagTypes from the - * file. By default it removes all tags. - * - * \note This will also invalidate pointers to the tags - * as their memory will be freed. - * \note In order to make the removal permanent save() still needs to be called - */ - void strip(int tags = AllTags); - - /*! - * Returns whether or not the file on disk actually has an APE tag. - * - * \see APETag() - */ - bool hasAPETag() const; - - /*! - * Returns whether or not the file on disk actually has an ID3v1 tag. - * - * \see ID3v1Tag() - */ - bool hasID3v1Tag() const; - - private: - File(const File &); - File &operator=(const File &); - - void read(bool readProperties); - long findAPE(); - long findID3v1(); - long findID3v2(); - - class FilePrivate; - FilePrivate *d; - }; - } -} - -#endif diff --git a/3rdparty/taglib/include/taglib/apefooter.h b/3rdparty/taglib/include/taglib/apefooter.h deleted file mode 100644 index 683af12..0000000 --- a/3rdparty/taglib/include/taglib/apefooter.h +++ /dev/null @@ -1,173 +0,0 @@ -/*************************************************************************** - copyright : (C) 2004 by Allan Sandfeld Jensen - email : kde@carewolf.org - ***************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * - * 02110-1301 USA * - * * - * Alternatively, this file is available under the Mozilla Public * - * License Version 1.1. You may obtain a copy of the License at * - * http://www.mozilla.org/MPL/ * - ***************************************************************************/ - -#ifndef TAGLIB_APEFOOTER_H -#define TAGLIB_APEFOOTER_H - -#include "tbytevector.h" -#include "taglib_export.h" - -namespace TagLib { - - namespace APE { - - //! An implementation of APE footers - - /*! - * This class implements APE footers (and headers). It attempts to follow, both - * semantically and programmatically, the structure specified in - * the APE v2.0 standard. The API is based on the properties of APE footer and - * headers specified there. - */ - - class TAGLIB_EXPORT Footer - { - public: - /*! - * Constructs an empty APE footer. - */ - Footer(); - - /*! - * Constructs an APE footer based on \a data. parse() is called - * immediately. - */ - Footer(const ByteVector &data); - - /*! - * Destroys the footer. - */ - virtual ~Footer(); - - /*! - * Returns the version number. (Note: This is the 1000 or 2000.) - */ - uint version() const; - - /*! - * Returns true if a header is present in the tag. - */ - bool headerPresent() const; - - /*! - * Returns true if a footer is present in the tag. - */ - bool footerPresent() const; - - /*! - * Returns true this is actually the header. - */ - bool isHeader() const; - - /*! - * Sets whether the header should be rendered or not - */ - void setHeaderPresent(bool b) const; - - /*! - * Returns the number of items in the tag. - */ - uint itemCount() const; - - /*! - * Set the item count to \a s. - * \see itemCount() - */ - void setItemCount(uint s); - - /*! - * Returns the tag size in bytes. This is the size of the frame content and footer. - * The size of the \e entire tag will be this plus the header size, if present. - * - * \see completeTagSize() - */ - uint tagSize() const; - - /*! - * Returns the tag size, including if present, the header - * size. - * - * \see tagSize() - */ - uint completeTagSize() const; - - /*! - * Set the tag size to \a s. - * \see tagSize() - */ - void setTagSize(uint s); - - /*! - * Returns the size of the footer. Presently this is always 32 bytes. - */ - static uint size(); - - /*! - * Returns the string used to identify an APE tag inside of a file. - * Presently this is always "APETAGEX". - */ - static ByteVector fileIdentifier(); - - /*! - * Sets the data that will be used as the footer. 32 bytes, - * starting from \a data will be used. - */ - void setData(const ByteVector &data); - - /*! - * Renders the footer back to binary format. - */ - ByteVector renderFooter() const; - - /*! - * Renders the header corresponding to the footer. If headerPresent is - * set to false, it returns an empty ByteVector. - */ - ByteVector renderHeader() const; - - protected: - /*! - * Called by setData() to parse the footer data. It makes this information - * available through the public API. - */ - void parse(const ByteVector &data); - - /*! - * Called by renderFooter and renderHeader - */ - ByteVector render(bool isHeader) const; - - private: - Footer(const Footer &); - Footer &operator=(const Footer &); - - class FooterPrivate; - FooterPrivate *d; - }; - - } -} - -#endif diff --git a/3rdparty/taglib/include/taglib/apeitem.h b/3rdparty/taglib/include/taglib/apeitem.h deleted file mode 100644 index 4dd77d6..0000000 --- a/3rdparty/taglib/include/taglib/apeitem.h +++ /dev/null @@ -1,219 +0,0 @@ -/*************************************************************************** - copyright : (C) 2004 by Allan Sandfeld Jensen - email : kde@carewolf.org - ***************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * - * 02110-1301 USA * - * * - * Alternatively, this file is available under the Mozilla Public * - * License Version 1.1. You may obtain a copy of the License at * - * http://www.mozilla.org/MPL/ * - ***************************************************************************/ - -#ifndef TAGLIB_APEITEM_H -#define TAGLIB_APEITEM_H - -#include "tbytevector.h" -#include "tstring.h" -#include "tstringlist.h" - -namespace TagLib { - - namespace APE { - - //! An implementation of APE-items - - /*! - * This class provides the features of items in the APEv2 standard. - */ - class TAGLIB_EXPORT Item - { - public: - /*! - * Enum of types an Item can have. The value of 3 is reserved. - */ - enum ItemTypes { - //! Item contains text information coded in UTF-8 - Text = 0, - //! Item contains binary information - Binary = 1, - //! Item is a locator of external stored information - Locator = 2 - }; - /*! - * Constructs an empty item. - */ - Item(); - - /*! - * Constructs a text item with \a key and \a value. - */ - // BIC: Remove this, StringList has a constructor from a single string - Item(const String &key, const String &value); - - /*! - * Constructs a text item with \a key and \a values. - */ - Item(const String &key, const StringList &values); - - /*! - * Constructs an item with \a key and \a value. - * If \a binary is true a Binary item will be created, otherwise \a value will be interpreted as text - */ - Item(const String &key, const ByteVector &value, bool binary); - - /*! - * Construct an item as a copy of \a item. - */ - Item(const Item &item); - - /*! - * Destroys the item. - */ - virtual ~Item(); - - /*! - * Copies the contents of \a item into this item. - */ - Item &operator=(const Item &item); - - /*! - * Returns the key. - */ - String key() const; - - /*! - * Returns the binary value. - * If the item type is not \a Binary, always returns an empty ByteVector. - */ - ByteVector binaryData() const; - - /*! - * Set the binary value to \a value - * The item's type will also be set to \a Binary - */ - void setBinaryData(const ByteVector &value); - -#ifndef DO_NOT_DOCUMENT - /* Remove in next binary incompatible release */ - ByteVector value() const; -#endif - - /*! - * Sets the key for the item to \a key. - */ - void setKey(const String &key); - - /*! - * Sets the text value of the item to \a value and clears any previous contents. - * - * \see toString() - */ - void setValue(const String &value); - - /*! - * Sets the text value of the item to the list of values in \a value and clears - * any previous contents. - * - * \see toStringList() - */ - void setValues(const StringList &values); - - /*! - * Appends \a value to create (or extend) the current list of text values. - * - * \see toString() - */ - void appendValue(const String &value); - - /*! - * Appends \a values to extend the current list of text values. - * - * \see toStringList() - */ - void appendValues(const StringList &values); - - /*! - * Returns the size of the full item. - */ - int size() const; - - /*! - * Returns the value as a single string. In case of multiple strings, - * the first is returned. If the data type is not \a Text, always returns - * an empty String. - */ - String toString() const; - -#ifndef DO_NOT_DOCUMENT - /* Remove in next binary incompatible release */ - StringList toStringList() const; -#endif - - /*! - * Returns the list of text values. If the data type is not \a Text, always - * returns an empty StringList. - */ - StringList values() const; - - /*! - * Render the item to a ByteVector. - */ - ByteVector render() const; - - /*! - * Parse the item from the ByteVector \a data. - */ - void parse(const ByteVector& data); - - /*! - * Set the item to read-only. - */ - void setReadOnly(bool readOnly); - - /*! - * Return true if the item is read-only. - */ - bool isReadOnly() const; - - /*! - * Sets the type of the item to \a type. - * - * \see ItemTypes - */ - void setType(ItemTypes type); - - /*! - * Returns the type of the item. - */ - ItemTypes type() const; - - /*! - * Returns if the item has any real content. - */ - bool isEmpty() const; - - private: - class ItemPrivate; - ItemPrivate *d; - }; - } - -} - -#endif - - diff --git a/3rdparty/taglib/include/taglib/apeproperties.h b/3rdparty/taglib/include/taglib/apeproperties.h deleted file mode 100644 index fcf125f..0000000 --- a/3rdparty/taglib/include/taglib/apeproperties.h +++ /dev/null @@ -1,143 +0,0 @@ -/*************************************************************************** - copyright : (C) 2010 by Alex Novichkov - email : novichko@atnet.ru - - copyright : (C) 2006 by Lukáš Lalinský - email : lalinsky@gmail.com - (original WavPack implementation) - ***************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * - * 02110-1301 USA * - * * - * Alternatively, this file is available under the Mozilla Public * - * License Version 1.1. You may obtain a copy of the License at * - * http://www.mozilla.org/MPL/ * - ***************************************************************************/ - -#ifndef TAGLIB_APEPROPERTIES_H -#define TAGLIB_APEPROPERTIES_H - -#include "taglib_export.h" -#include "audioproperties.h" - -namespace TagLib { - - namespace APE { - - class File; - - //! An implementation of audio property reading for APE - - /*! - * This reads the data from an APE stream found in the AudioProperties - * API. - */ - - class TAGLIB_EXPORT Properties : public AudioProperties - { - public: - /*! - * Create an instance of APE::Properties with the data read from the - * APE::File \a file. - * - * \deprecated - */ - Properties(File *file, ReadStyle style = Average); - - /*! - * Create an instance of APE::Properties with the data read from the - * APE::File \a file. - */ - Properties(File *file, long streamLength, ReadStyle style = Average); - - /*! - * Destroys this APE::Properties instance. - */ - virtual ~Properties(); - - /*! - * Returns the length of the file in seconds. The length is rounded down to - * the nearest whole second. - * - * \note This method is just an alias of lengthInSeconds(). - * - * \deprecated - */ - virtual int length() const; - - /*! - * Returns the length of the file in seconds. The length is rounded down to - * the nearest whole second. - * - * \see lengthInMilliseconds() - */ - // BIC: make virtual - int lengthInSeconds() const; - - /*! - * Returns the length of the file in milliseconds. - * - * \see lengthInSeconds() - */ - // BIC: make virtual - int lengthInMilliseconds() const; - - /*! - * Returns the average bit rate of the file in kb/s. - */ - virtual int bitrate() const; - - /*! - * Returns the sample rate in Hz. - */ - virtual int sampleRate() const; - - /*! - * Returns the number of audio channels. - */ - virtual int channels() const; - - /*! - * Returns the number of bits per audio sample. - */ - int bitsPerSample() const; - - /*! - * Returns the total number of audio samples in file. - */ - uint sampleFrames() const; - - /*! - * Returns APE version. - */ - int version() const; - - private: - Properties(const Properties &); - Properties &operator=(const Properties &); - - void read(File *file, long streamLength); - - void analyzeCurrent(File *file); - void analyzeOld(File *file); - - class PropertiesPrivate; - PropertiesPrivate *d; - }; - } -} - -#endif diff --git a/3rdparty/taglib/include/taglib/apetag.h b/3rdparty/taglib/include/taglib/apetag.h deleted file mode 100644 index 5557261..0000000 --- a/3rdparty/taglib/include/taglib/apetag.h +++ /dev/null @@ -1,208 +0,0 @@ -/*************************************************************************** - copyright : (C) 2004 by Allan Sandfeld Jensen - email : kde@carewolf.org - ***************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * - * 02110-1301 USA * - * * - * Alternatively, this file is available under the Mozilla Public * - * License Version 1.1. You may obtain a copy of the License at * - * http://www.mozilla.org/MPL/ * - ***************************************************************************/ - -#ifndef TAGLIB_APETAG_H -#define TAGLIB_APETAG_H - -#include "tag.h" -#include "tbytevector.h" -#include "tmap.h" -#include "tstring.h" -#include "taglib_export.h" - -#include "apeitem.h" - -namespace TagLib { - - class File; - - //! An implementation of the APE tagging format - - namespace APE { - - class Footer; - - /*! - * A mapping between a list of item names, or keys, and the associated item. - * - * \see APE::Tag::itemListMap() - */ - typedef Map ItemListMap; - - - //! An APE tag implementation - - class TAGLIB_EXPORT Tag : public TagLib::Tag - { - public: - /*! - * Create an APE tag with default values. - */ - Tag(); - - /*! - * Create an APE tag and parse the data in \a file with APE footer at - * \a tagOffset. - */ - Tag(TagLib::File *file, long footerLocation); - - /*! - * Destroys this Tag instance. - */ - virtual ~Tag(); - - /*! - * Renders the in memory values to a ByteVector suitable for writing to - * the file. - */ - ByteVector render() const; - - /*! - * Returns the string "APETAGEX" suitable for usage in locating the tag in a - * file. - */ - static ByteVector fileIdentifier(); - - // Reimplementations. - - virtual String title() const; - virtual String artist() const; - virtual String album() const; - virtual String comment() const; - virtual String genre() const; - virtual uint year() const; - virtual uint track() const; - - virtual void setTitle(const String &s); - virtual void setArtist(const String &s); - virtual void setAlbum(const String &s); - virtual void setComment(const String &s); - virtual void setGenre(const String &s); - virtual void setYear(uint i); - virtual void setTrack(uint i); - - /*! - * Implements the unified tag dictionary interface -- export function. - * APE tags are perfectly compatible with the dictionary interface because they - * support both arbitrary tag names and multiple values. Currently only - * APE items of type *Text* are handled by the dictionary interface; all *Binary* - * and *Locator* items will be put into the unsupportedData list and can be - * deleted on request using removeUnsupportedProperties(). The same happens - * to Text items if their key is invalid for PropertyMap (which should actually - * never happen). - * - * The only conversion done by this export function is to rename the APE tags - * TRACK to TRACKNUMBER, YEAR to DATE, and ALBUM ARTIST to ALBUMARTIST, respectively, - * in order to be compliant with the names used in other formats. - */ - PropertyMap properties() const; - - void removeUnsupportedProperties(const StringList &properties); - - /*! - * Implements the unified tag dictionary interface -- import function. The same - * comments as for the export function apply; additionally note that the APE tag - * specification requires keys to have between 2 and 16 printable ASCII characters - * with the exception of the fixed strings "ID3", "TAG", "OGGS", and "MP+". - */ - PropertyMap setProperties(const PropertyMap &); - - /*! - * Check if the given String is a valid APE tag key. - */ - static bool checkKey(const String&); - - /*! - * Returns a pointer to the tag's footer. - */ - Footer *footer() const; - - /*! - * Returns a reference to the item list map. This is an ItemListMap of - * all of the items in the tag. - * - * This is the most powerful structure for accessing the items of the tag. - * - * APE tags are case-insensitive, all keys in this map have been converted - * to upper case. - * - * \warning You should not modify this data structure directly, instead - * use setItem() and removeItem(). - */ - const ItemListMap &itemListMap() const; - - /*! - * Removes the \a key item from the tag - */ - void removeItem(const String &key); - - /*! - * Adds to the text item specified by \a key the data \a value. If \a replace - * is true, then all of the other values on the same key will be removed - * first. If a binary item exists for \a key it will be removed first. - */ - void addValue(const String &key, const String &value, bool replace = true); - - /*! - * Set the binary data for the key specified by \a item to \a value - * This will convert the item to type \a Binary if it isn't already and - * all of the other values on the same key will be removed. - */ - void setData(const String &key, const ByteVector &value); - - /*! - * Sets the \a key item to the value of \a item. If an item with the \a key is already - * present, it will be replaced. - */ - void setItem(const String &key, const Item &item); - - /*! - * Returns true if the tag does not contain any data. - */ - bool isEmpty() const; - - protected: - - /*! - * Reads from the file specified in the constructor. - */ - void read(); - - /*! - * Parses the body of the tag in \a data. - */ - void parse(const ByteVector &data); - - private: - Tag(const Tag &); - Tag &operator=(const Tag &); - - class TagPrivate; - TagPrivate *d; - }; - } -} - -#endif diff --git a/3rdparty/taglib/include/taglib/asfattribute.h b/3rdparty/taglib/include/taglib/asfattribute.h deleted file mode 100644 index 54eb0c7..0000000 --- a/3rdparty/taglib/include/taglib/asfattribute.h +++ /dev/null @@ -1,203 +0,0 @@ -/************************************************************************** - copyright : (C) 2005-2007 by Lukáš Lalinský - email : lalinsky@gmail.com - **************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * - * 02110-1301 USA * - * * - * Alternatively, this file is available under the Mozilla Public * - * License Version 1.1. You may obtain a copy of the License at * - * http://www.mozilla.org/MPL/ * - ***************************************************************************/ - -#ifndef TAGLIB_ASFATTRIBUTE_H -#define TAGLIB_ASFATTRIBUTE_H - -#include "tstring.h" -#include "tbytevector.h" -#include "taglib_export.h" -#include "asfpicture.h" - -namespace TagLib -{ - - namespace ASF - { - - class File; - class Picture; - - class TAGLIB_EXPORT Attribute - { - public: - - /*! - * Enum of types an Attribute can have. - */ - enum AttributeTypes { - UnicodeType = 0, - BytesType = 1, - BoolType = 2, - DWordType = 3, - QWordType = 4, - WordType = 5, - GuidType = 6 - }; - - /*! - * Constructs an empty attribute. - */ - Attribute(); - - /*! - * Constructs an attribute with \a key and a UnicodeType \a value. - */ - Attribute(const String &value); - - /*! - * Constructs an attribute with \a key and a BytesType \a value. - */ - Attribute(const ByteVector &value); - - /*! - * Constructs an attribute with \a key and a Picture \a value. - * - * This attribute is compatible with the ID3 frame, APIC. The ID3 specification for the APIC frame stipulates that, - * while there may be any number of APIC frames associated with a file, - * only one may be of type 1 and only one may be of type 2. - * - * The specification also states that the description of the picture can be no longer than 64 characters, but can be empty. - * WM/Picture attributes added with TagLib::ASF are not automatically validated to conform to ID3 specifications. - * You must add code in your application to perform validations if you want to maintain complete compatibility with ID3. - */ - Attribute(const Picture &value); - - /*! - * Constructs an attribute with \a key and a DWordType \a value. - */ - Attribute(unsigned int value); - - /*! - * Constructs an attribute with \a key and a QWordType \a value. - */ - Attribute(unsigned long long value); - - /*! - * Constructs an attribute with \a key and a WordType \a value. - */ - Attribute(unsigned short value); - - /*! - * Constructs an attribute with \a key and a BoolType \a value. - */ - Attribute(bool value); - - /*! - * Construct an attribute as a copy of \a other. - */ - Attribute(const Attribute &item); - - /*! - * Copies the contents of \a other into this item. - */ - ASF::Attribute &operator=(const Attribute &other); - - /*! - * Destroys the attribute. - */ - virtual ~Attribute(); - - /*! - * Returns type of the value. - */ - AttributeTypes type() const; - - /*! - * Returns the BoolType \a value. - */ - unsigned short toBool() const; - - /*! - * Returns the WordType \a value. - */ - unsigned short toUShort() const; - - /*! - * Returns the DWordType \a value. - */ - unsigned int toUInt() const; - - /*! - * Returns the QWordType \a value. - */ - unsigned long long toULongLong() const; - - /*! - * Returns the UnicodeType \a value. - */ - String toString() const; - - /*! - * Returns the BytesType \a value. - */ - ByteVector toByteVector() const; - - /*! - * Returns the Picture \a value. - */ - Picture toPicture() const; - - /*! - * Returns the language number, or 0 is no stream number was set. - */ - int language() const; - - /*! - * Sets the language number. - */ - void setLanguage(int value); - - /*! - * Returns the stream number, or 0 is no stream number was set. - */ - int stream() const; - - /*! - * Sets the stream number. - */ - void setStream(int value); - -#ifndef DO_NOT_DOCUMENT - /* THIS IS PRIVATE, DON'T TOUCH IT! */ - String parse(ASF::File &file, int kind = 0); -#endif - - //! Returns the size of the stored data - int dataSize() const; - - private: - friend class File; - - ByteVector render(const String &name, int kind = 0) const; - - class AttributePrivate; - AttributePrivate *d; - }; - } - -} - -#endif diff --git a/3rdparty/taglib/include/taglib/asffile.h b/3rdparty/taglib/include/taglib/asffile.h deleted file mode 100644 index f1ae431..0000000 --- a/3rdparty/taglib/include/taglib/asffile.h +++ /dev/null @@ -1,132 +0,0 @@ -/************************************************************************** - copyright : (C) 2005-2007 by Lukáš Lalinský - email : lalinsky@gmail.com - **************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * - * 02110-1301 USA * - * * - * Alternatively, this file is available under the Mozilla Public * - * License Version 1.1. You may obtain a copy of the License at * - * http://www.mozilla.org/MPL/ * - ***************************************************************************/ - -#ifndef TAGLIB_ASFFILE_H -#define TAGLIB_ASFFILE_H - -#include "tag.h" -#include "tfile.h" -#include "taglib_export.h" -#include "asfproperties.h" -#include "asftag.h" - -namespace TagLib { - - //! An implementation of ASF (WMA) metadata - namespace ASF { - - /*! - * This implements and provides an interface for ASF files to the - * TagLib::Tag and TagLib::AudioProperties interfaces by way of implementing - * the abstract TagLib::File API as well as providing some additional - * information specific to ASF files. - */ - class TAGLIB_EXPORT File : public TagLib::File - { - public: - - /*! - * Constructs an ASF file from \a file. - * - * \note In the current implementation, both \a readProperties and - * \a propertiesStyle are ignored. The audio properties are always - * read. - */ - File(FileName file, bool readProperties = true, - Properties::ReadStyle propertiesStyle = Properties::Average); - - /*! - * Constructs an ASF file from \a stream. - * - * \note In the current implementation, both \a readProperties and - * \a propertiesStyle are ignored. The audio properties are always - * read. - * - * \note TagLib will *not* take ownership of the stream, the caller is - * responsible for deleting it after the File object. - */ - File(IOStream *stream, bool readProperties = true, - Properties::ReadStyle propertiesStyle = Properties::Average); - - /*! - * Destroys this instance of the File. - */ - virtual ~File(); - - /*! - * Returns a pointer to the ASF tag of the file. - * - * ASF::Tag implements the tag interface, so this serves as the - * reimplementation of TagLib::File::tag(). - * - * \note The Tag is still owned by the ASF::File and should not be - * deleted by the user. It will be deleted when the file (object) is - * destroyed. - */ - virtual Tag *tag() const; - - /*! - * Implements the unified property interface -- export function. - */ - PropertyMap properties() const; - - /*! - * Removes unsupported properties. Forwards to the actual Tag's - * removeUnsupportedProperties() function. - */ - void removeUnsupportedProperties(const StringList &properties); - - /*! - * Implements the unified property interface -- import function. - */ - PropertyMap setProperties(const PropertyMap &); - - /*! - * Returns the ASF audio properties for this file. - */ - virtual Properties *audioProperties() const; - - /*! - * Save the file. - * - * This returns true if the save was successful. - * - * \warning In the current implementation, it's dangerous to call save() - * repeatedly. At worst it will corrupt the file. - */ - virtual bool save(); - - private: - void read(); - - class FilePrivate; - FilePrivate *d; - }; - - } - -} - -#endif diff --git a/3rdparty/taglib/include/taglib/asfpicture.h b/3rdparty/taglib/include/taglib/asfpicture.h deleted file mode 100644 index b510c35..0000000 --- a/3rdparty/taglib/include/taglib/asfpicture.h +++ /dev/null @@ -1,217 +0,0 @@ -/************************************************************************** - copyright : (C) 2010 by Anton Sergunov - email : setosha@gmail.com - **************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * - * 02110-1301 USA * - * * - * Alternatively, this file is available under the Mozilla Public * - * License Version 1.1. You may obtain a copy of the License at * - * http://www.mozilla.org/MPL/ * - ***************************************************************************/ - -#ifndef ASFPICTURE_H -#define ASFPICTURE_H - -#include "tstring.h" -#include "tbytevector.h" -#include "taglib_export.h" -#include "attachedpictureframe.h" - -namespace TagLib -{ - namespace ASF - { - - //! An ASF attached picture interface implementation - - /*! - * This is an implementation of ASF attached pictures interface. Pictures may be - * included in attributes, one per WM/Picture attribute (but there may be multiple WM/Picture - * attribute in a single tag). These pictures are usually in either JPEG or - * PNG format. - * \see Attribute::toPicture() - * \see Attribute::Attribute(const Picture& picture) - */ - class TAGLIB_EXPORT Picture { - public: - - /*! - * This describes the function or content of the picture. - */ - enum Type { - //! A type not enumerated below - Other = 0x00, - //! 32x32 PNG image that should be used as the file icon - FileIcon = 0x01, - //! File icon of a different size or format - OtherFileIcon = 0x02, - //! Front cover image of the album - FrontCover = 0x03, - //! Back cover image of the album - BackCover = 0x04, - //! Inside leaflet page of the album - LeafletPage = 0x05, - //! Image from the album itself - Media = 0x06, - //! Picture of the lead artist or soloist - LeadArtist = 0x07, - //! Picture of the artist or performer - Artist = 0x08, - //! Picture of the conductor - Conductor = 0x09, - //! Picture of the band or orchestra - Band = 0x0A, - //! Picture of the composer - Composer = 0x0B, - //! Picture of the lyricist or text writer - Lyricist = 0x0C, - //! Picture of the recording location or studio - RecordingLocation = 0x0D, - //! Picture of the artists during recording - DuringRecording = 0x0E, - //! Picture of the artists during performance - DuringPerformance = 0x0F, - //! Picture from a movie or video related to the track - MovieScreenCapture = 0x10, - //! Picture of a large, coloured fish - ColouredFish = 0x11, - //! Illustration related to the track - Illustration = 0x12, - //! Logo of the band or performer - BandLogo = 0x13, - //! Logo of the publisher (record company) - PublisherLogo = 0x14 - }; - - /*! - * Constructs an empty picture. - */ - Picture(); - - /*! - * Construct an picture as a copy of \a other. - */ - Picture(const Picture& other); - - /*! - * Destroys the picture. - */ - virtual ~Picture(); - - /*! - * Copies the contents of \a other into this picture. - */ - Picture& operator=(const Picture& other); - - /*! - * Returns true if Picture stores valid picture - */ - bool isValid() const; - - /*! - * Returns the mime type of the image. This should in most cases be - * "image/png" or "image/jpeg". - * \see setMimeType(const String &) - * \see picture() - * \see setPicture(const ByteArray&) - */ - String mimeType() const; - - /*! - * Sets the mime type of the image. This should in most cases be - * "image/png" or "image/jpeg". - * \see setMimeType(const String &) - * \see picture() - * \see setPicture(const ByteArray&) - */ - void setMimeType(const String &value); - - /*! - * Returns the type of the image. - * - * \see Type - * \see setType() - */ - Type type() const; - - /*! - * Sets the type for the image. - * - * \see Type - * \see type() - */ - void setType(const ASF::Picture::Type& t); - - /*! - * Returns a text description of the image. - * - * \see setDescription() - */ - String description() const; - - /*! - * Sets a textual description of the image to \a desc. - * - * \see description() - */ - void setDescription(const String &desc); - - /*! - * Returns the image data as a ByteVector. - * - * \note ByteVector has a data() method that returns a const char * which - * should make it easy to export this data to external programs. - * - * \see setPicture() - * \see mimeType() - */ - ByteVector picture() const; - - /*! - * Sets the image data to \a p. \a p should be of the type specified in - * this frame's mime-type specification. - * - * \see picture() - * \see mimeType() - * \see setMimeType() - */ - void setPicture(const ByteVector &p); - - /*! - * Returns picture as binary raw data \a value - */ - ByteVector render() const; - - /*! - * Returns picture as binary raw data \a value - */ - int dataSize() const; - -#ifndef DO_NOT_DOCUMENT - /* THIS IS PRIVATE, DON'T TOUCH IT! */ - void parse(const ByteVector& ); - static Picture fromInvalid(); -#endif - - private: - class PicturePrivate; - PicturePrivate *d; - }; - } -} - -#endif // ASFPICTURE_H diff --git a/3rdparty/taglib/include/taglib/asfproperties.h b/3rdparty/taglib/include/taglib/asfproperties.h deleted file mode 100644 index b89349b..0000000 --- a/3rdparty/taglib/include/taglib/asfproperties.h +++ /dev/null @@ -1,186 +0,0 @@ -/************************************************************************** - copyright : (C) 2005-2007 by Lukáš Lalinský - email : lalinsky@gmail.com - **************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * - * 02110-1301 USA * - * * - * Alternatively, this file is available under the Mozilla Public * - * License Version 1.1. You may obtain a copy of the License at * - * http://www.mozilla.org/MPL/ * - ***************************************************************************/ - -#ifndef TAGLIB_ASFPROPERTIES_H -#define TAGLIB_ASFPROPERTIES_H - -#include "audioproperties.h" -#include "tstring.h" -#include "taglib_export.h" - -namespace TagLib { - - namespace ASF { - - //! An implementation of ASF audio properties - class TAGLIB_EXPORT Properties : public AudioProperties - { - public: - - /*! - * Audio codec types can be used in ASF file. - */ - enum Codec - { - /*! - * Couldn't detect the codec. - */ - Unknown = 0, - - /*! - * Windows Media Audio 1 - */ - WMA1, - - /*! - * Windows Media Audio 2 or above - */ - WMA2, - - /*! - * Windows Media Audio 9 Professional - */ - WMA9Pro, - - /*! - * Windows Media Audio 9 Lossless - */ - WMA9Lossless, - }; - - /*! - * Creates an instance of ASF::Properties. - */ - Properties(); - - /*! - * Destroys this ASF::Properties instance. - */ - virtual ~Properties(); - - /*! - * Returns the length of the file in seconds. The length is rounded down to - * the nearest whole second. - * - * \note This method is just an alias of lengthInSeconds(). - * - * \deprecated - */ - virtual int length() const; - - /*! - * Returns the length of the file in seconds. The length is rounded down to - * the nearest whole second. - * - * \see lengthInMilliseconds() - */ - // BIC: make virtual - int lengthInSeconds() const; - - /*! - * Returns the length of the file in milliseconds. - * - * \see lengthInSeconds() - */ - // BIC: make virtual - int lengthInMilliseconds() const; - - /*! - * Returns the average bit rate of the file in kb/s. - */ - virtual int bitrate() const; - - /*! - * Returns the sample rate in Hz. - */ - virtual int sampleRate() const; - - /*! - * Returns the number of audio channels. - */ - virtual int channels() const; - - /*! - * Returns the number of bits per audio sample. - */ - int bitsPerSample() const; - - /*! - * Returns the codec used in the file. - * - * \see codecName() - * \see codecDescription() - */ - Codec codec() const; - - /*! - * Returns the concrete codec name, for example "Windows Media Audio 9.1" - * used in the file if available, otherwise an empty string. - * - * \see codec() - * \see codecDescription() - */ - String codecName() const; - - /*! - * Returns the codec description, typically contains the encoder settings, - * for example "VBR Quality 50, 44kHz, stereo 1-pass VBR" if available, - * otherwise an empty string. - * - * \see codec() - * \see codecName() - */ - String codecDescription() const; - - /*! - * Returns whether or not the file is encrypted. - */ - bool isEncrypted() const; - -#ifndef DO_NOT_DOCUMENT - // deprecated - void setLength(int value); - - void setLengthInMilliseconds(int value); - void setBitrate(int value); - void setSampleRate(int value); - void setChannels(int value); - void setBitsPerSample(int value); - void setCodec(int value); - void setCodecName(const String &value); - void setCodecDescription(const String &value); - void setEncrypted(bool value); -#endif - - private: - class PropertiesPrivate; - PropertiesPrivate *d; - }; - - } - -} - -#endif diff --git a/3rdparty/taglib/include/taglib/asftag.h b/3rdparty/taglib/include/taglib/asftag.h deleted file mode 100644 index 8f322b1..0000000 --- a/3rdparty/taglib/include/taglib/asftag.h +++ /dev/null @@ -1,209 +0,0 @@ -/************************************************************************** - copyright : (C) 2005-2007 by Lukáš Lalinský - email : lalinsky@gmail.com - **************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * - * 02110-1301 USA * - * * - * Alternatively, this file is available under the Mozilla Public * - * License Version 1.1. You may obtain a copy of the License at * - * http://www.mozilla.org/MPL/ * - ***************************************************************************/ - -#ifndef TAGLIB_ASFTAG_H -#define TAGLIB_ASFTAG_H - -#include "tag.h" -#include "tlist.h" -#include "tmap.h" -#include "taglib_export.h" -#include "asfattribute.h" - -namespace TagLib { - - namespace ASF { - - typedef List AttributeList; - typedef Map AttributeListMap; - - class TAGLIB_EXPORT Tag : public TagLib::Tag { - - friend class File; - - public: - - Tag(); - - virtual ~Tag(); - - /*! - * Returns the track name. - */ - virtual String title() const; - - /*! - * Returns the artist name. - */ - virtual String artist() const; - - /*! - * Returns the album name; if no album name is present in the tag - * String::null will be returned. - */ - virtual String album() const; - - /*! - * Returns the track comment. - */ - virtual String comment() const; - - /*! - * Returns the genre name; if no genre is present in the tag String::null - * will be returned. - */ - virtual String genre() const; - - /*! - * Returns the rating. - */ - virtual String rating() const; - - /*! - * Returns the genre name; if no genre is present in the tag String::null - * will be returned. - */ - virtual String copyright() const; - - /*! - * Returns the year; if there is no year set, this will return 0. - */ - virtual uint year() const; - - /*! - * Returns the track number; if there is no track number set, this will - * return 0. - */ - virtual uint track() const; - - /*! - * Sets the title to \a s. - */ - virtual void setTitle(const String &s); - - /*! - * Sets the artist to \a s. - */ - virtual void setArtist(const String &s); - - /*! - * Sets the album to \a s. If \a s is String::null then this value will be - * cleared. - */ - virtual void setAlbum(const String &s); - - /*! - * Sets the comment to \a s. - */ - virtual void setComment(const String &s); - - /*! - * Sets the rating to \a s. - */ - virtual void setRating(const String &s); - - /*! - * Sets the copyright to \a s. - */ - virtual void setCopyright(const String &s); - - /*! - * Sets the genre to \a s. - */ - virtual void setGenre(const String &s); - - /*! - * Sets the year to \a i. If \a s is 0 then this value will be cleared. - */ - virtual void setYear(uint i); - - /*! - * Sets the track to \a i. If \a s is 0 then this value will be cleared. - */ - virtual void setTrack(uint i); - - /*! - * Returns true if the tag does not contain any data. This should be - * reimplemented in subclasses that provide more than the basic tagging - * abilities in this class. - */ - virtual bool isEmpty() const; - - /*! - * \deprecated - */ - AttributeListMap &attributeListMap(); - - /*! - * Returns a reference to the item list map. This is an AttributeListMap of - * all of the items in the tag. - */ - const AttributeListMap &attributeListMap() const; - - /*! - * \return True if a value for \a attribute is currently set. - */ - bool contains(const String &name) const; - - /*! - * Removes the \a key attribute from the tag - */ - void removeItem(const String &name); - - /*! - * \return The list of values for the key \a name, or an empty list if no - * values have been set. - */ - AttributeList attribute(const String &name) const; - - /*! - * Sets the \a key attribute to the value of \a attribute. If an attribute - * with the \a key is already present, it will be replaced. - */ - void setAttribute(const String &name, const Attribute &attribute); - - /*! - * Sets multiple \a values to the key \a name. - */ - void setAttribute(const String &name, const AttributeList &values); - - /*! - * Sets the \a key attribute to the value of \a attribute. If an attribute - * with the \a key is already present, it will be added to the list. - */ - void addAttribute(const String &name, const Attribute &attribute); - - PropertyMap properties() const; - void removeUnsupportedProperties(const StringList& properties); - PropertyMap setProperties(const PropertyMap &properties); - - private: - - class TagPrivate; - TagPrivate *d; - }; - } -} -#endif diff --git a/3rdparty/taglib/include/taglib/attachedpictureframe.h b/3rdparty/taglib/include/taglib/attachedpictureframe.h deleted file mode 100644 index 55067bd..0000000 --- a/3rdparty/taglib/include/taglib/attachedpictureframe.h +++ /dev/null @@ -1,230 +0,0 @@ -/*************************************************************************** - copyright : (C) 2002 - 2008 by Scott Wheeler - email : wheeler@kde.org - ***************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * - * 02110-1301 USA * - * * - * Alternatively, this file is available under the Mozilla Public * - * License Version 1.1. You may obtain a copy of the License at * - * http://www.mozilla.org/MPL/ * - ***************************************************************************/ - -#ifndef TAGLIB_ATTACHEDPICTUREFRAME_H -#define TAGLIB_ATTACHEDPICTUREFRAME_H - -#include "id3v2frame.h" -#include "id3v2header.h" -#include "taglib_export.h" - -namespace TagLib { - - namespace ID3v2 { - - //! An ID3v2 attached picture frame implementation - - /*! - * This is an implementation of ID3v2 attached pictures. Pictures may be - * included in tags, one per APIC frame (but there may be multiple APIC - * frames in a single tag). These pictures are usually in either JPEG or - * PNG format. - */ - - class TAGLIB_EXPORT AttachedPictureFrame : public Frame - { - friend class FrameFactory; - - public: - - /*! - * This describes the function or content of the picture. - */ - enum Type { - //! A type not enumerated below - Other = 0x00, - //! 32x32 PNG image that should be used as the file icon - FileIcon = 0x01, - //! File icon of a different size or format - OtherFileIcon = 0x02, - //! Front cover image of the album - FrontCover = 0x03, - //! Back cover image of the album - BackCover = 0x04, - //! Inside leaflet page of the album - LeafletPage = 0x05, - //! Image from the album itself - Media = 0x06, - //! Picture of the lead artist or soloist - LeadArtist = 0x07, - //! Picture of the artist or performer - Artist = 0x08, - //! Picture of the conductor - Conductor = 0x09, - //! Picture of the band or orchestra - Band = 0x0A, - //! Picture of the composer - Composer = 0x0B, - //! Picture of the lyricist or text writer - Lyricist = 0x0C, - //! Picture of the recording location or studio - RecordingLocation = 0x0D, - //! Picture of the artists during recording - DuringRecording = 0x0E, - //! Picture of the artists during performance - DuringPerformance = 0x0F, - //! Picture from a movie or video related to the track - MovieScreenCapture = 0x10, - //! Picture of a large, coloured fish - ColouredFish = 0x11, - //! Illustration related to the track - Illustration = 0x12, - //! Logo of the band or performer - BandLogo = 0x13, - //! Logo of the publisher (record company) - PublisherLogo = 0x14 - }; - - /*! - * Constructs an empty picture frame. The description, content and text - * encoding should be set manually. - */ - AttachedPictureFrame(); - - /*! - * Constructs an AttachedPicture frame based on \a data. - */ - explicit AttachedPictureFrame(const ByteVector &data); - - /*! - * Destroys the AttahcedPictureFrame instance. - */ - virtual ~AttachedPictureFrame(); - - /*! - * Returns a string containing the description and mime-type - */ - virtual String toString() const; - - /*! - * Returns the text encoding used for the description. - * - * \see setTextEncoding() - * \see description() - */ - String::Type textEncoding() const; - - /*! - * Set the text encoding used for the description. - * - * \see description() - */ - void setTextEncoding(String::Type t); - - /*! - * Returns the mime type of the image. This should in most cases be - * "image/png" or "image/jpeg". - */ - String mimeType() const; - - /*! - * Sets the mime type of the image. This should in most cases be - * "image/png" or "image/jpeg". - */ - void setMimeType(const String &m); - - /*! - * Returns the type of the image. - * - * \see Type - * \see setType() - */ - Type type() const; - - /*! - * Sets the type for the image. - * - * \see Type - * \see type() - */ - void setType(Type t); - - /*! - * Returns a text description of the image. - * - * \see setDescription() - * \see textEncoding() - * \see setTextEncoding() - */ - - String description() const; - - /*! - * Sets a textual description of the image to \a desc. - * - * \see description() - * \see textEncoding() - * \see setTextEncoding() - */ - - void setDescription(const String &desc); - - /*! - * Returns the image data as a ByteVector. - * - * \note ByteVector has a data() method that returns a const char * which - * should make it easy to export this data to external programs. - * - * \see setPicture() - * \see mimeType() - */ - ByteVector picture() const; - - /*! - * Sets the image data to \a p. \a p should be of the type specified in - * this frame's mime-type specification. - * - * \see picture() - * \see mimeType() - * \see setMimeType() - */ - void setPicture(const ByteVector &p); - - protected: - virtual void parseFields(const ByteVector &data); - virtual ByteVector renderFields() const; - class AttachedPictureFramePrivate; - AttachedPictureFramePrivate *d; - - private: - AttachedPictureFrame(const AttachedPictureFrame &); - AttachedPictureFrame &operator=(const AttachedPictureFrame &); - AttachedPictureFrame(const ByteVector &data, Header *h); - - }; - - //! support for ID3v2.2 PIC frames - class TAGLIB_EXPORT AttachedPictureFrameV22 : public AttachedPictureFrame - { - protected: - virtual void parseFields(const ByteVector &data); - private: - AttachedPictureFrameV22(const ByteVector &data, Header *h); - friend class FrameFactory; - }; - } -} - -#endif diff --git a/3rdparty/taglib/include/taglib/audioproperties.h b/3rdparty/taglib/include/taglib/audioproperties.h deleted file mode 100644 index f27aefc..0000000 --- a/3rdparty/taglib/include/taglib/audioproperties.h +++ /dev/null @@ -1,127 +0,0 @@ -/*************************************************************************** - copyright : (C) 2002 - 2008 by Scott Wheeler - email : wheeler@kde.org - ***************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * - * 02110-1301 USA * - * * - * Alternatively, this file is available under the Mozilla Public * - * License Version 1.1. You may obtain a copy of the License at * - * http://www.mozilla.org/MPL/ * - ***************************************************************************/ - -#ifndef TAGLIB_AUDIOPROPERTIES_H -#define TAGLIB_AUDIOPROPERTIES_H - -#include "taglib_export.h" - -namespace TagLib { - - //! A simple, abstract interface to common audio properties - - /*! - * The values here are common to most audio formats. For more specific, codec - * dependent values, please see see the subclasses APIs. This is meant to - * compliment the TagLib::File and TagLib::Tag APIs in providing a simple - * interface that is sufficient for most applications. - */ - - class TAGLIB_EXPORT AudioProperties - { - public: - - /*! - * Reading audio properties from a file can sometimes be very time consuming - * and for the most accurate results can often involve reading the entire - * file. Because in many situations speed is critical or the accuracy of the - * values is not particularly important this allows the level of desired - * accuracy to be set. - */ - enum ReadStyle { - //! Read as little of the file as possible - Fast, - //! Read more of the file and make better values guesses - Average, - //! Read as much of the file as needed to report accurate values - Accurate - }; - - /*! - * Destroys this AudioProperties instance. - */ - virtual ~AudioProperties(); - - /*! - * Returns the length of the file in seconds. - */ - virtual int length() const = 0; - - /*! - * Returns the length of the file in seconds. The length is rounded down to - * the nearest whole second. - * - * \see lengthInMilliseconds() - */ - // BIC: make virtual - int lengthInSeconds() const; - - /*! - * Returns the length of the file in milliseconds. - * - * \see lengthInSeconds() - */ - // BIC: make virtual - int lengthInMilliseconds() const; - - /*! - * Returns the most appropriate bit rate for the file in kb/s. For constant - * bitrate formats this is simply the bitrate of the file. For variable - * bitrate formats this is either the average or nominal bitrate. - */ - virtual int bitrate() const = 0; - - /*! - * Returns the sample rate in Hz. - */ - virtual int sampleRate() const = 0; - - /*! - * Returns the number of audio channels. - */ - virtual int channels() const = 0; - - protected: - - /*! - * Construct an audio properties instance. This is protected as this class - * should not be instantiated directly, but should be instantiated via its - * subclasses and can be fetched from the FileRef or File APIs. - * - * \see ReadStyle - */ - AudioProperties(ReadStyle style); - - private: - AudioProperties(const AudioProperties &); - AudioProperties &operator=(const AudioProperties &); - - class AudioPropertiesPrivate; - AudioPropertiesPrivate *d; - }; - -} - -#endif diff --git a/3rdparty/taglib/include/taglib/chapterframe.h b/3rdparty/taglib/include/taglib/chapterframe.h deleted file mode 100644 index 3685306..0000000 --- a/3rdparty/taglib/include/taglib/chapterframe.h +++ /dev/null @@ -1,249 +0,0 @@ -/*************************************************************************** - copyright : (C) 2013 by Lukas Krejci - email : krejclu6@fel.cvut.cz - ***************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * - * 02110-1301 USA * - * * - * Alternatively, this file is available under the Mozilla Public * - * License Version 1.1. You may obtain a copy of the License at * - * http://www.mozilla.org/MPL/ * - ***************************************************************************/ - -#ifndef TAGLIB_CHAPTERFRAME -#define TAGLIB_CHAPTERFRAME - -#include "id3v2tag.h" -#include "id3v2frame.h" -#include "taglib_export.h" - -namespace TagLib { - - namespace ID3v2 { - - /*! - * This is an implementation of ID3v2 chapter frames. The purpose of this - * frame is to describe a single chapter within an audio file. - */ - - //! An implementation of ID3v2 chapter frames - - class TAGLIB_EXPORT ChapterFrame : public ID3v2::Frame - { - friend class FrameFactory; - - public: - /*! - * Creates a chapter frame based on \a data. \a tagHeader is required as - * the internal frames are parsed based on the tag version. - */ - ChapterFrame(const ID3v2::Header *tagHeader, const ByteVector &data); - - /*! - * Creates a chapter frame with the element ID \a elementID, start time - * \a startTime, end time \a endTime, start offset \a startOffset, - * end offset \a endOffset and optionally a list of embedded frames, - * whose ownership will then be taken over by this Frame, in - * \a embeededFrames; - * - * All times are in milliseconds. - */ - ChapterFrame(const ByteVector &elementID, - uint startTime, uint endTime, - uint startOffset, uint endOffset, - const FrameList &embeddedFrames = FrameList()); - - /*! - * Destroys the frame. - */ - virtual ~ChapterFrame(); - - /*! - * Returns the element ID of the frame. Element ID - * is a null terminated string, however it's not human-readable. - * - * \see setElementID() - */ - ByteVector elementID() const; - - /*! - * Returns time of chapter's start (in milliseconds). - * - * \see setStartTime() - */ - uint startTime() const; - - /*! - * Returns time of chapter's end (in milliseconds). - * - * \see setEndTime() - */ - uint endTime() const; - - /*! - * Returns zero based byte offset (count of bytes from the beginning - * of the audio file) of chapter's start. - * - * \note If returned value is 0xFFFFFFFF, start time should be used instead. - * \see setStartOffset() - */ - uint startOffset() const; - - /*! - * Returns zero based byte offset (count of bytes from the beginning - * of the audio file) of chapter's end. - * - * \note If returned value is 0xFFFFFFFF, end time should be used instead. - * \see setEndOffset() - */ - uint endOffset() const; - - /*! - * Sets the element ID of the frame to \a eID. If \a eID isn't - * null terminated, a null char is appended automatically. - * - * \see elementID() - */ - void setElementID(const ByteVector &eID); - - /*! - * Sets time of chapter's start (in milliseconds) to \a sT. - * - * \see startTime() - */ - void setStartTime(const uint &sT); - - /*! - * Sets time of chapter's end (in milliseconds) to \a eT. - * - * \see endTime() - */ - void setEndTime(const uint &eT); - - /*! - * Sets zero based byte offset (count of bytes from the beginning - * of the audio file) of chapter's start to \a sO. - * - * \see startOffset() - */ - void setStartOffset(const uint &sO); - - /*! - * Sets zero based byte offset (count of bytes from the beginning - * of the audio file) of chapter's end to \a eO. - * - * \see endOffset() - */ - void setEndOffset(const uint &eO); - - /*! - * Returns a reference to the frame list map. This is an FrameListMap of - * all of the frames embedded in the CHAP frame. - * - * This is the most convenient structure for accessing the CHAP frame's - * embedded frames. Many frame types allow multiple instances of the same - * frame type so this is a map of lists. In most cases however there will - * only be a single frame of a certain type. - * - * \warning You should not modify this data structure directly, instead - * use addEmbeddedFrame() and removeEmbeddedFrame(). - * - * \see embeddedFrameList() - */ - const FrameListMap &embeddedFrameListMap() const; - - /*! - * Returns a reference to the embedded frame list. This is an FrameList - * of all of the frames embedded in the CHAP frame in the order that they - * were parsed. - * - * This can be useful if for example you want iterate over the CHAP frame's - * embedded frames in the order that they occur in the CHAP frame. - * - * \warning You should not modify this data structure directly, instead - * use addEmbeddedFrame() and removeEmbeddedFrame(). - */ - const FrameList &embeddedFrameList() const; - - /*! - * Returns the embedded frame list for frames with the id \a frameID - * or an empty list if there are no embedded frames of that type. This - * is just a convenience and is equivalent to: - * - * \code - * embeddedFrameListMap()[frameID]; - * \endcode - * - * \see embeddedFrameListMap() - */ - const FrameList &embeddedFrameList(const ByteVector &frameID) const; - - /*! - * Add an embedded frame to the CHAP frame. At this point the CHAP frame - * takes ownership of the embedded frame and will handle freeing its memory. - * - * \note Using this method will invalidate any pointers on the list - * returned by embeddedFrameList() - */ - void addEmbeddedFrame(Frame *frame); - - /*! - * Remove an embedded frame from the CHAP frame. If \a del is true the frame's - * memory will be freed; if it is false, it must be deleted by the user. - * - * \note Using this method will invalidate any pointers on the list - * returned by embeddedFrameList() - */ - void removeEmbeddedFrame(Frame *frame, bool del = true); - - /*! - * Remove all embedded frames of type \a id from the CHAP frame and free their - * memory. - * - * \note Using this method will invalidate any pointers on the list - * returned by embeddedFrameList() - */ - void removeEmbeddedFrames(const ByteVector &id); - - virtual String toString() const; - - PropertyMap asProperties() const; - - /*! - * CHAP frames each have a unique element ID. This searches for a CHAP - * frame with the element ID \a eID and returns a pointer to it. This - * can be used to link CTOC and CHAP frames together. - * - * \see elementID() - */ - static ChapterFrame *findByElementID(const Tag *tag, const ByteVector &eID); - - protected: - virtual void parseFields(const ByteVector &data); - virtual ByteVector renderFields() const; - - private: - ChapterFrame(const ID3v2::Header *tagHeader, const ByteVector &data, Header *h); - ChapterFrame(const ChapterFrame &); - ChapterFrame &operator=(const ChapterFrame &); - - class ChapterFramePrivate; - ChapterFramePrivate *d; - }; - } -} - -#endif diff --git a/3rdparty/taglib/include/taglib/commentsframe.h b/3rdparty/taglib/include/taglib/commentsframe.h deleted file mode 100644 index 4da9d53..0000000 --- a/3rdparty/taglib/include/taglib/commentsframe.h +++ /dev/null @@ -1,179 +0,0 @@ -/*************************************************************************** - copyright : (C) 2002 - 2008 by Scott Wheeler - email : wheeler@kde.org - ***************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * - * 02110-1301 USA * - * * - * Alternatively, this file is available under the Mozilla Public * - * License Version 1.1. You may obtain a copy of the License at * - * http://www.mozilla.org/MPL/ * - ***************************************************************************/ - -#ifndef TAGLIB_COMMENTSFRAME_H -#define TAGLIB_COMMENTSFRAME_H - -#include "id3v2frame.h" -#include "taglib_export.h" - -namespace TagLib { - - namespace ID3v2 { - - //! An implementation of ID3v2 comments - - /*! - * This implements the ID3v2 comment format. An ID3v2 comment consists of - * a language encoding, a description and a single text field. - */ - - class TAGLIB_EXPORT CommentsFrame : public Frame - { - friend class FrameFactory; - - public: - /*! - * Construct an empty comment frame that will use the text encoding - * \a encoding. - */ - explicit CommentsFrame(String::Type encoding = String::Latin1); - - /*! - * Construct a comment based on the data in \a data. - */ - explicit CommentsFrame(const ByteVector &data); - - /*! - * Destroys this CommentFrame instance. - */ - virtual ~CommentsFrame(); - - /*! - * Returns the text of this comment. - * - * \see text() - */ - virtual String toString() const; - - /*! - * Returns the language encoding as a 3 byte encoding as specified by - * ISO-639-2. - * - * \note Most taggers simply ignore this value. - * - * \see setLanguage() - */ - ByteVector language() const; - - /*! - * Returns the description of this comment. - * - * \note Most taggers simply ignore this value. - * - * \see setDescription() - */ - String description() const; - - /*! - * Returns the text of this comment. - * - * \see setText() - */ - String text() const; - - /*! - * Set the language using the 3 byte language code from - * ISO-639-2 to - * \a languageCode. - * - * \see language() - */ - void setLanguage(const ByteVector &languageCode); - - /*! - * Sets the description of the comment to \a s. - * - * \see description() - */ - void setDescription(const String &s); - - /*! - * Sets the text portion of the comment to \a s. - * - * \see text() - */ - virtual void setText(const String &s); - - /*! - * Returns the text encoding that will be used in rendering this frame. - * This defaults to the type that was either specified in the constructor - * or read from the frame when parsed. - * - * \see setTextEncoding() - * \see render() - */ - String::Type textEncoding() const; - - /*! - * Sets the text encoding to be used when rendering this frame to - * \a encoding. - * - * \see textEncoding() - * \see render() - */ - void setTextEncoding(String::Type encoding); - - /*! - * Parses this frame as PropertyMap with a single key. - * - if description() is empty or "COMMENT", the key will be "COMMENT" - * - if description() is not a valid PropertyMap key, the frame will be - * marked unsupported by an entry "COMM/" in the unsupportedData() - * attribute of the returned map. - * - otherwise, the key will be "COMMENT:" - * - The single value will be the frame's text(). - */ - PropertyMap asProperties() const; - - /*! - * Comments each have a unique description. This searches for a comment - * frame with the description \a d and returns a pointer to it. If no - * frame is found that matches the given description null is returned. - * - * \see description() - */ - static CommentsFrame *findByDescription(const Tag *tag, const String &d); - - protected: - // Reimplementations. - - virtual void parseFields(const ByteVector &data); - virtual ByteVector renderFields() const; - - private: - /*! - * The constructor used by the FrameFactory. - */ - CommentsFrame(const ByteVector &data, Header *h); - CommentsFrame(const CommentsFrame &); - CommentsFrame &operator=(const CommentsFrame &); - - class CommentsFramePrivate; - CommentsFramePrivate *d; - }; - - } -} -#endif diff --git a/3rdparty/taglib/include/taglib/eventtimingcodesframe.h b/3rdparty/taglib/include/taglib/eventtimingcodesframe.h deleted file mode 100644 index 0719f51..0000000 --- a/3rdparty/taglib/include/taglib/eventtimingcodesframe.h +++ /dev/null @@ -1,185 +0,0 @@ -/*************************************************************************** - copyright : (C) 2014 by Urs Fleisch - email : ufleisch@users.sourceforge.net - ***************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * - * 02110-1301 USA * - * * - * Alternatively, this file is available under the Mozilla Public * - * License Version 1.1. You may obtain a copy of the License at * - * http://www.mozilla.org/MPL/ * - ***************************************************************************/ - -#ifndef TAGLIB_EVENTTIMINGCODESFRAME_H -#define TAGLIB_EVENTTIMINGCODESFRAME_H - -#include "id3v2frame.h" -#include "tlist.h" - -namespace TagLib { - - namespace ID3v2 { - - //! ID3v2 event timing codes frame - /*! - * An implementation of ID3v2 event timing codes. - */ - class TAGLIB_EXPORT EventTimingCodesFrame : public Frame - { - friend class FrameFactory; - - public: - - /*! - * Specifies the timestamp format used. - */ - enum TimestampFormat { - //! The timestamp is of unknown format. - Unknown = 0x00, - //! The timestamp represents the number of MPEG frames since - //! the beginning of the audio stream. - AbsoluteMpegFrames = 0x01, - //! The timestamp represents the number of milliseconds since - //! the beginning of the audio stream. - AbsoluteMilliseconds = 0x02 - }; - - /*! - * Event types defined in id3v2.4.0-frames.txt 4.5. Event timing codes. - */ - enum EventType { - Padding = 0x00, - EndOfInitialSilence = 0x01, - IntroStart = 0x02, - MainPartStart = 0x03, - OutroStart = 0x04, - OutroEnd = 0x05, - VerseStart = 0x06, - RefrainStart = 0x07, - InterludeStart = 0x08, - ThemeStart = 0x09, - VariationStart = 0x0a, - KeyChange = 0x0b, - TimeChange = 0x0c, - MomentaryUnwantedNoise = 0x0d, - SustainedNoise = 0x0e, - SustainedNoiseEnd = 0x0f, - IntroEnd = 0x10, - MainPartEnd = 0x11, - VerseEnd = 0x12, - RefrainEnd = 0x13, - ThemeEnd = 0x14, - Profanity = 0x15, - ProfanityEnd = 0x16, - NotPredefinedSynch0 = 0xe0, - NotPredefinedSynch1 = 0xe1, - NotPredefinedSynch2 = 0xe2, - NotPredefinedSynch3 = 0xe3, - NotPredefinedSynch4 = 0xe4, - NotPredefinedSynch5 = 0xe5, - NotPredefinedSynch6 = 0xe6, - NotPredefinedSynch7 = 0xe7, - NotPredefinedSynch8 = 0xe8, - NotPredefinedSynch9 = 0xe9, - NotPredefinedSynchA = 0xea, - NotPredefinedSynchB = 0xeb, - NotPredefinedSynchC = 0xec, - NotPredefinedSynchD = 0xed, - NotPredefinedSynchE = 0xee, - NotPredefinedSynchF = 0xef, - AudioEnd = 0xfd, - AudioFileEnds = 0xfe - }; - - /*! - * Single entry of time stamp and event. - */ - struct SynchedEvent { - SynchedEvent(uint ms, EventType t) : time(ms), type(t) {} - uint time; - EventType type; - }; - - /*! - * List of synchronized events. - */ - typedef TagLib::List SynchedEventList; - - /*! - * Construct an empty event timing codes frame. - */ - explicit EventTimingCodesFrame(); - - /*! - * Construct a event timing codes frame based on the data in \a data. - */ - explicit EventTimingCodesFrame(const ByteVector &data); - - /*! - * Destroys this EventTimingCodesFrame instance. - */ - virtual ~EventTimingCodesFrame(); - - /*! - * Returns a null string. - */ - virtual String toString() const; - - /*! - * Returns the timestamp format. - */ - TimestampFormat timestampFormat() const; - - /*! - * Returns the events with the time stamps. - */ - SynchedEventList synchedEvents() const; - - /*! - * Set the timestamp format. - * - * \see timestampFormat() - */ - void setTimestampFormat(TimestampFormat f); - - /*! - * Sets the text with the time stamps. - * - * \see text() - */ - void setSynchedEvents(const SynchedEventList &e); - - protected: - // Reimplementations. - - virtual void parseFields(const ByteVector &data); - virtual ByteVector renderFields() const; - - private: - /*! - * The constructor used by the FrameFactory. - */ - EventTimingCodesFrame(const ByteVector &data, Header *h); - EventTimingCodesFrame(const EventTimingCodesFrame &); - EventTimingCodesFrame &operator=(const EventTimingCodesFrame &); - - class EventTimingCodesFramePrivate; - EventTimingCodesFramePrivate *d; - }; - - } -} -#endif diff --git a/3rdparty/taglib/include/taglib/fileref.h b/3rdparty/taglib/include/taglib/fileref.h deleted file mode 100644 index 1e96522..0000000 --- a/3rdparty/taglib/include/taglib/fileref.h +++ /dev/null @@ -1,263 +0,0 @@ -/*************************************************************************** - copyright : (C) 2002 - 2008 by Scott Wheeler - email : wheeler@kde.org - ***************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * - * 02110-1301 USA * - * * - * Alternatively, this file is available under the Mozilla Public * - * License Version 1.1. You may obtain a copy of the License at * - * http://www.mozilla.org/MPL/ * - ***************************************************************************/ - -#ifndef TAGLIB_FILEREF_H -#define TAGLIB_FILEREF_H - -#include "tfile.h" -#include "tstringlist.h" - -#include "taglib_export.h" -#include "audioproperties.h" - -namespace TagLib { - - class Tag; - - //! This class provides a simple abstraction for creating and handling files - - /*! - * FileRef exists to provide a minimal, generic and value-based wrapper around - * a File. It is lightweight and implicitly shared, and as such suitable for - * pass-by-value use. This hides some of the uglier details of TagLib::File - * and the non-generic portions of the concrete file implementations. - * - * This class is useful in a "simple usage" situation where it is desirable - * to be able to get and set some of the tag information that is similar - * across file types. - * - * Also note that it is probably a good idea to plug this into your mime - * type system rather than using the constructor that accepts a file name using - * the FileTypeResolver. - * - * \see FileTypeResolver - * \see addFileTypeResolver() - */ - - class TAGLIB_EXPORT FileRef - { - public: - - //! A class for pluggable file type resolution. - - /*! - * This class is used to add extend TagLib's very basic file name based file - * type resolution. - * - * This can be accomplished with: - * - * \code - * - * class MyFileTypeResolver : FileTypeResolver - * { - * TagLib::File *createFile(TagLib::FileName *fileName, bool, AudioProperties::ReadStyle) const - * { - * if(someCheckForAnMP3File(fileName)) - * return new TagLib::MPEG::File(fileName); - * return 0; - * } - * } - * - * FileRef::addFileTypeResolver(new MyFileTypeResolver); - * - * \endcode - * - * Naturally a less contrived example would be slightly more complex. This - * can be used to plug in mime-type detection systems or to add new file types - * to TagLib. - */ - - class TAGLIB_EXPORT FileTypeResolver - { - TAGLIB_IGNORE_MISSING_DESTRUCTOR - public: - /*! - * This method must be overridden to provide an additional file type - * resolver. If the resolver is able to determine the file type it should - * return a valid File object; if not it should return 0. - * - * \note The created file is then owned by the FileRef and should not be - * deleted. Deletion will happen automatically when the FileRef passes - * out of scope. - */ - virtual File *createFile(FileName fileName, - bool readAudioProperties = true, - AudioProperties::ReadStyle - audioPropertiesStyle = AudioProperties::Average) const = 0; - }; - - /*! - * Creates a null FileRef. - */ - FileRef(); - - /*! - * Create a FileRef from \a fileName. If \a readAudioProperties is true then - * the audio properties will be read using \a audioPropertiesStyle. If - * \a readAudioProperties is false then \a audioPropertiesStyle will be - * ignored. - * - * Also see the note in the class documentation about why you may not want to - * use this method in your application. - */ - explicit FileRef(FileName fileName, - bool readAudioProperties = true, - AudioProperties::ReadStyle - audioPropertiesStyle = AudioProperties::Average); - - /*! - * Construct a FileRef using \a file. The FileRef now takes ownership of the - * pointer and will delete the File when it passes out of scope. - */ - explicit FileRef(File *file); - - /*! - * Make a copy of \a ref. - */ - FileRef(const FileRef &ref); - - /*! - * Destroys this FileRef instance. - */ - virtual ~FileRef(); - - /*! - * Returns a pointer to represented file's tag. - * - * \warning This pointer will become invalid when this FileRef and all - * copies pass out of scope. - * - * \warning Do not cast it to any subclasses of \class Tag. - * Use tag returning methods of appropriate subclasses of \class File instead. - * - * \see File::tag() - */ - Tag *tag() const; - - /*! - * Returns the audio properties for this FileRef. If no audio properties - * were read then this will returns a null pointer. - */ - AudioProperties *audioProperties() const; - - /*! - * Returns a pointer to the file represented by this handler class. - * - * As a general rule this call should be avoided since if you need to work - * with file objects directly, you are probably better served instantiating - * the File subclasses (i.e. MPEG::File) manually and working with their APIs. - * - * This handle exists to provide a minimal, generic and value-based - * wrapper around a File. Accessing the file directly generally indicates - * a moving away from this simplicity (and into things beyond the scope of - * FileRef). - * - * \warning This pointer will become invalid when this FileRef and all - * copies pass out of scope. - */ - File *file() const; - - /*! - * Saves the file. Returns true on success. - */ - bool save(); - - /*! - * Adds a FileTypeResolver to the list of those used by TagLib. Each - * additional FileTypeResolver is added to the front of a list of resolvers - * that are tried. If the FileTypeResolver returns zero the next resolver - * is tried. - * - * Returns a pointer to the added resolver (the same one that's passed in -- - * this is mostly so that static initializers have something to use for - * assignment). - * - * \see FileTypeResolver - */ - static const FileTypeResolver *addFileTypeResolver(const FileTypeResolver *resolver); - - /*! - * As is mentioned elsewhere in this class's documentation, the default file - * type resolution code provided by TagLib only works by comparing file - * extensions. - * - * This method returns the list of file extensions that are used by default. - * - * The extensions are all returned in lowercase, though the comparison used - * by TagLib for resolution is case-insensitive. - * - * \note This does not account for any additional file type resolvers that - * are plugged in. Also note that this is not intended to replace a proper - * mime-type resolution system, but is just here for reference. - * - * \see FileTypeResolver - */ - static StringList defaultFileExtensions(); - - /*! - * Returns true if the file (and as such other pointers) are null. - */ - bool isNull() const; - - /*! - * Assign the file pointed to by \a ref to this FileRef. - */ - FileRef &operator=(const FileRef &ref); - - /*! - * Returns true if this FileRef and \a ref point to the same File object. - */ - bool operator==(const FileRef &ref) const; - - /*! - * Returns true if this FileRef and \a ref do not point to the same File - * object. - */ - bool operator!=(const FileRef &ref) const; - - /*! - * A simple implementation of file type guessing. If \a readAudioProperties - * is true then the audio properties will be read using - * \a audioPropertiesStyle. If \a readAudioProperties is false then - * \a audioPropertiesStyle will be ignored. - * - * \note You generally shouldn't use this method, but instead the constructor - * directly. - * - * \deprecated - */ - static File *create(FileName fileName, - bool readAudioProperties = true, - AudioProperties::ReadStyle audioPropertiesStyle = AudioProperties::Average); - - - private: - class FileRefPrivate; - FileRefPrivate *d; - }; - -} // namespace TagLib - -#endif diff --git a/3rdparty/taglib/include/taglib/flacfile.h b/3rdparty/taglib/include/taglib/flacfile.h deleted file mode 100644 index 1c055d3..0000000 --- a/3rdparty/taglib/include/taglib/flacfile.h +++ /dev/null @@ -1,307 +0,0 @@ -/*************************************************************************** - copyright : (C) 2003 by Allan Sandfeld Jensen - email : kde@carewolf.org - ***************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * - * 02110-1301 USA * - * * - * Alternatively, this file is available under the Mozilla Public * - * License Version 1.1. You may obtain a copy of the License at * - * http://www.mozilla.org/MPL/ * - ***************************************************************************/ - -#ifndef TAGLIB_FLACFILE_H -#define TAGLIB_FLACFILE_H - -#include "taglib_export.h" -#include "tfile.h" -#include "tlist.h" -#include "tag.h" - -#include "flacpicture.h" -#include "flacproperties.h" - -namespace TagLib { - - class Tag; - namespace ID3v2 { class FrameFactory; class Tag; } - namespace ID3v1 { class Tag; } - namespace Ogg { class XiphComment; } - - //! An implementation of FLAC metadata - - /*! - * This is implementation of FLAC metadata for non-Ogg FLAC files. At some - * point when Ogg / FLAC is more common there will be a similar implementation - * under the Ogg hierarchy. - * - * This supports ID3v1, ID3v2 and Xiph style comments as well as reading stream - * properties from the file. - */ - - namespace FLAC { - - //! An implementation of TagLib::File with FLAC specific methods - - /*! - * This implements and provides an interface for FLAC files to the - * TagLib::Tag and TagLib::AudioProperties interfaces by way of implementing - * the abstract TagLib::File API as well as providing some additional - * information specific to FLAC files. - */ - - class TAGLIB_EXPORT File : public TagLib::File - { - public: - /*! - * Constructs a FLAC file from \a file. If \a readProperties is true the - * file's audio properties will also be read. - * - * \note In the current implementation, \a propertiesStyle is ignored. - * - * \deprecated This constructor will be dropped in favor of the one below - * in a future version. - */ - File(FileName file, bool readProperties = true, - Properties::ReadStyle propertiesStyle = Properties::Average); - - /*! - * Constructs an FLAC file from \a file. If \a readProperties is true the - * file's audio properties will also be read. - * - * If this file contains and ID3v2 tag the frames will be created using - * \a frameFactory. - * - * \note In the current implementation, \a propertiesStyle is ignored. - */ - // BIC: merge with the above constructor - File(FileName file, ID3v2::FrameFactory *frameFactory, - bool readProperties = true, - Properties::ReadStyle propertiesStyle = Properties::Average); - - /*! - * Constructs a FLAC file from \a stream. If \a readProperties is true the - * file's audio properties will also be read. - * - * \note TagLib will *not* take ownership of the stream, the caller is - * responsible for deleting it after the File object. - * - * If this file contains and ID3v2 tag the frames will be created using - * \a frameFactory. - * - * \note In the current implementation, \a propertiesStyle is ignored. - */ - // BIC: merge with the above constructor - File(IOStream *stream, ID3v2::FrameFactory *frameFactory, - bool readProperties = true, - Properties::ReadStyle propertiesStyle = Properties::Average); - - /*! - * Destroys this instance of the File. - */ - virtual ~File(); - - /*! - * Returns the Tag for this file. This will be a union of XiphComment, - * ID3v1 and ID3v2 tags. - * - * \see ID3v2Tag() - * \see ID3v1Tag() - * \see XiphComment() - */ - virtual TagLib::Tag *tag() const; - - /*! - * Implements the unified property interface -- export function. - * If the file contains more than one tag (e.g. XiphComment and ID3v1), - * only the first one (in the order XiphComment, ID3v2, ID3v1) will be - * converted to the PropertyMap. - */ - PropertyMap properties() const; - - void removeUnsupportedProperties(const StringList &); - - /*! - * Implements the unified property interface -- import function. - * This always creates a Xiph comment, if none exists. The return value - * relates to the Xiph comment only. - * Ignores any changes to ID3v1 or ID3v2 comments since they are not allowed - * in the FLAC specification. - */ - PropertyMap setProperties(const PropertyMap &); - - /*! - * Returns the FLAC::Properties for this file. If no audio properties - * were read then this will return a null pointer. - */ - virtual Properties *audioProperties() const; - - /*! - * Save the file. This will primarily save the XiphComment, but - * will also keep any old ID3-tags up to date. If the file - * has no XiphComment, one will be constructed from the ID3-tags. - * - * This returns true if the save was successful. - * - * \warning In the current implementation, it's dangerous to call save() - * repeatedly. At worst it will corrupt the file. - */ - virtual bool save(); - - /*! - * Returns a pointer to the ID3v2 tag of the file. - * - * If \a create is false (the default) this returns a null pointer - * if there is no valid ID3v2 tag. If \a create is true it will create - * an ID3v2 tag if one does not exist and returns a valid pointer. - * - * \note This may return a valid pointer regardless of whether or not the - * file on disk has an ID3v2 tag. Use hasID3v2Tag() to check if the file - * on disk actually has an ID3v2 tag. - * - * \note The Tag is still owned by the MPEG::File and should not be - * deleted by the user. It will be deleted when the file (object) is - * destroyed. - * - * \see hasID3v2Tag() - */ - ID3v2::Tag *ID3v2Tag(bool create = false); - - /*! - * Returns a pointer to the ID3v1 tag of the file. - * - * If \a create is false (the default) this returns a null pointer - * if there is no valid APE tag. If \a create is true it will create - * an APE tag if one does not exist and returns a valid pointer. - * - * \note This may return a valid pointer regardless of whether or not the - * file on disk has an ID3v1 tag. Use hasID3v1Tag() to check if the file - * on disk actually has an ID3v1 tag. - * - * \note The Tag is still owned by the MPEG::File and should not be - * deleted by the user. It will be deleted when the file (object) is - * destroyed. - * - * \see hasID3v1Tag() - */ - ID3v1::Tag *ID3v1Tag(bool create = false); - - /*! - * Returns a pointer to the XiphComment for the file. - * - * If \a create is false (the default) this returns a null pointer - * if there is no valid XiphComment. If \a create is true it will create - * a XiphComment if one does not exist and returns a valid pointer. - * - * \note This may return a valid pointer regardless of whether or not the - * file on disk has a XiphComment. Use hasXiphComment() to check if the - * file on disk actually has a XiphComment. - * - * \note The Tag is still owned by the FLAC::File and should not be - * deleted by the user. It will be deleted when the file (object) is - * destroyed. - * - * \see hasXiphComment() - */ - Ogg::XiphComment *xiphComment(bool create = false); - - /*! - * Set the ID3v2::FrameFactory to something other than the default. This - * can be used to specify the way that ID3v2 frames will be interpreted - * when - * - * \see ID3v2FrameFactory - * \deprecated This value should be passed in via the constructor - */ - void setID3v2FrameFactory(const ID3v2::FrameFactory *factory); - - /*! - * Returns the block of data used by FLAC::Properties for parsing the - * stream properties. - * - * \deprecated Always returns an empty vector. - */ - ByteVector streamInfoData(); // BIC: remove - - /*! - * Returns the length of the audio-stream, used by FLAC::Properties for - * calculating the bitrate. - * - * \deprecated Always returns zero. - */ - long streamLength(); // BIC: remove - - /*! - * Returns a list of pictures attached to the FLAC file. - */ - List pictureList(); - - /*! - * Removes an attached picture. If \a del is true the picture's memory - * will be freed; if it is false, it must be deleted by the user. - */ - void removePicture(Picture *picture, bool del = true); - - /*! - * Remove all attached images. - */ - void removePictures(); - - /*! - * Add a new picture to the file. The file takes ownership of the - * picture and will handle freeing its memory. - * - * \note The file will be saved only after calling save(). - */ - void addPicture(Picture *picture); - - /*! - * Returns whether or not the file on disk actually has a XiphComment. - * - * \see xiphComment() - */ - bool hasXiphComment() const; - - /*! - * Returns whether or not the file on disk actually has an ID3v1 tag. - * - * \see ID3v1Tag() - */ - bool hasID3v1Tag() const; - - /*! - * Returns whether or not the file on disk actually has an ID3v2 tag. - * - * \see ID3v2Tag() - */ - bool hasID3v2Tag() const; - - private: - File(const File &); - File &operator=(const File &); - - void read(bool readProperties); - void scan(); - long findID3v2(); - long findID3v1(); - - class FilePrivate; - FilePrivate *d; - }; - } -} - -#endif diff --git a/3rdparty/taglib/include/taglib/flacmetadatablock.h b/3rdparty/taglib/include/taglib/flacmetadatablock.h deleted file mode 100644 index 41bca31..0000000 --- a/3rdparty/taglib/include/taglib/flacmetadatablock.h +++ /dev/null @@ -1,75 +0,0 @@ -/************************************************************************** - copyright : (C) 2010 by Lukáš Lalinský - email : lalinsky@gmail.com - **************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * - * 02110-1301 USA * - * * - * Alternatively, this file is available under the Mozilla Public * - * License Version 1.1. You may obtain a copy of the License at * - * http://www.mozilla.org/MPL/ * - ***************************************************************************/ - -#ifndef TAGLIB_FLACMETADATABLOCK_H -#define TAGLIB_FLACMETADATABLOCK_H - -#include "tlist.h" -#include "tbytevector.h" -#include "taglib_export.h" - -namespace TagLib { - - namespace FLAC { - - class TAGLIB_EXPORT MetadataBlock - { - public: - MetadataBlock(); - virtual ~MetadataBlock(); - - enum BlockType { - StreamInfo = 0, - Padding, - Application, - SeekTable, - VorbisComment, - CueSheet, - Picture - }; - - /*! - * Returns the FLAC metadata block type. - */ - virtual int code() const = 0; - - /*! - * Render the content of the block. - */ - virtual ByteVector render() const = 0; - - private: - MetadataBlock(const MetadataBlock &item); - MetadataBlock &operator=(const MetadataBlock &item); - - class MetadataBlockPrivate; - MetadataBlockPrivate *d; - }; - - } - -} - -#endif diff --git a/3rdparty/taglib/include/taglib/flacpicture.h b/3rdparty/taglib/include/taglib/flacpicture.h deleted file mode 100644 index b6def57..0000000 --- a/3rdparty/taglib/include/taglib/flacpicture.h +++ /dev/null @@ -1,208 +0,0 @@ -/************************************************************************** - copyright : (C) 2010 by Lukáš Lalinský - email : lalinsky@gmail.com - **************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * - * 02110-1301 USA * - * * - * Alternatively, this file is available under the Mozilla Public * - * License Version 1.1. You may obtain a copy of the License at * - * http://www.mozilla.org/MPL/ * - ***************************************************************************/ - -#ifndef TAGLIB_FLACPICTURE_H -#define TAGLIB_FLACPICTURE_H - -#include "tlist.h" -#include "tstring.h" -#include "tbytevector.h" -#include "taglib_export.h" -#include "flacmetadatablock.h" - -namespace TagLib { - - namespace FLAC { - - class TAGLIB_EXPORT Picture : public MetadataBlock - { - public: - - /*! - * This describes the function or content of the picture. - */ - enum Type { - //! A type not enumerated below - Other = 0x00, - //! 32x32 PNG image that should be used as the file icon - FileIcon = 0x01, - //! File icon of a different size or format - OtherFileIcon = 0x02, - //! Front cover image of the album - FrontCover = 0x03, - //! Back cover image of the album - BackCover = 0x04, - //! Inside leaflet page of the album - LeafletPage = 0x05, - //! Image from the album itself - Media = 0x06, - //! Picture of the lead artist or soloist - LeadArtist = 0x07, - //! Picture of the artist or performer - Artist = 0x08, - //! Picture of the conductor - Conductor = 0x09, - //! Picture of the band or orchestra - Band = 0x0A, - //! Picture of the composer - Composer = 0x0B, - //! Picture of the lyricist or text writer - Lyricist = 0x0C, - //! Picture of the recording location or studio - RecordingLocation = 0x0D, - //! Picture of the artists during recording - DuringRecording = 0x0E, - //! Picture of the artists during performance - DuringPerformance = 0x0F, - //! Picture from a movie or video related to the track - MovieScreenCapture = 0x10, - //! Picture of a large, coloured fish - ColouredFish = 0x11, - //! Illustration related to the track - Illustration = 0x12, - //! Logo of the band or performer - BandLogo = 0x13, - //! Logo of the publisher (record company) - PublisherLogo = 0x14 - }; - - Picture(); - Picture(const ByteVector &data); - ~Picture(); - - /*! - * Returns the type of the image. - */ - Type type() const; - - /*! - * Sets the type of the image. - */ - void setType(Type type); - - /*! - * Returns the mime type of the image. This should in most cases be - * "image/png" or "image/jpeg". - */ - String mimeType() const; - - /*! - * Sets the mime type of the image. This should in most cases be - * "image/png" or "image/jpeg". - */ - void setMimeType(const String &m); - - /*! - * Returns a text description of the image. - */ - - String description() const; - - /*! - * Sets a textual description of the image to \a desc. - */ - - void setDescription(const String &desc); - - /*! - * Returns the width of the image. - */ - int width() const; - - /*! - * Sets the width of the image. - */ - void setWidth(int w); - - /*! - * Returns the height of the image. - */ - int height() const; - - /*! - * Sets the height of the image. - */ - void setHeight(int h); - - /*! - * Returns the color depth (in bits-per-pixel) of the image. - */ - int colorDepth() const; - - /*! - * Sets the color depth (in bits-per-pixel) of the image. - */ - void setColorDepth(int depth); - - /*! - * Returns the number of colors used on the image.. - */ - int numColors() const; - - /*! - * Sets the number of colors used on the image (for indexed images). - */ - void setNumColors(int numColors); - - /*! - * Returns the image data. - */ - ByteVector data() const; - - /*! - * Sets the image data. - */ - void setData(const ByteVector &data); - - /*! - * Returns the FLAC metadata block type. - */ - int code() const; - - /*! - * Render the content to the FLAC picture block format. - */ - ByteVector render() const; - - /*! - * Parse the picture data in the FLAC picture block format. - */ - bool parse(const ByteVector &rawData); - - private: - Picture(const Picture &item); - Picture &operator=(const Picture &item); - - class PicturePrivate; - PicturePrivate *d; - }; - - typedef List PictureList; - - } - -} - -#endif diff --git a/3rdparty/taglib/include/taglib/flacproperties.h b/3rdparty/taglib/include/taglib/flacproperties.h deleted file mode 100644 index 6f13ce6..0000000 --- a/3rdparty/taglib/include/taglib/flacproperties.h +++ /dev/null @@ -1,148 +0,0 @@ -/*************************************************************************** - copyright : (C) 2003 by Allan Sandfeld Jensen - email : kde@carewolf.org - ***************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * - * 02110-1301 USA * - * * - * Alternatively, this file is available under the Mozilla Public * - * License Version 1.1. You may obtain a copy of the License at * - * http://www.mozilla.org/MPL/ * - ***************************************************************************/ - -#ifndef TAGLIB_FLACPROPERTIES_H -#define TAGLIB_FLACPROPERTIES_H - -#include "taglib_export.h" -#include "audioproperties.h" - -namespace TagLib { - - namespace FLAC { - - class File; - - //! An implementation of audio property reading for FLAC - - /*! - * This reads the data from an FLAC stream found in the AudioProperties - * API. - */ - - class TAGLIB_EXPORT Properties : public AudioProperties - { - public: - /*! - * Create an instance of FLAC::Properties with the data read from the - * ByteVector \a data. - */ - // BIC: switch to const reference - Properties(ByteVector data, long streamLength, ReadStyle style = Average); - - /*! - * Create an instance of FLAC::Properties with the data read from the - * FLAC::File \a file. - */ - // BIC: remove - Properties(File *file, ReadStyle style = Average); - - /*! - * Destroys this FLAC::Properties instance. - */ - virtual ~Properties(); - - /*! - * Returns the length of the file in seconds. The length is rounded down to - * the nearest whole second. - * - * \note This method is just an alias of lengthInSeconds(). - * - * \deprecated - */ - virtual int length() const; - - /*! - * Returns the length of the file in seconds. The length is rounded down to - * the nearest whole second. - * - * \see lengthInMilliseconds() - */ - // BIC: make virtual - int lengthInSeconds() const; - - /*! - * Returns the length of the file in milliseconds. - * - * \see lengthInSeconds() - */ - // BIC: make virtual - int lengthInMilliseconds() const; - - /*! - * Returns the average bit rate of the file in kb/s. - */ - virtual int bitrate() const; - - /*! - * Returns the sample rate in Hz. - */ - virtual int sampleRate() const; - - /*! - * Returns the number of audio channels. - */ - virtual int channels() const; - - /*! - * Returns the number of bits per audio sample as read from the FLAC - * identification header. - */ - int bitsPerSample() const; - - /*! - * Returns the sample width as read from the FLAC identification - * header. - * - * \note This method is just an alias of bitsPerSample(). - * - * \deprecated - */ - int sampleWidth() const; - - /*! - * Return the number of sample frames. - */ - unsigned long long sampleFrames() const; - - /*! - * Returns the MD5 signature of the uncompressed audio stream as read - * from the stream info header. - */ - ByteVector signature() const; - - private: - Properties(const Properties &); - Properties &operator=(const Properties &); - - void read(const ByteVector &data, long streamLength); - - class PropertiesPrivate; - PropertiesPrivate *d; - }; - } -} - -#endif diff --git a/3rdparty/taglib/include/taglib/generalencapsulatedobjectframe.h b/3rdparty/taglib/include/taglib/generalencapsulatedobjectframe.h deleted file mode 100644 index 42f854c..0000000 --- a/3rdparty/taglib/include/taglib/generalencapsulatedobjectframe.h +++ /dev/null @@ -1,178 +0,0 @@ -/*************************************************************************** - copyright : (C) 2002 - 2008 by Scott Wheeler - email : wheeler@kde.org - copyright : (C) 2006 by Aaron VonderHaar - email : avh4@users.sourceforge.net - ***************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * - * 02110-1301 USA * - * * - * Alternatively, this file is available under the Mozilla Public * - * License Version 1.1. You may obtain a copy of the License at * - * http://www.mozilla.org/MPL/ * - ***************************************************************************/ - -#ifndef TAGLIB_GENERALENCAPSULATEDOBJECT_H -#define TAGLIB_GENERALENCAPSULATEDOBJECT_H - -#include "id3v2frame.h" -#include "id3v2header.h" -#include "taglib_export.h" - -namespace TagLib { - - namespace ID3v2 { - - //! An ID3v2 general encapsulated object frame implementation - - /*! - * This is an implementation of ID3v2 general encapsulated objects. - * Arbitrary binary data may be included in tags, stored in GEOB frames. - * There may be multiple GEOB frames in a single tag. Each GEOB it - * labelled with a content description (which may be blank), a required - * mime-type, and a file name (may be blank). The content description - * uniquely identifies the GEOB frame in the tag. - */ - - class TAGLIB_EXPORT GeneralEncapsulatedObjectFrame : public Frame - { - friend class FrameFactory; - - public: - - /*! - * Constructs an empty object frame. The description, file name and text - * encoding should be set manually. - */ - GeneralEncapsulatedObjectFrame(); - - /*! - * Constructs a GeneralEncapsulatedObjectFrame frame based on \a data. - * - * \warning This is \em not data for the encapsulated object, for that use - * setObject(). This constructor is used when reading the frame from the - * disk. - */ - explicit GeneralEncapsulatedObjectFrame(const ByteVector &data); - - /*! - * Destroys the GeneralEncapsulatedObjectFrame instance. - */ - virtual ~GeneralEncapsulatedObjectFrame(); - - /*! - * Returns a string containing the description, file name and mime-type - */ - virtual String toString() const; - - /*! - * Returns the text encoding used for the description and file name. - * - * \see setTextEncoding() - * \see description() - * \see fileName() - */ - String::Type textEncoding() const; - - /*! - * Set the text encoding used for the description and file name. - * - * \see description() - * \see fileName() - */ - void setTextEncoding(String::Type encoding); - - /*! - * Returns the mime type of the object. - */ - String mimeType() const; - - /*! - * Sets the mime type of the object. - */ - void setMimeType(const String &type); - - /*! - * Returns the file name of the object. - * - * \see setFileName() - */ - String fileName() const; - - /*! - * Sets the file name for the object. - * - * \see fileName() - */ - void setFileName(const String &name); - - /*! - * Returns the content description of the object. - * - * \see setDescription() - * \see textEncoding() - * \see setTextEncoding() - */ - - String description() const; - - /*! - * Sets the content description of the object to \a desc. - * - * \see description() - * \see textEncoding() - * \see setTextEncoding() - */ - - void setDescription(const String &desc); - - /*! - * Returns the object data as a ByteVector. - * - * \note ByteVector has a data() method that returns a const char * which - * should make it easy to export this data to external programs. - * - * \see setObject() - * \see mimeType() - */ - ByteVector object() const; - - /*! - * Sets the object data to \a data. \a data should be of the type specified in - * this frame's mime-type specification. - * - * \see object() - * \see mimeType() - * \see setMimeType() - */ - void setObject(const ByteVector &object); - - protected: - virtual void parseFields(const ByteVector &data); - virtual ByteVector renderFields() const; - - private: - GeneralEncapsulatedObjectFrame(const ByteVector &data, Header *h); - GeneralEncapsulatedObjectFrame(const GeneralEncapsulatedObjectFrame &); - GeneralEncapsulatedObjectFrame &operator=(const GeneralEncapsulatedObjectFrame &); - - class GeneralEncapsulatedObjectFramePrivate; - GeneralEncapsulatedObjectFramePrivate *d; - }; - } -} - -#endif diff --git a/3rdparty/taglib/include/taglib/id3v1genres.h b/3rdparty/taglib/include/taglib/id3v1genres.h deleted file mode 100644 index 0a0dd97..0000000 --- a/3rdparty/taglib/include/taglib/id3v1genres.h +++ /dev/null @@ -1,66 +0,0 @@ -/*************************************************************************** - copyright : (C) 2002 - 2008 by Scott Wheeler - email : wheeler@kde.org - ***************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * - * 02110-1301 USA * - * * - * Alternatively, this file is available under the Mozilla Public * - * License Version 1.1. You may obtain a copy of the License at * - * http://www.mozilla.org/MPL/ * - ***************************************************************************/ - -#ifndef TAGLIB_ID3V1GENRE_H -#define TAGLIB_ID3V1GENRE_H - -#include "tmap.h" -#include "tstringlist.h" -#include "taglib_export.h" - -namespace TagLib { - namespace ID3v1 { - - typedef Map GenreMap; - - /*! - * Returns the list of canonical ID3v1 genre names in the order that they - * are listed in the standard. - */ - StringList TAGLIB_EXPORT genreList(); - - /*! - * A "reverse mapping" that goes from the canonical ID3v1 genre name to the - * respective genre number. genreMap()["Rock"] == - */ - GenreMap TAGLIB_EXPORT genreMap(); - - /*! - * Returns the name of the genre at \a index in the ID3v1 genre list. If - * \a index is out of range -- less than zero or greater than 191 -- a null - * string will be returned. - */ - String TAGLIB_EXPORT genre(int index); - - /*! - * Returns the genre index for the (case sensitive) genre \a name. If the - * genre is not in the list 255 (which signifies an unknown genre in ID3v1) - * will be returned. - */ - int TAGLIB_EXPORT genreIndex(const String &name); - } -} - -#endif diff --git a/3rdparty/taglib/include/taglib/id3v1tag.h b/3rdparty/taglib/include/taglib/id3v1tag.h deleted file mode 100644 index 4cba00d..0000000 --- a/3rdparty/taglib/include/taglib/id3v1tag.h +++ /dev/null @@ -1,202 +0,0 @@ -/*************************************************************************** - copyright : (C) 2002 - 2008 by Scott Wheeler - email : wheeler@kde.org - ***************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * - * 02110-1301 USA * - * * - * Alternatively, this file is available under the Mozilla Public * - * License Version 1.1. You may obtain a copy of the License at * - * http://www.mozilla.org/MPL/ * - ***************************************************************************/ - -#ifndef TAGLIB_ID3V1TAG_H -#define TAGLIB_ID3V1TAG_H - -#include "tag.h" -#include "tbytevector.h" -#include "taglib_export.h" - -namespace TagLib { - - class File; - - //! An ID3v1 implementation - - namespace ID3v1 { - - //! A abstraction for the string to data encoding in ID3v1 tags. - - /*! - * ID3v1 should in theory always contain ISO-8859-1 (Latin1) data. In - * practice it does not. TagLib by default only supports ISO-8859-1 data - * in ID3v1 tags. - * - * However by subclassing this class and reimplementing parse() and render() - * and setting your reimplementation as the default with - * ID3v1::Tag::setStringHandler() you can define how you would like these - * transformations to be done. - * - * \warning It is advisable not to write non-ISO-8859-1 data to ID3v1 - * tags. Please consider disabling the writing of ID3v1 tags in the case - * that the data is not ISO-8859-1. - * - * \see ID3v1::Tag::setStringHandler() - */ - - class TAGLIB_EXPORT StringHandler - { - TAGLIB_IGNORE_MISSING_DESTRUCTOR - public: - // BIC: Add virtual destructor. - StringHandler(); - - /*! - * Decode a string from \a data. The default implementation assumes that - * \a data is an ISO-8859-1 (Latin1) character array. - */ - virtual String parse(const ByteVector &data) const; - - /*! - * Encode a ByteVector with the data from \a s. The default implementation - * assumes that \a s is an ISO-8859-1 (Latin1) string. If the string is - * does not conform to ISO-8859-1, no value is written. - * - * \warning It is recommended that you not override this method, but - * instead do not write an ID3v1 tag in the case that the data is not - * ISO-8859-1. - */ - virtual ByteVector render(const String &s) const; - }; - - //! The main class in the ID3v1 implementation - - /*! - * This is an implementation of the ID3v1 format. ID3v1 is both the simplest - * and most common of tag formats but is rather limited. Because of its - * pervasiveness and the way that applications have been written around the - * fields that it provides, the generic TagLib::Tag API is a mirror of what is - * provided by ID3v1. - * - * ID3v1 tags should generally only contain Latin1 information. However because - * many applications do not follow this rule there is now support for overriding - * the ID3v1 string handling using the ID3v1::StringHandler class. Please see - * the documentation for that class for more information. - * - * \see StringHandler - * - * \note Most fields are truncated to a maximum of 28-30 bytes. The - * truncation happens automatically when the tag is rendered. - */ - - class TAGLIB_EXPORT Tag : public TagLib::Tag - { - public: - /*! - * Create an ID3v1 tag with default values. - */ - Tag(); - - /*! - * Create an ID3v1 tag and parse the data in \a file starting at - * \a tagOffset. - */ - Tag(File *file, long tagOffset); - - /*! - * Destroys this Tag instance. - */ - virtual ~Tag(); - - /*! - * Renders the in memory values to a ByteVector suitable for writing to - * the file. - */ - ByteVector render() const; - - /*! - * Returns the string "TAG" suitable for usage in locating the tag in a - * file. - */ - static ByteVector fileIdentifier(); - - // Reimplementations. - - virtual String title() const; - virtual String artist() const; - virtual String album() const; - virtual String comment() const; - virtual String genre() const; - virtual TagLib::uint year() const; - virtual TagLib::uint track() const; - - virtual void setTitle(const String &s); - virtual void setArtist(const String &s); - virtual void setAlbum(const String &s); - virtual void setComment(const String &s); - virtual void setGenre(const String &s); - virtual void setYear(TagLib::uint i); - virtual void setTrack(TagLib::uint i); - - /*! - * Returns the genre in number. - * - * \note Normally 255 indicates that this tag contains no genre. - */ - TagLib::uint genreNumber() const; - - /*! - * Sets the genre in number to \a i. - * - * \note Valid value is from 0 up to 255. Normally 255 indicates that - * this tag contains no genre. - */ - void setGenreNumber(TagLib::uint i); - - /*! - * Sets the string handler that decides how the ID3v1 data will be - * converted to and from binary data. - * If the parameter \a handler is null, the previous handler is - * released and default ISO-8859-1 handler is restored. - * - * \note The caller is responsible for deleting the previous handler - * as needed after it is released. - * - * \see StringHandler - */ - static void setStringHandler(const StringHandler *handler); - - protected: - /*! - * Reads from the file specified in the constructor. - */ - void read(); - /*! - * Pareses the body of the tag in \a data. - */ - void parse(const ByteVector &data); - - private: - Tag(const Tag &); - Tag &operator=(const Tag &); - - class TagPrivate; - TagPrivate *d; - }; - } -} - -#endif diff --git a/3rdparty/taglib/include/taglib/id3v2extendedheader.h b/3rdparty/taglib/include/taglib/id3v2extendedheader.h deleted file mode 100644 index d60200e..0000000 --- a/3rdparty/taglib/include/taglib/id3v2extendedheader.h +++ /dev/null @@ -1,93 +0,0 @@ -/*************************************************************************** - copyright : (C) 2002 - 2008 by Scott Wheeler - email : wheeler@kde.org - ***************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * - * 02110-1301 USA * - * * - * Alternatively, this file is available under the Mozilla Public * - * License Version 1.1. You may obtain a copy of the License at * - * http://www.mozilla.org/MPL/ * - ***************************************************************************/ - -#ifndef TAGLIB_ID3V2EXTENDEDHEADER_H -#define TAGLIB_ID3V2EXTENDEDHEADER_H - -#include "taglib_export.h" -#include "tbytevector.h" -#include "taglib.h" - -namespace TagLib { - - namespace ID3v2 { - - //! ID3v2 extended header implementation - - /*! - * This class implements ID3v2 extended headers. It attempts to follow, - * both semantically and programatically, the structure specified in - * the ID3v2 standard. The API is based on the properties of ID3v2 extended - * headers specified there. If any of the terms used in this documentation - * are unclear please check the specification in the linked section. - * (Structure, 3.2) - */ - - class TAGLIB_EXPORT ExtendedHeader - { - public: - /*! - * Constructs an empty ID3v2 extended header. - */ - ExtendedHeader(); - - /*! - * Destroys the extended header. - */ - virtual ~ExtendedHeader(); - - /*! - * Returns the size of the extended header. This is variable for the - * extended header. - */ - uint size() const; - - /*! - * Sets the data that will be used as the extended header. Since the - * length is not known before the extended header has been parsed, this - * should just be a pointer to the first byte of the extended header. It - * will determine the length internally and make that available through - * size(). - */ - void setData(const ByteVector &data); - - protected: - /*! - * Called by setData() to parse the extended header data. It makes this - * information available through the public API. - */ - void parse(const ByteVector &data); - - private: - ExtendedHeader(const ExtendedHeader &); - ExtendedHeader &operator=(const ExtendedHeader &); - - class ExtendedHeaderPrivate; - ExtendedHeaderPrivate *d; - }; - - } -} -#endif diff --git a/3rdparty/taglib/include/taglib/id3v2footer.h b/3rdparty/taglib/include/taglib/id3v2footer.h deleted file mode 100644 index 1374a14..0000000 --- a/3rdparty/taglib/include/taglib/id3v2footer.h +++ /dev/null @@ -1,82 +0,0 @@ -/*************************************************************************** - copyright : (C) 2002 - 2008 by Scott Wheeler - email : wheeler@kde.org - ***************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * - * 02110-1301 USA * - * * - * Alternatively, this file is available under the Mozilla Public * - * License Version 1.1. You may obtain a copy of the License at * - * http://www.mozilla.org/MPL/ * - ***************************************************************************/ - -#ifndef TAGLIB_ID3V2FOOTER_H -#define TAGLIB_ID3V2FOOTER_H - -#include "taglib_export.h" -#include "tbytevector.h" - -namespace TagLib { - - namespace ID3v2 { - - class Header; - - //! ID3v2 footer implementation - - /*! - * Per the ID3v2 specification, the tag's footer is just a copy of the - * information in the header. As such there is no API for reading the - * data from the header, it can just as easily be done from the header. - * - * In fact, at this point, TagLib does not even parse the footer since - * it is not useful internally. However, if the flag to include a footer - * has been set in the ID3v2::Tag, TagLib will render a footer. - */ - - class TAGLIB_EXPORT Footer - { - public: - /*! - * Constructs an empty ID3v2 footer. - */ - Footer(); - /*! - * Destroys the footer. - */ - virtual ~Footer(); - - /*! - * Returns the size of the footer. Presently this is always 10 bytes. - */ - static uint size(); - - /*! - * Renders the footer based on the data in \a header. - */ - ByteVector render(const Header *header) const; - - private: - Footer(const Footer &); - Footer &operator=(const Footer &); - - class FooterPrivate; - FooterPrivate *d; - }; - - } -} -#endif diff --git a/3rdparty/taglib/include/taglib/id3v2frame.h b/3rdparty/taglib/include/taglib/id3v2frame.h deleted file mode 100644 index 3771f4f..0000000 --- a/3rdparty/taglib/include/taglib/id3v2frame.h +++ /dev/null @@ -1,518 +0,0 @@ -/*************************************************************************** - copyright : (C) 2002 - 2008 by Scott Wheeler - email : wheeler@kde.org - ***************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * - * 02110-1301 USA * - * * - * Alternatively, this file is available under the Mozilla Public * - * License Version 1.1. You may obtain a copy of the License at * - * http://www.mozilla.org/MPL/ * - ***************************************************************************/ - -#ifndef TAGLIB_ID3V2FRAME_H -#define TAGLIB_ID3V2FRAME_H - -#include "tstring.h" -#include "tbytevector.h" -#include "taglib_export.h" - -namespace TagLib { - - class StringList; - class PropertyMap; - - namespace ID3v2 { - - class Tag; - class FrameFactory; - - //! ID3v2 frame implementation - - /*! - * This class is the main ID3v2 frame implementation. In ID3v2, a tag is - * split between a collection of frames (which are in turn split into fields - * (Structure, 4) - * (Frames). This class provides an API for - * gathering information about and modifying ID3v2 frames. Funtionallity - * specific to a given frame type is handed in one of the many subclasses. - */ - - class TAGLIB_EXPORT Frame - { - friend class Tag; - friend class FrameFactory; - - public: - - /*! - * Creates a textual frame which corresponds to a single key in the PropertyMap - * interface. These are all (User)TextIdentificationFrames except TIPL and TMCL, - * all (User)URLLinkFrames, CommentsFrames, and UnsynchronizedLyricsFrame. - */ - static Frame *createTextualFrame(const String &key, const StringList &values); - - /*! - * Destroys this Frame instance. - */ - virtual ~Frame(); - - /*! - * Returns the Frame ID (Structure, 4) - * (Frames, 4) - */ - ByteVector frameID() const; - - /*! - * Returns the size of the frame. - */ - uint size() const; - - /*! - * Returns the size of the frame header - * - * \deprecated This is only accurate for ID3v2.3 or ID3v2.4. Please use - * the call below which accepts an ID3v2 version number. In the next - * non-binary compatible release this will be made into a non-static - * member that checks the internal ID3v2 version. - */ - static uint headerSize(); // BIC: remove and make non-static - - /*! - * Returns the size of the frame header for the given ID3v2 version. - * - * \deprecated Please see the explanation above. - */ - static uint headerSize(uint version); // BIC: remove and make non-static - - /*! - * Sets the data that will be used as the frame. Since the length is not - * known before the frame has been parsed, this should just be a pointer to - * the first byte of the frame. It will determine the length internally - * and make that available through size(). - */ - void setData(const ByteVector &data); - - /*! - * Set the text of frame in the sanest way possible. This should only be - * reimplemented in frames where there is some logical mapping to text. - * - * \note If the frame type supports multiple text encodings, this will not - * change the text encoding of the frame; the string will be converted to - * that frame's encoding. Please use the specific APIs of the frame types - * to set the encoding if that is desired. - */ - virtual void setText(const String &text); - - /*! - * This returns the textual representation of the data in the frame. - * Subclasses must reimplement this method to provide a string - * representation of the frame's data. - */ - virtual String toString() const = 0; - - /*! - * Render the frame back to its binary format in a ByteVector. - */ - ByteVector render() const; - - /*! - * Returns the text delimiter that is used between fields for the string - * type \a t. - */ - static ByteVector textDelimiter(String::Type t); - - /*! - * The string with which an instrument name is prefixed to build a key in a PropertyMap; - * used to translate PropertyMaps to TMCL frames. In the current implementation, this - * is "PERFORMER:". - */ - static const String instrumentPrefix; - /*! - * The PropertyMap key prefix which triggers the use of a COMM frame instead of a TXXX - * frame for a non-standard key. In the current implementation, this is "COMMENT:". - */ - static const String commentPrefix; - /*! - * The PropertyMap key prefix which triggers the use of a USLT frame instead of a TXXX - * frame for a non-standard key. In the current implementation, this is "LYRICS:". - */ - static const String lyricsPrefix; - /*! - * The PropertyMap key prefix which triggers the use of a WXXX frame instead of a TXX - * frame for a non-standard key. In the current implementation, this is "URL:". - */ - static const String urlPrefix; - - protected: - class Header; - - /*! - * Constructs an ID3v2 frame using \a data to read the header information. - * All other processing of \a data should be handled in a subclass. - * - * \note This need not contain anything more than a frame ID, but - * \e must contain at least that. - */ - explicit Frame(const ByteVector &data); - - /*! - * This creates an Frame using the header \a h. - * - * The ownership of this header will be assigned to the frame and the - * header will be deleted when the frame is destroyed. - */ - Frame(Header *h); - - /*! - * Returns a pointer to the frame header. - */ - Header *header() const; - - /*! - * Sets the header to \a h. If \a deleteCurrent is true, this will free - * the memory of the current header. - * - * The ownership of this header will be assigned to the frame and the - * header will be deleted when the frame is destroyed. - */ - void setHeader(Header *h, bool deleteCurrent = true); - - /*! - * Called by setData() to parse the frame data. It makes this information - * available through the public API. - */ - void parse(const ByteVector &data); - - /*! - * Called by parse() to parse the field data. It makes this information - * available through the public API. This must be overridden by the - * subclasses. - */ - virtual void parseFields(const ByteVector &data) = 0; - - /*! - * Render the field data back to a binary format in a ByteVector. This - * must be overridden by subclasses. - */ - virtual ByteVector renderFields() const = 0; - - /*! - * Returns a ByteVector containing the field data given the frame data. - * This correctly adjusts for the header size plus any additional frame - * data that's specified in the frame header flags. - */ - ByteVector fieldData(const ByteVector &frameData) const; - - /*! - * Reads a String of type \a encoding from the ByteVector \a data. If \a - * position is passed in it is used both as the starting point and is - * updated to return the position just after the string that has been read. - * This is useful for reading strings sequentially. - */ - String readStringField(const ByteVector &data, String::Type encoding, - int *positon = 0); - - /*! - * Checks a the list of string values to see if they can be used with the - * specified encoding and returns the recommended encoding. - */ - // BIC: remove and make non-static - static String::Type checkEncoding(const StringList &fields, - String::Type encoding); - - /*! - * Checks a the list of string values to see if they can be used with the - * specified encoding and returns the recommended encoding. This method - * also checks the ID3v2 version and makes sure the encoding can be used - * in the specified version. - */ - // BIC: remove and make non-static - static String::Type checkEncoding(const StringList &fields, - String::Type encoding, uint version); - - /*! - * Checks a the list of string values to see if they can be used with the - * specified encoding and returns the recommended encoding. This method - * also checks the ID3v2 version and makes sure the encoding can be used - * in the version specified by the frame's header. - */ - String::Type checkTextEncoding(const StringList &fields, - String::Type encoding) const; - - - /*! - * Parses the contents of this frame as PropertyMap. If that fails, the returend - * PropertyMap will be empty, and its unsupportedData() will contain this frame's - * ID. - * BIC: Will be a virtual function in future releases. - */ - PropertyMap asProperties() const; - - /*! - * Returns an appropriate ID3 frame ID for the given free-form tag key. This method - * will return ByteVector::null if no specialized translation is found. - */ - static ByteVector keyToFrameID(const String &); - - /*! - * Returns a free-form tag name for the given ID3 frame ID. Note that this does not work - * for general frame IDs such as TXXX or WXXX; in such a case String::null is returned. - */ - static String frameIDToKey(const ByteVector &); - - /*! - * Returns an appropriate TXXX frame description for the given free-form tag key. - */ - static String keyToTXXX(const String &); - - /*! - * Returns a free-form tag name for the given ID3 frame description. - */ - static String txxxToKey(const String &); - - /*! - * This helper function splits the PropertyMap \a original into three ProperytMaps - * \a singleFrameProperties, \a tiplProperties, and \a tmclProperties, such that: - * - \a singleFrameProperties contains only of keys which can be represented with - * exactly one ID3 frame per key. In the current implementation - * this is everything except for the fixed "involved people" keys and keys of the - * form "TextIdentificationFrame::instrumentPrefix" + "instrument", which are - * mapped to a TMCL frame. - * - \a tiplProperties will consist of those keys that are present in - * TextIdentificationFrame::involvedPeopleMap() - * - \a tmclProperties contains the "musician credits" keys which should be mapped - * to a TMCL frame - */ - static void splitProperties(const PropertyMap &original, PropertyMap &singleFrameProperties, - PropertyMap &tiplProperties, PropertyMap &tmclProperties); - - private: - Frame(const Frame &); - Frame &operator=(const Frame &); - - class FramePrivate; - friend class FramePrivate; - FramePrivate *d; - }; - - //! ID3v2 frame header implementation - - /*! - * The ID3v2 Frame Header (Structure, 4) - * - * Every ID3v2::Frame has an associated header that gives some general - * properties of the frame and also makes it possible to identify the frame - * type. - * - * As such when reading an ID3v2 tag ID3v2::FrameFactory first creates the - * frame headers and then creates the appropriate Frame subclass based on - * the type and attaches the header. - */ - - class TAGLIB_EXPORT Frame::Header - { - public: - /*! - * Construct a Frame Header based on \a data. \a data must at least - * contain a 4 byte frame ID, and optionally can contain flag data and the - * frame size. i.e. Just the frame id -- "TALB" -- is a valid value. - * - * \deprecated Please use the constructor below that accepts a version - * number. - */ - Header(const ByteVector &data, bool synchSafeInts); - - /*! - * Construct a Frame Header based on \a data. \a data must at least - * contain a 4 byte frame ID, and optionally can contain flag data and the - * frame size. i.e. Just the frame id -- "TALB" -- is a valid value. - * - * \a version should be the ID3v2 version of the tag. - */ - explicit Header(const ByteVector &data, uint version = 4); - - /*! - * Destroys this Header instance. - */ - virtual ~Header(); - - /*! - * Sets the data for the Header. - * - * \deprecated Please use the version below that accepts an ID3v2 version - * number. - */ - void setData(const ByteVector &data, bool synchSafeInts); - - /*! - * Sets the data for the Header. \a version should indicate the ID3v2 - * version number of the tag that this frame is contained in. - */ - void setData(const ByteVector &data, uint version = 4); - - /*! - * Returns the Frame ID (Structure, 4) - * (Frames, 4) - */ - ByteVector frameID() const; - - /*! - * Sets the frame's ID to \a id. Only the first four bytes of \a id will - * be used. - * - * \warning This method should in general be avoided. It exists simply to - * provide a mechanism for transforming frames from a deprecated frame type - * to a newer one -- i.e. TYER to TDRC from ID3v2.3 to ID3v2.4. - */ - void setFrameID(const ByteVector &id); - - /*! - * Returns the size of the frame data portion, as set when setData() was - * called or set explicitly via setFrameSize(). - */ - uint frameSize() const; - - /*! - * Sets the size of the frame data portion. - */ - void setFrameSize(uint size); - - /*! - * Returns the ID3v2 version of the header, as passed in from the - * construction of the header or set via setVersion(). - */ - uint version() const; - - /*! - * Sets the ID3v2 version of the header, changing has impact on the - * correct parsing/rendering of frame data. - */ - void setVersion(uint version); - - /*! - * Returns the size of the frame header in bytes. - * - * \deprecated Please use the version of this method that accepts a - * version. This is only accurate for ID3v2.3 and ID3v2.4. This will be - * removed in the next binary incompatible release (2.0) and will be - * replaced with a non-static method that checks the frame version. - */ - static uint size(); - - /*! - * Returns the size of the frame header in bytes for the ID3v2 version - * that's given. - * - * \deprecated Please see the explanation in the version above. - */ - static uint size(uint version); - - /*! - * Returns true if the flag for tag alter preservation is set. - * - * The semantics are a little backwards from what would seem natural - * (setting the preservation flag to throw away the frame), but this - * follows the ID3v2 standard. - * - * \see setTagAlterPreservation() - */ - bool tagAlterPreservation() const; - - /*! - * Sets the flag for preservation of this frame if the tag is set. If - * this is set to true the frame will not be written when the tag is - * saved. - * - * The semantics are a little backwards from what would seem natural - * (setting the preservation flag to throw away the frame), but this - * follows the ID3v2 standard. - * - * \see tagAlterPreservation() - */ - void setTagAlterPreservation(bool discard); - - /*! - * Returns true if the flag for file alter preservation is set. - * - * \note This flag is currently ignored internally in TagLib. - */ - bool fileAlterPreservation() const; - - /*! - * Returns true if the frame is meant to be read only. - * - * \note This flag is currently ignored internally in TagLib. - */ - bool readOnly() const; - - /*! - * Returns true if the flag for the grouping identity is set. - * - * \note This flag is currently ignored internally in TagLib. - */ - bool groupingIdentity() const; - - /*! - * Returns true if compression is enabled for this frame. - * - * \note This flag is currently ignored internally in TagLib. - */ - bool compression() const; - - /*! - * Returns true if encryption is enabled for this frame. - * - * \note This flag is currently ignored internally in TagLib. - */ - bool encryption() const; - -#ifndef DO_NOT_DOCUMENT - bool unsycronisation() const; -#endif - - /*! - * Returns true if unsynchronisation is enabled for this frame. - */ - bool unsynchronisation() const; - - /*! - * Returns true if the flag for a data length indicator is set. - */ - bool dataLengthIndicator() const; - - /*! - * Render the Header back to binary format in a ByteVector. - */ - ByteVector render() const; - - /*! - * \deprecated - */ - bool frameAlterPreservation() const; - - private: - Header(const Header &); - Header &operator=(const Header &); - - class HeaderPrivate; - HeaderPrivate *d; - }; - - } -} - -#endif diff --git a/3rdparty/taglib/include/taglib/id3v2framefactory.h b/3rdparty/taglib/include/taglib/id3v2framefactory.h deleted file mode 100644 index 3de59ac..0000000 --- a/3rdparty/taglib/include/taglib/id3v2framefactory.h +++ /dev/null @@ -1,174 +0,0 @@ - /*************************************************************************** - copyright : (C) 2002 - 2008 by Scott Wheeler - email : wheeler@kde.org - ***************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * - * 02110-1301 USA * - * * - * Alternatively, this file is available under the Mozilla Public * - * License Version 1.1. You may obtain a copy of the License at * - * http://www.mozilla.org/MPL/ * - ***************************************************************************/ - -#ifndef TAGLIB_ID3V2FRAMEFACTORY_H -#define TAGLIB_ID3V2FRAMEFACTORY_H - -#include "taglib_export.h" -#include "tbytevector.h" -#include "id3v2frame.h" -#include "id3v2header.h" - -namespace TagLib { - - namespace ID3v2 { - - class TextIdentificationFrame; - - //! A factory for creating ID3v2 frames during parsing - - /*! - * This factory abstracts away the frame creation process and instantiates - * the appropriate ID3v2::Frame subclasses based on the contents of the - * data. - * - * Reimplementing this factory is the key to adding support for frame types - * not directly supported by TagLib to your application. To do so you would - * subclass this factory reimplement createFrame(). Then by setting your - * factory to be the default factory in ID3v2::Tag constructor or with - * MPEG::File::setID3v2FrameFactory() you can implement behavior that will - * allow for new ID3v2::Frame subclasses (also provided by you) to be used. - * - * This implements both abstract factory and singleton patterns - * of which more information is available on the web and in software design - * textbooks (Notably Design Patters). - * - * \note You do not need to use this factory to create new frames to add to - * an ID3v2::Tag. You can instantiate frame subclasses directly (with new) - * and add them to a tag using ID3v2::Tag::addFrame() - * - * \see ID3v2::Tag::addFrame() - */ - - class TAGLIB_EXPORT FrameFactory - { - public: - static FrameFactory *instance(); - /*! - * Create a frame based on \a data. \a synchSafeInts should only be set - * false if we are parsing an old tag (v2.3 or older) that does not support - * synchsafe ints. - * - * \deprecated Please use the method below that accepts a ID3v2::Header - * instance in new code. - */ - Frame *createFrame(const ByteVector &data, bool synchSafeInts) const; - - /*! - * Create a frame based on \a data. \a version should indicate the ID3v2 - * version of the tag. As ID3v2.4 is the most current version of the - * standard 4 is the default. - * - * \deprecated Please use the method below that accepts a ID3v2::Header - * instance in new code. - */ - Frame *createFrame(const ByteVector &data, uint version = 4) const; - - /*! - * Create a frame based on \a data. \a tagHeader should be a valid - * ID3v2::Header instance. - */ - // BIC: make virtual - Frame *createFrame(const ByteVector &data, Header *tagHeader) const; - - /*! - * After a tag has been read, this tries to rebuild some of them - * information, most notably the recording date, from frames that - * have been deprecated and can't be upgraded directly. - */ - // BIC: Make virtual - void rebuildAggregateFrames(ID3v2::Tag *tag) const; - - /*! - * Returns the default text encoding for text frames. If setTextEncoding() - * has not been explicitly called this will only be used for new text - * frames. However, if this value has been set explicitly all frames will be - * converted to this type (unless it's explicitly set differently for the - * individual frame) when being rendered. - * - * \see setDefaultTextEncoding() - */ - String::Type defaultTextEncoding() const; - - /*! - * Set the default text encoding for all text frames that are created to - * \a encoding. If no value is set the frames with either default to the - * encoding type that was parsed and new frames default to Latin1. - * - * Valid string types for ID3v2 tags are Latin1, UTF8, UTF16 and UTF16BE. - * - * \see defaultTextEncoding() - */ - void setDefaultTextEncoding(String::Type encoding); - - protected: - /*! - * Constructs a frame factory. Because this is a singleton this method is - * protected, but may be used for subclasses. - */ - FrameFactory(); - - /*! - * Destroys the frame factory. - */ - virtual ~FrameFactory(); - - /*! - * This method checks for compliance to the current ID3v2 standard (2.4) - * and does nothing in the common case. However if a frame is found that - * is not compatible with the current standard, this method either updates - * the frame or indicates that it should be discarded. - * - * This method with return true (with or without changes to the frame) if - * this frame should be kept or false if it should be discarded. - * - * See the id3v2.4.0-changes.txt document for further information. - */ - virtual bool updateFrame(Frame::Header *header) const; - - private: - FrameFactory(const FrameFactory &); - FrameFactory &operator=(const FrameFactory &); - - /*! - * This method is used internally to convert a frame from ID \a from to ID - * \a to. If the frame matches the \a from pattern and converts the frame - * ID in the \a header or simply does nothing if the frame ID does not match. - */ - void convertFrame(const char *from, const char *to, - Frame::Header *header) const; - - void updateGenre(TextIdentificationFrame *frame) const; - - static FrameFactory factory; - - class FrameFactoryPrivate; - FrameFactoryPrivate *d; - }; - - } -} - -#endif diff --git a/3rdparty/taglib/include/taglib/id3v2header.h b/3rdparty/taglib/include/taglib/id3v2header.h deleted file mode 100644 index 52294dd..0000000 --- a/3rdparty/taglib/include/taglib/id3v2header.h +++ /dev/null @@ -1,175 +0,0 @@ -/*************************************************************************** - copyright : (C) 2002 - 2008 by Scott Wheeler - email : wheeler@kde.org - ***************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * - * 02110-1301 USA * - * * - * Alternatively, this file is available under the Mozilla Public * - * License Version 1.1. You may obtain a copy of the License at * - * http://www.mozilla.org/MPL/ * - ***************************************************************************/ - -#ifndef TAGLIB_ID3V2HEADER_H -#define TAGLIB_ID3V2HEADER_H - -#include "tbytevector.h" -#include "taglib_export.h" - -namespace TagLib { - - namespace ID3v2 { - - //! An implementation of ID3v2 headers - - /*! - * This class implements ID3v2 headers. It attempts to follow, both - * semantically and programmatically, the structure specified in - * the ID3v2 standard. The API is based on the properties of ID3v2 headers - * specified there. If any of the terms used in this documentation are - * unclear please check the specification in the linked section. - * (Structure, 3.1) - */ - - class TAGLIB_EXPORT Header - { - public: - /*! - * Constructs an empty ID3v2 header. - */ - Header(); - - /*! - * Constructs an ID3v2 header based on \a data. parse() is called - * immediately. - */ - Header(const ByteVector &data); - - /*! - * Destroys the header. - */ - virtual ~Header(); - - /*! - * Returns the major version number. (Note: This is the 4, not the 2 in - * ID3v2.4.0. The 2 is implied.) - */ - uint majorVersion() const; - - /*! - * Set the the major version number to \a version. (Note: This is - * the 4, not the 2 in ID3v2.4.0. The 2 is implied.) - * \see majorVersion() - * - * \note This is used by the internal parser; this will not change the - * version which is written and in general should not be called by API - * users. - */ - void setMajorVersion(uint version); - - /*! - * Returns the revision number. (Note: This is the 0, not the 4 in - * ID3v2.4.0. The 2 is implied.) - */ - uint revisionNumber() const; - - /*! - * Returns true if unsynchronisation has been applied to all frames. - */ - bool unsynchronisation() const; - - /*! - * Returns true if an extended header is present in the tag. - */ - bool extendedHeader() const; - - /*! - * Returns true if the experimental indicator flag is set. - */ - bool experimentalIndicator() const; - - /*! - * Returns true if a footer is present in the tag. - */ - bool footerPresent() const; - /*! - * Returns the tag size in bytes. This is the size of the frame content. - * The size of the \e entire tag will be this plus the header size (10 - * bytes) and, if present, the footer size (potentially another 10 bytes). - * - * \note This is the value as read from the header to which TagLib attempts - * to provide an API to; it was not a design decision on the part of TagLib - * to not include the mentioned portions of the tag in the \e size. - * - * \see completeTagSize() - */ - uint tagSize() const; - - /*! - * Returns the tag size, including the header and, if present, the footer - * size. - * - * \see tagSize() - */ - uint completeTagSize() const; - - /*! - * Set the tag size to \a s. - * \see tagSize() - */ - void setTagSize(uint s); - - /*! - * Returns the size of the header. Presently this is always 10 bytes. - */ - static uint size(); - - /*! - * Returns the string used to identify and ID3v2 tag inside of a file. - * Presently this is always "ID3". - */ - static ByteVector fileIdentifier(); - - /*! - * Sets the data that will be used as the header. 10 bytes, starting from - * the beginning of \a data are used. - */ - void setData(const ByteVector &data); - - /*! - * Renders the Header back to binary format. - */ - ByteVector render() const; - - protected: - /*! - * Called by setData() to parse the header data. It makes this information - * available through the public API. - */ - void parse(const ByteVector &data); - - private: - Header(const Header &); - Header &operator=(const Header &); - - class HeaderPrivate; - HeaderPrivate *d; - }; - - } -} - -#endif diff --git a/3rdparty/taglib/include/taglib/id3v2synchdata.h b/3rdparty/taglib/include/taglib/id3v2synchdata.h deleted file mode 100644 index 4a1f596..0000000 --- a/3rdparty/taglib/include/taglib/id3v2synchdata.h +++ /dev/null @@ -1,70 +0,0 @@ -/*************************************************************************** - copyright : (C) 2002 - 2008 by Scott Wheeler - email : wheeler@kde.org - ***************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * - * 02110-1301 USA * - * * - * Alternatively, this file is available under the Mozilla Public * - * License Version 1.1. You may obtain a copy of the License at * - * http://www.mozilla.org/MPL/ * - ***************************************************************************/ - -#ifndef TAGLIB_ID3V2SYNCHDATA_H -#define TAGLIB_ID3V2SYNCHDATA_H - -#include "tbytevector.h" -#include "taglib.h" - -namespace TagLib { - - namespace ID3v2 { - - //! A few functions for ID3v2 synch safe integer conversion - - /*! - * In the ID3v2.4 standard most integer values are encoded as "synch safe" - * integers which are encoded in such a way that they will not give false - * MPEG syncs and confuse MPEG decoders. This namespace provides some - * methods for converting to and from these values to ByteVectors for - * things rendering and parsing ID3v2 data. - */ - - namespace SynchData - { - /*! - * This returns the unsigned integer value of \a data where \a data is a - * ByteVector that contains a \e synchsafe integer (Structure, - * 6.2). The default \a length of - * 4 is used if another value is not specified. - */ - TAGLIB_EXPORT uint toUInt(const ByteVector &data); - - /*! - * Returns a 4 byte (32 bit) synchsafe integer based on \a value. - */ - TAGLIB_EXPORT ByteVector fromUInt(uint value); - - /*! - * Convert the data from unsynchronized data to its original format. - */ - TAGLIB_EXPORT ByteVector decode(const ByteVector &input); - } - - } -} - -#endif diff --git a/3rdparty/taglib/include/taglib/id3v2tag.h b/3rdparty/taglib/include/taglib/id3v2tag.h deleted file mode 100644 index 76ca73f..0000000 --- a/3rdparty/taglib/include/taglib/id3v2tag.h +++ /dev/null @@ -1,412 +0,0 @@ -/*************************************************************************** - copyright : (C) 2002 - 2008 by Scott Wheeler - email : wheeler@kde.org - ***************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * - * 02110-1301 USA * - * * - * Alternatively, this file is available under the Mozilla Public * - * License Version 1.1. You may obtain a copy of the License at * - * http://www.mozilla.org/MPL/ * - ***************************************************************************/ - -#ifndef TAGLIB_ID3V2TAG_H -#define TAGLIB_ID3V2TAG_H - -#include "tag.h" -#include "tbytevector.h" -#include "tstring.h" -#include "tlist.h" -#include "tmap.h" -#include "taglib_export.h" - -#include "id3v2framefactory.h" - -namespace TagLib { - - class File; - - //! An ID3v2 implementation - - /*! - * This is a relatively complete and flexible framework for working with ID3v2 - * tags. - * - * \see ID3v2::Tag - */ - - namespace ID3v2 { - - class Header; - class ExtendedHeader; - class Footer; - - typedef List FrameList; - typedef Map FrameListMap; - - //! An abstraction for the ISO-8859-1 string to data encoding in ID3v2 tags. - - /*! - * ID3v2 tag can store strings in ISO-8859-1 (Latin1), and TagLib only - * supports genuine ISO-8859-1 by default. However, in practice, non - * ISO-8859-1 encodings are often used instead of ISO-8859-1, such as - * Windows-1252 for western languages, Shift_JIS for Japanese and so on. - * - * Here is an option to read such tags by subclassing this class, - * reimplementing parse() and setting your reimplementation as the default - * with ID3v2::Tag::setStringHandler(). - * - * \note Writing non-ISO-8859-1 tags is not implemented intentionally. - * Use UTF-16 or UTF-8 instead. - * - * \see ID3v2::Tag::setStringHandler() - */ - class TAGLIB_EXPORT Latin1StringHandler - { - public: - Latin1StringHandler(); - virtual ~Latin1StringHandler(); - - /*! - * Decode a string from \a data. The default implementation assumes that - * \a data is an ISO-8859-1 (Latin1) character array. - */ - virtual String parse(const ByteVector &data) const; - }; - - //! The main class in the ID3v2 implementation - - /*! - * This is the main class in the ID3v2 implementation. It serves two - * functions. This first, as is obvious from the public API, is to provide a - * container for the other ID3v2 related classes. In addition, through the - * read() and parse() protected methods, it provides the most basic level of - * parsing. In these methods the ID3v2 tag is extracted from the file and - * split into data components. - * - * ID3v2 tags have several parts, TagLib attempts to provide an interface - * for them all. header(), footer() and extendedHeader() correspond to those - * data structures in the ID3v2 standard and the APIs for the classes that - * they return attempt to reflect this. - * - * Also ID3v2 tags are built up from a list of frames, which are in turn - * have a header and a list of fields. TagLib provides two ways of accessing - * the list of frames that are in a given ID3v2 tag. The first is simply - * via the frameList() method. This is just a list of pointers to the frames. - * The second is a map from the frame type -- i.e. "COMM" for comments -- and - * a list of frames of that type. (In some cases ID3v2 allows for multiple - * frames of the same type, hence this being a map to a list rather than just - * a map to an individual frame.) - * - * More information on the structure of frames can be found in the ID3v2::Frame - * class. - * - * read() and parse() pass binary data to the other ID3v2 class structures, - * they do not handle parsing of flags or fields, for instance. Those are - * handled by similar functions within those classes. - * - * \note All pointers to data structures within the tag will become invalid - * when the tag is destroyed. - * - * \warning Dealing with the nasty details of ID3v2 is not for the faint of - * heart and should not be done without much meditation on the spec. It's - * rather long, but if you're planning on messing with this class and others - * that deal with the details of ID3v2 (rather than the nice, safe, abstract - * TagLib::Tag and friends), it's worth your time to familiarize yourself - * with said spec (which is distributed with the TagLib sources). TagLib - * tries to do most of the work, but with a little luck, you can still - * convince it to generate invalid ID3v2 tags. The APIs for ID3v2 assume a - * working knowledge of ID3v2 structure. You're been warned. - */ - - class TAGLIB_EXPORT Tag : public TagLib::Tag - { - public: - /*! - * Constructs an empty ID3v2 tag. - * - * \note You must create at least one frame for this tag to be valid. - */ - Tag(); - - /*! - * Constructs an ID3v2 tag read from \a file starting at \a tagOffset. - * \a factory specifies which FrameFactory will be used for the - * construction of new frames. - * - * \note You should be able to ignore the \a factory parameter in almost - * all situations. You would want to specify your own FrameFactory - * subclass in the case that you are extending TagLib to support additional - * frame types, which would be incorporated into your factory. - * - * \see FrameFactory - */ - Tag(File *file, long tagOffset, - const FrameFactory *factory = FrameFactory::instance()); - - /*! - * Destroys this Tag instance. - */ - virtual ~Tag(); - - // Reimplementations. - - virtual String title() const; - virtual String artist() const; - virtual String album() const; - virtual String comment() const; - virtual String genre() const; - virtual uint year() const; - virtual uint track() const; - - virtual void setTitle(const String &s); - virtual void setArtist(const String &s); - virtual void setAlbum(const String &s); - virtual void setComment(const String &s); - virtual void setGenre(const String &s); - virtual void setYear(uint i); - virtual void setTrack(uint i); - - virtual bool isEmpty() const; - - /*! - * Returns a pointer to the tag's header. - */ - Header *header() const; - - /*! - * Returns a pointer to the tag's extended header or null if there is no - * extended header. - */ - ExtendedHeader *extendedHeader() const; - - /*! - * Returns a pointer to the tag's footer or null if there is no footer. - * - * \deprecated I don't see any reason to keep this around since there's - * nothing useful to be retrieved from the footer, but well, again, I'm - * prone to change my mind, so this gets to stay around until near a - * release. - */ - Footer *footer() const; - - /*! - * Returns a reference to the frame list map. This is an FrameListMap of - * all of the frames in the tag. - * - * This is the most convenient structure for accessing the tag's frames. - * Many frame types allow multiple instances of the same frame type so this - * is a map of lists. In most cases however there will only be a single - * frame of a certain type. - * - * Let's say for instance that you wanted to access the frame for total - * beats per minute -- the TBPM frame. - * - * \code - * TagLib::MPEG::File f("foo.mp3"); - * - * // Check to make sure that it has an ID3v2 tag - * - * if(f.ID3v2Tag()) { - * - * // Get the list of frames for a specific frame type - * - * TagLib::ID3v2::FrameList l = f.ID3v2Tag()->frameListMap()["TBPM"]; - * - * if(!l.isEmpty()) - * std::cout << l.front()->toString() << std::endl; - * } - * - * \endcode - * - * \warning You should not modify this data structure directly, instead - * use addFrame() and removeFrame(). - * - * \see frameList() - */ - const FrameListMap &frameListMap() const; - - /*! - * Returns a reference to the frame list. This is an FrameList of all of - * the frames in the tag in the order that they were parsed. - * - * This can be useful if for example you want iterate over the tag's frames - * in the order that they occur in the tag. - * - * \warning You should not modify this data structure directly, instead - * use addFrame() and removeFrame(). - */ - const FrameList &frameList() const; - - /*! - * Returns the frame list for frames with the id \a frameID or an empty - * list if there are no frames of that type. This is just a convenience - * and is equivalent to: - * - * \code - * frameListMap()[frameID]; - * \endcode - * - * \see frameListMap() - */ - const FrameList &frameList(const ByteVector &frameID) const; - - /*! - * Add a frame to the tag. At this point the tag takes ownership of - * the frame and will handle freeing its memory. - * - * \note Using this method will invalidate any pointers on the list - * returned by frameList() - */ - void addFrame(Frame *frame); - - /*! - * Remove a frame from the tag. If \a del is true the frame's memory - * will be freed; if it is false, it must be deleted by the user. - * - * \note Using this method will invalidate any pointers on the list - * returned by frameList() - */ - void removeFrame(Frame *frame, bool del = true); - - /*! - * Remove all frames of type \a id from the tag and free their memory. - * - * \note Using this method will invalidate any pointers on the list - * returned by frameList() - */ - void removeFrames(const ByteVector &id); - - /*! - * Implements the unified property interface -- export function. - * This function does some work to translate the hard-specified ID3v2 - * frame types into a free-form string-to-stringlist PropertyMap: - * - if ID3v2 frame ID is known by Frame::frameIDToKey(), the returned - * key is used - * - if the frame ID is "TXXX" (user text frame), the description() is - * used as key - * - if the frame ID is "WXXX" (user url frame), - * - if the description is empty or "URL", the key "URL" is used - * - otherwise, the key "URL:" is used; - * - if the frame ID is "COMM" (comments frame), - * - if the description is empty or "COMMENT", the key "COMMENT" - * is used - * - otherwise, the key "COMMENT:" is used; - * - if the frame ID is "USLT" (unsynchronized lyrics), - * - if the description is empty or "LYRICS", the key "LYRICS" is used - * - otherwise, the key "LYRICS:" is used; - * - if the frame ID is "TIPL" (involved peoples list), and if all the - * roles defined in the frame are known in TextIdentificationFrame::involvedPeopleMap(), - * then "=" will be contained in the returned obejct for each - * - if the frame ID is "TMCL" (musician credit list), then - * "PERFORMER:=" will be contained in the returned - * PropertyMap for each defined musician - * In any other case, the unsupportedData() of the returned object will contain - * the frame's ID and, in case of a frame ID which is allowed to appear more than - * once, the description, separated by a "/". - * - */ - PropertyMap properties() const; - - /*! - * Removes unsupported frames given by \a properties. The elements of - * \a properties must be taken from properties().unsupportedData(); they - * are of one of the following forms: - * - a four-character frame ID, if the ID3 specification allows only one - * frame with that ID (thus, the frame is uniquely determined) - * - frameID + "/" + description(), when the ID is one of "TXXX", "WXXX", - * "COMM", or "USLT", - * - "UNKNOWN/" + frameID, for frames that could not be parsed by TagLib. - * In that case, *all* unknown frames with the given ID will be removed. - */ - void removeUnsupportedProperties(const StringList &properties); - - /*! - * Implements the unified property interface -- import function. - * See the comments in properties(). - */ - PropertyMap setProperties(const PropertyMap &); - - /*! - * Render the tag back to binary data, suitable to be written to disk. - */ - ByteVector render() const; - - /*! - * Render the tag back to binary data, suitable to be written to disk. - * - * The \a version parameter specifies the version of the rendered - * ID3v2 tag. It can be either 4 or 3. - */ - // BIC: combine with the above method - ByteVector render(int version) const; - - /*! - * Gets the current string handler that decides how the "Latin-1" data - * will be converted to and from binary data. - * - * \see Latin1StringHandler - */ - static Latin1StringHandler const *latin1StringHandler(); - - /*! - * Sets the string handler that decides how the "Latin-1" data will be - * converted to and from binary data. - * If the parameter \a handler is null, the previous handler is - * released and default ISO-8859-1 handler is restored. - * - * \note The caller is responsible for deleting the previous handler - * as needed after it is released. - * - * \see Latin1StringHandler - */ - static void setLatin1StringHandler(const Latin1StringHandler *handler); - - protected: - /*! - * Reads data from the file specified in the constructor. It does basic - * parsing of the data in the largest chunks. It partitions the tag into - * the Header, the body of the tag (which contains the ExtendedHeader and - * frames) and Footer. - */ - void read(); - - /*! - * This is called by read to parse the body of the tag. It determines if an - * extended header exists and adds frames to the FrameListMap. - */ - void parse(const ByteVector &data); - - /*! - * Sets the value of the text frame with the Frame ID \a id to \a value. - * If the frame does not exist, it is created. - */ - void setTextFrame(const ByteVector &id, const String &value); - - void downgradeFrames(FrameList *existingFrames, FrameList *newFrames) const; - - private: - Tag(const Tag &); - Tag &operator=(const Tag &); - - class TagPrivate; - TagPrivate *d; - }; - - } -} - -#endif diff --git a/3rdparty/taglib/include/taglib/infotag.h b/3rdparty/taglib/include/taglib/infotag.h deleted file mode 100644 index 440e7b9..0000000 --- a/3rdparty/taglib/include/taglib/infotag.h +++ /dev/null @@ -1,192 +0,0 @@ -/*************************************************************************** - copyright : (C) 2012 by Tsuda Kageyu - email : tsuda.kageyu@gmail.com - ***************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * - * 02110-1301 USA * - * * - * Alternatively, this file is available under the Mozilla Public * - * License Version 1.1. You may obtain a copy of the License at * - * http://www.mozilla.org/MPL/ * - ***************************************************************************/ - -#ifndef TAGLIB_INFOTAG_H -#define TAGLIB_INFOTAG_H - -#include "tag.h" -#include "tmap.h" -#include "tstring.h" -#include "tstringlist.h" -#include "tbytevector.h" -#include "taglib_export.h" - -namespace TagLib { - - class File; - - //! A RIFF INFO tag implementation. - namespace RIFF { - namespace Info { - - typedef Map FieldListMap; - - //! A abstraction for the string to data encoding in Info tags. - - /*! - * RIFF INFO tag has no clear definitions about character encodings. - * In practice, local encoding of each system is largely used and UTF-8 is - * popular too. - * - * Here is an option to read and write tags in your preferred encoding - * by subclassing this class, reimplementing parse() and render() and setting - * your reimplementation as the default with Info::Tag::setStringHandler(). - * - * \see ID3v1::Tag::setStringHandler() - */ - - class TAGLIB_EXPORT StringHandler - { - public: - StringHandler(); - ~StringHandler(); - - /*! - * Decode a string from \a data. The default implementation assumes that - * \a data is an UTF-8 character array. - */ - virtual String parse(const ByteVector &data) const; - - /*! - * Encode a ByteVector with the data from \a s. The default implementation - * assumes that \a s is an UTF-8 string. - */ - virtual ByteVector render(const String &s) const; - }; - - //! The main class in the ID3v2 implementation - - /*! - * This is the main class in the INFO tag implementation. RIFF INFO tag is a - * metadata format found in WAV audio and AVI video files. Though it is a part - * of Microsoft/IBM's RIFF specification, the author could not find the official - * documents about it. So, this implementation is referring to unofficial documents - * online and some applications' behaviors especially Windows Explorer. - */ - class TAGLIB_EXPORT Tag : public TagLib::Tag - { - public: - /*! - * Constructs an empty INFO tag. - */ - Tag(); - - /*! - * Constructs an INFO tag read from \a data which is contents of "LIST" chunk. - */ - Tag(const ByteVector &data); - - virtual ~Tag(); - - // Reimplementations - - virtual String title() const; - virtual String artist() const; - virtual String album() const; - virtual String comment() const; - virtual String genre() const; - virtual uint year() const; - virtual uint track() const; - - virtual void setTitle(const String &s); - virtual void setArtist(const String &s); - virtual void setAlbum(const String &s); - virtual void setComment(const String &s); - virtual void setGenre(const String &s); - virtual void setYear(uint i); - virtual void setTrack(uint i); - - virtual bool isEmpty() const; - - /*! - * Returns a copy of the internal fields of the tag. The returned map directly - * reflects the contents of the "INFO" chunk. - * - * \note Modifying this map does not affect the tag's internal data. - * Use setFieldText() and removeField() instead. - * - * \see setFieldText() - * \see removeField() - */ - FieldListMap fieldListMap() const; - - /* - * Gets the value of the field with the ID \a id. - */ - String fieldText(const ByteVector &id) const; - - /* - * Sets the value of the field with the ID \a id to \a s. - * If the field does not exist, it is created. - * If \s is empty, the field is removed. - * - * \note fieldId must be four-byte long pure ASCII string. This function - * performs nothing if fieldId is invalid. - */ - void setFieldText(const ByteVector &id, const String &s); - - /* - * Removes the field with the ID \a id. - */ - void removeField(const ByteVector &id); - - /*! - * Render the tag back to binary data, suitable to be written to disk. - * - * \note Returns empty ByteVector is the tag contains no fields. - */ - ByteVector render() const; - - /*! - * Sets the string handler that decides how the text data will be - * converted to and from binary data. - * If the parameter \a handler is null, the previous handler is - * released and default UTF-8 handler is restored. - * - * \note The caller is responsible for deleting the previous handler - * as needed after it is released. - * - * \see StringHandler - */ - static void setStringHandler(const StringHandler *handler); - - protected: - /*! - * Pareses the body of the tag in \a data. - */ - void parse(const ByteVector &data); - - - private: - Tag(const Tag &); - Tag &operator=(const Tag &); - - class TagPrivate; - TagPrivate *d; - }; - }} -} - -#endif diff --git a/3rdparty/taglib/include/taglib/itfile.h b/3rdparty/taglib/include/taglib/itfile.h deleted file mode 100644 index 19327dc..0000000 --- a/3rdparty/taglib/include/taglib/itfile.h +++ /dev/null @@ -1,109 +0,0 @@ -/*************************************************************************** - copyright : (C) 2011 by Mathias Panzenböck - email : grosser.meister.morti@gmx.net - ***************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * - * MA 02110-1301 USA * - ***************************************************************************/ - -#ifndef TAGLIB_ITFILE_H -#define TAGLIB_ITFILE_H - -#include "tfile.h" -#include "audioproperties.h" -#include "taglib_export.h" -#include "modfilebase.h" -#include "modtag.h" -#include "itproperties.h" - -namespace TagLib { - - namespace IT { - - class TAGLIB_EXPORT File : public Mod::FileBase { - public: - /*! - * Constructs a Impulse Tracker file from \a file. - * - * \note In the current implementation, both \a readProperties and - * \a propertiesStyle are ignored. The audio properties are always - * read. - */ - File(FileName file, bool readProperties = true, - AudioProperties::ReadStyle propertiesStyle = - AudioProperties::Average); - - /*! - * Constructs a Impulse Tracker file from \a stream. - * - * \note In the current implementation, both \a readProperties and - * \a propertiesStyle are ignored. The audio properties are always - * read. - * - * \note TagLib will *not* take ownership of the stream, the caller is - * responsible for deleting it after the File object. - */ - File(IOStream *stream, bool readProperties = true, - AudioProperties::ReadStyle propertiesStyle = - AudioProperties::Average); - - /*! - * Destroys this instance of the File. - */ - virtual ~File(); - - Mod::Tag *tag() const; - - /*! - * Forwards to Mod::Tag::properties(). - * BIC: will be removed once File::toDict() is made virtual - */ - PropertyMap properties() const; - - /*! - * Forwards to Mod::Tag::setProperties(). - * BIC: will be removed once File::setProperties() is made virtual - */ - PropertyMap setProperties(const PropertyMap &); - - /*! - * Returns the IT::Properties for this file. If no audio properties - * were read then this will return a null pointer. - */ - IT::Properties *audioProperties() const; - - /*! - * Save the file. - * This is the same as calling save(AllTags); - * - * \note Saving Impulse Tracker tags is not supported. - */ - bool save(); - - - private: - File(const File &); - File &operator=(const File &); - - void read(bool readProperties); - - class FilePrivate; - FilePrivate *d; - }; - } -} - -#endif diff --git a/3rdparty/taglib/include/taglib/itproperties.h b/3rdparty/taglib/include/taglib/itproperties.h deleted file mode 100644 index 060ad35..0000000 --- a/3rdparty/taglib/include/taglib/itproperties.h +++ /dev/null @@ -1,103 +0,0 @@ -/*************************************************************************** - copyright : (C) 2011 by Mathias Panzenböck - email : grosser.meister.morti@gmx.net - ***************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * - * MA 02110-1301 USA * - ***************************************************************************/ - -#ifndef TAGLIB_ITPROPERTIES_H -#define TAGLIB_ITPROPERTIES_H - -#include "taglib.h" -#include "audioproperties.h" - -namespace TagLib { - namespace IT { - class TAGLIB_EXPORT Properties : public AudioProperties { - friend class File; - public: - /*! Flag bits. */ - enum { - Stereo = 1, - Vol0MixOptimizations = 2, - UseInstruments = 4, - LinearSlides = 8, - OldEffects = 16, - LinkEffects = 32, - UseMidiPitchController = 64, - RequestEmbeddedMidiConf = 128 - }; - - /*! Special bits. */ - enum { - MessageAttached = 1, - MidiConfEmbedded = 8 - }; - - Properties(AudioProperties::ReadStyle propertiesStyle); - virtual ~Properties(); - - int length() const; - int lengthInSeconds() const; - int lengthInMilliseconds() const; - int bitrate() const; - int sampleRate() const; - int channels() const; - - ushort lengthInPatterns() const; - bool stereo() const; - ushort instrumentCount() const; - ushort sampleCount() const; - ushort patternCount() const; - ushort version() const; - ushort compatibleVersion() const; - ushort flags() const; - ushort special() const; - uchar globalVolume() const; - uchar mixVolume() const; - uchar tempo() const; - uchar bpmSpeed() const; - uchar panningSeparation() const; - uchar pitchWheelDepth() const; - - void setChannels(int channels); - void setLengthInPatterns(ushort lengthInPatterns); - void setInstrumentCount(ushort instrumentCount); - void setSampleCount (ushort sampleCount); - void setPatternCount(ushort patternCount); - void setVersion (ushort version); - void setCompatibleVersion(ushort compatibleVersion); - void setFlags (ushort flags); - void setSpecial (ushort special); - void setGlobalVolume(uchar globalVolume); - void setMixVolume (uchar mixVolume); - void setTempo (uchar tempo); - void setBpmSpeed (uchar bpmSpeed); - void setPanningSeparation(uchar panningSeparation); - void setPitchWheelDepth (uchar pitchWheelDepth); - - private: - Properties(const Properties&); - Properties &operator=(const Properties&); - - class PropertiesPrivate; - PropertiesPrivate *d; - }; - } -} - -#endif diff --git a/3rdparty/taglib/include/taglib/modfile.h b/3rdparty/taglib/include/taglib/modfile.h deleted file mode 100644 index c45ede2..0000000 --- a/3rdparty/taglib/include/taglib/modfile.h +++ /dev/null @@ -1,110 +0,0 @@ -/*************************************************************************** - copyright : (C) 2011 by Mathias Panzenböck - email : grosser.meister.morti@gmx.net - ***************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * - * MA 02110-1301 USA * - ***************************************************************************/ - -#ifndef TAGLIB_MODFILE_H -#define TAGLIB_MODFILE_H - -#include "tfile.h" -#include "audioproperties.h" -#include "taglib_export.h" -#include "modfilebase.h" -#include "modtag.h" -#include "modproperties.h" - -namespace TagLib { - - namespace Mod { - - class TAGLIB_EXPORT File : public TagLib::Mod::FileBase - { - public: - /*! - * Constructs a Protracker file from \a file. - * - * \note In the current implementation, both \a readProperties and - * \a propertiesStyle are ignored. The audio properties are always - * read. - */ - File(FileName file, bool readProperties = true, - AudioProperties::ReadStyle propertiesStyle = - AudioProperties::Average); - - /*! - * Constructs a Protracker file from \a stream. - * - * \note In the current implementation, both \a readProperties and - * \a propertiesStyle are ignored. The audio properties are always - * read. - * - * \note TagLib will *not* take ownership of the stream, the caller is - * responsible for deleting it after the File object. - */ - File(IOStream *stream, bool readProperties = true, - AudioProperties::ReadStyle propertiesStyle = - AudioProperties::Average); - - /*! - * Destroys this instance of the File. - */ - virtual ~File(); - - Mod::Tag *tag() const; - - /*! - * Implements the unified property interface -- export function. - * Forwards to Mod::Tag::properties(). - */ - PropertyMap properties() const; - - /*! - * Implements the unified property interface -- import function. - * Forwards to Mod::Tag::setProperties(). - */ - PropertyMap setProperties(const PropertyMap &); - /*! - * Returns the Mod::Properties for this file. If no audio properties - * were read then this will return a null pointer. - */ - Mod::Properties *audioProperties() const; - - /*! - * Save the file. - * This is the same as calling save(AllTags); - * - * \note Saving Protracker tags is not supported. - */ - bool save(); - - private: - File(const File &); - File &operator=(const File &); - - void read(bool readProperties); - - class FilePrivate; - FilePrivate *d; - }; - - } - -} - -#endif diff --git a/3rdparty/taglib/include/taglib/modfilebase.h b/3rdparty/taglib/include/taglib/modfilebase.h deleted file mode 100644 index 383bde1..0000000 --- a/3rdparty/taglib/include/taglib/modfilebase.h +++ /dev/null @@ -1,62 +0,0 @@ -/*************************************************************************** - copyright : (C) 2011 by Mathias Panzenböck - email : grosser.meister.morti@gmx.net - ***************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * - * MA 02110-1301 USA * - ***************************************************************************/ - -#ifndef TAGLIB_MODFILEBASE_H -#define TAGLIB_MODFILEBASE_H - -#include "taglib.h" -#include "tfile.h" -#include "tstring.h" -#include "tlist.h" -#include "taglib_export.h" - -#include - -namespace TagLib { - - namespace Mod { - - class TAGLIB_EXPORT FileBase : public TagLib::File - { - protected: - FileBase(FileName file); - FileBase(IOStream *stream); - - void writeString(const String &s, ulong size, char padding = 0); - void writeByte(uchar byte); - void writeU16L(ushort number); - void writeU32L(ulong number); - void writeU16B(ushort number); - void writeU32B(ulong number); - - bool readString(String &s, ulong size); - bool readByte(uchar &byte); - bool readU16L(ushort &number); - bool readU32L(ulong &number); - bool readU16B(ushort &number); - bool readU32B(ulong &number); - }; - - } - -} - -#endif diff --git a/3rdparty/taglib/include/taglib/modproperties.h b/3rdparty/taglib/include/taglib/modproperties.h deleted file mode 100644 index ac4bf7f..0000000 --- a/3rdparty/taglib/include/taglib/modproperties.h +++ /dev/null @@ -1,67 +0,0 @@ -/*************************************************************************** - copyright : (C) 2011 by Mathias Panzenböck - email : grosser.meister.morti@gmx.net - ***************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * - * MA 02110-1301 USA * - ***************************************************************************/ - -#ifndef TAGLIB_MODPROPERTIES_H -#define TAGLIB_MODPROPERTIES_H - -#include "taglib.h" -#include "audioproperties.h" - -namespace TagLib { - - namespace Mod { - - class TAGLIB_EXPORT Properties : public AudioProperties - { - public: - Properties(AudioProperties::ReadStyle propertiesStyle); - virtual ~Properties(); - - int length() const; - int lengthInSeconds() const; - int lengthInMilliseconds() const; - int bitrate() const; - int sampleRate() const; - int channels() const; - - uint instrumentCount() const; - uchar lengthInPatterns() const; - - void setChannels(int channels); - - void setInstrumentCount(uint sampleCount); - void setLengthInPatterns(uchar lengthInPatterns); - - private: - friend class File; - - Properties(const Properties&); - Properties &operator=(const Properties&); - - class PropertiesPrivate; - PropertiesPrivate *d; - }; - - } - -} - -#endif diff --git a/3rdparty/taglib/include/taglib/modtag.h b/3rdparty/taglib/include/taglib/modtag.h deleted file mode 100644 index 5b66035..0000000 --- a/3rdparty/taglib/include/taglib/modtag.h +++ /dev/null @@ -1,190 +0,0 @@ -/*************************************************************************** - copyright : (C) 2011 by Mathias Panzenböck - email : grosser.meister.morti@gmx.net - ***************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * - * MA 02110-1301 USA * - ***************************************************************************/ - -#ifndef TAGLIB_MODTAG_H -#define TAGLIB_MODTAG_H - -#include "tag.h" - -namespace TagLib { - - namespace Mod { - - /*! - * Tags for module files (Mod, S3M, IT, XM). - * - * Note that only the \a title is supported as such by most - * module file formats. Except for XM files the \a trackerName - * is derived from the file format or the flavour of the file - * format. For XM files it is stored in the file. - * - * The \a comment tag is not strictly supported by module files, - * but it is common practice to abuse instrument/sample/pattern - * names as multiline comments. TagLib does so as well. - */ - class TAGLIB_EXPORT Tag : public TagLib::Tag - { - public: - Tag(); - virtual ~Tag(); - - /*! - * Returns the track name; if no track name is present in the tag - * String::null will be returned. - */ - String title() const; - - /*! - * Not supported by module files. Therefore always returns String::null. - */ - String artist() const; - - /*! - * Not supported by module files. Therefore always returns String::null. - */ - String album() const; - - /*! - * Returns the track comment derived from the instrument/sample/pattern - * names; if no comment is present in the tag String::null will be - * returned. - */ - String comment() const; - - /*! - * Not supported by module files. Therefore always returns String::null. - */ - String genre() const; - - /*! - * Not supported by module files. Therefore always returns 0. - */ - uint year() const; - - /*! - * Not supported by module files. Therefore always returns 0. - */ - uint track() const; - - /*! - * Returns the name of the tracker used to create/edit the module file. - * Only XM files store this tag to the file as such, for other formats - * (Mod, S3M, IT) this is derived from the file type or the flavour of - * the file type. Therefore only XM files might have an empty - * (String::null) tracker name. - */ - String trackerName() const; - - /*! - * Sets the title to \a title. If \a title is String::null then this - * value will be cleared. - * - * The length limits per file type are (1 character = 1 byte): - * Mod 20 characters, S3M 27 characters, IT 25 characters and XM 20 - * characters. - */ - void setTitle(const String &title); - - /*! - * Not supported by module files and therefore ignored. - */ - void setArtist(const String &artist); - - /*! - * Not supported by module files and therefore ignored. - */ - void setAlbum(const String &album); - - /*! - * Sets the comment to \a comment. If \a comment is String::null then - * this value will be cleared. - * - * Note that module file formats don't actually support a comment tag. - * Instead the names of instruments/patterns/samples are abused as - * a multiline comment. Because of this the number of lines in a - * module file is fixed to the number of instruments/patterns/samples. - * - * Also note that the instrument/pattern/sample name length is limited - * an thus the line length in comments are limited. Too big comments - * will be truncated. - * - * The line length limits per file type are (1 character = 1 byte): - * Mod 22 characters, S3M 27 characters, IT 25 characters and XM 22 - * characters. - */ - void setComment(const String &comment); - - /*! - * Not supported by module files and therefore ignored. - */ - void setGenre(const String &genre); - - /*! - * Not supported by module files and therefore ignored. - */ - void setYear(uint year); - - /*! - * Not supported by module files and therefore ignored. - */ - void setTrack(uint track); - - /*! - * Sets the tracker name to \a trackerName. If \a trackerName is - * String::null then this value will be cleared. - * - * Note that only XM files support this tag. Setting the - * tracker name for other module file formats will be ignored. - * - * The length of this tag is limited to 20 characters (1 character - * = 1 byte). - */ - void setTrackerName(const String &trackerName); - - /*! - * Implements the unified property interface -- export function. - * Since the module tag is very limited, the exported map is as well. - */ - PropertyMap properties() const; - - /*! - * Implements the unified property interface -- import function. - * Because of the limitations of the module file tag, any tags besides - * COMMENT, TITLE and, if it is an XM file, TRACKERNAME, will be - * returned. Additionally, if the map contains tags with multiple values, - * all but the first will be contained in the returned map of unsupported - * properties. - */ - PropertyMap setProperties(const PropertyMap &); - - private: - Tag(const Tag &); - Tag &operator=(const Tag &); - - class TagPrivate; - TagPrivate *d; - }; - - } - -} - -#endif diff --git a/3rdparty/taglib/include/taglib/mp4atom.h b/3rdparty/taglib/include/taglib/mp4atom.h deleted file mode 100644 index 6cdb1d4..0000000 --- a/3rdparty/taglib/include/taglib/mp4atom.h +++ /dev/null @@ -1,111 +0,0 @@ -/************************************************************************** - copyright : (C) 2007,2011 by Lukáš Lalinský - email : lalinsky@gmail.com - **************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * - * 02110-1301 USA * - * * - * Alternatively, this file is available under the Mozilla Public * - * License Version 1.1. You may obtain a copy of the License at * - * http://www.mozilla.org/MPL/ * - ***************************************************************************/ - -// This file is not part of the public API! - -#ifndef DO_NOT_DOCUMENT - -#ifndef TAGLIB_MP4ATOM_H -#define TAGLIB_MP4ATOM_H - -#include "tfile.h" -#include "tlist.h" - -namespace TagLib { - - namespace MP4 { - - class Atom; - typedef TagLib::List AtomList; - - enum AtomDataType - { - TypeImplicit = 0, // for use with tags for which no type needs to be indicated because only one type is allowed - TypeUTF8 = 1, // without any count or null terminator - TypeUTF16 = 2, // also known as UTF-16BE - TypeSJIS = 3, // deprecated unless it is needed for special Japanese characters - TypeHTML = 6, // the HTML file header specifies which HTML version - TypeXML = 7, // the XML header must identify the DTD or schemas - TypeUUID = 8, // also known as GUID; stored as 16 bytes in binary (valid as an ID) - TypeISRC = 9, // stored as UTF-8 text (valid as an ID) - TypeMI3P = 10, // stored as UTF-8 text (valid as an ID) - TypeGIF = 12, // (deprecated) a GIF image - TypeJPEG = 13, // a JPEG image - TypePNG = 14, // a PNG image - TypeURL = 15, // absolute, in UTF-8 characters - TypeDuration = 16, // in milliseconds, 32-bit integer - TypeDateTime = 17, // in UTC, counting seconds since midnight, January 1, 1904; 32 or 64-bits - TypeGenred = 18, // a list of enumerated values - TypeInteger = 21, // a signed big-endian integer with length one of { 1,2,3,4,8 } bytes - TypeRIAAPA = 24, // RIAA parental advisory; { -1=no, 1=yes, 0=unspecified }, 8-bit integer - TypeUPC = 25, // Universal Product Code, in text UTF-8 format (valid as an ID) - TypeBMP = 27, // Windows bitmap image - TypeUndefined = 255 // undefined - }; - - struct AtomData { - AtomData(AtomDataType type, ByteVector data) : type(type), locale(0), data(data) {} - AtomDataType type; - int locale; - ByteVector data; - }; - - typedef TagLib::List AtomDataList; - - class Atom - { - public: - Atom(File *file); - ~Atom(); - Atom *find(const char *name1, const char *name2 = 0, const char *name3 = 0, const char *name4 = 0); - bool path(AtomList &path, const char *name1, const char *name2 = 0, const char *name3 = 0); - AtomList findall(const char *name, bool recursive = false); - long offset; - long length; - TagLib::ByteVector name; - AtomList children; - private: - static const int numContainers = 11; - static const char *containers[11]; - }; - - //! Root-level atoms - class Atoms - { - public: - Atoms(File *file); - ~Atoms(); - Atom *find(const char *name1, const char *name2 = 0, const char *name3 = 0, const char *name4 = 0); - AtomList path(const char *name1, const char *name2 = 0, const char *name3 = 0, const char *name4 = 0); - AtomList atoms; - }; - - } - -} - -#endif - -#endif diff --git a/3rdparty/taglib/include/taglib/mp4coverart.h b/3rdparty/taglib/include/taglib/mp4coverart.h deleted file mode 100644 index 64115b4..0000000 --- a/3rdparty/taglib/include/taglib/mp4coverart.h +++ /dev/null @@ -1,75 +0,0 @@ -/************************************************************************** - copyright : (C) 2009 by Lukáš Lalinský - email : lalinsky@gmail.com - **************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * - * 02110-1301 USA * - * * - * Alternatively, this file is available under the Mozilla Public * - * License Version 1.1. You may obtain a copy of the License at * - * http://www.mozilla.org/MPL/ * - ***************************************************************************/ - -#ifndef TAGLIB_MP4COVERART_H -#define TAGLIB_MP4COVERART_H - -#include "tlist.h" -#include "tbytevector.h" -#include "taglib_export.h" -#include "mp4atom.h" - -namespace TagLib { - - namespace MP4 { - - class TAGLIB_EXPORT CoverArt - { - public: - /*! - * This describes the image type. - */ - enum Format { - JPEG = TypeJPEG, - PNG = TypePNG, - BMP = TypeBMP, - GIF = TypeGIF, - Unknown = TypeImplicit, - }; - - CoverArt(Format format, const ByteVector &data); - ~CoverArt(); - - CoverArt(const CoverArt &item); - CoverArt &operator=(const CoverArt &item); - - //! Format of the image - Format format() const; - - //! The image data - ByteVector data() const; - - private: - class CoverArtPrivate; - CoverArtPrivate *d; - }; - - typedef List CoverArtList; - - } - -} - -#endif diff --git a/3rdparty/taglib/include/taglib/mp4file.h b/3rdparty/taglib/include/taglib/mp4file.h deleted file mode 100644 index 791a019..0000000 --- a/3rdparty/taglib/include/taglib/mp4file.h +++ /dev/null @@ -1,131 +0,0 @@ -/************************************************************************** - copyright : (C) 2007 by Lukáš Lalinský - email : lalinsky@gmail.com - **************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * - * 02110-1301 USA * - * * - * Alternatively, this file is available under the Mozilla Public * - * License Version 1.1. You may obtain a copy of the License at * - * http://www.mozilla.org/MPL/ * - ***************************************************************************/ - -#ifndef TAGLIB_MP4FILE_H -#define TAGLIB_MP4FILE_H - -#include "tag.h" -#include "tfile.h" -#include "taglib_export.h" -#include "mp4properties.h" -#include "mp4tag.h" - -namespace TagLib { - - //! An implementation of MP4 (AAC, ALAC, ...) metadata - namespace MP4 { - - class Atoms; - - /*! - * This implements and provides an interface for MP4 files to the - * TagLib::Tag and TagLib::AudioProperties interfaces by way of implementing - * the abstract TagLib::File API as well as providing some additional - * information specific to MP4 files. - */ - class TAGLIB_EXPORT File : public TagLib::File - { - public: - /*! - * Constructs an MP4 file from \a file. If \a readProperties is true the - * file's audio properties will also be read. - * - * \note In the current implementation, \a propertiesStyle is ignored. - */ - File(FileName file, bool readProperties = true, - Properties::ReadStyle audioPropertiesStyle = Properties::Average); - - /*! - * Constructs an MP4 file from \a stream. If \a readProperties is true the - * file's audio properties will also be read. - * - * \note TagLib will *not* take ownership of the stream, the caller is - * responsible for deleting it after the File object. - * - * \note In the current implementation, \a propertiesStyle is ignored. - */ - File(IOStream *stream, bool readProperties = true, - Properties::ReadStyle audioPropertiesStyle = Properties::Average); - - /*! - * Destroys this instance of the File. - */ - virtual ~File(); - - /*! - * Returns a pointer to the MP4 tag of the file. - * - * MP4::Tag implements the tag interface, so this serves as the - * reimplementation of TagLib::File::tag(). - * - * \note The Tag is still owned by the MP4::File and should not be - * deleted by the user. It will be deleted when the file (object) is - * destroyed. - */ - Tag *tag() const; - - /*! - * Implements the unified property interface -- export function. - */ - PropertyMap properties() const; - - /*! - * Removes unsupported properties. Forwards to the actual Tag's - * removeUnsupportedProperties() function. - */ - void removeUnsupportedProperties(const StringList &properties); - - /*! - * Implements the unified property interface -- import function. - */ - PropertyMap setProperties(const PropertyMap &); - - /*! - * Returns the MP4 audio properties for this file. - */ - Properties *audioProperties() const; - - /*! - * Save the file. - * - * This returns true if the save was successful. - * - * \warning In the current implementation, it's dangerous to call save() - * repeatedly. At worst it will corrupt the file. - */ - bool save(); - - private: - void read(bool readProperties); - - class FilePrivate; - FilePrivate *d; - }; - - } - -} - -#endif diff --git a/3rdparty/taglib/include/taglib/mp4item.h b/3rdparty/taglib/include/taglib/mp4item.h deleted file mode 100644 index be7aa1a..0000000 --- a/3rdparty/taglib/include/taglib/mp4item.h +++ /dev/null @@ -1,83 +0,0 @@ -/************************************************************************** - copyright : (C) 2007 by Lukáš Lalinský - email : lalinsky@gmail.com - **************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * - * 02110-1301 USA * - * * - * Alternatively, this file is available under the Mozilla Public * - * License Version 1.1. You may obtain a copy of the License at * - * http://www.mozilla.org/MPL/ * - ***************************************************************************/ - -#ifndef TAGLIB_MP4ITEM_H -#define TAGLIB_MP4ITEM_H - -#include "tstringlist.h" -#include "mp4coverart.h" -#include "taglib_export.h" - -namespace TagLib { - - namespace MP4 { - - class TAGLIB_EXPORT Item - { - public: - struct IntPair { - int first, second; - }; - - Item(); - Item(const Item &item); - Item &operator=(const Item &item); - ~Item(); - - Item(int value); - Item(uchar value); - Item(uint value); - Item(long long value); - Item(bool value); - Item(int first, int second); - Item(const StringList &value); - Item(const ByteVectorList &value); - Item(const CoverArtList &value); - - void setAtomDataType(AtomDataType type); - AtomDataType atomDataType() const; - - int toInt() const; - uchar toByte() const; - uint toUInt() const; - long long toLongLong() const; - bool toBool() const; - IntPair toIntPair() const; - StringList toStringList() const; - ByteVectorList toByteVectorList() const; - CoverArtList toCoverArtList() const; - - bool isValid() const; - - private: - class ItemPrivate; - ItemPrivate *d; - }; - - } - -} - -#endif diff --git a/3rdparty/taglib/include/taglib/mp4properties.h b/3rdparty/taglib/include/taglib/mp4properties.h deleted file mode 100644 index 410d534..0000000 --- a/3rdparty/taglib/include/taglib/mp4properties.h +++ /dev/null @@ -1,120 +0,0 @@ -/************************************************************************** - copyright : (C) 2007 by Lukáš Lalinský - email : lalinsky@gmail.com - **************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * - * 02110-1301 USA * - * * - * Alternatively, this file is available under the Mozilla Public * - * License Version 1.1. You may obtain a copy of the License at * - * http://www.mozilla.org/MPL/ * - ***************************************************************************/ - -#ifndef TAGLIB_MP4PROPERTIES_H -#define TAGLIB_MP4PROPERTIES_H - -#include "taglib_export.h" -#include "audioproperties.h" - -namespace TagLib { - - namespace MP4 { - - class Atoms; - class File; - - //! An implementation of MP4 audio properties - class TAGLIB_EXPORT Properties : public AudioProperties - { - public: - enum Codec { - Unknown = 0, - AAC, - ALAC - }; - - Properties(File *file, Atoms *atoms, ReadStyle style = Average); - virtual ~Properties(); - - /*! - * Returns the length of the file in seconds. The length is rounded down to - * the nearest whole second. - * - * \note This method is just an alias of lengthInSeconds(). - * - * \deprecated - */ - virtual int length() const; - - /*! - * Returns the length of the file in seconds. The length is rounded down to - * the nearest whole second. - * - * \see lengthInMilliseconds() - */ - // BIC: make virtual - int lengthInSeconds() const; - - /*! - * Returns the length of the file in milliseconds. - * - * \see lengthInSeconds() - */ - // BIC: make virtual - int lengthInMilliseconds() const; - - /*! - * Returns the average bit rate of the file in kb/s. - */ - virtual int bitrate() const; - - /*! - * Returns the sample rate in Hz. - */ - virtual int sampleRate() const; - - /*! - * Returns the number of audio channels. - */ - virtual int channels() const; - - /*! - * Returns the number of bits per audio sample. - */ - virtual int bitsPerSample() const; - - /*! - * Returns whether or not the file is encrypted. - */ - bool isEncrypted() const; - - /*! - * Returns the codec used in the file. - */ - Codec codec() const; - - private: - void read(File *file, Atoms *atoms); - - class PropertiesPrivate; - PropertiesPrivate *d; - }; - - } - -} - -#endif diff --git a/3rdparty/taglib/include/taglib/mp4tag.h b/3rdparty/taglib/include/taglib/mp4tag.h deleted file mode 100644 index c299c59..0000000 --- a/3rdparty/taglib/include/taglib/mp4tag.h +++ /dev/null @@ -1,157 +0,0 @@ -/************************************************************************** - copyright : (C) 2007,2011 by Lukáš Lalinský - email : lalinsky@gmail.com - **************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * - * 02110-1301 USA * - * * - * Alternatively, this file is available under the Mozilla Public * - * License Version 1.1. You may obtain a copy of the License at * - * http://www.mozilla.org/MPL/ * - ***************************************************************************/ - -#ifndef TAGLIB_MP4TAG_H -#define TAGLIB_MP4TAG_H - -#include "tag.h" -#include "tbytevectorlist.h" -#include "tfile.h" -#include "tmap.h" -#include "tstringlist.h" -#include "taglib_export.h" -#include "mp4atom.h" -#include "mp4item.h" - -namespace TagLib { - - namespace MP4 { - - /*! - * \deprecated - */ - typedef TagLib::Map ItemListMap; - typedef TagLib::Map ItemMap; - - class TAGLIB_EXPORT Tag: public TagLib::Tag - { - public: - Tag(); - Tag(TagLib::File *file, Atoms *atoms); - ~Tag(); - bool save(); - - String title() const; - String artist() const; - String album() const; - String comment() const; - String genre() const; - uint year() const; - uint track() const; - - void setTitle(const String &value); - void setArtist(const String &value); - void setAlbum(const String &value); - void setComment(const String &value); - void setGenre(const String &value); - void setYear(uint value); - void setTrack(uint value); - - virtual bool isEmpty() const; - - /*! - * \deprecated Use the item() and setItem() API instead - */ - ItemMap &itemListMap(); - - /*! - * Returns a string-keyed map of the MP4::Items for this tag. - */ - const ItemMap &itemMap() const; - - /*! - * \return The item, if any, corresponding to \a key. - */ - Item item(const String &key) const; - - /*! - * Sets the value of \a key to \a value, overwriting any previous value. - */ - void setItem(const String &key, const Item &value); - - /*! - * Removes the entry with \a key from the tag, or does nothing if it does - * not exist. - */ - void removeItem(const String &key); - - /*! - * \return True if the tag contains an entry for \a key. - */ - bool contains(const String &key) const; - - PropertyMap properties() const; - void removeUnsupportedProperties(const StringList& properties); - PropertyMap setProperties(const PropertyMap &properties); - - private: - AtomDataList parseData2(const Atom *atom, int expectedFlags = -1, - bool freeForm = false); - ByteVectorList parseData(const Atom *atom, int expectedFlags = -1, - bool freeForm = false); - void parseText(const Atom *atom, int expectedFlags = 1); - void parseFreeForm(const Atom *atom); - void parseInt(const Atom *atom); - void parseByte(const Atom *atom); - void parseUInt(const Atom *atom); - void parseLongLong(const Atom *atom); - void parseGnre(const Atom *atom); - void parseIntPair(const Atom *atom); - void parseBool(const Atom *atom); - void parseCovr(const Atom *atom); - - ByteVector padIlst(const ByteVector &data, int length = -1) const; - ByteVector renderAtom(const ByteVector &name, const ByteVector &data) const; - ByteVector renderData(const ByteVector &name, int flags, - const ByteVectorList &data) const; - ByteVector renderText(const ByteVector &name, const Item &item, - int flags = TypeUTF8) const; - ByteVector renderFreeForm(const String &name, const Item &item) const; - ByteVector renderBool(const ByteVector &name, const Item &item) const; - ByteVector renderInt(const ByteVector &name, const Item &item) const; - ByteVector renderByte(const ByteVector &name, const Item &item) const; - ByteVector renderUInt(const ByteVector &name, const Item &item) const; - ByteVector renderLongLong(const ByteVector &name, const Item &item) const; - ByteVector renderIntPair(const ByteVector &name, const Item &item) const; - ByteVector renderIntPairNoTrailing(const ByteVector &name, const Item &item) const; - ByteVector renderCovr(const ByteVector &name, const Item &item) const; - - void updateParents(const AtomList &path, long delta, int ignore = 0); - void updateOffsets(long delta, long offset); - - void saveNew(ByteVector data); - void saveExisting(ByteVector data, const AtomList &path); - - void addItem(const String &name, const Item &value); - - class TagPrivate; - TagPrivate *d; - }; - - } - -} - -#endif diff --git a/3rdparty/taglib/include/taglib/mpcfile.h b/3rdparty/taglib/include/taglib/mpcfile.h deleted file mode 100644 index 0980a5c..0000000 --- a/3rdparty/taglib/include/taglib/mpcfile.h +++ /dev/null @@ -1,235 +0,0 @@ -/*************************************************************************** - copyright : (C) 2004 by Allan Sandfeld Jensen - email : kde@carewolf.org - ***************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * - * 02110-1301 USA * - * * - * Alternatively, this file is available under the Mozilla Public * - * License Version 1.1. You may obtain a copy of the License at * - * http://www.mozilla.org/MPL/ * - ***************************************************************************/ - -#ifndef TAGLIB_MPCFILE_H -#define TAGLIB_MPCFILE_H - -#include "taglib_export.h" -#include "tfile.h" -#include "tag.h" - -#include "mpcproperties.h" - -#include "tlist.h" - -namespace TagLib { - - class Tag; - - namespace ID3v1 { class Tag; } - namespace APE { class Tag; } - - //! An implementation of MPC metadata - - /*! - * This is implementation of MPC metadata. - * - * This supports ID3v1 and APE (v1 and v2) style comments as well as reading stream - * properties from the file. ID3v2 tags are invalid in MPC-files, but will be skipped - * and ignored. - */ - - namespace MPC { - - //! An implementation of TagLib::File with MPC specific methods - - /*! - * This implements and provides an interface for MPC files to the - * TagLib::Tag and TagLib::AudioProperties interfaces by way of implementing - * the abstract TagLib::File API as well as providing some additional - * information specific to MPC files. - * The only invalid tag combination supported is an ID3v1 tag after an APE tag. - */ - - class TAGLIB_EXPORT File : public TagLib::File - { - public: - /*! - * This set of flags is used for various operations and is suitable for - * being OR-ed together. - */ - enum TagTypes { - //! Empty set. Matches no tag types. - NoTags = 0x0000, - //! Matches ID3v1 tags. - ID3v1 = 0x0001, - //! Matches ID3v2 tags. - ID3v2 = 0x0002, - //! Matches APE tags. - APE = 0x0004, - //! Matches all tag types. - AllTags = 0xffff - }; - - /*! - * Constructs an MPC file from \a file. If \a readProperties is true the - * file's audio properties will also be read. - * - * \note In the current implementation, \a propertiesStyle is ignored. - */ - File(FileName file, bool readProperties = true, - Properties::ReadStyle propertiesStyle = Properties::Average); - - /*! - * Constructs an MPC file from \a stream. If \a readProperties is true the - * file's audio properties will also be read. - * - * \note TagLib will *not* take ownership of the stream, the caller is - * responsible for deleting it after the File object. - * - * \note In the current implementation, \a propertiesStyle is ignored. - */ - File(IOStream *stream, bool readProperties = true, - Properties::ReadStyle propertiesStyle = Properties::Average); - - /*! - * Destroys this instance of the File. - */ - virtual ~File(); - - /*! - * Returns the Tag for this file. This will be an APE tag, an ID3v1 tag - * or a combination of the two. - */ - virtual TagLib::Tag *tag() const; - - /*! - * Implements the unified property interface -- export function. - * If the file contains both an APE and an ID3v1 tag, only the APE - * tag will be converted to the PropertyMap. - */ - PropertyMap properties() const; - - void removeUnsupportedProperties(const StringList &properties); - - /*! - * Implements the unified property interface -- import function. - * Affects only the APEv2 tag which will be created if necessary. - * If an ID3v1 tag exists, it will be updated as well. - */ - PropertyMap setProperties(const PropertyMap &); - - /*! - * Returns the MPC::Properties for this file. If no audio properties - * were read then this will return a null pointer. - */ - virtual Properties *audioProperties() const; - - /*! - * Saves the file. - * - * This returns true if the save was successful. - * - * \warning In the current implementation, it's dangerous to call save() - * repeatedly. At worst it will corrupt the file. - */ - virtual bool save(); - - /*! - * Returns a pointer to the ID3v1 tag of the file. - * - * If \a create is false (the default) this returns a null pointer - * if there is no valid APE tag. If \a create is true it will create - * an APE tag if one does not exist and returns a valid pointer. - * - * \note This may return a valid pointer regardless of whether or not the - * file on disk has an ID3v1 tag. Use hasID3v1Tag() to check if the file - * on disk actually has an ID3v1 tag. - * - * \note The Tag is still owned by the MPEG::File and should not be - * deleted by the user. It will be deleted when the file (object) is - * destroyed. - * - * \see hasID3v1Tag() - */ - ID3v1::Tag *ID3v1Tag(bool create = false); - - /*! - * Returns a pointer to the APE tag of the file. - * - * If \a create is false (the default) this may return a null pointer - * if there is no valid APE tag. If \a create is true it will create - * an APE tag if one does not exist and returns a valid pointer. If - * there already be an ID3v1 tag, the new APE tag will be placed before it. - * - * \note This may return a valid pointer regardless of whether or not the - * file on disk has an APE tag. Use hasAPETag() to check if the file - * on disk actually has an APE tag. - * - * \note The Tag is still owned by the MPEG::File and should not be - * deleted by the user. It will be deleted when the file (object) is - * destroyed. - * - * \see hasAPETag() - */ - APE::Tag *APETag(bool create = false); - - /*! - * This will remove the tags that match the OR-ed together TagTypes from the - * file. By default it removes all tags. - * - * \warning This will also invalidate pointers to the tags - * as their memory will be freed. - * - * \note In order to make the removal permanent save() still needs to be called. - */ - void strip(int tags = AllTags); - - /*! - * \deprecated - * \see strip - */ - void remove(int tags = AllTags); - - /*! - * Returns whether or not the file on disk actually has an ID3v1 tag. - * - * \see ID3v1Tag() - */ - bool hasID3v1Tag() const; - - /*! - * Returns whether or not the file on disk actually has an APE tag. - * - * \see APETag() - */ - bool hasAPETag() const; - - private: - File(const File &); - File &operator=(const File &); - - void read(bool readProperties); - long findAPE(); - long findID3v1(); - long findID3v2(); - - class FilePrivate; - FilePrivate *d; - }; - } -} - -#endif diff --git a/3rdparty/taglib/include/taglib/mpcproperties.h b/3rdparty/taglib/include/taglib/mpcproperties.h deleted file mode 100644 index d6b0669..0000000 --- a/3rdparty/taglib/include/taglib/mpcproperties.h +++ /dev/null @@ -1,158 +0,0 @@ -/*************************************************************************** - copyright : (C) 2004 by Allan Sandfeld Jensen - email : kde@carewolf.org - ***************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * - * 02110-1301 USA * - * * - * Alternatively, this file is available under the Mozilla Public * - * License Version 1.1. You may obtain a copy of the License at * - * http://www.mozilla.org/MPL/ * - ***************************************************************************/ - -#ifndef TAGLIB_MPCPROPERTIES_H -#define TAGLIB_MPCPROPERTIES_H - -#include "taglib_export.h" -#include "audioproperties.h" - -namespace TagLib { - - namespace MPC { - - class File; - - static const uint HeaderSize = 8*7; - - //! An implementation of audio property reading for MPC - - /*! - * This reads the data from an MPC stream found in the AudioProperties - * API. - */ - - class TAGLIB_EXPORT Properties : public AudioProperties - { - public: - /*! - * Create an instance of MPC::Properties with the data read from the - * ByteVector \a data. - * - * This constructor is deprecated. It only works for MPC version up to 7. - */ - Properties(const ByteVector &data, long streamLength, ReadStyle style = Average); - - /*! - * Create an instance of MPC::Properties with the data read directly - * from a MPC::File. - */ - Properties(File *file, long streamLength, ReadStyle style = Average); - - /*! - * Destroys this MPC::Properties instance. - */ - virtual ~Properties(); - - /*! - * Returns the length of the file in seconds. The length is rounded down to - * the nearest whole second. - * - * \note This method is just an alias of lengthInSeconds(). - * - * \deprecated - */ - virtual int length() const; - - /*! - * Returns the length of the file in seconds. The length is rounded down to - * the nearest whole second. - * - * \see lengthInMilliseconds() - */ - // BIC: make virtual - int lengthInSeconds() const; - - /*! - * Returns the length of the file in milliseconds. - * - * \see lengthInSeconds() - */ - // BIC: make virtual - int lengthInMilliseconds() const; - - /*! - * Returns the average bit rate of the file in kb/s. - */ - virtual int bitrate() const; - - /*! - * Returns the sample rate in Hz. - */ - virtual int sampleRate() const; - - /*! - * Returns the number of audio channels. - */ - virtual int channels() const; - - /*! - * Returns the version of the bitstream (SV4-SV8) - */ - int mpcVersion() const; - - uint totalFrames() const; - uint sampleFrames() const; - - /*! - * Returns the track gain as an integer value, - * to convert to dB: trackGain in dB = 64.82 - (trackGain / 256) - */ - int trackGain() const; - - /*! - * Returns the track peak as an integer value, - * to convert to dB: trackPeak in dB = trackPeak / 256 - * to convert to floating [-1..1]: trackPeak = 10^(trackPeak / 256 / 20)/32768 - */ - int trackPeak() const; - - /*! - * Returns the album gain as an integer value, - * to convert to dB: albumGain in dB = 64.82 - (albumGain / 256) - */ - int albumGain() const; - - /*! - * Returns the album peak as an integer value, - * to convert to dB: albumPeak in dB = albumPeak / 256 - * to convert to floating [-1..1]: albumPeak = 10^(albumPeak / 256 / 20)/32768 - */ - int albumPeak() const; - - private: - Properties(const Properties &); - Properties &operator=(const Properties &); - - void readSV7(const ByteVector &data, long streamLength); - void readSV8(File *file, long streamLength); - - class PropertiesPrivate; - PropertiesPrivate *d; - }; - } -} - -#endif diff --git a/3rdparty/taglib/include/taglib/mpegfile.h b/3rdparty/taglib/include/taglib/mpegfile.h deleted file mode 100644 index 858a6a5..0000000 --- a/3rdparty/taglib/include/taglib/mpegfile.h +++ /dev/null @@ -1,403 +0,0 @@ -/*************************************************************************** - copyright : (C) 2002 - 2008 by Scott Wheeler - email : wheeler@kde.org - ***************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * - * 02110-1301 USA * - * * - * Alternatively, this file is available under the Mozilla Public * - * License Version 1.1. You may obtain a copy of the License at * - * http://www.mozilla.org/MPL/ * - ***************************************************************************/ - -#ifndef TAGLIB_MPEGFILE_H -#define TAGLIB_MPEGFILE_H - -#include "taglib_export.h" -#include "tfile.h" -#include "tag.h" - -#include "mpegproperties.h" - -namespace TagLib { - - namespace ID3v2 { class Tag; class FrameFactory; } - namespace ID3v1 { class Tag; } - namespace APE { class Tag; } - - //! An implementation of TagLib::File with MPEG (MP3) specific methods - - namespace MPEG { - - //! An MPEG file class with some useful methods specific to MPEG - - /*! - * This implements the generic TagLib::File API and additionally provides - * access to properties that are distinct to MPEG files, notably access - * to the different ID3 tags. - */ - - class TAGLIB_EXPORT File : public TagLib::File - { - public: - /*! - * This set of flags is used for various operations and is suitable for - * being OR-ed together. - */ - enum TagTypes { - //! Empty set. Matches no tag types. - NoTags = 0x0000, - //! Matches ID3v1 tags. - ID3v1 = 0x0001, - //! Matches ID3v2 tags. - ID3v2 = 0x0002, - //! Matches APE tags. - APE = 0x0004, - //! Matches all tag types. - AllTags = 0xffff - }; - - /*! - * Constructs an MPEG file from \a file. If \a readProperties is true the - * file's audio properties will also be read. - * - * \note In the current implementation, \a propertiesStyle is ignored. - * - * \deprecated This constructor will be dropped in favor of the one below - * in a future version. - */ - File(FileName file, bool readProperties = true, - Properties::ReadStyle propertiesStyle = Properties::Average); - - /*! - * Constructs an MPEG file from \a file. If \a readProperties is true the - * file's audio properties will also be read. - * - * If this file contains and ID3v2 tag the frames will be created using - * \a frameFactory. - * - * \note In the current implementation, \a propertiesStyle is ignored. - */ - // BIC: merge with the above constructor - File(FileName file, ID3v2::FrameFactory *frameFactory, - bool readProperties = true, - Properties::ReadStyle propertiesStyle = Properties::Average); - - /*! - * Constructs an MPEG file from \a stream. If \a readProperties is true the - * file's audio properties will also be read. - * - * \note TagLib will *not* take ownership of the stream, the caller is - * responsible for deleting it after the File object. - * - * If this file contains and ID3v2 tag the frames will be created using - * \a frameFactory. - * - * \note In the current implementation, \a propertiesStyle is ignored. - */ - File(IOStream *stream, ID3v2::FrameFactory *frameFactory, - bool readProperties = true, - Properties::ReadStyle propertiesStyle = Properties::Average); - - /*! - * Destroys this instance of the File. - */ - virtual ~File(); - - /*! - * Returns a pointer to a tag that is the union of the ID3v2 and ID3v1 - * tags. The ID3v2 tag is given priority in reading the information -- if - * requested information exists in both the ID3v2 tag and the ID3v1 tag, - * the information from the ID3v2 tag will be returned. - * - * If you would like more granular control over the content of the tags, - * with the concession of generality, use the tag-type specific calls. - * - * \note As this tag is not implemented as an ID3v2 tag or an ID3v1 tag, - * but a union of the two this pointer may not be cast to the specific - * tag types. - * - * \see ID3v1Tag() - * \see ID3v2Tag() - * \see APETag() - */ - virtual Tag *tag() const; - - /*! - * Implements the reading part of the unified property interface. - * If the file contains more than one tag, only the - * first one (in the order ID3v2, APE, ID3v1) will be converted to the - * PropertyMap. - */ - PropertyMap properties() const; - - void removeUnsupportedProperties(const StringList &properties); - - /*! - * Implements the writing part of the unified tag dictionary interface. - * In order to avoid problems with deprecated tag formats, this method - * always creates an ID3v2 tag if necessary. - * If an ID3v1 tag exists, it will be updated as well, within the - * limitations of that format. - * The returned PropertyMap refers to the ID3v2 tag only. - */ - PropertyMap setProperties(const PropertyMap &); - - /*! - * Returns the MPEG::Properties for this file. If no audio properties - * were read then this will return a null pointer. - */ - virtual Properties *audioProperties() const; - - /*! - * Save the file. If at least one tag -- ID3v1 or ID3v2 -- exists this - * will duplicate its content into the other tag. This returns true - * if saving was successful. - * - * If neither exists or if both tags are empty, this will strip the tags - * from the file. - * - * This is the same as calling save(AllTags); - * - * If you would like more granular control over the content of the tags, - * with the concession of generality, use parameterized save call below. - * - * \warning In the current implementation, it's dangerous to call save() - * repeatedly. At worst it will corrupt the file. - * - * \see save(int tags) - */ - virtual bool save(); - - /*! - * Save the file. This will attempt to save all of the tag types that are - * specified by OR-ing together TagTypes values. The save() method above - * uses AllTags. This returns true if saving was successful. - * - * This strips all tags not included in the mask, but does not modify them - * in memory, so later calls to save() which make use of these tags will - * remain valid. This also strips empty tags. - * - * \warning In the current implementation, it's dangerous to call save() - * repeatedly. At worst it will corrupt the file. - */ - bool save(int tags); - - /*! - * Save the file. This will attempt to save all of the tag types that are - * specified by OR-ing together TagTypes values. The save() method above - * uses AllTags. This returns true if saving was successful. - * - * If \a stripOthers is true this strips all tags not included in the mask, - * but does not modify them in memory, so later calls to save() which make - * use of these tags will remain valid. This also strips empty tags. - * - * \warning In the current implementation, it's dangerous to call save() - * repeatedly. At worst it will corrupt the file. - */ - // BIC: combine with the above method - bool save(int tags, bool stripOthers); - - /*! - * Save the file. This will attempt to save all of the tag types that are - * specified by OR-ing together TagTypes values. The save() method above - * uses AllTags. This returns true if saving was successful. - * - * If \a stripOthers is true this strips all tags not included in the mask, - * but does not modify them in memory, so later calls to save() which make - * use of these tags will remain valid. This also strips empty tags. - * - * The \a id3v2Version parameter specifies the version of the saved - * ID3v2 tag. It can be either 4 or 3. - * - * \warning In the current implementation, it's dangerous to call save() - * repeatedly. At worst it will corrupt the file. - */ - // BIC: combine with the above method - bool save(int tags, bool stripOthers, int id3v2Version); - - /*! - * Save the file. This will attempt to save all of the tag types that are - * specified by OR-ing together TagTypes values. The save() method above - * uses AllTags. This returns true if saving was successful. - * - * If \a stripOthers is true this strips all tags not included in the mask, - * but does not modify them in memory, so later calls to save() which make - * use of these tags will remain valid. This also strips empty tags. - * - * The \a id3v2Version parameter specifies the version of the saved - * ID3v2 tag. It can be either 4 or 3. - * - * If \a duplicateTags is true and at least one tag -- ID3v1 or ID3v2 -- - * exists this will duplicate its content into the other tag. - * - * \warning In the current implementation, it's dangerous to call save() - * repeatedly. At worst it will corrupt the file. - */ - // BIC: combine with the above method - bool save(int tags, bool stripOthers, int id3v2Version, bool duplicateTags); - - /*! - * Returns a pointer to the ID3v2 tag of the file. - * - * If \a create is false (the default) this may return a null pointer - * if there is no valid ID3v2 tag. If \a create is true it will create - * an ID3v2 tag if one does not exist and returns a valid pointer. - * - * \note This may return a valid pointer regardless of whether or not the - * file on disk has an ID3v2 tag. Use hasID3v2Tag() to check if the file - * on disk actually has an ID3v2 tag. - * - * \note The Tag is still owned by the MPEG::File and should not be - * deleted by the user. It will be deleted when the file (object) is - * destroyed. - * - * \see hasID3v2Tag() - */ - ID3v2::Tag *ID3v2Tag(bool create = false); - - /*! - * Returns a pointer to the ID3v1 tag of the file. - * - * If \a create is false (the default) this may return a null pointer - * if there is no valid ID3v1 tag. If \a create is true it will create - * an ID3v1 tag if one does not exist and returns a valid pointer. - * - * \note This may return a valid pointer regardless of whether or not the - * file on disk has an ID3v1 tag. Use hasID3v1Tag() to check if the file - * on disk actually has an ID3v1 tag. - * - * \note The Tag is still owned by the MPEG::File and should not be - * deleted by the user. It will be deleted when the file (object) is - * destroyed. - * - * \see hasID3v1Tag() - */ - ID3v1::Tag *ID3v1Tag(bool create = false); - - /*! - * Returns a pointer to the APE tag of the file. - * - * If \a create is false (the default) this may return a null pointer - * if there is no valid APE tag. If \a create is true it will create - * an APE tag if one does not exist and returns a valid pointer. - * - * \note This may return a valid pointer regardless of whether or not the - * file on disk has an APE tag. Use hasAPETag() to check if the file - * on disk actually has an APE tag. - * - * \note The Tag is still owned by the MPEG::File and should not be - * deleted by the user. It will be deleted when the file (object) is - * destroyed. - * - * \see hasAPETag() - */ - APE::Tag *APETag(bool create = false); - - /*! - * This will strip the tags that match the OR-ed together TagTypes from the - * file. By default it strips all tags. It returns true if the tags are - * successfully stripped. - * - * This is equivalent to strip(tags, true) - * - * \note This will also invalidate pointers to the ID3 and APE tags - * as their memory will be freed. - * - * \note This will update the file immediately. - */ - bool strip(int tags = AllTags); - - /*! - * This will strip the tags that match the OR-ed together TagTypes from the - * file. By default it strips all tags. It returns true if the tags are - * successfully stripped. - * - * If \a freeMemory is true the ID3 and APE tags will be deleted and - * pointers to them will be invalidated. - * - * \note This will update the file immediately. - */ - // BIC: merge with the method above - bool strip(int tags, bool freeMemory); - - /*! - * Set the ID3v2::FrameFactory to something other than the default. - * - * \see ID3v2FrameFactory - * \deprecated This value should be passed in via the constructor - */ - void setID3v2FrameFactory(const ID3v2::FrameFactory *factory); - - /*! - * Returns the position in the file of the first MPEG frame. - */ - long firstFrameOffset(); - - /*! - * Returns the position in the file of the next MPEG frame, - * using the current position as start - */ - long nextFrameOffset(long position); - - /*! - * Returns the position in the file of the previous MPEG frame, - * using the current position as start - */ - long previousFrameOffset(long position); - - /*! - * Returns the position in the file of the last MPEG frame. - */ - long lastFrameOffset(); - - /*! - * Returns whether or not the file on disk actually has an ID3v1 tag. - * - * \see ID3v1Tag() - */ - bool hasID3v1Tag() const; - - /*! - * Returns whether or not the file on disk actually has an ID3v2 tag. - * - * \see ID3v2Tag() - */ - bool hasID3v2Tag() const; - - /*! - * Returns whether or not the file on disk actually has an APE tag. - * - * \see APETag() - */ - bool hasAPETag() const; - - private: - File(const File &); - File &operator=(const File &); - - void read(bool readProperties); - long findID3v2(long offset); - long findID3v1(); - void findAPE(); - - class FilePrivate; - FilePrivate *d; - }; - } -} - -#endif diff --git a/3rdparty/taglib/include/taglib/mpegheader.h b/3rdparty/taglib/include/taglib/mpegheader.h deleted file mode 100644 index a55cac0..0000000 --- a/3rdparty/taglib/include/taglib/mpegheader.h +++ /dev/null @@ -1,166 +0,0 @@ -/*************************************************************************** - copyright : (C) 2002 - 2008 by Scott Wheeler - email : wheeler@kde.org - ***************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * - * 02110-1301 USA * - * * - * Alternatively, this file is available under the Mozilla Public * - * License Version 1.1. You may obtain a copy of the License at * - * http://www.mozilla.org/MPL/ * - ***************************************************************************/ - -#ifndef TAGLIB_MPEGHEADER_H -#define TAGLIB_MPEGHEADER_H - -#include "taglib_export.h" - -namespace TagLib { - - class ByteVector; - - namespace MPEG { - - //! An implementation of MP3 frame headers - - /*! - * This is an implementation of MPEG Layer III headers. The API follows more - * or less the binary format of these headers. I've used - * this - * document as a reference. - */ - - class TAGLIB_EXPORT Header - { - public: - /*! - * Parses an MPEG header based on \a data. - */ - Header(const ByteVector &data); - - /*! - * Does a shallow copy of \a h. - */ - Header(const Header &h); - - /*! - * Destroys this Header instance. - */ - virtual ~Header(); - - /*! - * Returns true if the frame is at least an appropriate size and has - * legal values. - */ - bool isValid() const; - - /*! - * The MPEG Version. - */ - enum Version { - //! MPEG Version 1 - Version1 = 0, - //! MPEG Version 2 - Version2 = 1, - //! MPEG Version 2.5 - Version2_5 = 2 - }; - - /*! - * Returns the MPEG Version of the header. - */ - Version version() const; - - /*! - * Returns the layer version. This will be between the values 1-3. - */ - int layer() const; - - /*! - * Returns true if the MPEG protection bit is enabled. - */ - bool protectionEnabled() const; - - /*! - * Returns the bitrate encoded in the header. - */ - int bitrate() const; - - /*! - * Returns the sample rate in Hz. - */ - int sampleRate() const; - - /*! - * Returns true if the frame is padded. - */ - bool isPadded() const; - - /*! - * There are a few combinations or one or two channel audio that are - * possible: - */ - enum ChannelMode { - //! Stereo - Stereo = 0, - //! Stereo - JointStereo = 1, - //! Dual Mono - DualChannel = 2, - //! Mono - SingleChannel = 3 - }; - - /*! - * Returns the channel mode for this frame. - */ - ChannelMode channelMode() const; - - /*! - * Returns true if the copyrighted bit is set. - */ - bool isCopyrighted() const; - - /*! - * Returns true if the "original" bit is set. - */ - bool isOriginal() const; - - /*! - * Returns the frame length in bytes. - */ - int frameLength() const; - - /*! - * Returns the number of frames per sample. - */ - int samplesPerFrame() const; - - /*! - * Makes a shallow copy of the header. - */ - Header &operator=(const Header &h); - - private: - void parse(const ByteVector &data); - - class HeaderPrivate; - HeaderPrivate *d; - }; - } -} - -#endif diff --git a/3rdparty/taglib/include/taglib/mpegproperties.h b/3rdparty/taglib/include/taglib/mpegproperties.h deleted file mode 100644 index f11fad1..0000000 --- a/3rdparty/taglib/include/taglib/mpegproperties.h +++ /dev/null @@ -1,152 +0,0 @@ -/*************************************************************************** - copyright : (C) 2002 - 2008 by Scott Wheeler - email : wheeler@kde.org - ***************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * - * 02110-1301 USA * - * * - * Alternatively, this file is available under the Mozilla Public * - * License Version 1.1. You may obtain a copy of the License at * - * http://www.mozilla.org/MPL/ * - ***************************************************************************/ - -#ifndef TAGLIB_MPEGPROPERTIES_H -#define TAGLIB_MPEGPROPERTIES_H - -#include "taglib_export.h" -#include "audioproperties.h" - -#include "mpegheader.h" - -namespace TagLib { - - namespace MPEG { - - class File; - class XingHeader; - - //! An implementation of audio property reading for MP3 - - /*! - * This reads the data from an MPEG Layer III stream found in the - * AudioProperties API. - */ - - class TAGLIB_EXPORT Properties : public AudioProperties - { - public: - /*! - * Create an instance of MPEG::Properties with the data read from the - * MPEG::File \a file. - */ - Properties(File *file, ReadStyle style = Average); - - /*! - * Destroys this MPEG Properties instance. - */ - virtual ~Properties(); - - /*! - * Returns the length of the file in seconds. The length is rounded down to - * the nearest whole second. - * - * \note This method is just an alias of lengthInSeconds(). - * - * \deprecated - */ - virtual int length() const; - - /*! - * Returns the length of the file in seconds. The length is rounded down to - * the nearest whole second. - * - * \see lengthInMilliseconds() - */ - // BIC: make virtual - int lengthInSeconds() const; - - /*! - * Returns the length of the file in milliseconds. - * - * \see lengthInSeconds() - */ - // BIC: make virtual - int lengthInMilliseconds() const; - - /*! - * Returns the average bit rate of the file in kb/s. - */ - virtual int bitrate() const; - - /*! - * Returns the sample rate in Hz. - */ - virtual int sampleRate() const; - - /*! - * Returns the number of audio channels. - */ - virtual int channels() const; - - /*! - * Returns a pointer to the Xing/VBRI header if one exists or null if no - * Xing/VBRI header was found. - */ - const XingHeader *xingHeader() const; - - /*! - * Returns the MPEG Version of the file. - */ - Header::Version version() const; - - /*! - * Returns the layer version. This will be between the values 1-3. - */ - int layer() const; - - /*! - * Returns true if the MPEG protection bit is enabled. - */ - bool protectionEnabled() const; - - /*! - * Returns the channel mode for this frame. - */ - Header::ChannelMode channelMode() const; - - /*! - * Returns true if the copyrighted bit is set. - */ - bool isCopyrighted() const; - - /*! - * Returns true if the "original" bit is set. - */ - bool isOriginal() const; - - private: - Properties(const Properties &); - Properties &operator=(const Properties &); - - void read(File *file); - - class PropertiesPrivate; - PropertiesPrivate *d; - }; - } -} - -#endif diff --git a/3rdparty/taglib/include/taglib/oggfile.h b/3rdparty/taglib/include/taglib/oggfile.h deleted file mode 100644 index 8fed4ba..0000000 --- a/3rdparty/taglib/include/taglib/oggfile.h +++ /dev/null @@ -1,122 +0,0 @@ -/*************************************************************************** - copyright : (C) 2002 - 2008 by Scott Wheeler - email : wheeler@kde.org - ***************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * - * 02110-1301 USA * - * * - * Alternatively, this file is available under the Mozilla Public * - * License Version 1.1. You may obtain a copy of the License at * - * http://www.mozilla.org/MPL/ * - ***************************************************************************/ - -#include "taglib_export.h" -#include "tfile.h" -#include "tbytevectorlist.h" - -#ifndef TAGLIB_OGGFILE_H -#define TAGLIB_OGGFILE_H - -namespace TagLib { - - //! A namespace for the classes used by Ogg-based metadata files - - namespace Ogg { - - class PageHeader; - - //! An implementation of TagLib::File with some helpers for Ogg based formats - - /*! - * This is an implementation of Ogg file page and packet rendering and is of - * use to Ogg based formats. While the API is small this handles the - * non-trivial details of breaking up an Ogg stream into packets and makes - * these available (via subclassing) to the codec meta data implementations. - */ - - class TAGLIB_EXPORT File : public TagLib::File - { - public: - virtual ~File(); - - /*! - * Returns the packet contents for the i-th packet (starting from zero) - * in the Ogg bitstream. - * - * \warning The requires reading at least the packet header for every page - * up to the requested page. - */ - ByteVector packet(uint i); - - /*! - * Sets the packet with index \a i to the value \a p. - */ - void setPacket(uint i, const ByteVector &p); - - /*! - * Returns a pointer to the PageHeader for the first page in the stream or - * null if the page could not be found. - */ - const PageHeader *firstPageHeader(); - - /*! - * Returns a pointer to the PageHeader for the last page in the stream or - * null if the page could not be found. - */ - const PageHeader *lastPageHeader(); - - virtual bool save(); - - protected: - /*! - * Constructs an Ogg file from \a file. - * - * \note This constructor is protected since Ogg::File shouldn't be - * instantiated directly but rather should be used through the codec - * specific subclasses. - */ - File(FileName file); - - /*! - * Constructs an Ogg file from \a stream. - * - * \note This constructor is protected since Ogg::File shouldn't be - * instantiated directly but rather should be used through the codec - * specific subclasses. - * - * \note TagLib will *not* take ownership of the stream, the caller is - * responsible for deleting it after the File object. - */ - File(IOStream *stream); - - private: - File(const File &); - File &operator=(const File &); - - /*! - * Reads the next page and updates the internal "current page" pointer. - */ - bool nextPage(); - void writePageGroup(const List &group); - - class FilePrivate; - FilePrivate *d; - }; - - } -} - -#endif diff --git a/3rdparty/taglib/include/taglib/oggflacfile.h b/3rdparty/taglib/include/taglib/oggflacfile.h deleted file mode 100644 index 28b3f67..0000000 --- a/3rdparty/taglib/include/taglib/oggflacfile.h +++ /dev/null @@ -1,165 +0,0 @@ -/*************************************************************************** - copyright : (C) 2004 by Allan Sandfeld Jensen - email : kde@carewolf.org - ***************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * - * 02110-1301 USA * - * * - * Alternatively, this file is available under the Mozilla Public * - * License Version 1.1. You may obtain a copy of the License at * - * http://www.mozilla.org/MPL/ * - ***************************************************************************/ - -#ifndef TAGLIB_OGGFLACFILE_H -#define TAGLIB_OGGFLACFILE_H - -#include "taglib_export.h" -#include "oggfile.h" -#include "xiphcomment.h" - -#include "flacproperties.h" - -namespace TagLib { - - class Tag; - - namespace Ogg { - - //! An implementation of Ogg FLAC metadata - - /*! - * This is implementation of FLAC metadata for Ogg FLAC files. For "pure" - * FLAC files look under the FLAC hierarchy. - * - * Unlike "pure" FLAC-files, Ogg FLAC only supports Xiph-comments, - * while the audio-properties are the same. - */ - namespace FLAC { - - using TagLib::FLAC::Properties; - - //! An implementation of TagLib::File with Ogg/FLAC specific methods - - /*! - * This implements and provides an interface for Ogg/FLAC files to the - * TagLib::Tag and TagLib::AudioProperties interfaces by way of implementing - * the abstract TagLib::File API as well as providing some additional - * information specific to Ogg FLAC files. - */ - - class TAGLIB_EXPORT File : public Ogg::File - { - public: - /*! - * Constructs an Ogg/FLAC file from \a file. If \a readProperties is true - * the file's audio properties will also be read. - * - * \note In the current implementation, \a propertiesStyle is ignored. - */ - File(FileName file, bool readProperties = true, - Properties::ReadStyle propertiesStyle = Properties::Average); - - /*! - * Constructs an Ogg/FLAC file from \a stream. If \a readProperties is true - * the file's audio properties will also be read. - * - * \note TagLib will *not* take ownership of the stream, the caller is - * responsible for deleting it after the File object. - * - * \note In the current implementation, \a propertiesStyle is ignored. - */ - File(IOStream *stream, bool readProperties = true, - Properties::ReadStyle propertiesStyle = Properties::Average); - - /*! - * Destroys this instance of the File. - */ - virtual ~File(); - - /*! - * Returns the Tag for this file. This will always be a XiphComment. - * - * \note This always returns a valid pointer regardless of whether or not - * the file on disk has a XiphComment. Use hasXiphComment() to check if - * the file on disk actually has a XiphComment. - * - * \note The Tag is still owned by the FLAC::File and should not be - * deleted by the user. It will be deleted when the file (object) is - * destroyed. - * - * \see hasXiphComment() - */ - virtual XiphComment *tag() const; - - /*! - * Returns the FLAC::Properties for this file. If no audio properties - * were read then this will return a null pointer. - */ - virtual Properties *audioProperties() const; - - - /*! - * Implements the unified property interface -- export function. - * This forwards directly to XiphComment::properties(). - */ - PropertyMap properties() const; - - /*! - * Implements the unified tag dictionary interface -- import function. - * Like properties(), this is a forwarder to the file's XiphComment. - */ - PropertyMap setProperties(const PropertyMap &); - - - /*! - * Save the file. This will primarily save and update the XiphComment. - * Returns true if the save is successful. - * - * \warning In the current implementation, it's dangerous to call save() - * repeatedly. It leads to a segfault. - */ - virtual bool save(); - - /*! - * Returns the length of the audio-stream, used by FLAC::Properties for - * calculating the bitrate. - */ - long streamLength(); - - /*! - * Returns whether or not the file on disk actually has a XiphComment. - * - * \see tag() - */ - bool hasXiphComment() const; - - private: - File(const File &); - File &operator=(const File &); - - void read(bool readProperties, Properties::ReadStyle propertiesStyle); - void scan(); - ByteVector streamInfoData(); - ByteVector xiphCommentData(); - - class FilePrivate; - FilePrivate *d; - }; - } // namespace FLAC - } // namespace Ogg -} // namespace TagLib - -#endif diff --git a/3rdparty/taglib/include/taglib/oggpage.h b/3rdparty/taglib/include/taglib/oggpage.h deleted file mode 100644 index 9ec7940..0000000 --- a/3rdparty/taglib/include/taglib/oggpage.h +++ /dev/null @@ -1,211 +0,0 @@ -/*************************************************************************** - copyright : (C) 2002 - 2008 by Scott Wheeler - email : wheeler@kde.org - ***************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * - * 02110-1301 USA * - * * - * Alternatively, this file is available under the Mozilla Public * - * License Version 1.1. You may obtain a copy of the License at * - * http://www.mozilla.org/MPL/ * - ***************************************************************************/ - -#ifndef TAGLIB_OGGPAGE_H -#define TAGLIB_OGGPAGE_H - -#include "taglib_export.h" -#include "tbytevectorlist.h" - -namespace TagLib { - - namespace Ogg { - - class File; - class PageHeader; - - //! An implementation of Ogg pages - - /*! - * This is an implementation of the pages that make up an Ogg stream. - * This handles parsing pages and breaking them down into packets and handles - * the details of packets spanning multiple pages and pages that contain - * multiple packets. - * - * In most Xiph.org formats the comments are found in the first few packets, - * this however is a reasonably complete implementation of Ogg pages that - * could potentially be useful for non-meta data purposes. - */ - - class TAGLIB_EXPORT Page - { - public: - /*! - * Read an Ogg page from the \a file at the position \a pageOffset. - */ - Page(File *file, long pageOffset); - - virtual ~Page(); - - /*! - * Returns the page's position within the file (in bytes). - */ - long fileOffset() const; - - /*! - * Returns a pointer to the header for this page. This pointer will become - * invalid when the page is deleted. - */ - const PageHeader *header() const; - - /*! - * Returns a copy of the page with \a sequenceNumber set as sequence number. - * - * \see header() - * \see PageHeader::setPageSequenceNumber() - */ - Page* getCopyWithNewPageSequenceNumber(int sequenceNumber); - - /*! - * Returns the index of the first packet wholly or partially contained in - * this page. - * - * \see setFirstPacketIndex() - */ - int firstPacketIndex() const; - - /*! - * Sets the index of the first packet in the page. - * - * \see firstPacketIndex() - */ - void setFirstPacketIndex(int index); - - /*! - * When checking to see if a page contains a given packet this set of flags - * represents the possible values for that packets status in the page. - * - * \see containsPacket() - */ - enum ContainsPacketFlags { - //! No part of the packet is contained in the page - DoesNotContainPacket = 0x0000, - //! The packet is wholly contained in the page - CompletePacket = 0x0001, - //! The page starts with the given packet - BeginsWithPacket = 0x0002, - //! The page ends with the given packet - EndsWithPacket = 0x0004 - }; - - /*! - * Checks to see if the specified \a packet is contained in the current - * page. - * - * \see ContainsPacketFlags - */ - ContainsPacketFlags containsPacket(int index) const; - - /*! - * Returns the number of packets (whole or partial) in this page. - */ - uint packetCount() const; - - /*! - * Returns a list of the packets in this page. - * - * \note Either or both the first and last packets may be only partial. - * \see PageHeader::firstPacketContinued() - */ - ByteVectorList packets() const; - - /*! - * Returns the size of the page in bytes. - */ - int size() const; - - ByteVector render() const; - - /*! - * Defines a strategy for pagination, or grouping pages into Ogg packets, - * for use with pagination methods. - * - * \note Yes, I'm aware that this is not a canonical "Strategy Pattern", - * the term was simply convenient. - */ - enum PaginationStrategy { - /*! - * Attempt to put the specified set of packets into a single Ogg packet. - * If the sum of the packet data is greater than will fit into a single - * Ogg page -- 65280 bytes -- this will fall back to repagination using - * the recommended page sizes. - */ - SinglePagePerGroup, - /*! - * Split the packet or group of packets into pages that conform to the - * sizes recommended in the Ogg standard. - */ - Repaginate - }; - - /*! - * Pack \a packets into Ogg pages using the \a strategy for pagination. - * The page number indicator inside of the rendered packets will start - * with \a firstPage and be incremented for each page rendered. - * \a containsLastPacket should be set to true if \a packets contains the - * last page in the stream and will set the appropriate flag in the last - * rendered Ogg page's header. \a streamSerialNumber should be set to - * the serial number for this stream. - * - * \note The "absolute granule position" is currently always zeroed using - * this method as this suffices for the comment headers. - * - * \warning The pages returned by this method must be deleted by the user. - * You can use List::setAutoDelete(true) to set these pages to be - * automatically deleted when this list passes out of scope. - * - * \see PaginationStrategy - * \see List::setAutoDelete() - */ - static List paginate(const ByteVectorList &packets, - PaginationStrategy strategy, - uint streamSerialNumber, - int firstPage, - bool firstPacketContinued = false, - bool lastPacketCompleted = true, - bool containsLastPacket = false); - - protected: - /*! - * Creates an Ogg packet based on the data in \a packets. The page number - * for each page will be set to \a pageNumber. - */ - Page(const ByteVectorList &packets, - uint streamSerialNumber, - int pageNumber, - bool firstPacketContinued = false, - bool lastPacketCompleted = true, - bool containsLastPacket = false); - - private: - Page(const Page &); - Page &operator=(const Page &); - - class PagePrivate; - PagePrivate *d; - }; - } -} -#endif diff --git a/3rdparty/taglib/include/taglib/oggpageheader.h b/3rdparty/taglib/include/taglib/oggpageheader.h deleted file mode 100644 index 742710a..0000000 --- a/3rdparty/taglib/include/taglib/oggpageheader.h +++ /dev/null @@ -1,232 +0,0 @@ -/*************************************************************************** - copyright : (C) 2002 - 2008 by Scott Wheeler - email : wheeler@kde.org - ***************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * - * 02110-1301 USA * - * * - * Alternatively, this file is available under the Mozilla Public * - * License Version 1.1. You may obtain a copy of the License at * - * http://www.mozilla.org/MPL/ * - ***************************************************************************/ - -#ifndef TAGLIB_OGGPAGEHEADER_H -#define TAGLIB_OGGPAGEHEADER_H - -#include "tlist.h" -#include "tbytevector.h" -#include "taglib_export.h" - -namespace TagLib { - - namespace Ogg { - - class File; - - //! An implementation of the page headers associated with each Ogg::Page - - /*! - * This class implements Ogg page headers which contain the information - * about Ogg pages needed to break them into packets which can be passed on - * to the codecs. - */ - - class TAGLIB_EXPORT PageHeader - { - public: - /*! - * Reads a PageHeader from \a file starting at \a pageOffset. The defaults - * create a page with no (and as such, invalid) data that must be set - * later. - */ - PageHeader(File *file = 0, long pageOffset = -1); - - /*! - * Deletes this instance of the PageHeader. - */ - virtual ~PageHeader(); - - /*! - * Returns true if the header parsed properly and is valid. - */ - bool isValid() const; - - /*! - * Ogg pages contain a list of packets (which are used by the contained - * codecs). The sizes of these pages is encoded in the page header. This - * returns a list of the packet sizes in bytes. - * - * \see setPacketSizes() - */ - List packetSizes() const; - - /*! - * Sets the sizes of the packets in this page to \a sizes. Internally this - * updates the lacing values in the header. - * - * \see packetSizes() - */ - void setPacketSizes(const List &sizes); - - /*! - * Some packets can be continued across multiple pages. If the - * first packet in the current page is a continuation this will return - * true. If this is page starts with a new packet this will return false. - * - * \see lastPacketCompleted() - * \see setFirstPacketContinued() - */ - bool firstPacketContinued() const; - - /*! - * Sets the internal flag indicating if the first packet in this page is - * continued to \a continued. - * - * \see firstPacketContinued() - */ - void setFirstPacketContinued(bool continued); - - /*! - * Returns true if the last packet of this page is completely contained in - * this page. - * - * \see firstPacketContinued() - * \see setLastPacketCompleted() - */ - bool lastPacketCompleted() const; - - /*! - * Sets the internal flag indicating if the last packet in this page is - * complete to \a completed. - * - * \see lastPacketCompleted() - */ - void setLastPacketCompleted(bool completed); - - /*! - * This returns true if this is the first page of the Ogg (logical) stream. - * - * \see setFirstPageOfStream() - */ - bool firstPageOfStream() const; - - /*! - * Marks this page as the first page of the Ogg stream. - * - * \see firstPageOfStream() - */ - void setFirstPageOfStream(bool first); - - /*! - * This returns true if this is the last page of the Ogg (logical) stream. - * - * \see setLastPageOfStream() - */ - bool lastPageOfStream() const; - - /*! - * Marks this page as the last page of the Ogg stream. - * - * \see lastPageOfStream() - */ - void setLastPageOfStream(bool last); - - /*! - * A special value of containing the position of the packet to be - * interpreted by the codec. In the case of Vorbis this contains the PCM - * value and is used to calculate the length of the stream. - * - * \see setAbsoluteGranularPosition() - */ - long long absoluteGranularPosition() const; - - /*! - * A special value of containing the position of the packet to be - * interpreted by the codec. It is only supported here so that it may be - * coppied from one page to another. - * - * \see absoluteGranularPosition() - */ - void setAbsoluteGranularPosition(long long agp); - - /*! - * Every Ogg logical stream is given a random serial number which is common - * to every page in that logical stream. This returns the serial number of - * the stream associated with this packet. - * - * \see setStreamSerialNumber() - */ - uint streamSerialNumber() const; - - /*! - * Every Ogg logical stream is given a random serial number which is common - * to every page in that logical stream. This sets this pages serial - * number. This method should be used when adding new pages to a logical - * stream. - * - * \see streamSerialNumber() - */ - void setStreamSerialNumber(uint n); - - /*! - * Returns the index of the page within the Ogg stream. This helps make it - * possible to determine if pages have been lost. - * - * \see setPageSequenceNumber() - */ - int pageSequenceNumber() const; - - /*! - * Sets the page's position in the stream to \a sequenceNumber. - * - * \see pageSequenceNumber() - */ - void setPageSequenceNumber(int sequenceNumber); - - /*! - * Returns the complete header size. - */ - int size() const; - - /*! - * Returns the size of the data portion of the page -- i.e. the size of the - * page less the header size. - */ - int dataSize() const; - - /*! - * Render the page header to binary data. - * - * \note The checksum -- bytes 22 - 25 -- will be left empty and must be - * filled in when rendering the entire page. - */ - ByteVector render() const; - - private: - PageHeader(const PageHeader &); - PageHeader &operator=(const PageHeader &); - - void read(); - ByteVector lacingValues() const; - - class PageHeaderPrivate; - PageHeaderPrivate *d; - }; - - } -} - -#endif diff --git a/3rdparty/taglib/include/taglib/opusfile.h b/3rdparty/taglib/include/taglib/opusfile.h deleted file mode 100644 index 0363b58..0000000 --- a/3rdparty/taglib/include/taglib/opusfile.h +++ /dev/null @@ -1,132 +0,0 @@ -/*************************************************************************** - copyright : (C) 2012 by Lukáš Lalinský - email : lalinsky@gmail.com - - copyright : (C) 2002 - 2008 by Scott Wheeler - email : wheeler@kde.org - (original Vorbis implementation) -***************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * - * 02110-1301 USA * - * * - * Alternatively, this file is available under the Mozilla Public * - * License Version 1.1. You may obtain a copy of the License at * - * http://www.mozilla.org/MPL/ * - ***************************************************************************/ - -#ifndef TAGLIB_OPUSFILE_H -#define TAGLIB_OPUSFILE_H - -#include "oggfile.h" -#include "xiphcomment.h" - -#include "opusproperties.h" - -namespace TagLib { - - namespace Ogg { - - //! A namespace containing classes for Opus metadata - - namespace Opus { - - //! An implementation of Ogg::File with Opus specific methods - - /*! - * This is the central class in the Ogg Opus metadata processing collection - * of classes. It's built upon Ogg::File which handles processing of the Ogg - * logical bitstream and breaking it down into pages which are handled by - * the codec implementations, in this case Opus specifically. - */ - - class TAGLIB_EXPORT File : public Ogg::File - { - public: - /*! - * Constructs an Opus file from \a file. If \a readProperties is true the - * file's audio properties will also be read. - * - * \note In the current implementation, \a propertiesStyle is ignored. - */ - File(FileName file, bool readProperties = true, - Properties::ReadStyle propertiesStyle = Properties::Average); - - /*! - * Constructs an Opus file from \a stream. If \a readProperties is true the - * file's audio properties will also be read. - * - * \note TagLib will *not* take ownership of the stream, the caller is - * responsible for deleting it after the File object. - * - * \note In the current implementation, \a propertiesStyle is ignored. - */ - File(IOStream *stream, bool readProperties = true, - Properties::ReadStyle propertiesStyle = Properties::Average); - - /*! - * Destroys this instance of the File. - */ - virtual ~File(); - - /*! - * Returns the XiphComment for this file. XiphComment implements the tag - * interface, so this serves as the reimplementation of - * TagLib::File::tag(). - */ - virtual Ogg::XiphComment *tag() const; - - /*! - * Implements the unified property interface -- export function. - * This forwards directly to XiphComment::properties(). - */ - PropertyMap properties() const; - - /*! - * Implements the unified tag dictionary interface -- import function. - * Like properties(), this is a forwarder to the file's XiphComment. - */ - PropertyMap setProperties(const PropertyMap &); - - /*! - * Returns the Opus::Properties for this file. If no audio properties - * were read then this will return a null pointer. - */ - virtual Properties *audioProperties() const; - - /*! - * Save the file. - * - * This returns true if the save was successful. - * - * \warning In the current implementation, it's dangerous to call save() - * repeatedly. It leads to a segfault. - */ - virtual bool save(); - - private: - File(const File &); - File &operator=(const File &); - - void read(bool readProperties); - - class FilePrivate; - FilePrivate *d; - }; - } - } -} - -#endif diff --git a/3rdparty/taglib/include/taglib/opusproperties.h b/3rdparty/taglib/include/taglib/opusproperties.h deleted file mode 100644 index be88b14..0000000 --- a/3rdparty/taglib/include/taglib/opusproperties.h +++ /dev/null @@ -1,134 +0,0 @@ -/*************************************************************************** - copyright : (C) 2012 by Lukáš Lalinský - email : lalinsky@gmail.com - - copyright : (C) 2002 - 2008 by Scott Wheeler - email : wheeler@kde.org - (original Vorbis implementation) -***************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * - * 02110-1301 USA * - * * - * Alternatively, this file is available under the Mozilla Public * - * License Version 1.1. You may obtain a copy of the License at * - * http://www.mozilla.org/MPL/ * - ***************************************************************************/ - -#ifndef TAGLIB_OPUSPROPERTIES_H -#define TAGLIB_OPUSPROPERTIES_H - -#include "audioproperties.h" - -namespace TagLib { - - namespace Ogg { - - namespace Opus { - - class File; - - //! An implementation of audio property reading for Ogg Opus - - /*! - * This reads the data from an Ogg Opus stream found in the AudioProperties - * API. - */ - - class TAGLIB_EXPORT Properties : public AudioProperties - { - public: - /*! - * Create an instance of Opus::Properties with the data read from the - * Opus::File \a file. - */ - Properties(File *file, ReadStyle style = Average); - - /*! - * Destroys this Opus::Properties instance. - */ - virtual ~Properties(); - - /*! - * Returns the length of the file in seconds. The length is rounded down to - * the nearest whole second. - * - * \note This method is just an alias of lengthInSeconds(). - * - * \deprecated - */ - virtual int length() const; - - /*! - * Returns the length of the file in seconds. The length is rounded down to - * the nearest whole second. - * - * \see lengthInMilliseconds() - */ - // BIC: make virtual - int lengthInSeconds() const; - - /*! - * Returns the length of the file in milliseconds. - * - * \see lengthInSeconds() - */ - // BIC: make virtual - int lengthInMilliseconds() const; - - /*! - * Returns the average bit rate of the file in kb/s. - */ - virtual int bitrate() const; - - /*! - * Returns the sample rate in Hz. - * - * \note Always returns 48000, because Opus can decode any stream at a - * sample rate of 8, 12, 16, 24, or 48 kHz, - */ - virtual int sampleRate() const; - - /*! - * Returns the number of audio channels. - */ - virtual int channels() const; - - /*! - * The Opus codec supports decoding at multiple sample rates, there is no - * single sample rate of the encoded stream. This returns the sample rate - * of the original audio stream. - */ - int inputSampleRate() const; - - /*! - * Returns the Opus version, in the range 0...255. - */ - int opusVersion() const; - - private: - Properties(const Properties &); - Properties &operator=(const Properties &); - - void read(File *file); - - class PropertiesPrivate; - PropertiesPrivate *d; - }; - } - } -} - -#endif diff --git a/3rdparty/taglib/include/taglib/ownershipframe.h b/3rdparty/taglib/include/taglib/ownershipframe.h deleted file mode 100644 index 06a1e23..0000000 --- a/3rdparty/taglib/include/taglib/ownershipframe.h +++ /dev/null @@ -1,151 +0,0 @@ -/*************************************************************************** - copyright : (C) 2012 by Rupert Daniel - email : rupert@cancelmonday.com - ***************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * - * 02110-1301 USA * - * * - * Alternatively, this file is available under the Mozilla Public * - * License Version 1.1. You may obtain a copy of the License at * - * http://www.mozilla.org/MPL/ * - ***************************************************************************/ - -#ifndef TAGLIB_OWNERSHIPFRAME_H -#define TAGLIB_OWNERSHIPFRAME_H - -#include "id3v2frame.h" -#include "taglib_export.h" - -namespace TagLib { - - namespace ID3v2 { - - //! An implementation of ID3v2 "ownership" - - /*! - * This implements the ID3v2 ownership (OWNE frame). It consists of - * a price paid, a date purchased (YYYYMMDD) and the name of the seller. - */ - - class TAGLIB_EXPORT OwnershipFrame : public Frame - { - friend class FrameFactory; - - public: - /*! - * Construct an empty ownership frame. - */ - explicit OwnershipFrame(String::Type encoding = String::Latin1); - - /*! - * Construct a ownership based on the data in \a data. - */ - explicit OwnershipFrame(const ByteVector &data); - - /*! - * Destroys this OwnershipFrame instance. - */ - virtual ~OwnershipFrame(); - - /*! - * Returns the text of this popularimeter. - * - * \see text() - */ - virtual String toString() const; - - /*! - * Returns the date purchased. - * - * \see setDatePurchased() - */ - String datePurchased() const; - - /*! - * Set the date purchased. - * - * \see datePurchased() - */ - void setDatePurchased(const String &datePurchased); - - /*! - * Returns the price paid. - * - * \see setPricePaid() - */ - String pricePaid() const; - - /*! - * Set the price paid. - * - * \see pricePaid() - */ - void setPricePaid(const String &pricePaid); - - /*! - * Returns the seller. - * - * \see setSeller() - */ - String seller() const; - - /*! - * Set the seller. - * - * \see seller() - */ - void setSeller(const String &seller); - - /*! - * Returns the text encoding that will be used in rendering this frame. - * This defaults to the type that was either specified in the constructor - * or read from the frame when parsed. - * - * \see setTextEncoding() - * \see render() - */ - String::Type textEncoding() const; - - /*! - * Sets the text encoding to be used when rendering this frame to - * \a encoding. - * - * \see textEncoding() - * \see render() - */ - void setTextEncoding(String::Type encoding); - - protected: - // Reimplementations. - - virtual void parseFields(const ByteVector &data); - virtual ByteVector renderFields() const; - - private: - /*! - * The constructor used by the FrameFactory. - */ - OwnershipFrame(const ByteVector &data, Header *h); - OwnershipFrame(const OwnershipFrame &); - OwnershipFrame &operator=(const OwnershipFrame &); - - class OwnershipFramePrivate; - OwnershipFramePrivate *d; - }; - - } -} -#endif diff --git a/3rdparty/taglib/include/taglib/popularimeterframe.h b/3rdparty/taglib/include/taglib/popularimeterframe.h deleted file mode 100644 index 79b88cb..0000000 --- a/3rdparty/taglib/include/taglib/popularimeterframe.h +++ /dev/null @@ -1,132 +0,0 @@ -/*************************************************************************** - copyright : (C) 2008 by Lukas Lalinsky - email : lalinsky@gmail.com - ***************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * - * 02110-1301 USA * - * * - * Alternatively, this file is available under the Mozilla Public * - * License Version 1.1. You may obtain a copy of the License at * - * http://www.mozilla.org/MPL/ * - ***************************************************************************/ - -#ifndef TAGLIB_POPULARIMETERFRAME_H -#define TAGLIB_POPULARIMETERFRAME_H - -#include "id3v2frame.h" -#include "taglib_export.h" - -namespace TagLib { - - namespace ID3v2 { - - //! An implementation of ID3v2 "popularimeter" - - /*! - * This implements the ID3v2 popularimeter (POPM frame). It consists of - * an email, a rating and an optional counter. - */ - - class TAGLIB_EXPORT PopularimeterFrame : public Frame - { - friend class FrameFactory; - - public: - /*! - * Construct an empty popularimeter frame. - */ - explicit PopularimeterFrame(); - - /*! - * Construct a popularimeter based on the data in \a data. - */ - explicit PopularimeterFrame(const ByteVector &data); - - /*! - * Destroys this PopularimeterFrame instance. - */ - virtual ~PopularimeterFrame(); - - /*! - * Returns the text of this popularimeter. - * - * \see text() - */ - virtual String toString() const; - - /*! - * Returns the email. - * - * \see setEmail() - */ - String email() const; - - /*! - * Set the email. - * - * \see email() - */ - void setEmail(const String &email); - - /*! - * Returns the rating. - * - * \see setRating() - */ - int rating() const; - - /*! - * Set the rating. - * - * \see rating() - */ - void setRating(int rating); - - /*! - * Returns the counter. - * - * \see setCounter() - */ - uint counter() const; - - /*! - * Set the counter. - * - * \see counter() - */ - void setCounter(uint counter); - - protected: - // Reimplementations. - - virtual void parseFields(const ByteVector &data); - virtual ByteVector renderFields() const; - - private: - /*! - * The constructor used by the FrameFactory. - */ - PopularimeterFrame(const ByteVector &data, Header *h); - PopularimeterFrame(const PopularimeterFrame &); - PopularimeterFrame &operator=(const PopularimeterFrame &); - - class PopularimeterFramePrivate; - PopularimeterFramePrivate *d; - }; - - } -} -#endif diff --git a/3rdparty/taglib/include/taglib/privateframe.h b/3rdparty/taglib/include/taglib/privateframe.h deleted file mode 100644 index 06f82f3..0000000 --- a/3rdparty/taglib/include/taglib/privateframe.h +++ /dev/null @@ -1,111 +0,0 @@ -/*************************************************************************** - copyright : (C) 2008 by Serkan Kalyoncu - copyright : (C) 2008 by Scott Wheeler - email : wheeler@kde.org -***************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * - * 02110-1301 USA * - * * - * Alternatively, this file is available under the Mozilla Public * - * License Version 1.1. You may obtain a copy of the License at * - * http://www.mozilla.org/MPL/ * - ***************************************************************************/ - -#ifndef TAGLIB_PRIVATEFRAME_H -#define TAGLIB_PRIVATEFRAME_H - -#include "id3v2frame.h" -#include "taglib_export.h" - -namespace TagLib { - - namespace ID3v2 { - - //! An implementation of ID3v2 privateframe - - class TAGLIB_EXPORT PrivateFrame : public Frame - { - friend class FrameFactory; - - public: - /*! - * Construct an empty private frame. - */ - PrivateFrame(); - - /*! - * Construct a private frame based on the data in \a data. - * - * \note This is the constructor used when parsing the frame from a file. - */ - explicit PrivateFrame(const ByteVector &data); - - /*! - * Destroys this private frame instance. - */ - virtual ~PrivateFrame(); - - /*! - * Returns the text of this private frame, currently just the owner. - * - * \see text() - */ - virtual String toString() const; - - /*! - * \return The owner of the private frame. - * \note This should contain an email address or link to a website. - */ - String owner() const; - - /*! - * - */ - ByteVector data() const; - - /*! - * Sets the owner of the frame to \a s. - * \note This should contain an email address or link to a website. - */ - void setOwner(const String &s); - - /*! - * - */ - void setData(const ByteVector &v); - - protected: - // Reimplementations. - - virtual void parseFields(const ByteVector &data); - virtual ByteVector renderFields() const; - - private: - /*! - * The constructor used by the FrameFactory. - */ - PrivateFrame(const ByteVector &data, Header *h); - - PrivateFrame(const PrivateFrame &); - PrivateFrame &operator=(const PrivateFrame &); - - class PrivateFramePrivate; - PrivateFramePrivate *d; - }; - - } -} -#endif diff --git a/3rdparty/taglib/include/taglib/relativevolumeframe.h b/3rdparty/taglib/include/taglib/relativevolumeframe.h deleted file mode 100644 index 695e26f..0000000 --- a/3rdparty/taglib/include/taglib/relativevolumeframe.h +++ /dev/null @@ -1,274 +0,0 @@ -/*************************************************************************** - copyright : (C) 2002 - 2008 by Scott Wheeler - email : wheeler@kde.org - ***************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * - * 02110-1301 USA * - * * - * Alternatively, this file is available under the Mozilla Public * - * License Version 1.1. You may obtain a copy of the License at * - * http://www.mozilla.org/MPL/ * - ***************************************************************************/ - -#ifndef TAGLIB_RELATIVEVOLUMEFRAME_H -#define TAGLIB_RELATIVEVOLUMEFRAME_H - -#include "tlist.h" -#include "id3v2frame.h" -#include "taglib_export.h" - -namespace TagLib { - - namespace ID3v2 { - - //! An ID3v2 relative volume adjustment frame implementation - - /*! - * This is an implementation of ID3v2 relative volume adjustment. The - * presence of this frame makes it possible to specify an increase in volume - * for an audio file or specific audio tracks in that file. - * - * Multiple relative volume adjustment frames may be present in the tag - * each with a unique identification and describing volume adjustment for - * different channel types. - */ - - class TAGLIB_EXPORT RelativeVolumeFrame : public Frame - { - friend class FrameFactory; - - public: - - /*! - * This indicates the type of volume adjustment that should be applied. - */ - enum ChannelType { - //! A type not enumerated below - Other = 0x00, - //! The master volume for the track - MasterVolume = 0x01, - //! The front right audio channel - FrontRight = 0x02, - //! The front left audio channel - FrontLeft = 0x03, - //! The back right audio channel - BackRight = 0x04, - //! The back left audio channel - BackLeft = 0x05, - //! The front center audio channel - FrontCentre = 0x06, - //! The back center audio channel - BackCentre = 0x07, - //! The subwoofer audio channel - Subwoofer = 0x08 - }; - - //! Struct that stores the relevant values for ID3v2 peak volume - - /*! - * The peak volume is described as a series of bits that is padded to fill - * a block of bytes. These two values should always be updated in tandem. - */ - struct PeakVolume - { - /*! - * Constructs an empty peak volume description. - */ - PeakVolume() : bitsRepresentingPeak(0) {} - /*! - * The number of bits (in the range of 0 to 255) used to describe the - * peak volume. - */ - unsigned char bitsRepresentingPeak; - /*! - * The array of bits (represented as a series of bytes) used to describe - * the peak volume. - */ - ByteVector peakVolume; - }; - - /*! - * Constructs a RelativeVolumeFrame. The relevant data should be set - * manually. - */ - RelativeVolumeFrame(); - - /*! - * Constructs a RelativeVolumeFrame based on the contents of \a data. - */ - RelativeVolumeFrame(const ByteVector &data); - - /*! - * Destroys the RelativeVolumeFrame instance. - */ - virtual ~RelativeVolumeFrame(); - - /*! - * Returns the frame's identification. - * - * \see identification() - */ - virtual String toString() const; - - /*! - * Returns a list of channels with information currently in the frame. - */ - List channels() const; - - /*! - * \deprecated Always returns master volume. - */ - ChannelType channelType() const; - - /*! - * \deprecated This method no longer has any effect. - */ - void setChannelType(ChannelType t); - - /* - * There was a terrible API goof here, and while this can't be changed to - * the way it appears below for binary compatibility reasons, let's at - * least pretend that it looks clean. - */ - -#ifdef DOXYGEN - - /*! - * Returns the relative volume adjustment "index". As indicated by the - * ID3v2 standard this is a 16-bit signed integer that reflects the - * decibels of adjustment when divided by 512. - * - * This defaults to returning the value for the master volume channel if - * available and returns 0 if the specified channel does not exist. - * - * \see setVolumeAdjustmentIndex() - * \see volumeAjustment() - */ - short volumeAdjustmentIndex(ChannelType type = MasterVolume) const; - - /*! - * Set the volume adjustment to \a index. As indicated by the ID3v2 - * standard this is a 16-bit signed integer that reflects the decibels of - * adjustment when divided by 512. - * - * By default this sets the value for the master volume. - * - * \see volumeAdjustmentIndex() - * \see setVolumeAjustment() - */ - void setVolumeAdjustmentIndex(short index, ChannelType type = MasterVolume); - - /*! - * Returns the relative volume adjustment in decibels. - * - * \note Because this is actually stored internally as an "index" to this - * value the value returned by this method may not be identical to the - * value set using setVolumeAdjustment(). - * - * This defaults to returning the value for the master volume channel if - * available and returns 0 if the specified channel does not exist. - * - * \see setVolumeAdjustment() - * \see volumeAdjustmentIndex() - */ - float volumeAdjustment(ChannelType type = MasterVolume) const; - - /*! - * Set the relative volume adjustment in decibels to \a adjustment. - * - * By default this sets the value for the master volume. - * - * \note Because this is actually stored internally as an "index" to this - * value the value set by this method may not be identical to the one - * returned by volumeAdjustment(). - * - * \see setVolumeAdjustment() - * \see volumeAdjustmentIndex() - */ - void setVolumeAdjustment(float adjustment, ChannelType type = MasterVolume); - - /*! - * Returns the peak volume (represented as a length and a string of bits). - * - * This defaults to returning the value for the master volume channel if - * available and returns 0 if the specified channel does not exist. - * - * \see setPeakVolume() - */ - PeakVolume peakVolume(ChannelType type = MasterVolume) const; - - /*! - * Sets the peak volume to \a peak. - * - * By default this sets the value for the master volume. - * - * \see peakVolume() - */ - void setPeakVolume(const PeakVolume &peak, ChannelType type = MasterVolume); - -#else - - // BIC: Combine each of the following pairs of functions (or maybe just - // rework this junk altogether). - - short volumeAdjustmentIndex(ChannelType type) const; - short volumeAdjustmentIndex() const; - - void setVolumeAdjustmentIndex(short index, ChannelType type); - void setVolumeAdjustmentIndex(short index); - - float volumeAdjustment(ChannelType type) const; - float volumeAdjustment() const; - - void setVolumeAdjustment(float adjustment, ChannelType type); - void setVolumeAdjustment(float adjustment); - - PeakVolume peakVolume(ChannelType type) const; - PeakVolume peakVolume() const; - - void setPeakVolume(const PeakVolume &peak, ChannelType type); - void setPeakVolume(const PeakVolume &peak); - -#endif - - /*! - * Returns the identification for this frame. - */ - String identification() const; - - /*! - * Sets the identification of the frame to \a s. The string - * is used to identify the situation and/or device where this - * adjustment should apply. - */ - void setIdentification(const String &s); - - protected: - virtual void parseFields(const ByteVector &data); - virtual ByteVector renderFields() const; - - private: - RelativeVolumeFrame(const ByteVector &data, Header *h); - RelativeVolumeFrame(const RelativeVolumeFrame &); - RelativeVolumeFrame &operator=(const RelativeVolumeFrame &); - - class RelativeVolumeFramePrivate; - RelativeVolumeFramePrivate *d; - }; - - } -} -#endif diff --git a/3rdparty/taglib/include/taglib/rifffile.h b/3rdparty/taglib/include/taglib/rifffile.h deleted file mode 100644 index 11d2b71..0000000 --- a/3rdparty/taglib/include/taglib/rifffile.h +++ /dev/null @@ -1,157 +0,0 @@ -/*************************************************************************** - copyright : (C) 2002 - 2008 by Scott Wheeler - email : wheeler@kde.org - ***************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * - * 02110-1301 USA * - * * - * Alternatively, this file is available under the Mozilla Public * - * License Version 1.1. You may obtain a copy of the License at * - * http://www.mozilla.org/MPL/ * - ***************************************************************************/ - -#ifndef TAGLIB_RIFFFILE_H -#define TAGLIB_RIFFFILE_H - -#include "taglib_export.h" -#include "tfile.h" - -namespace TagLib { - - //! An implementation of TagLib::File with RIFF specific methods - - namespace RIFF { - - //! An RIFF file class with some useful methods specific to RIFF - - /*! - * This implements the generic TagLib::File API and additionally provides - * access to properties that are distinct to RIFF files, notably access - * to the different ID3 tags. - */ - - class TAGLIB_EXPORT File : public TagLib::File - { - public: - /*! - * Destroys this instance of the File. - */ - virtual ~File(); - - protected: - - enum Endianness { BigEndian, LittleEndian }; - - File(FileName file, Endianness endianness); - File(IOStream *stream, Endianness endianness); - - /*! - * \return The size of the main RIFF chunk. - */ - uint riffSize() const; - - /*! - * \return The number of chunks in the file. - */ - uint chunkCount() const; - - /*! - * \return The offset within the file for the selected chunk number. - */ - uint chunkOffset(uint i) const; - - /*! - * \return The size of the chunk data. - */ - uint chunkDataSize(uint i) const; - - /*! - * \return The size of the padding after the chunk (can be either 0 or 1). - */ - uint chunkPadding(uint i) const; - - /*! - * \return The name of the specified chunk, for instance, "COMM" or "ID3 " - */ - ByteVector chunkName(uint i) const; - - /*! - * Reads the chunk data from the file and returns it. - * - * \note This \e will move the read pointer for the file. - */ - ByteVector chunkData(uint i); - - /*! - * Sets the data for the specified chunk to \a data. - * - * \warning This will update the file immediately. - */ - void setChunkData(uint i, const ByteVector &data); - - /*! - * Sets the data for the chunk \a name to \a data. If a chunk with the - * given name already exists it will be overwritten, otherwise it will be - * created after the existing chunks. - * - * \warning This will update the file immediately. - */ - void setChunkData(const ByteVector &name, const ByteVector &data); - - /*! - * Sets the data for the chunk \a name to \a data. If a chunk with the - * given name already exists it will be overwritten, otherwise it will be - * created after the existing chunks. - * - * \note If \a alwaysCreate is true, a new chunk is created regardless of - * whether or not the chunk \a name exists. It should only be used for - * "LIST" chunks. - * - * \warning This will update the file immediately. - */ - void setChunkData(const ByteVector &name, const ByteVector &data, bool alwaysCreate); - - /*! - * Removes the specified chunk. - * - * \warning This will update the file immediately. - */ - void removeChunk(uint i); - - /*! - * Removes the chunk \a name. - * - * \warning This will update the file immediately. - * \warning This removes all the chunks with the given name. - */ - void removeChunk(const ByteVector &name); - - private: - File(const File &); - File &operator=(const File &); - - void read(); - void writeChunk(const ByteVector &name, const ByteVector &data, - ulong offset, ulong replace = 0, - uint leadingPadding = 0); - - class FilePrivate; - FilePrivate *d; - }; - } -} - -#endif diff --git a/3rdparty/taglib/include/taglib/s3mfile.h b/3rdparty/taglib/include/taglib/s3mfile.h deleted file mode 100644 index 5f45297..0000000 --- a/3rdparty/taglib/include/taglib/s3mfile.h +++ /dev/null @@ -1,108 +0,0 @@ -/*************************************************************************** - copyright : (C) 2011 by Mathias Panzenböck - email : grosser.meister.morti@gmx.net - ***************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * - * MA 02110-1301 USA * - ***************************************************************************/ - -#ifndef TAGLIB_S3MFILE_H -#define TAGLIB_S3MFILE_H - -#include "tfile.h" -#include "audioproperties.h" -#include "taglib_export.h" -#include "modfilebase.h" -#include "modtag.h" -#include "s3mproperties.h" - -namespace TagLib { - - namespace S3M { - - class TAGLIB_EXPORT File : public Mod::FileBase { - public: - /*! - * Constructs a ScreamTracker III from \a file. - * - * \note In the current implementation, both \a readProperties and - * \a propertiesStyle are ignored. The audio properties are always - * read. - */ - File(FileName file, bool readProperties = true, - AudioProperties::ReadStyle propertiesStyle = - AudioProperties::Average); - - /*! - * Constructs a ScreamTracker III file from \a stream. - * - * \note In the current implementation, both \a readProperties and - * \a propertiesStyle are ignored. The audio properties are always - * read. - * - * \note TagLib will *not* take ownership of the stream, the caller is - * responsible for deleting it after the File object. - */ - File(IOStream *stream, bool readProperties = true, - AudioProperties::ReadStyle propertiesStyle = - AudioProperties::Average); - - /*! - * Destroys this instance of the File. - */ - virtual ~File(); - - Mod::Tag *tag() const; - - /*! - * Implements the unified property interface -- export function. - * Forwards to Mod::Tag::properties(). - */ - PropertyMap properties() const; - - /*! - * Implements the unified property interface -- import function. - * Forwards to Mod::Tag::setProperties(). - */ - PropertyMap setProperties(const PropertyMap &); - - /*! - * Returns the S3M::Properties for this file. If no audio properties - * were read then this will return a null pointer. - */ - S3M::Properties *audioProperties() const; - - /*! - * Save the file. - * This is the same as calling save(AllTags); - * - * \note Saving ScreamTracker III tags is not supported. - */ - bool save(); - - private: - File(const File &); - File &operator=(const File &); - - void read(bool readProperties); - - class FilePrivate; - FilePrivate *d; - }; - } -} - -#endif diff --git a/3rdparty/taglib/include/taglib/s3mproperties.h b/3rdparty/taglib/include/taglib/s3mproperties.h deleted file mode 100644 index 4499627..0000000 --- a/3rdparty/taglib/include/taglib/s3mproperties.h +++ /dev/null @@ -1,90 +0,0 @@ -/*************************************************************************** - copyright : (C) 2011 by Mathias Panzenböck - email : grosser.meister.morti@gmx.net - ***************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * - * MA 02110-1301 USA * - ***************************************************************************/ - -#ifndef TAGLIB_S3MPROPERTIES_H -#define TAGLIB_S3MPROPERTIES_H - -#include "taglib.h" -#include "audioproperties.h" - -namespace TagLib { - namespace S3M { - class TAGLIB_EXPORT Properties : public AudioProperties { - friend class File; - public: - /*! Flag bits. */ - enum { - ST2Vibrato = 1, - ST2Tempo = 2, - AmigaSlides = 4, - Vol0MixOptimizations = 8, - AmigaLimits = 16, - EnableFilter = 32, - CustomData = 128 - }; - - Properties(AudioProperties::ReadStyle propertiesStyle); - virtual ~Properties(); - - int length() const; - int lengthInSeconds() const; - int lengthInMilliseconds() const; - int bitrate() const; - int sampleRate() const; - int channels() const; - - ushort lengthInPatterns() const; - bool stereo() const; - ushort sampleCount() const; - ushort patternCount() const; - ushort flags() const; - ushort trackerVersion() const; - ushort fileFormatVersion() const; - uchar globalVolume() const; - uchar masterVolume() const; - uchar tempo() const; - uchar bpmSpeed() const; - - void setChannels(int channels); - - void setLengthInPatterns (ushort lengthInPatterns); - void setStereo (bool stereo); - void setSampleCount (ushort sampleCount); - void setPatternCount (ushort patternCount); - void setFlags (ushort flags); - void setTrackerVersion (ushort trackerVersion); - void setFileFormatVersion(ushort fileFormatVersion); - void setGlobalVolume (uchar globalVolume); - void setMasterVolume (uchar masterVolume); - void setTempo (uchar tempo); - void setBpmSpeed (uchar bpmSpeed); - - private: - Properties(const Properties&); - Properties &operator=(const Properties&); - - class PropertiesPrivate; - PropertiesPrivate *d; - }; - } -} - -#endif diff --git a/3rdparty/taglib/include/taglib/speexfile.h b/3rdparty/taglib/include/taglib/speexfile.h deleted file mode 100644 index de38bfb..0000000 --- a/3rdparty/taglib/include/taglib/speexfile.h +++ /dev/null @@ -1,132 +0,0 @@ -/*************************************************************************** - copyright : (C) 2006 by Lukáš Lalinský - email : lalinsky@gmail.com - - copyright : (C) 2002 - 2008 by Scott Wheeler - email : wheeler@kde.org - (original Vorbis implementation) -***************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * - * 02110-1301 USA * - * * - * Alternatively, this file is available under the Mozilla Public * - * License Version 1.1. You may obtain a copy of the License at * - * http://www.mozilla.org/MPL/ * - ***************************************************************************/ - -#ifndef TAGLIB_SPEEXFILE_H -#define TAGLIB_SPEEXFILE_H - -#include "oggfile.h" -#include "xiphcomment.h" - -#include "speexproperties.h" - -namespace TagLib { - - namespace Ogg { - - //! A namespace containing classes for Speex metadata - - namespace Speex { - - //! An implementation of Ogg::File with Speex specific methods - - /*! - * This is the central class in the Ogg Speex metadata processing collection - * of classes. It's built upon Ogg::File which handles processing of the Ogg - * logical bitstream and breaking it down into pages which are handled by - * the codec implementations, in this case Speex specifically. - */ - - class TAGLIB_EXPORT File : public Ogg::File - { - public: - /*! - * Constructs a Speex file from \a file. If \a readProperties is true the - * file's audio properties will also be read. - * - * \note In the current implementation, \a propertiesStyle is ignored. - */ - File(FileName file, bool readProperties = true, - Properties::ReadStyle propertiesStyle = Properties::Average); - - /*! - * Constructs a Speex file from \a stream. If \a readProperties is true the - * file's audio properties will also be read. - * - * \note TagLib will *not* take ownership of the stream, the caller is - * responsible for deleting it after the File object. - * - * \note In the current implementation, \a propertiesStyle is ignored. - */ - File(IOStream *stream, bool readProperties = true, - Properties::ReadStyle propertiesStyle = Properties::Average); - - /*! - * Destroys this instance of the File. - */ - virtual ~File(); - - /*! - * Returns the XiphComment for this file. XiphComment implements the tag - * interface, so this serves as the reimplementation of - * TagLib::File::tag(). - */ - virtual Ogg::XiphComment *tag() const; - - /*! - * Implements the unified property interface -- export function. - * This forwards directly to XiphComment::properties(). - */ - PropertyMap properties() const; - - /*! - * Implements the unified tag dictionary interface -- import function. - * Like properties(), this is a forwarder to the file's XiphComment. - */ - PropertyMap setProperties(const PropertyMap &); - - /*! - * Returns the Speex::Properties for this file. If no audio properties - * were read then this will return a null pointer. - */ - virtual Properties *audioProperties() const; - - /*! - * Save the file. - * - * This returns true if the save was successful. - * - * \warning In the current implementation, it's dangerous to call save() - * repeatedly. It leads to a segfault. - */ - virtual bool save(); - - private: - File(const File &); - File &operator=(const File &); - - void read(bool readProperties); - - class FilePrivate; - FilePrivate *d; - }; - } - } -} - -#endif diff --git a/3rdparty/taglib/include/taglib/speexproperties.h b/3rdparty/taglib/include/taglib/speexproperties.h deleted file mode 100644 index 64e6fac..0000000 --- a/3rdparty/taglib/include/taglib/speexproperties.h +++ /dev/null @@ -1,129 +0,0 @@ -/*************************************************************************** - copyright : (C) 2006 by Lukáš Lalinský - email : lalinsky@gmail.com - - copyright : (C) 2002 - 2008 by Scott Wheeler - email : wheeler@kde.org - (original Vorbis implementation) -***************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * - * 02110-1301 USA * - * * - * Alternatively, this file is available under the Mozilla Public * - * License Version 1.1. You may obtain a copy of the License at * - * http://www.mozilla.org/MPL/ * - ***************************************************************************/ - -#ifndef TAGLIB_SPEEXPROPERTIES_H -#define TAGLIB_SPEEXPROPERTIES_H - -#include "audioproperties.h" - -namespace TagLib { - - namespace Ogg { - - namespace Speex { - - class File; - - //! An implementation of audio property reading for Ogg Speex - - /*! - * This reads the data from an Ogg Speex stream found in the AudioProperties - * API. - */ - - class TAGLIB_EXPORT Properties : public AudioProperties - { - public: - /*! - * Create an instance of Speex::Properties with the data read from the - * Speex::File \a file. - */ - Properties(File *file, ReadStyle style = Average); - - /*! - * Destroys this Speex::Properties instance. - */ - virtual ~Properties(); - - /*! - * Returns the length of the file in seconds. The length is rounded down to - * the nearest whole second. - * - * \note This method is just an alias of lengthInSeconds(). - * - * \deprecated - */ - virtual int length() const; - - /*! - * Returns the length of the file in seconds. The length is rounded down to - * the nearest whole second. - * - * \see lengthInMilliseconds() - */ - // BIC: make virtual - int lengthInSeconds() const; - - /*! - * Returns the length of the file in milliseconds. - * - * \see lengthInSeconds() - */ - // BIC: make virtual - int lengthInMilliseconds() const; - - /*! - * Returns the average bit rate of the file in kb/s. - */ - virtual int bitrate() const; - - /*! - * Returns the nominal bit rate as read from the Speex header in kb/s. - */ - int bitrateNominal() const; - - /*! - * Returns the sample rate in Hz. - */ - virtual int sampleRate() const; - - /*! - * Returns the number of audio channels. - */ - virtual int channels() const; - - /*! - * Returns the Speex version, currently "0" (as specified by the spec). - */ - int speexVersion() const; - - private: - Properties(const Properties &); - Properties &operator=(const Properties &); - - void read(File *file); - - class PropertiesPrivate; - PropertiesPrivate *d; - }; - } - } -} - -#endif diff --git a/3rdparty/taglib/include/taglib/synchronizedlyricsframe.h b/3rdparty/taglib/include/taglib/synchronizedlyricsframe.h deleted file mode 100644 index 704ac4b..0000000 --- a/3rdparty/taglib/include/taglib/synchronizedlyricsframe.h +++ /dev/null @@ -1,231 +0,0 @@ -/*************************************************************************** - copyright : (C) 2014 by Urs Fleisch - email : ufleisch@users.sourceforge.net - ***************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * - * 02110-1301 USA * - * * - * Alternatively, this file is available under the Mozilla Public * - * License Version 1.1. You may obtain a copy of the License at * - * http://www.mozilla.org/MPL/ * - ***************************************************************************/ - -#ifndef TAGLIB_SYNCHRONIZEDLYRICSFRAME_H -#define TAGLIB_SYNCHRONIZEDLYRICSFRAME_H - -#include "id3v2frame.h" -#include "tlist.h" - -namespace TagLib { - - namespace ID3v2 { - - //! ID3v2 synchronized lyrics frame - /*! - * An implementation of ID3v2 synchronized lyrics. - */ - class TAGLIB_EXPORT SynchronizedLyricsFrame : public Frame - { - friend class FrameFactory; - - public: - - /*! - * Specifies the timestamp format used. - */ - enum TimestampFormat { - //! The timestamp is of unknown format. - Unknown = 0x00, - //! The timestamp represents the number of MPEG frames since - //! the beginning of the audio stream. - AbsoluteMpegFrames = 0x01, - //! The timestamp represents the number of milliseconds since - //! the beginning of the audio stream. - AbsoluteMilliseconds = 0x02 - }; - - /*! - * Specifies the type of text contained. - */ - enum Type { - //! The text is some other type of text. - Other = 0x00, - //! The text contains lyrical data. - Lyrics = 0x01, - //! The text contains a transcription. - TextTranscription = 0x02, - //! The text lists the movements in the piece. - Movement = 0x03, - //! The text describes events that occur. - Events = 0x04, - //! The text contains chord changes that occur in the music. - Chord = 0x05, - //! The text contains trivia or "pop up" information about the media. - Trivia = 0x06, - //! The text contains URLs for relevant webpages. - WebpageUrls = 0x07, - //! The text contains URLs for relevant images. - ImageUrls = 0x08 - }; - - /*! - * Single entry of time stamp and lyrics text. - */ - struct SynchedText { - SynchedText(uint ms, String str) : time(ms), text(str) {} - uint time; - String text; - }; - - /*! - * List of synchronized lyrics. - */ - typedef TagLib::List SynchedTextList; - - /*! - * Construct an empty synchronized lyrics frame that will use the text - * encoding \a encoding. - */ - explicit SynchronizedLyricsFrame(String::Type encoding = String::Latin1); - - /*! - * Construct a synchronized lyrics frame based on the data in \a data. - */ - explicit SynchronizedLyricsFrame(const ByteVector &data); - - /*! - * Destroys this SynchronizedLyricsFrame instance. - */ - virtual ~SynchronizedLyricsFrame(); - - /*! - * Returns the description of this synchronized lyrics frame. - * - * \see description() - */ - virtual String toString() const; - - /*! - * Returns the text encoding that will be used in rendering this frame. - * This defaults to the type that was either specified in the constructor - * or read from the frame when parsed. - * - * \see setTextEncoding() - * \see render() - */ - String::Type textEncoding() const; - - /*! - * Returns the language encoding as a 3 byte encoding as specified by - * ISO-639-2. - * - * \note Most taggers simply ignore this value. - * - * \see setLanguage() - */ - ByteVector language() const; - - /*! - * Returns the timestamp format. - */ - TimestampFormat timestampFormat() const; - - /*! - * Returns the type of text contained. - */ - Type type() const; - - /*! - * Returns the description of this synchronized lyrics frame. - * - * \note Most taggers simply ignore this value. - * - * \see setDescription() - */ - String description() const; - - /*! - * Returns the text with the time stamps. - */ - SynchedTextList synchedText() const; - - /*! - * Sets the text encoding to be used when rendering this frame to - * \a encoding. - * - * \see textEncoding() - * \see render() - */ - void setTextEncoding(String::Type encoding); - - /*! - * Set the language using the 3 byte language code from - * ISO-639-2 to - * \a languageCode. - * - * \see language() - */ - void setLanguage(const ByteVector &languageCode); - - /*! - * Set the timestamp format. - * - * \see timestampFormat() - */ - void setTimestampFormat(TimestampFormat f); - - /*! - * Set the type of text contained. - * - * \see type() - */ - void setType(Type t); - - /*! - * Sets the description of the synchronized lyrics frame to \a s. - * - * \see description() - */ - void setDescription(const String &s); - - /*! - * Sets the text with the time stamps. - * - * \see text() - */ - void setSynchedText(const SynchedTextList &t); - - protected: - // Reimplementations. - - virtual void parseFields(const ByteVector &data); - virtual ByteVector renderFields() const; - - private: - /*! - * The constructor used by the FrameFactory. - */ - SynchronizedLyricsFrame(const ByteVector &data, Header *h); - SynchronizedLyricsFrame(const SynchronizedLyricsFrame &); - SynchronizedLyricsFrame &operator=(const SynchronizedLyricsFrame &); - - class SynchronizedLyricsFramePrivate; - SynchronizedLyricsFramePrivate *d; - }; - - } -} -#endif diff --git a/3rdparty/taglib/include/taglib/tableofcontentsframe.h b/3rdparty/taglib/include/taglib/tableofcontentsframe.h deleted file mode 100644 index 66facf8..0000000 --- a/3rdparty/taglib/include/taglib/tableofcontentsframe.h +++ /dev/null @@ -1,258 +0,0 @@ -/*************************************************************************** - copyright : (C) 2013 by Lukas Krejci - email : krejclu6@fel.cvut.cz - ***************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * - * 02110-1301 USA * - * * - * Alternatively, this file is available under the Mozilla Public * - * License Version 1.1. You may obtain a copy of the License at * - * http://www.mozilla.org/MPL/ * - ***************************************************************************/ - -#ifndef TAGLIB_TABLEOFCONTENTSFRAME -#define TAGLIB_TABLEOFCONTENTSFRAME - -#include "id3v2tag.h" -#include "id3v2frame.h" - -namespace TagLib { - - namespace ID3v2 { - - /*! - * This is an implementation of ID3v2 table of contents frames. Purpose - * of this frame is to allow a table of contents to be defined. - */ - - //! An implementation of ID3v2 table of contents frames - - class TAGLIB_EXPORT TableOfContentsFrame : public ID3v2::Frame - { - friend class FrameFactory; - - public: - /*! - * Creates a table of contents frame based on \a data. \a tagHeader is - * required as the internal frames are parsed based on the tag version. - */ - TableOfContentsFrame(const ID3v2::Header *tagHeader, const ByteVector &data); - - /*! - * Creates a table of contents frame with the element ID \a elementID, - * the child elements \a children and embedded frames, which become owned - * by this frame, in \a embeddedFrames. - */ - TableOfContentsFrame(const ByteVector &elementID, - const ByteVectorList &children = ByteVectorList(), - const FrameList &embeddedFrames = FrameList()); - - /*! - * Destroys the frame. - */ - ~TableOfContentsFrame(); - - /*! - * Returns the elementID of the frame. Element ID - * is a null terminated string, however it's not human-readable. - * - * \see setElementID() - */ - ByteVector elementID() const; - - /*! - * Returns true, if the frame is top-level (doesn't have - * any parent CTOC frame). - * - * \see setIsTopLevel() - */ - bool isTopLevel() const; - - /*! - * Returns true, if the child elements list entries - * are ordered. - * - * \see setIsOrdered() - */ - bool isOrdered() const; - - /*! - * Returns count of child elements of the frame. It always - * corresponds to size of child elements list. - * - * \see childElements() - */ - uint entryCount() const; - - /*! - * Returns list of child elements of the frame. - * - * \see setChildElements() - */ - ByteVectorList childElements() const; - - /*! - * Sets the elementID of the frame to \a eID. If \a eID isn't - * null terminated, a null char is appended automatically. - * - * \see elementID() - */ - void setElementID(const ByteVector &eID); - - /*! - * Sets, if the frame is top-level (doesn't have - * any parent CTOC frame). - * - * \see isTopLevel() - */ - void setIsTopLevel(const bool &t); - - /*! - * Sets, if the child elements list entries - * are ordered. - * - * \see isOrdered() - */ - void setIsOrdered(const bool &o); - - /*! - * Sets list of child elements of the frame to \a l. - * - * \see childElements() - */ - void setChildElements(const ByteVectorList &l); - - /*! - * Adds \a cE to list of child elements of the frame. - * - * \see childElements() - */ - void addChildElement(const ByteVector &cE); - - /*! - * Removes \a cE to list of child elements of the frame. - * - * \see childElements() - */ - void removeChildElement(const ByteVector &cE); - - /*! - * Returns a reference to the frame list map. This is an FrameListMap of - * all of the frames embedded in the CTOC frame. - * - * This is the most convenient structure for accessing the CTOC frame's - * embedded frames. Many frame types allow multiple instances of the same - * frame type so this is a map of lists. In most cases however there will - * only be a single frame of a certain type. - * - * \warning You should not modify this data structure directly, instead - * use addEmbeddedFrame() and removeEmbeddedFrame(). - * - * \see embeddedFrameList() - */ - const FrameListMap &embeddedFrameListMap() const; - - /*! - * Returns a reference to the embedded frame list. This is an FrameList - * of all of the frames embedded in the CTOC frame in the order that they - * were parsed. - * - * This can be useful if for example you want iterate over the CTOC frame's - * embedded frames in the order that they occur in the CTOC frame. - * - * \warning You should not modify this data structure directly, instead - * use addEmbeddedFrame() and removeEmbeddedFrame(). - */ - const FrameList &embeddedFrameList() const; - - /*! - * Returns the embedded frame list for frames with the id \a frameID - * or an empty list if there are no embedded frames of that type. This - * is just a convenience and is equivalent to: - * - * \code - * embeddedFrameListMap()[frameID]; - * \endcode - * - * \see embeddedFrameListMap() - */ - const FrameList &embeddedFrameList(const ByteVector &frameID) const; - - /*! - * Add an embedded frame to the CTOC frame. At this point the CTOC frame - * takes ownership of the embedded frame and will handle freeing its memory. - * - * \note Using this method will invalidate any pointers on the list - * returned by embeddedFrameList() - */ - void addEmbeddedFrame(Frame *frame); - - /*! - * Remove an embedded frame from the CTOC frame. If \a del is true the frame's - * memory will be freed; if it is false, it must be deleted by the user. - * - * \note Using this method will invalidate any pointers on the list - * returned by embeddedFrameList() - */ - void removeEmbeddedFrame(Frame *frame, bool del = true); - - /*! - * Remove all embedded frames of type \a id from the CTOC frame and free their - * memory. - * - * \note Using this method will invalidate any pointers on the list - * returned by embeddedFrameList() - */ - void removeEmbeddedFrames(const ByteVector &id); - - virtual String toString() const; - - PropertyMap asProperties() const; - - /*! - * CTOC frames each have a unique element ID. This searches for a CTOC - * frame with the element ID \a eID and returns a pointer to it. This - * can be used to link together parent and child CTOC frames. - * - * \see elementID() - */ - static TableOfContentsFrame *findByElementID(const Tag *tag, const ByteVector &eID); - - /*! - * CTOC frames each contain a flag that indicates, if CTOC frame is top-level (there isn't - * any frame, which contains this frame in its child elements list). Only a single frame - * within tag can be top-level. This searches for a top-level CTOC frame. - * - * \see isTopLevel() - */ - static TableOfContentsFrame *findTopLevel(const Tag *tag); - - protected: - virtual void parseFields(const ByteVector &data); - virtual ByteVector renderFields() const; - - private: - TableOfContentsFrame(const ID3v2::Header *tagHeader, const ByteVector &data, Header *h); - TableOfContentsFrame(const TableOfContentsFrame &); - TableOfContentsFrame &operator=(const TableOfContentsFrame &); - - class TableOfContentsFramePrivate; - TableOfContentsFramePrivate *d; - }; - } -} - -#endif diff --git a/3rdparty/taglib/include/taglib/tag.h b/3rdparty/taglib/include/taglib/tag.h deleted file mode 100644 index e04567b..0000000 --- a/3rdparty/taglib/include/taglib/tag.h +++ /dev/null @@ -1,201 +0,0 @@ -/*************************************************************************** - copyright : (C) 2002 - 2008 by Scott Wheeler - email : wheeler@kde.org - ***************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * - * 02110-1301 USA * - * * - * Alternatively, this file is available under the Mozilla Public * - * License Version 1.1. You may obtain a copy of the License at * - * http://www.mozilla.org/MPL/ * - ***************************************************************************/ - -#ifndef TAGLIB_TAG_H -#define TAGLIB_TAG_H - -#include "taglib_export.h" -#include "tstring.h" - -namespace TagLib { - - //! A simple, generic interface to common audio meta data fields - - /*! - * This is an attempt to abstract away the difference in the meta data formats - * of various audio codecs and tagging schemes. As such it is generally a - * subset of what is available in the specific formats but should be suitable - * for most applications. This is meant to compliment the generic APIs found - * in TagLib::AudioProperties, TagLib::File and TagLib::FileRef. - */ - - class PropertyMap; - - class TAGLIB_EXPORT Tag - { - public: - - /*! - * Destroys this Tag instance. - */ - virtual ~Tag(); - - /*! - * Exports the tags of the file as dictionary mapping (human readable) tag - * names (Strings) to StringLists of tag values. - * The default implementation in this class considers only the usual built-in - * tags (artist, album, ...) and only one value per key. - */ - PropertyMap properties() const; - - /*! - * Removes unsupported properties, or a subset of them, from the tag. - * The parameter \a properties must contain only entries from - * properties().unsupportedData(). - * BIC: Will become virtual in future releases. Currently the non-virtual - * standard implementation of TagLib::Tag does nothing, since there are - * no unsupported elements. - */ - void removeUnsupportedProperties(const StringList& properties); - - /*! - * Sets the tags of this File to those specified in \a properties. This default - * implementation sets only the tags for which setter methods exist in this class - * (artist, album, ...), and only one value per key; the rest will be contained - * in the returned PropertyMap. - */ - PropertyMap setProperties(const PropertyMap &properties); - - /*! - * Returns the track name; if no track name is present in the tag - * String::null will be returned. - */ - virtual String title() const = 0; - - /*! - * Returns the artist name; if no artist name is present in the tag - * String::null will be returned. - */ - virtual String artist() const = 0; - - /*! - * Returns the album name; if no album name is present in the tag - * String::null will be returned. - */ - virtual String album() const = 0; - - /*! - * Returns the track comment; if no comment is present in the tag - * String::null will be returned. - */ - virtual String comment() const = 0; - - /*! - * Returns the genre name; if no genre is present in the tag String::null - * will be returned. - */ - virtual String genre() const = 0; - - /*! - * Returns the year; if there is no year set, this will return 0. - */ - virtual uint year() const = 0; - - /*! - * Returns the track number; if there is no track number set, this will - * return 0. - */ - virtual uint track() const = 0; - - /*! - * Sets the title to \a s. If \a s is String::null then this value will be - * cleared. - */ - virtual void setTitle(const String &s) = 0; - - /*! - * Sets the artist to \a s. If \a s is String::null then this value will be - * cleared. - */ - virtual void setArtist(const String &s) = 0; - - /*! - * Sets the album to \a s. If \a s is String::null then this value will be - * cleared. - */ - virtual void setAlbum(const String &s) = 0; - - /*! - * Sets the comment to \a s. If \a s is String::null then this value will be - * cleared. - */ - virtual void setComment(const String &s) = 0; - - /*! - * Sets the genre to \a s. If \a s is String::null then this value will be - * cleared. For tag formats that use a fixed set of genres, the appropriate - * value will be selected based on a string comparison. A list of available - * genres for those formats should be available in that type's - * implementation. - */ - virtual void setGenre(const String &s) = 0; - - /*! - * Sets the year to \a i. If \a s is 0 then this value will be cleared. - */ - virtual void setYear(uint i) = 0; - - /*! - * Sets the track to \a i. If \a s is 0 then this value will be cleared. - */ - virtual void setTrack(uint i) = 0; - - /*! - * Returns true if the tag does not contain any data. This should be - * reimplemented in subclasses that provide more than the basic tagging - * abilities in this class. - */ - virtual bool isEmpty() const; - - /*! - * Copies the generic data from one tag to another. - * - * \note This will no affect any of the lower level details of the tag. For - * instance if any of the tag type specific data (maybe a URL for a band) is - * set, this will not modify or copy that. This just copies using the API - * in this class. - * - * If \a overwrite is true then the values will be unconditionally copied. - * If false only empty values will be overwritten. - */ - static void duplicate(const Tag *source, Tag *target, bool overwrite = true); - - protected: - /*! - * Construct a Tag. This is protected since tags should only be instantiated - * through subclasses. - */ - Tag(); - - private: - Tag(const Tag &); - Tag &operator=(const Tag &); - - class TagPrivate; - TagPrivate *d; - }; -} - -#endif diff --git a/3rdparty/taglib/include/taglib/tag_c.h b/3rdparty/taglib/include/taglib/tag_c.h deleted file mode 100644 index 2e8b752..0000000 --- a/3rdparty/taglib/include/taglib/tag_c.h +++ /dev/null @@ -1,299 +0,0 @@ -/*************************************************************************** - copyright : (C) 2003 by Scott Wheeler - email : wheeler@kde.org - ***************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * - * USA * - ***************************************************************************/ - -#ifndef TAGLIB_TAG_C -#define TAGLIB_TAG_C - -/* Do not include this in the main TagLib documentation. */ -#ifndef DO_NOT_DOCUMENT - -#ifdef __cplusplus -extern "C" { -#endif - -#if defined(TAGLIB_STATIC) -#define TAGLIB_C_EXPORT -#elif defined(_WIN32) || defined(_WIN64) -#ifdef MAKE_TAGLIB_C_LIB -#define TAGLIB_C_EXPORT __declspec(dllexport) -#else -#define TAGLIB_C_EXPORT __declspec(dllimport) -#endif -#elif defined(__GNUC__) && (__GNUC__ > 4 || __GNUC__ == 4 && __GNUC_MINOR__ >= 1) -#define TAGLIB_C_EXPORT __attribute__ ((visibility("default"))) -#else -#define TAGLIB_C_EXPORT -#endif - -#ifndef BOOL -#define BOOL int -#endif - -/******************************************************************************* - * [ TagLib C Binding ] - * - * This is an interface to TagLib's "simple" API, meaning that you can read and - * modify media files in a generic, but not specialized way. This is a rough - * representation of TagLib::File and TagLib::Tag, for which the documentation - * is somewhat more complete and worth consulting. - *******************************************************************************/ - -/* - * These are used for type provide some type safety to the C API (as opposed to - * using void *, but pointers to them are simply cast to the corresponding C++ - * types in the implementation. - */ - -typedef struct { int dummy; } TagLib_File; -typedef struct { int dummy; } TagLib_Tag; -typedef struct { int dummy; } TagLib_AudioProperties; - -/*! - * By default all strings coming into or out of TagLib's C API are in UTF8. - * However, it may be desirable for TagLib to operate on Latin1 (ISO-8859-1) - * strings in which case this should be set to FALSE. - */ -TAGLIB_C_EXPORT void taglib_set_strings_unicode(BOOL unicode); - -/*! - * TagLib can keep track of strings that are created when outputting tag values - * and clear them using taglib_tag_clear_strings(). This is enabled by default. - * However if you wish to do more fine grained management of strings, you can do - * so by setting \a management to FALSE. - */ -TAGLIB_C_EXPORT void taglib_set_string_management_enabled(BOOL management); - -/*! - * Explicitly free a string returned from TagLib - */ -TAGLIB_C_EXPORT void taglib_free(void* pointer); - -/******************************************************************************* - * File API - ******************************************************************************/ - -typedef enum { - TagLib_File_MPEG, - TagLib_File_OggVorbis, - TagLib_File_FLAC, - TagLib_File_MPC, - TagLib_File_OggFlac, - TagLib_File_WavPack, - TagLib_File_Speex, - TagLib_File_TrueAudio, - TagLib_File_MP4, - TagLib_File_ASF -} TagLib_File_Type; - -/*! - * Creates a TagLib file based on \a filename. TagLib will try to guess the file - * type. - * - * \returns NULL if the file type cannot be determined or the file cannot - * be opened. - */ -TAGLIB_C_EXPORT TagLib_File *taglib_file_new(const char *filename); - -/*! - * Creates a TagLib file based on \a filename. Rather than attempting to guess - * the type, it will use the one specified by \a type. - */ -TAGLIB_C_EXPORT TagLib_File *taglib_file_new_type(const char *filename, TagLib_File_Type type); - -/*! - * Frees and closes the file. - */ -TAGLIB_C_EXPORT void taglib_file_free(TagLib_File *file); - -/*! - * Returns true if the file is open and readble and valid information for - * the Tag and / or AudioProperties was found. - */ - -TAGLIB_C_EXPORT BOOL taglib_file_is_valid(const TagLib_File *file); - -/*! - * Returns a pointer to the tag associated with this file. This will be freed - * automatically when the file is freed. - */ -TAGLIB_C_EXPORT TagLib_Tag *taglib_file_tag(const TagLib_File *file); - -/*! - * Returns a pointer to the the audio properties associated with this file. This - * will be freed automatically when the file is freed. - */ -TAGLIB_C_EXPORT const TagLib_AudioProperties *taglib_file_audioproperties(const TagLib_File *file); - -/*! - * Saves the \a file to disk. - */ -TAGLIB_C_EXPORT BOOL taglib_file_save(TagLib_File *file); - -/****************************************************************************** - * Tag API - ******************************************************************************/ - -/*! - * Returns a string with this tag's title. - * - * \note By default this string should be UTF8 encoded and its memory should be - * freed using taglib_tag_free_strings(). - */ -TAGLIB_C_EXPORT char *taglib_tag_title(const TagLib_Tag *tag); - -/*! - * Returns a string with this tag's artist. - * - * \note By default this string should be UTF8 encoded and its memory should be - * freed using taglib_tag_free_strings(). - */ -TAGLIB_C_EXPORT char *taglib_tag_artist(const TagLib_Tag *tag); - -/*! - * Returns a string with this tag's album name. - * - * \note By default this string should be UTF8 encoded and its memory should be - * freed using taglib_tag_free_strings(). - */ -TAGLIB_C_EXPORT char *taglib_tag_album(const TagLib_Tag *tag); - -/*! - * Returns a string with this tag's comment. - * - * \note By default this string should be UTF8 encoded and its memory should be - * freed using taglib_tag_free_strings(). - */ -TAGLIB_C_EXPORT char *taglib_tag_comment(const TagLib_Tag *tag); - -/*! - * Returns a string with this tag's genre. - * - * \note By default this string should be UTF8 encoded and its memory should be - * freed using taglib_tag_free_strings(). - */ -TAGLIB_C_EXPORT char *taglib_tag_genre(const TagLib_Tag *tag); - -/*! - * Returns the tag's year or 0 if year is not set. - */ -TAGLIB_C_EXPORT unsigned int taglib_tag_year(const TagLib_Tag *tag); - -/*! - * Returns the tag's track number or 0 if track number is not set. - */ -TAGLIB_C_EXPORT unsigned int taglib_tag_track(const TagLib_Tag *tag); - -/*! - * Sets the tag's title. - * - * \note By default this string should be UTF8 encoded. - */ -TAGLIB_C_EXPORT void taglib_tag_set_title(TagLib_Tag *tag, const char *title); - -/*! - * Sets the tag's artist. - * - * \note By default this string should be UTF8 encoded. - */ -TAGLIB_C_EXPORT void taglib_tag_set_artist(TagLib_Tag *tag, const char *artist); - -/*! - * Sets the tag's album. - * - * \note By default this string should be UTF8 encoded. - */ -TAGLIB_C_EXPORT void taglib_tag_set_album(TagLib_Tag *tag, const char *album); - -/*! - * Sets the tag's comment. - * - * \note By default this string should be UTF8 encoded. - */ -TAGLIB_C_EXPORT void taglib_tag_set_comment(TagLib_Tag *tag, const char *comment); - -/*! - * Sets the tag's genre. - * - * \note By default this string should be UTF8 encoded. - */ -TAGLIB_C_EXPORT void taglib_tag_set_genre(TagLib_Tag *tag, const char *genre); - -/*! - * Sets the tag's year. 0 indicates that this field should be cleared. - */ -TAGLIB_C_EXPORT void taglib_tag_set_year(TagLib_Tag *tag, unsigned int year); - -/*! - * Sets the tag's track number. 0 indicates that this field should be cleared. - */ -TAGLIB_C_EXPORT void taglib_tag_set_track(TagLib_Tag *tag, unsigned int track); - -/*! - * Frees all of the strings that have been created by the tag. - */ -TAGLIB_C_EXPORT void taglib_tag_free_strings(void); - -/****************************************************************************** - * Audio Properties API - ******************************************************************************/ - -/*! - * Returns the length of the file in seconds. - */ -TAGLIB_C_EXPORT int taglib_audioproperties_length(const TagLib_AudioProperties *audioProperties); - -/*! - * Returns the bitrate of the file in kb/s. - */ -TAGLIB_C_EXPORT int taglib_audioproperties_bitrate(const TagLib_AudioProperties *audioProperties); - -/*! - * Returns the sample rate of the file in Hz. - */ -TAGLIB_C_EXPORT int taglib_audioproperties_samplerate(const TagLib_AudioProperties *audioProperties); - -/*! - * Returns the number of channels in the audio stream. - */ -TAGLIB_C_EXPORT int taglib_audioproperties_channels(const TagLib_AudioProperties *audioProperties); - -/******************************************************************************* - * Special convenience ID3v2 functions - *******************************************************************************/ - -typedef enum { - TagLib_ID3v2_Latin1, - TagLib_ID3v2_UTF16, - TagLib_ID3v2_UTF16BE, - TagLib_ID3v2_UTF8 -} TagLib_ID3v2_Encoding; - -/*! - * This sets the default encoding for ID3v2 frames that are written to tags. - */ - -TAGLIB_C_EXPORT void taglib_id3v2_set_default_text_encoding(TagLib_ID3v2_Encoding encoding); - -#ifdef __cplusplus -} -#endif -#endif /* DO_NOT_DOCUMENT */ -#endif diff --git a/3rdparty/taglib/include/taglib/taglib.h b/3rdparty/taglib/include/taglib/taglib.h deleted file mode 100644 index ef7650c..0000000 --- a/3rdparty/taglib/include/taglib/taglib.h +++ /dev/null @@ -1,170 +0,0 @@ -/*************************************************************************** - copyright : (C) 2002 - 2008 by Scott Wheeler - email : wheeler@kde.org - ***************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * - * 02110-1301 USA * - * * - * Alternatively, this file is available under the Mozilla Public * - * License Version 1.1. You may obtain a copy of the License at * - * http://www.mozilla.org/MPL/ * - ***************************************************************************/ - -#ifndef TAGLIB_H -#define TAGLIB_H - -#include "taglib_config.h" - -#define TAGLIB_MAJOR_VERSION 1 -#define TAGLIB_MINOR_VERSION 10 -#define TAGLIB_PATCH_VERSION 0 - -#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 1)) -#define TAGLIB_IGNORE_MISSING_DESTRUCTOR _Pragma("GCC diagnostic ignored \"-Wnon-virtual-dtor\"") -#else -#define TAGLIB_IGNORE_MISSING_DESTRUCTOR -#endif - -#if (defined(_MSC_VER) && _MSC_VER >= 1600) -#define TAGLIB_CONSTRUCT_BITSET(x) static_cast(x) -#else -#define TAGLIB_CONSTRUCT_BITSET(x) static_cast(x) -#endif - -#include - -//! A namespace for all TagLib related classes and functions - -/*! - * This namespace contains everything in TagLib. For projects working with - * TagLib extensively it may be convenient to add a - * \code - * using namespace TagLib; - * \endcode - */ - -namespace TagLib { - - class String; - - typedef wchar_t wchar; // Assumed to be sufficient to store a UTF-16 char. - typedef unsigned char uchar; - typedef unsigned short ushort; - typedef unsigned int uint; - typedef unsigned long long ulonglong; - - // long/ulong can be either 32-bit or 64-bit wide. - typedef unsigned long ulong; - - /*! - * Unfortunately std::wstring isn't defined on some systems, (i.e. GCC < 3) - * so I'm providing something here that should be constant. - */ - typedef std::basic_string wstring; -} - -/*! - * \mainpage TagLib - * - * \section intro Introduction - * - * TagLib is a library for reading and editing audio meta data, commonly know as \e tags. - * - * Features: - * - A clean, high level, C++ API to handling audio meta data. - * - Format specific APIs for advanced API users. - * - ID3v1, ID3v2, APE, FLAC, Xiph, iTunes-style MP4 and WMA tag formats. - * - MP3, MPC, FLAC, MP4, ASF, AIFF, WAV, TrueAudio, WavPack, Ogg FLAC, Ogg Vorbis, Speex and Opus file formats. - * - Basic audio file properties such as length, sample rate, etc. - * - Long term binary and source compatibility. - * - Extensible design, notably the ability to add other formats or extend current formats as a library user. - * - Full support for unicode and internationalized tags. - * - Dual MPL and - * LGPL licenses. - * - No external toolkit dependencies. - * - * \section why Why TagLib? - * - * TagLib originally was written to provide an updated and improved ID3v2 implementation in C++ for use - * in a variety of Open Source projects. Since development began in 2002 and the 1.0 release in 2004 - * it has expanded to cover a wide variety of tag and file formats and is used in a wide variety of - * Open Source and proprietary applications. It now supports a variety of UNIXes, including Apple's OS - * X, as well as Microsoft Windows. - * - * \section commercial Usage in Commercial Applications - * - * TagLib's licenses \e do allow usage within propriety (\e closed) applications, however TagLib is \e not - * public domain. Please note the requirements of the LGPL or MPL, and adhere to at least one of them. - * In simple terms, you must at a minimum note your usage of TagLib, note the licensing terms of TagLib and - * if you make changes to TagLib publish them. Please review the licenses above before using TagLib in your - * software. Note that you may choose either the MPL or the LGPL, you do not have to fulfill the - * requirements of both. - * - * \section installing Installing TagLib - * - * Please see the TagLib website for the latest - * downloads. - * - * TagLib can be built using the CMake build system. TagLib installs a taglib-config and pkg-config file to - * make it easier to integrate into various build systems. Note that TagLib's include install directory \e must - * be included in the header include path. Simply adding will \e not work. - * - * \section start Getting Started - * - * TagLib provides both simple, abstract APIs which make it possible to ignore the differences between tagging - * formats and format specific APIs which allow programmers to work with the features of specific tagging - * schemes. There is a similar abstraction mechanism for AudioProperties. - * - * The best place to start is with the Class Hierarchy linked at the top of the page. The File and - * AudioProperties classes and their subclasses are the core of TagLib. The FileRef class is also a convenient - * way for using a value-based handle. - * - * \note When working with FileRef please consider that it has only the most basic (extension-based) file - * type resolution. Please see its documentation on how to plug in more advanced file type resolution. (Such - * resolution may be part of later TagLib releases by default.) - * - * Here's a very simple example with TagLib: - * - * \code - * - * TagLib::FileRef f("Latex Solar Beef.mp3"); - * TagLib::String artist = f.tag()->artist(); // artist == "Frank Zappa" - * - * f.tag()->setAlbum("Fillmore East"); - * f.save(); - * - * TagLib::FileRef g("Free City Rhymes.ogg"); - * TagLib::String album = g.tag()->album(); // album == "NYC Ghosts & Flowers" - * - * g.tag()->setTrack(1); - * g.save(); - * - * \endcode - * - * More examples can be found in the \e examples directory of the source distribution. - * - * \section Contact - * - * Questions about TagLib should be directed to the TagLib mailing list, not directly to the author. - * - * - TagLib Homepage - * - TagLib Mailing List (taglib-devel@kde.org) - * - * \author Scott Wheeler et al. - * - */ - -#endif diff --git a/3rdparty/taglib/include/taglib/taglib_config.h b/3rdparty/taglib/include/taglib/taglib_config.h deleted file mode 100644 index 5f0ee6c..0000000 --- a/3rdparty/taglib/include/taglib/taglib_config.h +++ /dev/null @@ -1,6 +0,0 @@ -/* taglib_config.h. Generated by cmake from taglib_config.h.cmake */ - -/* These values are no longer used. This file is present only for compatibility reasons. */ - -#define TAGLIB_WITH_ASF 1 -#define TAGLIB_WITH_MP4 1 diff --git a/3rdparty/taglib/include/taglib/taglib_export.h b/3rdparty/taglib/include/taglib/taglib_export.h deleted file mode 100644 index 737ae64..0000000 --- a/3rdparty/taglib/include/taglib/taglib_export.h +++ /dev/null @@ -1,43 +0,0 @@ -/*************************************************************************** - copyright : (C) 2002 - 2008 by Scott Wheeler - email : wheeler@kde.org - ***************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * - * 02110-1301 USA * - * * - * Alternatively, this file is available under the Mozilla Public * - * License Version 1.1. You may obtain a copy of the License at * - * http://www.mozilla.org/MPL/ * - ***************************************************************************/ - -#ifndef TAGLIB_EXPORT_H -#define TAGLIB_EXPORT_H - -#if defined(TAGLIB_STATIC) -#define TAGLIB_EXPORT -#elif (defined(_WIN32) || defined(_WIN64)) -#ifdef MAKE_TAGLIB_LIB -#define TAGLIB_EXPORT __declspec(dllexport) -#else -#define TAGLIB_EXPORT __declspec(dllimport) -#endif -#elif defined(__GNUC__) && (__GNUC__ > 4 || __GNUC__ == 4 && __GNUC_MINOR__ >= 1) -#define TAGLIB_EXPORT __attribute__ ((visibility("default"))) -#else -#define TAGLIB_EXPORT -#endif - -#endif diff --git a/3rdparty/taglib/include/taglib/tbytevector.h b/3rdparty/taglib/include/taglib/tbytevector.h deleted file mode 100644 index 793b414..0000000 --- a/3rdparty/taglib/include/taglib/tbytevector.h +++ /dev/null @@ -1,596 +0,0 @@ -/*************************************************************************** - copyright : (C) 2002 - 2008 by Scott Wheeler - email : wheeler@kde.org - ***************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * - * 02110-1301 USA * - * * - * Alternatively, this file is available under the Mozilla Public * - * License Version 1.1. You may obtain a copy of the License at * - * http://www.mozilla.org/MPL/ * - ***************************************************************************/ - -#ifndef TAGLIB_BYTEVECTOR_H -#define TAGLIB_BYTEVECTOR_H - -#include "taglib.h" -#include "taglib_export.h" - -#include -#include - -namespace TagLib { - - //! A byte vector - - /*! - * This class provides a byte vector with some methods that are useful for - * tagging purposes. Many of the search functions are tailored to what is - * useful for finding tag related patterns in a data array. - */ - - class TAGLIB_EXPORT ByteVector - { - public: -#ifndef DO_NOT_DOCUMENT - typedef std::vector::iterator Iterator; - typedef std::vector::const_iterator ConstIterator; - typedef std::vector::reverse_iterator ReverseIterator; - typedef std::vector::const_reverse_iterator ConstReverseIterator; -#endif - - /*! - * Constructs an empty byte vector. - */ - ByteVector(); - - /*! - * Construct a vector of size \a size with all values set to \a value by - * default. - */ - ByteVector(uint size, char value = 0); - - /*! - * Constructs a byte vector that is a copy of \a v. - */ - ByteVector(const ByteVector &v); - - /*! - * Constructs a byte vector that is a copy of \a v. - */ - ByteVector(const ByteVector &v, uint offset, uint length); - - /*! - * Constructs a byte vector that contains \a c. - */ - ByteVector(char c); - - /*! - * Constructs a byte vector that copies \a data for up to \a length bytes. - */ - ByteVector(const char *data, uint length); - - /*! - * Constructs a byte vector that copies \a data up to the first null - * byte. This is particularly useful for constructing byte arrays from - * string constants. - * - * \warning The behavior is undefined if \a data is not null terminated. - */ - ByteVector(const char *data); - - /*! - * Destroys this ByteVector instance. - */ - virtual ~ByteVector(); - - /*! - * Sets the data for the byte array using the first \a length bytes of \a data - */ - ByteVector &setData(const char *data, uint length); - - /*! - * Sets the data for the byte array copies \a data up to the first null - * byte. The behavior is undefined if \a data is not null terminated. - */ - ByteVector &setData(const char *data); - - /*! - * Returns a pointer to the internal data structure. - * - * \warning Care should be taken when modifying this data structure as it is - * easy to corrupt the ByteVector when doing so. Specifically, while the - * data may be changed, its length may not be. - */ - char *data(); - - /*! - * Returns a pointer to the internal data structure which may not be modified. - */ - const char *data() const; - - /*! - * Returns a byte vector made up of the bytes starting at \a index and - * for \a length bytes. If \a length is not specified it will return the bytes - * from \a index to the end of the vector. - */ - ByteVector mid(uint index, uint length = 0xffffffff) const; - - /*! - * This essentially performs the same as operator[](), but instead of causing - * a runtime error if the index is out of bounds, it will return a null byte. - */ - char at(uint index) const; - - /*! - * Searches the ByteVector for \a pattern starting at \a offset and returns - * the offset. Returns -1 if the pattern was not found. If \a byteAlign is - * specified the pattern will only be matched if it starts on a byte divisible - * by \a byteAlign (starting from \a offset). - */ - int find(const ByteVector &pattern, uint offset = 0, int byteAlign = 1) const; - - /*! - * Searches the char for \a c starting at \a offset and returns - * the offset. Returns \a -1 if the pattern was not found. If \a byteAlign is - * specified the pattern will only be matched if it starts on a byte divisible - * by \a byteAlign (starting from \a offset). - */ - int find(char c, uint offset = 0, int byteAlign = 1) const; - - /*! - * Searches the ByteVector for \a pattern starting from either the end of the - * vector or \a offset and returns the offset. Returns -1 if the pattern was - * not found. If \a byteAlign is specified the pattern will only be matched - * if it starts on a byte divisible by \a byteAlign (starting from \a offset). - */ - int rfind(const ByteVector &pattern, uint offset = 0, int byteAlign = 1) const; - - /*! - * Checks to see if the vector contains the \a pattern starting at position - * \a offset. Optionally, if you only want to search for part of the pattern - * you can specify an offset within the pattern to start from. Also, you can - * specify to only check for the first \a patternLength bytes of \a pattern with - * the \a patternLength argument. - */ - bool containsAt(const ByteVector &pattern, uint offset, uint patternOffset = 0, uint patternLength = 0xffffffff) const; - - /*! - * Returns true if the vector starts with \a pattern. - */ - bool startsWith(const ByteVector &pattern) const; - - /*! - * Returns true if the vector ends with \a pattern. - */ - bool endsWith(const ByteVector &pattern) const; - - /*! - * Replaces \a pattern with \a with and returns a reference to the ByteVector - * after the operation. This \e does modify the vector. - */ - ByteVector &replace(const ByteVector &pattern, const ByteVector &with); - - /*! - * Checks for a partial match of \a pattern at the end of the vector. It - * returns the offset of the partial match within the vector, or -1 if the - * pattern is not found. This method is particularly useful when searching for - * patterns that start in one vector and end in another. When combined with - * startsWith() it can be used to find a pattern that overlaps two buffers. - * - * \note This will not match the complete pattern at the end of the string; use - * endsWith() for that. - */ - int endsWithPartialMatch(const ByteVector &pattern) const; - - /*! - * Appends \a v to the end of the ByteVector. - */ - ByteVector &append(const ByteVector &v); - - /*! - * Clears the data. - */ - ByteVector &clear(); - - /*! - * Returns the size of the array. - */ - uint size() const; - - /*! - * Resize the vector to \a size. If the vector is currently less than - * \a size, pad the remaining spaces with \a padding. Returns a reference - * to the resized vector. - */ - ByteVector &resize(uint size, char padding = 0); - - /*! - * Returns an Iterator that points to the front of the vector. - */ - Iterator begin(); - - /*! - * Returns a ConstIterator that points to the front of the vector. - */ - ConstIterator begin() const; - - /*! - * Returns an Iterator that points to the back of the vector. - */ - Iterator end(); - - /*! - * Returns a ConstIterator that points to the back of the vector. - */ - ConstIterator end() const; - - /*! - * Returns a ReverseIterator that points to the front of the vector. - */ - ReverseIterator rbegin(); - - /*! - * Returns a ConstReverseIterator that points to the front of the vector. - */ - ConstReverseIterator rbegin() const; - - /*! - * Returns a ReverseIterator that points to the back of the vector. - */ - ReverseIterator rend(); - - /*! - * Returns a ConstReverseIterator that points to the back of the vector. - */ - ConstReverseIterator rend() const; - - /*! - * Returns true if the vector is null. - * - * \note A vector may be empty without being null. - * \see isEmpty() - */ - bool isNull() const; - - /*! - * Returns true if the ByteVector is empty. - * - * \see size() - * \see isNull() - */ - bool isEmpty() const; - - /*! - * Returns a CRC checksum of the byte vector's data. - * - * \note This uses an uncommon variant of CRC32 specializes in Ogg. - */ - // BIC: Remove or make generic. - uint checksum() const; - - /*! - * Converts the first 4 bytes of the vector to an unsigned integer. - * - * If \a mostSignificantByteFirst is true this will operate left to right - * evaluating the integer. For example if \a mostSignificantByteFirst is - * true then $00 $00 $00 $01 == 0x00000001 == 1, if false, $01 00 00 00 == - * 0x01000000 == 1. - * - * \see fromUInt() - */ - uint toUInt(bool mostSignificantByteFirst = true) const; - - /*! - * Converts the 4 bytes at \a offset of the vector to an unsigned integer. - * - * If \a mostSignificantByteFirst is true this will operate left to right - * evaluating the integer. For example if \a mostSignificantByteFirst is - * true then $00 $00 $00 $01 == 0x00000001 == 1, if false, $01 00 00 00 == - * 0x01000000 == 1. - * - * \see fromUInt() - */ - uint toUInt(uint offset, bool mostSignificantByteFirst = true) const; - - /*! - * Converts the \a length bytes at \a offset of the vector to an unsigned - * integer. If \a length is larger than 4, the excess is ignored. - * - * If \a mostSignificantByteFirst is true this will operate left to right - * evaluating the integer. For example if \a mostSignificantByteFirst is - * true then $00 $00 $00 $01 == 0x00000001 == 1, if false, $01 00 00 00 == - * 0x01000000 == 1. - * - * \see fromUInt() - */ - uint toUInt(uint offset, uint length, bool mostSignificantByteFirst = true) const; - - /*! - * Converts the first 2 bytes of the vector to a (signed) short. - * - * If \a mostSignificantByteFirst is true this will operate left to right - * evaluating the integer. For example if \a mostSignificantByteFirst is - * true then $00 $01 == 0x0001 == 1, if false, $01 00 == 0x01000000 == 1. - * - * \see fromShort() - */ - short toShort(bool mostSignificantByteFirst = true) const; - - /*! - * Converts the 2 bytes at \a offset of the vector to a (signed) short. - * - * If \a mostSignificantByteFirst is true this will operate left to right - * evaluating the integer. For example if \a mostSignificantByteFirst is - * true then $00 $01 == 0x0001 == 1, if false, $01 00 == 0x01000000 == 1. - * - * \see fromShort() - */ - short toShort(uint offset, bool mostSignificantByteFirst = true) const; - - /*! - * Converts the first 2 bytes of the vector to a unsigned short. - * - * If \a mostSignificantByteFirst is true this will operate left to right - * evaluating the integer. For example if \a mostSignificantByteFirst is - * true then $00 $01 == 0x0001 == 1, if false, $01 00 == 0x01000000 == 1. - * - * \see fromShort() - */ - unsigned short toUShort(bool mostSignificantByteFirst = true) const; - - /*! - * Converts the 2 bytes at \a offset of the vector to a unsigned short. - * - * If \a mostSignificantByteFirst is true this will operate left to right - * evaluating the integer. For example if \a mostSignificantByteFirst is - * true then $00 $01 == 0x0001 == 1, if false, $01 00 == 0x01000000 == 1. - * - * \see fromShort() - */ - unsigned short toUShort(uint offset, bool mostSignificantByteFirst = true) const; - - /*! - * Converts the first 8 bytes of the vector to a (signed) long long. - * - * If \a mostSignificantByteFirst is true this will operate left to right - * evaluating the integer. For example if \a mostSignificantByteFirst is - * true then $00 00 00 00 00 00 00 01 == 0x0000000000000001 == 1, - * if false, $01 00 00 00 00 00 00 00 == 0x0100000000000000 == 1. - * - * \see fromUInt() - */ - long long toLongLong(bool mostSignificantByteFirst = true) const; - - /*! - * Converts the 8 bytes at \a offset of the vector to a (signed) long long. - * - * If \a mostSignificantByteFirst is true this will operate left to right - * evaluating the integer. For example if \a mostSignificantByteFirst is - * true then $00 00 00 00 00 00 00 01 == 0x0000000000000001 == 1, - * if false, $01 00 00 00 00 00 00 00 == 0x0100000000000000 == 1. - * - * \see fromUInt() - */ - long long toLongLong(uint offset, bool mostSignificantByteFirst = true) const; - - /* - * Converts the 4 bytes at \a offset of the vector to a float as an IEEE754 - * 32-bit little-endian floating point number. - */ - float toFloat32LE(size_t offset) const; - - /* - * Converts the 4 bytes at \a offset of the vector to a float as an IEEE754 - * 32-bit big-endian floating point number. - */ - float toFloat32BE(size_t offset) const; - - /* - * Converts the 8 bytes at \a offset of the vector to a double as an IEEE754 - * 64-bit little-endian floating point number. - */ - double toFloat64LE(size_t offset) const; - - /* - * Converts the 8 bytes at \a offset of the vector to a double as an IEEE754 - * 64-bit big-endian floating point number. - */ - double toFloat64BE(size_t offset) const; - - /* - * Converts the 10 bytes at \a offset of the vector to a long double as an - * IEEE754 80-bit little-endian floating point number. - * - * \note This may compromise the precision depends on the size of long double. - */ - long double toFloat80LE(size_t offset) const; - - /* - * Converts the 10 bytes at \a offset of the vector to a long double as an - * IEEE754 80-bit big-endian floating point number. - * - * \note This may compromise the precision depends on the size of long double. - */ - long double toFloat80BE(size_t offset) const; - - /*! - * Creates a 4 byte ByteVector based on \a value. If - * \a mostSignificantByteFirst is true, then this will operate left to right - * in building the ByteVector. For example if \a mostSignificantByteFirst is - * true then $00 00 00 01 == 0x00000001 == 1, if false, $01 00 00 00 == - * 0x01000000 == 1. - * - * \see toUInt() - */ - static ByteVector fromUInt(uint value, bool mostSignificantByteFirst = true); - - /*! - * Creates a 2 byte ByteVector based on \a value. If - * \a mostSignificantByteFirst is true, then this will operate left to right - * in building the ByteVector. For example if \a mostSignificantByteFirst is - * true then $00 01 == 0x0001 == 1, if false, $01 00 == 0x0100 == 1. - * - * \see toShort() - */ - static ByteVector fromShort(short value, bool mostSignificantByteFirst = true); - - /*! - * Creates a 8 byte ByteVector based on \a value. If - * \a mostSignificantByteFirst is true, then this will operate left to right - * in building the ByteVector. For example if \a mostSignificantByteFirst is - * true then $00 00 00 01 == 0x0000000000000001 == 1, if false, - * $01 00 00 00 00 00 00 00 == 0x0100000000000000 == 1. - * - * \see toLongLong() - */ - static ByteVector fromLongLong(long long value, bool mostSignificantByteFirst = true); - - /*! - * Creates a 4 byte ByteVector based on \a value as an IEEE754 32-bit - * little-endian floating point number. - * - * \see fromFloat32BE() - */ - static ByteVector fromFloat32LE(float value); - - /*! - * Creates a 4 byte ByteVector based on \a value as an IEEE754 32-bit - * big-endian floating point number. - * - * \see fromFloat32LE() - */ - static ByteVector fromFloat32BE(float value); - - /*! - * Creates a 8 byte ByteVector based on \a value as an IEEE754 64-bit - * little-endian floating point number. - * - * \see fromFloat64BE() - */ - static ByteVector fromFloat64LE(double value); - - /*! - * Creates a 8 byte ByteVector based on \a value as an IEEE754 64-bit - * big-endian floating point number. - * - * \see fromFloat64LE() - */ - static ByteVector fromFloat64BE(double value); - - /*! - * Returns a ByteVector based on the CString \a s. - */ - static ByteVector fromCString(const char *s, uint length = 0xffffffff); - - /*! - * Returns a const reference to the byte at \a index. - */ - const char &operator[](int index) const; - - /*! - * Returns a reference to the byte at \a index. - */ - char &operator[](int index); - - /*! - * Returns true if this ByteVector and \a v are equal. - */ - bool operator==(const ByteVector &v) const; - - /*! - * Returns true if this ByteVector and \a v are not equal. - */ - bool operator!=(const ByteVector &v) const; - - /*! - * Returns true if this ByteVector and the null terminated C string \a s - * contain the same data. - */ - bool operator==(const char *s) const; - - /*! - * Returns true if this ByteVector and the null terminated C string \a s - * do not contain the same data. - */ - bool operator!=(const char *s) const; - - /*! - * Returns true if this ByteVector is less than \a v. The value of the - * vectors is determined by evaluating the character from left to right, and - * in the event one vector is a superset of the other, the size is used. - */ - bool operator<(const ByteVector &v) const; - - /*! - * Returns true if this ByteVector is greater than \a v. - */ - bool operator>(const ByteVector &v) const; - - /*! - * Returns a vector that is \a v appended to this vector. - */ - ByteVector operator+(const ByteVector &v) const; - - /*! - * Copies ByteVector \a v. - */ - ByteVector &operator=(const ByteVector &v); - - /*! - * Copies a byte \a c. - */ - ByteVector &operator=(char c); - - /*! - * Copies \a data up to the first null byte. - * - * \warning The behavior is undefined if \a data is not null terminated. - */ - ByteVector &operator=(const char *data); - - /*! - * A static, empty ByteVector which is convenient and fast (since returning - * an empty or "null" value does not require instantiating a new ByteVector). - */ - static ByteVector null; - - /*! - * Returns a hex-encoded copy of the byte vector. - */ - ByteVector toHex() const; - - protected: - /* - * If this ByteVector is being shared via implicit sharing, do a deep copy - * of the data and separate from the shared members. This should be called - * by all non-const subclass members. - */ - void detach(); - - private: - class ByteVectorPrivate; - ByteVectorPrivate *d; - }; -} - -/*! - * \relates TagLib::ByteVector - * Streams the ByteVector \a v to the output stream \a s. - */ -TAGLIB_EXPORT std::ostream &operator<<(std::ostream &s, const TagLib::ByteVector &v); - -#endif diff --git a/3rdparty/taglib/include/taglib/tbytevectorlist.h b/3rdparty/taglib/include/taglib/tbytevectorlist.h deleted file mode 100644 index 5852583..0000000 --- a/3rdparty/taglib/include/taglib/tbytevectorlist.h +++ /dev/null @@ -1,91 +0,0 @@ -/*************************************************************************** - copyright : (C) 2002 - 2008 by Scott Wheeler - email : wheeler@kde.org - ***************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * - * 02110-1301 USA * - * * - * Alternatively, this file is available under the Mozilla Public * - * License Version 1.1. You may obtain a copy of the License at * - * http://www.mozilla.org/MPL/ * - ***************************************************************************/ - -#ifndef TAGLIB_BYTEVECTORLIST_H -#define TAGLIB_BYTEVECTORLIST_H - -#include "taglib_export.h" -#include "tbytevector.h" -#include "tlist.h" - -namespace TagLib { - - //! A list of ByteVectors - - /*! - * A List specialization with some handy features useful for ByteVectors. - */ - - class TAGLIB_EXPORT ByteVectorList : public List - { - public: - - /*! - * Construct an empty ByteVectorList. - */ - ByteVectorList(); - - /*! - * Destroys this ByteVectorList instance. - */ - virtual ~ByteVectorList(); - - /*! - * Make a shallow, implicitly shared, copy of \a l. Because this is - * implicitly shared, this method is lightweight and suitable for - * pass-by-value usage. - */ - ByteVectorList(const ByteVectorList &l); - - /*! - * Convert the ByteVectorList to a ByteVector separated by \a separator. By - * default a space is used. - */ - ByteVector toByteVector(const ByteVector &separator = " ") const; - - /*! - * Splits the ByteVector \a v into several strings at \a pattern. This will - * not include the pattern in the returned ByteVectors. - */ - static ByteVectorList split(const ByteVector &v, const ByteVector &pattern, - int byteAlign = 1); - /*! - * Splits the ByteVector \a v into several strings at \a pattern. This will - * not include the pattern in the returned ByteVectors. \a max is the - * maximum number of entries that will be separated. If \a max for instance - * is 2 then a maximum of 1 match will be found and the vector will be split - * on that match. - */ - // BIC: merge with the function above - static ByteVectorList split(const ByteVector &v, const ByteVector &pattern, - int byteAlign, int max); - private: - class ByteVectorListPrivate; - ByteVectorListPrivate *d; - }; - -} - -#endif diff --git a/3rdparty/taglib/include/taglib/tbytevectorstream.h b/3rdparty/taglib/include/taglib/tbytevectorstream.h deleted file mode 100644 index 456b854..0000000 --- a/3rdparty/taglib/include/taglib/tbytevectorstream.h +++ /dev/null @@ -1,145 +0,0 @@ -/*************************************************************************** - copyright : (C) 2011 by Lukas Lalinsky - email : lalinsky@gmail.com - ***************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * - * 02110-1301 USA * - * * - * Alternatively, this file is available under the Mozilla Public * - * License Version 1.1. You may obtain a copy of the License at * - * http://www.mozilla.org/MPL/ * - ***************************************************************************/ - -#ifndef TAGLIB_BYTEVECTORSTREAM_H -#define TAGLIB_BYTEVECTORSTREAM_H - -#include "taglib_export.h" -#include "taglib.h" -#include "tbytevector.h" -#include "tiostream.h" - -namespace TagLib { - - class String; - class Tag; - class AudioProperties; - - //! In-memory Stream class using ByteVector for its storage. - - class TAGLIB_EXPORT ByteVectorStream : public IOStream - { - public: - /*! - * Construct a File object and opens the \a file. \a file should be a - * be a C-string in the local file system encoding. - */ - ByteVectorStream(const ByteVector &data); - - /*! - * Destroys this ByteVectorStream instance. - */ - virtual ~ByteVectorStream(); - - /*! - * Returns the file name in the local file system encoding. - */ - FileName name() const; - - /*! - * Reads a block of size \a length at the current get pointer. - */ - ByteVector readBlock(ulong length); - - /*! - * Attempts to write the block \a data at the current get pointer. If the - * file is currently only opened read only -- i.e. readOnly() returns true -- - * this attempts to reopen the file in read/write mode. - * - * \note This should be used instead of using the streaming output operator - * for a ByteVector. And even this function is significantly slower than - * doing output with a char[]. - */ - void writeBlock(const ByteVector &data); - - /*! - * Insert \a data at position \a start in the file overwriting \a replace - * bytes of the original content. - * - * \note This method is slow since it requires rewriting all of the file - * after the insertion point. - */ - void insert(const ByteVector &data, ulong start = 0, ulong replace = 0); - - /*! - * Removes a block of the file starting a \a start and continuing for - * \a length bytes. - * - * \note This method is slow since it involves rewriting all of the file - * after the removed portion. - */ - void removeBlock(ulong start = 0, ulong length = 0); - - /*! - * Returns true if the file is read only (or if the file can not be opened). - */ - bool readOnly() const; - - /*! - * Since the file can currently only be opened as an argument to the - * constructor (sort-of by design), this returns if that open succeeded. - */ - bool isOpen() const; - - /*! - * Move the I/O pointer to \a offset in the file from position \a p. This - * defaults to seeking from the beginning of the file. - * - * \see Position - */ - void seek(long offset, Position p = Beginning); - - /*! - * Reset the end-of-file and error flags on the file. - */ - void clear(); - - /*! - * Returns the current offset within the file. - */ - long tell() const; - - /*! - * Returns the length of the file. - */ - long length(); - - /*! - * Truncates the file to a \a length. - */ - void truncate(long length); - - ByteVector *data(); - - protected: - - private: - class ByteVectorStreamPrivate; - ByteVectorStreamPrivate *d; - }; - -} - -#endif diff --git a/3rdparty/taglib/include/taglib/tdebuglistener.h b/3rdparty/taglib/include/taglib/tdebuglistener.h deleted file mode 100644 index 3c8e118..0000000 --- a/3rdparty/taglib/include/taglib/tdebuglistener.h +++ /dev/null @@ -1,74 +0,0 @@ -/*************************************************************************** - copyright : (C) 2013 by Tsuda Kageyu - email : tsuda.kageyu@gmail.com - ***************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * - * 02110-1301 USA * - * * - * Alternatively, this file is available under the Mozilla Public * - * License Version 1.1. You may obtain a copy of the License at * - * http://www.mozilla.org/MPL/ * - ***************************************************************************/ - -#ifndef TAGLIB_DEBUGLISTENER_H -#define TAGLIB_DEBUGLISTENER_H - -#include "taglib_export.h" -#include "tstring.h" - -namespace TagLib -{ - //! An abstraction for the listener to the debug messages. - - /*! - * This class enables you to handle the debug messages in your preferred - * way by subclassing this class, reimplementing printMessage() and setting - * your reimplementation as the default with setDebugListener(). - * - * \see setDebugListener() - */ - class TAGLIB_EXPORT DebugListener - { - public: - DebugListener(); - virtual ~DebugListener(); - - /*! - * When overridden in a derived class, redirects \a msg to your preferred - * channel such as stderr, Windows debugger or so forth. - */ - virtual void printMessage(const String &msg) = 0; - - private: - // Noncopyable - DebugListener(const DebugListener &); - DebugListener &operator=(const DebugListener &); - }; - - /*! - * Sets the listener that decides how the debug messages are redirected. - * If the parameter \a listener is null, the previous listener is released - * and default stderr listener is restored. - * - * \note The caller is responsible for deleting the previous listener - * as needed after it is released. - * - * \see DebugListener - */ - TAGLIB_EXPORT void setDebugListener(DebugListener *listener); -} - -#endif diff --git a/3rdparty/taglib/include/taglib/textidentificationframe.h b/3rdparty/taglib/include/taglib/textidentificationframe.h deleted file mode 100644 index e49aa89..0000000 --- a/3rdparty/taglib/include/taglib/textidentificationframe.h +++ /dev/null @@ -1,313 +0,0 @@ -/*************************************************************************** - copyright : (C) 2002 - 2008 by Scott Wheeler - email : wheeler@kde.org - ***************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * - * 02110-1301 USA * - * * - * Alternatively, this file is available under the Mozilla Public * - * License Version 1.1. You may obtain a copy of the License at * - * http://www.mozilla.org/MPL/ * - ***************************************************************************/ - -#ifndef TAGLIB_TEXTIDENTIFICATIONFRAME_H -#define TAGLIB_TEXTIDENTIFICATIONFRAME_H - -#include "tstringlist.h" -#include "tmap.h" -#include "taglib_export.h" - -#include "id3v2frame.h" - -namespace TagLib { - - namespace ID3v2 { - - class Tag; - typedef Map KeyConversionMap; - - //! An ID3v2 text identification frame implementation - - /*! - * This is an implementation of the most common type of ID3v2 frame -- text - * identification frames. There are a number of variations on this. Those - * enumerated in the ID3v2.4 standard are: - * - *
    - *
  • TALB Album/Movie/Show title
  • - *
  • TBPM BPM (beats per minute)
  • - *
  • TCOM Composer
  • - *
  • TCON Content type
  • - *
  • TCOP Copyright message
  • - *
  • TDEN Encoding time
  • - *
  • TDLY Playlist delay
  • - *
  • TDOR Original release time
  • - *
  • TDRC Recording time
  • - *
  • TDRL Release time
  • - *
  • TDTG Tagging time
  • - *
  • TENC Encoded by
  • - *
  • TEXT Lyricist/Text writer
  • - *
  • TFLT File type
  • - *
  • TIPL Involved people list
  • - *
  • TIT1 Content group description
  • - *
  • TIT2 Title/songname/content description
  • - *
  • TIT3 Subtitle/Description refinement
  • - *
  • TKEY Initial key
  • - *
  • TLAN Language(s)
  • - *
  • TLEN Length
  • - *
  • TMCL Musician credits list
  • - *
  • TMED Media type
  • - *
  • TMOO Mood
  • - *
  • TOAL Original album/movie/show title
  • - *
  • TOFN Original filename
  • - *
  • TOLY Original lyricist(s)/text writer(s)
  • - *
  • TOPE Original artist(s)/performer(s)
  • - *
  • TOWN File owner/licensee
  • - *
  • TPE1 Lead performer(s)/Soloist(s)
  • - *
  • TPE2 Band/orchestra/accompaniment
  • - *
  • TPE3 Conductor/performer refinement
  • - *
  • TPE4 Interpreted, remixed, or otherwise modified by
  • - *
  • TPOS Part of a set
  • - *
  • TPRO Produced notice
  • - *
  • TPUB Publisher
  • - *
  • TRCK Track number/Position in set
  • - *
  • TRSN Internet radio station name
  • - *
  • TRSO Internet radio station owner
  • - *
  • TSOA Album sort order
  • - *
  • TSOP Performer sort order
  • - *
  • TSOT Title sort order
  • - *
  • TSRC ISRC (international standard recording code)
  • - *
  • TSSE Software/Hardware and settings used for encoding
  • - *
  • TSST Set subtitle
  • - *
- * - * The ID3v2 Frames document gives a description of each of these formats - * and the expected order of strings in each. ID3v2::Header::frameID() can - * be used to determine the frame type. - * - * \note If non-Latin1 compatible strings are used with this class, even if - * the text encoding is set to Latin1, the frame will be written using UTF8 - * (with the encoding flag appropriately set in the output). - */ - - class TAGLIB_EXPORT TextIdentificationFrame : public Frame - { - friend class FrameFactory; - - public: - /*! - * Construct an empty frame of type \a type. Uses \a encoding as the - * default text encoding. - * - * \note In this case you must specify the text encoding as it - * resolves the ambiguity between constructors. - * - * \note Please see the note in the class description regarding Latin1. - */ - TextIdentificationFrame(const ByteVector &type, String::Type encoding); - - /*! - * This is a dual purpose constructor. \a data can either be binary data - * that should be parsed or (at a minimum) the frame ID. - */ - explicit TextIdentificationFrame(const ByteVector &data); - - /*! - * This is a special factory method to create a TIPL (involved people list) - * frame from the given \a properties. Will parse key=[list of values] data - * into the TIPL format as specified in the ID3 standard. - */ - static TextIdentificationFrame *createTIPLFrame(const PropertyMap &properties); - - /*! - * This is a special factory method to create a TMCL (musician credits list) - * frame from the given \a properties. Will parse key=[list of values] data - * into the TMCL format as specified in the ID3 standard, where key should be - * of the form instrumentPrefix:instrument. - */ - static TextIdentificationFrame *createTMCLFrame(const PropertyMap &properties); - /*! - * Destroys this TextIdentificationFrame instance. - */ - virtual ~TextIdentificationFrame(); - - /*! - * Text identification frames are a list of string fields. - * - * This function will accept either a StringList or a String (using the - * StringList constructor that accepts a single String). - * - * \note This will not change the text encoding of the frame even if the - * strings passed in are not of the same encoding. Please use - * setEncoding(s.type()) if you wish to change the encoding of the frame. - */ - void setText(const StringList &l); - - // Reimplementations. - - virtual void setText(const String &s); - virtual String toString() const; - - /*! - * Returns the text encoding that will be used in rendering this frame. - * This defaults to the type that was either specified in the constructor - * or read from the frame when parsed. - * - * \note Please see the note in the class description regarding Latin1. - * - * \see setTextEncoding() - * \see render() - */ - String::Type textEncoding() const; - - /*! - * Sets the text encoding to be used when rendering this frame to - * \a encoding. - * - * \note Please see the note in the class description regarding Latin1. - * - * \see textEncoding() - * \see render() - */ - void setTextEncoding(String::Type encoding); - - /*! - * Returns a list of the strings in this frame. - */ - StringList fieldList() const; - - /*! - * Returns a KeyConversionMap mapping a role as it would be used in a PropertyMap - * to the corresponding key used in a TIPL ID3 frame to describe that role. - */ - static const KeyConversionMap &involvedPeopleMap(); - - PropertyMap asProperties() const; - - protected: - // Reimplementations. - - virtual void parseFields(const ByteVector &data); - virtual ByteVector renderFields() const; - - /*! - * The constructor used by the FrameFactory. - */ - TextIdentificationFrame(const ByteVector &data, Header *h); - - private: - TextIdentificationFrame(const TextIdentificationFrame &); - TextIdentificationFrame &operator=(const TextIdentificationFrame &); - - /*! - * Parses the special structure of a TIPL frame - * Only the whitelisted roles "ARRANGER", "ENGINEER", "PRODUCER", - * "DJMIXER" (ID3: "DJ-MIX") and "MIXER" (ID3: "MIX") are allowed. - */ - PropertyMap makeTIPLProperties() const; - /*! - * Parses the special structure of a TMCL frame. - */ - PropertyMap makeTMCLProperties() const; - class TextIdentificationFramePrivate; - TextIdentificationFramePrivate *d; - }; - - /*! - * This is a specialization of text identification frames that allows for - * user defined entries. Each entry has a description in addition to the - * normal list of fields that a text identification frame has. - * - * This description identifies the frame and must be unique. - */ - - //! An ID3v2 custom text identification frame implementation - - class TAGLIB_EXPORT UserTextIdentificationFrame : public TextIdentificationFrame - { - friend class FrameFactory; - - public: - /*! - * Constructs an empty user defined text identification frame. For this to be - * a useful frame both a description and text must be set. - */ - explicit UserTextIdentificationFrame(String::Type encoding = String::Latin1); - - /*! - * Creates a frame based on \a data. - */ - explicit UserTextIdentificationFrame(const ByteVector &data); - - /*! - * Creates a user defined text identification frame with the given \a description - * and \a values. - */ - UserTextIdentificationFrame(const String &description, const StringList &values, String::Type encoding = String::UTF8); - - virtual String toString() const; - - /*! - * Returns the description for this frame. - */ - String description() const; - - /*! - * Sets the description of the frame to \a s. \a s must be unique. You can - * check for the presence of another user defined text frame of the same type - * using find() and testing for null. - */ - void setDescription(const String &s); - - StringList fieldList() const; - void setText(const String &text); - void setText(const StringList &fields); - - /*! - * A UserTextIdentificationFrame is parsed into a PropertyMap as follows: - * - the key is the frame's description, uppercased - * - if the description contains '::', only the substring after that - * separator is considered as key (compatibility with exfalso) - * - if the above rules don't yield a valid key (e.g. containing non-ASCII - * characters), the returned map will contain an entry "TXXX/" - * in its unsupportedData() list. - * - The values will be copies of the fieldList(). - * - If the description() appears as value in fieldList(), it will be omitted - * in the value list, in order to be compatible with TagLib which copies - * the description() into the fieldList(). - */ - PropertyMap asProperties() const; - - /*! - * Searches for the user defined text frame with the description \a description - * in \a tag. This returns null if no matching frames were found. - */ - static UserTextIdentificationFrame *find(Tag *tag, const String &description); - - private: - UserTextIdentificationFrame(const ByteVector &data, Header *h); - UserTextIdentificationFrame(const TextIdentificationFrame &); - UserTextIdentificationFrame &operator=(const UserTextIdentificationFrame &); - - void checkFields(); - - class UserTextIdentificationFramePrivate; - UserTextIdentificationFramePrivate *d; - }; - - } -} -#endif diff --git a/3rdparty/taglib/include/taglib/tfile.h b/3rdparty/taglib/include/taglib/tfile.h deleted file mode 100644 index fe4efcb..0000000 --- a/3rdparty/taglib/include/taglib/tfile.h +++ /dev/null @@ -1,306 +0,0 @@ -/*************************************************************************** - copyright : (C) 2002 - 2008 by Scott Wheeler - email : wheeler@kde.org - ***************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * - * 02110-1301 USA * - * * - * Alternatively, this file is available under the Mozilla Public * - * License Version 1.1. You may obtain a copy of the License at * - * http://www.mozilla.org/MPL/ * - ***************************************************************************/ - -#ifndef TAGLIB_FILE_H -#define TAGLIB_FILE_H - -#include "taglib_export.h" -#include "taglib.h" -#include "tag.h" -#include "tbytevector.h" -#include "tiostream.h" - -namespace TagLib { - - class String; - class Tag; - class AudioProperties; - class PropertyMap; - - //! A file class with some useful methods for tag manipulation - - /*! - * This class is a basic file class with some methods that are particularly - * useful for tag editors. It has methods to take advantage of - * ByteVector and a binary search method for finding patterns in a file. - */ - - class TAGLIB_EXPORT File - { - public: - /*! - * Position in the file used for seeking. - */ - enum Position { - //! Seek from the beginning of the file. - Beginning, - //! Seek from the current position in the file. - Current, - //! Seek from the end of the file. - End - }; - - /*! - * Destroys this File instance. - */ - virtual ~File(); - - /*! - * Returns the file name in the local file system encoding. - */ - FileName name() const; - - /*! - * Returns a pointer to this file's tag. This should be reimplemented in - * the concrete subclasses. - */ - virtual Tag *tag() const = 0; - - /*! - * Exports the tags of the file as dictionary mapping (human readable) tag - * names (uppercase Strings) to StringLists of tag values. Calls the according - * specialization in the File subclasses. - * For each metadata object of the file that could not be parsed into the PropertyMap - * format, the returned map's unsupportedData() list will contain one entry identifying - * that object (e.g. the frame type for ID3v2 tags). Use removeUnsupportedProperties() - * to remove (a subset of) them. - * For files that contain more than one tag (e.g. an MP3 with both an ID3v2 and an ID3v2 - * tag) only the most "modern" one will be exported (ID3v2 in this case). - * BIC: Will be made virtual in future releases. - */ - PropertyMap properties() const; - - /*! - * Removes unsupported properties, or a subset of them, from the file's metadata. - * The parameter \a properties must contain only entries from - * properties().unsupportedData(). - * BIC: Will be mad virtual in future releases. - */ - void removeUnsupportedProperties(const StringList& properties); - - /*! - * Sets the tags of this File to those specified in \a properties. Calls the - * according specialization method in the subclasses of File to do the translation - * into the format-specific details. - * If some value(s) could not be written imported to the specific metadata format, - * the returned PropertyMap will contain those value(s). Otherwise it will be empty, - * indicating that no problems occurred. - * With file types that support several tag formats (for instance, MP3 files can have - * ID3v1, ID3v2, and APEv2 tags), this function will create the most appropriate one - * (ID3v2 for MP3 files). Older formats will be updated as well, if they exist, but won't - * be taken into account for the return value of this function. - * See the documentation of the subclass implementations for detailed descriptions. - * BIC: will become pure virtual in the future - */ - PropertyMap setProperties(const PropertyMap &properties); - - /*! - * Returns a pointer to this file's audio properties. This should be - * reimplemented in the concrete subclasses. If no audio properties were - * read then this will return a null pointer. - */ - virtual AudioProperties *audioProperties() const = 0; - - /*! - * Save the file and its associated tags. This should be reimplemented in - * the concrete subclasses. Returns true if the save succeeds. - * - * \warning On UNIX multiple processes are able to write to the same file at - * the same time. This can result in serious file corruption. If you are - * developing a program that makes use of TagLib from multiple processes you - * must insure that you are only doing writes to a particular file from one - * of them. - */ - virtual bool save() = 0; - - /*! - * Reads a block of size \a length at the current get pointer. - */ - ByteVector readBlock(ulong length); - - /*! - * Attempts to write the block \a data at the current get pointer. If the - * file is currently only opened read only -- i.e. readOnly() returns true -- - * this attempts to reopen the file in read/write mode. - * - * \note This should be used instead of using the streaming output operator - * for a ByteVector. And even this function is significantly slower than - * doing output with a char[]. - */ - void writeBlock(const ByteVector &data); - - /*! - * Returns the offset in the file that \a pattern occurs at or -1 if it can - * not be found. If \a before is set, the search will only continue until the - * pattern \a before is found. This is useful for tagging purposes to search - * for a tag before the sync frame. - * - * Searching starts at \a fromOffset, which defaults to the beginning of the - * file. - * - * \note This has the practical limitation that \a pattern can not be longer - * than the buffer size used by readBlock(). Currently this is 1024 bytes. - */ - long find(const ByteVector &pattern, - long fromOffset = 0, - const ByteVector &before = ByteVector::null); - - /*! - * Returns the offset in the file that \a pattern occurs at or -1 if it can - * not be found. If \a before is set, the search will only continue until the - * pattern \a before is found. This is useful for tagging purposes to search - * for a tag before the sync frame. - * - * Searching starts at \a fromOffset and proceeds from the that point to the - * beginning of the file and defaults to the end of the file. - * - * \note This has the practical limitation that \a pattern can not be longer - * than the buffer size used by readBlock(). Currently this is 1024 bytes. - */ - long rfind(const ByteVector &pattern, - long fromOffset = 0, - const ByteVector &before = ByteVector::null); - - /*! - * Insert \a data at position \a start in the file overwriting \a replace - * bytes of the original content. - * - * \note This method is slow since it requires rewriting all of the file - * after the insertion point. - */ - void insert(const ByteVector &data, ulong start = 0, ulong replace = 0); - - /*! - * Removes a block of the file starting a \a start and continuing for - * \a length bytes. - * - * \note This method is slow since it involves rewriting all of the file - * after the removed portion. - */ - void removeBlock(ulong start = 0, ulong length = 0); - - /*! - * Returns true if the file is read only (or if the file can not be opened). - */ - bool readOnly() const; - - /*! - * Since the file can currently only be opened as an argument to the - * constructor (sort-of by design), this returns if that open succeeded. - */ - bool isOpen() const; - - /*! - * Returns true if the file is open and readable. - */ - bool isValid() const; - - /*! - * Move the I/O pointer to \a offset in the file from position \a p. This - * defaults to seeking from the beginning of the file. - * - * \see Position - */ - void seek(long offset, Position p = Beginning); - - /*! - * Reset the end-of-file and error flags on the file. - */ - void clear(); - - /*! - * Returns the current offset within the file. - */ - long tell() const; - - /*! - * Returns the length of the file. - */ - long length(); - - /*! - * Returns true if \a file can be opened for reading. If the file does not - * exist, this will return false. - * - * \deprecated - */ - static bool isReadable(const char *file); - - /*! - * Returns true if \a file can be opened for writing. - * - * \deprecated - */ - static bool isWritable(const char *name); - - protected: - /*! - * Construct a File object and opens the \a file. \a file should be a - * be a C-string in the local file system encoding. - * - * \note Constructor is protected since this class should only be - * instantiated through subclasses. - */ - File(FileName file); - - /*! - * Construct a File object and use the \a stream instance. - * - * \note TagLib will *not* take ownership of the stream, the caller is - * responsible for deleting it after the File object. - * - * \note Constructor is protected since this class should only be - * instantiated through subclasses. - */ - File(IOStream *stream); - - /*! - * Marks the file as valid or invalid. - * - * \see isValid() - */ - void setValid(bool valid); - - /*! - * Truncates the file to a \a length. - */ - void truncate(long length); - - /*! - * Returns the buffer size that is used for internal buffering. - */ - static uint bufferSize(); - - private: - File(const File &); - File &operator=(const File &); - - class FilePrivate; - FilePrivate *d; - }; - -} - -#endif diff --git a/3rdparty/taglib/include/taglib/tfilestream.h b/3rdparty/taglib/include/taglib/tfilestream.h deleted file mode 100644 index fa113b7..0000000 --- a/3rdparty/taglib/include/taglib/tfilestream.h +++ /dev/null @@ -1,154 +0,0 @@ -/*************************************************************************** - copyright : (C) 2002 - 2008 by Scott Wheeler - email : wheeler@kde.org - ***************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * - * 02110-1301 USA * - * * - * Alternatively, this file is available under the Mozilla Public * - * License Version 1.1. You may obtain a copy of the License at * - * http://www.mozilla.org/MPL/ * - ***************************************************************************/ - -#ifndef TAGLIB_FILESTREAM_H -#define TAGLIB_FILESTREAM_H - -#include "taglib_export.h" -#include "taglib.h" -#include "tbytevector.h" -#include "tiostream.h" - -namespace TagLib { - - class String; - class Tag; - class AudioProperties; - - //! A file class with some useful methods for tag manipulation - - /*! - * This class is a basic file class with some methods that are particularly - * useful for tag editors. It has methods to take advantage of - * ByteVector and a binary search method for finding patterns in a file. - */ - - class TAGLIB_EXPORT FileStream : public IOStream - { - public: - /*! - * Construct a File object and opens the \a file. \a file should be a - * be a C-string in the local file system encoding. - */ - FileStream(FileName file, bool openReadOnly = false); - - /*! - * Destroys this FileStream instance. - */ - virtual ~FileStream(); - - /*! - * Returns the file name in the local file system encoding. - */ - FileName name() const; - - /*! - * Reads a block of size \a length at the current get pointer. - */ - ByteVector readBlock(ulong length); - - /*! - * Attempts to write the block \a data at the current get pointer. If the - * file is currently only opened read only -- i.e. readOnly() returns true -- - * this attempts to reopen the file in read/write mode. - * - * \note This should be used instead of using the streaming output operator - * for a ByteVector. And even this function is significantly slower than - * doing output with a char[]. - */ - void writeBlock(const ByteVector &data); - - /*! - * Insert \a data at position \a start in the file overwriting \a replace - * bytes of the original content. - * - * \note This method is slow since it requires rewriting all of the file - * after the insertion point. - */ - void insert(const ByteVector &data, ulong start = 0, ulong replace = 0); - - /*! - * Removes a block of the file starting a \a start and continuing for - * \a length bytes. - * - * \note This method is slow since it involves rewriting all of the file - * after the removed portion. - */ - void removeBlock(ulong start = 0, ulong length = 0); - - /*! - * Returns true if the file is read only (or if the file can not be opened). - */ - bool readOnly() const; - - /*! - * Since the file can currently only be opened as an argument to the - * constructor (sort-of by design), this returns if that open succeeded. - */ - bool isOpen() const; - - /*! - * Move the I/O pointer to \a offset in the file from position \a p. This - * defaults to seeking from the beginning of the file. - * - * \see Position - */ - void seek(long offset, Position p = Beginning); - - /*! - * Reset the end-of-file and error flags on the file. - */ - void clear(); - - /*! - * Returns the current offset within the file. - */ - long tell() const; - - /*! - * Returns the length of the file. - */ - long length(); - - /*! - * Truncates the file to a \a length. - */ - void truncate(long length); - - protected: - - /*! - * Returns the buffer size that is used for internal buffering. - */ - static uint bufferSize(); - - private: - class FileStreamPrivate; - FileStreamPrivate *d; - }; - -} - -#endif diff --git a/3rdparty/taglib/include/taglib/tiostream.h b/3rdparty/taglib/include/taglib/tiostream.h deleted file mode 100644 index 6bb96b5..0000000 --- a/3rdparty/taglib/include/taglib/tiostream.h +++ /dev/null @@ -1,169 +0,0 @@ -/*************************************************************************** - copyright : (C) 2011 by Lukas Lalinsky - email : lalinsky@gmail.com - ***************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * - * 02110-1301 USA * - * * - * Alternatively, this file is available under the Mozilla Public * - * License Version 1.1. You may obtain a copy of the License at * - * http://www.mozilla.org/MPL/ * - ***************************************************************************/ - -#ifndef TAGLIB_IOSTREAM_H -#define TAGLIB_IOSTREAM_H - -#include "taglib_export.h" -#include "taglib.h" -#include "tbytevector.h" - -namespace TagLib { - -#ifdef _WIN32 - class TAGLIB_EXPORT FileName - { - public: - FileName(const wchar_t *name); - FileName(const char *name); - - FileName(const FileName &name); - - operator const wchar_t *() const; - operator const char *() const; - - const std::wstring &wstr() const; - const std::string &str() const; - - String toString() const; - - private: - const std::string m_name; - const std::wstring m_wname; - }; -#else - typedef const char *FileName; -#endif - - //! An abstract class that provides operations on a sequence of bytes - - class TAGLIB_EXPORT IOStream - { - public: - /*! - * Position in the file used for seeking. - */ - enum Position { - //! Seek from the beginning of the file. - Beginning, - //! Seek from the current position in the file. - Current, - //! Seek from the end of the file. - End - }; - - IOStream(); - - /*! - * Destroys this IOStream instance. - */ - virtual ~IOStream(); - - /*! - * Returns the stream name in the local file system encoding. - */ - virtual FileName name() const = 0; - - /*! - * Reads a block of size \a length at the current get pointer. - */ - virtual ByteVector readBlock(ulong length) = 0; - - /*! - * Attempts to write the block \a data at the current get pointer. If the - * file is currently only opened read only -- i.e. readOnly() returns true -- - * this attempts to reopen the file in read/write mode. - * - * \note This should be used instead of using the streaming output operator - * for a ByteVector. And even this function is significantly slower than - * doing output with a char[]. - */ - virtual void writeBlock(const ByteVector &data) = 0; - - /*! - * Insert \a data at position \a start in the file overwriting \a replace - * bytes of the original content. - * - * \note This method is slow since it requires rewriting all of the file - * after the insertion point. - */ - virtual void insert(const ByteVector &data, ulong start = 0, ulong replace = 0) = 0; - - /*! - * Removes a block of the file starting a \a start and continuing for - * \a length bytes. - * - * \note This method is slow since it involves rewriting all of the file - * after the removed portion. - */ - virtual void removeBlock(ulong start = 0, ulong length = 0) = 0; - - /*! - * Returns true if the file is read only (or if the file can not be opened). - */ - virtual bool readOnly() const = 0; - - /*! - * Since the file can currently only be opened as an argument to the - * constructor (sort-of by design), this returns if that open succeeded. - */ - virtual bool isOpen() const = 0; - - /*! - * Move the I/O pointer to \a offset in the stream from position \a p. This - * defaults to seeking from the beginning of the stream. - * - * \see Position - */ - virtual void seek(long offset, Position p = Beginning) = 0; - - /*! - * Reset the end-of-stream and error flags on the stream. - */ - virtual void clear(); - - /*! - * Returns the current offset within the stream. - */ - virtual long tell() const = 0; - - /*! - * Returns the length of the stream. - */ - virtual long length() = 0; - - /*! - * Truncates the stream to a \a length. - */ - virtual void truncate(long length) = 0; - - private: - IOStream(const IOStream &); - IOStream &operator=(const IOStream &); - }; - -} - -#endif diff --git a/3rdparty/taglib/include/taglib/tlist.h b/3rdparty/taglib/include/taglib/tlist.h deleted file mode 100644 index 4277a18..0000000 --- a/3rdparty/taglib/include/taglib/tlist.h +++ /dev/null @@ -1,257 +0,0 @@ -/*************************************************************************** - copyright : (C) 2002 - 2008 by Scott Wheeler - email : wheeler@kde.org - ***************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * - * 02110-1301 USA * - * * - * Alternatively, this file is available under the Mozilla Public * - * License Version 1.1. You may obtain a copy of the License at * - * http://www.mozilla.org/MPL/ * - ***************************************************************************/ - -#ifndef TAGLIB_LIST_H -#define TAGLIB_LIST_H - -#include "taglib.h" - -#include - -namespace TagLib { - - //! A generic, implicitly shared list. - - /*! - * This is basic generic list that's somewhere between a std::list and a - * QValueList. This class is implicitly shared. For example: - * - * \code - * - * TagLib::List l = someOtherIntList; - * - * \endcode - * - * The above example is very cheap. This also makes lists suitable for the - * return types of functions. The above example will just copy a pointer rather - * than copying the data in the list. When your \e shared list's data changes, - * only \e then will the data be copied. - */ - - template class List - { - public: -#ifndef DO_NOT_DOCUMENT - typedef typename std::list::iterator Iterator; - typedef typename std::list::const_iterator ConstIterator; -#endif - - /*! - * Constructs an empty list. - */ - List(); - - /*! - * Make a shallow, implicitly shared, copy of \a l. Because this is - * implicitly shared, this method is lightweight and suitable for - * pass-by-value usage. - */ - List(const List &l); - - /*! - * Destroys this List instance. If auto deletion is enabled and this list - * contains a pointer type all of the members are also deleted. - */ - virtual ~List(); - - /*! - * Returns an STL style iterator to the beginning of the list. See - * std::list::const_iterator for the semantics. - */ - Iterator begin(); - - /*! - * Returns an STL style constant iterator to the beginning of the list. See - * std::list::iterator for the semantics. - */ - ConstIterator begin() const; - - /*! - * Returns an STL style iterator to the end of the list. See - * std::list::iterator for the semantics. - */ - Iterator end(); - - /*! - * Returns an STL style constant iterator to the end of the list. See - * std::list::const_iterator for the semantics. - */ - ConstIterator end() const; - - /*! - * Inserts a copy of \a value before \a it. - */ - Iterator insert(Iterator it, const T &value); - - /*! - * Inserts the \a value into the list. This assumes that the list is - * currently sorted. If \a unique is true then the value will not - * be inserted if it is already in the list. - */ - List &sortedInsert(const T &value, bool unique = false); - - /*! - * Appends \a item to the end of the list and returns a reference to the - * list. - */ - List &append(const T &item); - - /*! - * Appends all of the values in \a l to the end of the list and returns a - * reference to the list. - */ - List &append(const List &l); - - /*! - * Prepends \a item to the beginning list and returns a reference to the - * list. - */ - List &prepend(const T &item); - - /*! - * Prepends all of the items in \a l to the beginning list and returns a - * reference to the list. - */ - List &prepend(const List &l); - - /*! - * Clears the list. If auto deletion is enabled and this list contains a - * pointer type the members are also deleted. - * - * \see setAutoDelete() - */ - List &clear(); - - /*! - * Returns the number of elements in the list. - */ - uint size() const; - bool isEmpty() const; - - /*! - * Find the first occurrence of \a value. - */ - Iterator find(const T &value); - - /*! - * Find the first occurrence of \a value. - */ - ConstIterator find(const T &value) const; - - /*! - * Returns true if the list contains \a value. - */ - bool contains(const T &value) const; - - /*! - * Erase the item at \a it from the list. - */ - Iterator erase(Iterator it); - - /*! - * Returns a reference to the first item in the list. - */ - const T &front() const; - - /*! - * Returns a reference to the first item in the list. - */ - T &front(); - - /*! - * Returns a reference to the last item in the list. - */ - const T &back() const; - - /*! - * Returns a reference to the last item in the list. - */ - T &back(); - - /*! - * Auto delete the members of the list when the last reference to the list - * passes out of scope. This will have no effect on lists which do not - * contain a pointer type. - * - * \note This relies on partial template instantiation -- most modern C++ - * compilers should now support this. - */ - void setAutoDelete(bool autoDelete); - - /*! - * Returns a reference to item \a i in the list. - * - * \warning This method is slow. Use iterators to loop through the list. - */ - T &operator[](uint i); - - /*! - * Returns a const reference to item \a i in the list. - * - * \warning This method is slow. Use iterators to loop through the list. - */ - const T &operator[](uint i) const; - - /*! - * Make a shallow, implicitly shared, copy of \a l. Because this is - * implicitly shared, this method is lightweight and suitable for - * pass-by-value usage. - */ - List &operator=(const List &l); - - /*! - * Compares this list with \a l and returns true if all of the elements are - * the same. - */ - bool operator==(const List &l) const; - - /*! - * Compares this list with \a l and returns true if the lists differ. - */ - bool operator!=(const List &l) const; - - protected: - /* - * If this List is being shared via implicit sharing, do a deep copy of the - * data and separate from the shared members. This should be called by all - * non-const subclass members. - */ - void detach(); - - private: -#ifndef DO_NOT_DOCUMENT - template class ListPrivate; - ListPrivate *d; -#endif - }; - -} - -// Since GCC doesn't support the "export" keyword, we have to include the -// implementation. - -#include "tlist.tcc" - -#endif diff --git a/3rdparty/taglib/include/taglib/tlist.tcc b/3rdparty/taglib/include/taglib/tlist.tcc deleted file mode 100644 index 5f8414c..0000000 --- a/3rdparty/taglib/include/taglib/tlist.tcc +++ /dev/null @@ -1,321 +0,0 @@ -/*************************************************************************** - copyright : (C) 2002 - 2008 by Scott Wheeler - email : wheeler@kde.org - ***************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * - * 02110-1301 USA * - * * - * Alternatively, this file is available under the Mozilla Public * - * License Version 1.1. You may obtain a copy of the License at * - * http://www.mozilla.org/MPL/ * - ***************************************************************************/ - -#include -#include "trefcounter.h" - -namespace TagLib { - -//////////////////////////////////////////////////////////////////////////////// -// public members -//////////////////////////////////////////////////////////////////////////////// - -// The functionality of List::setAutoDelete() is implemented here partial -// template specialization. This is implemented in such a way that calling -// setAutoDelete() on non-pointer types will simply have no effect. - -// A base for the generic and specialized private class types. New -// non-templatized members should be added here. - -// BIC change to RefCounter -class ListPrivateBase : public RefCounterOld -{ -public: - ListPrivateBase() : autoDelete(false) {} - bool autoDelete; -}; - -// A generic implementation - -template -template class List::ListPrivate : public ListPrivateBase -{ -public: - ListPrivate() : ListPrivateBase() {} - ListPrivate(const std::list &l) : ListPrivateBase(), list(l) {} - void clear() { - list.clear(); - } - std::list list; -}; - -// A partial specialization for all pointer types that implements the -// setAutoDelete() functionality. - -template -template class List::ListPrivate : public ListPrivateBase -{ -public: - ListPrivate() : ListPrivateBase() {} - ListPrivate(const std::list &l) : ListPrivateBase(), list(l) {} - ~ListPrivate() { - clear(); - } - void clear() { - if(autoDelete) { - typename std::list::const_iterator it = list.begin(); - for(; it != list.end(); ++it) - delete *it; - } - list.clear(); - } - std::list list; -}; - -//////////////////////////////////////////////////////////////////////////////// -// public members -//////////////////////////////////////////////////////////////////////////////// - -template -List::List() -{ - d = new ListPrivate; -} - -template -List::List(const List &l) : d(l.d) -{ - d->ref(); -} - -template -List::~List() -{ - if(d->deref()) - delete d; -} - -template -typename List::Iterator List::begin() -{ - detach(); - return d->list.begin(); -} - -template -typename List::ConstIterator List::begin() const -{ - return d->list.begin(); -} - -template -typename List::Iterator List::end() -{ - detach(); - return d->list.end(); -} - -template -typename List::ConstIterator List::end() const -{ - return d->list.end(); -} - -template -typename List::Iterator List::insert(Iterator it, const T &item) -{ - detach(); - return d->list.insert(it, item); -} - -template -List &List::sortedInsert(const T &value, bool unique) -{ - detach(); - Iterator it = begin(); - while(it != end() && *it < value) - ++it; - if(unique && it != end() && *it == value) - return *this; - insert(it, value); - return *this; -} - -template -List &List::append(const T &item) -{ - detach(); - d->list.push_back(item); - return *this; -} - -template -List &List::append(const List &l) -{ - detach(); - d->list.insert(d->list.end(), l.begin(), l.end()); - return *this; -} - -template -List &List::prepend(const T &item) -{ - detach(); - d->list.push_front(item); - return *this; -} - -template -List &List::prepend(const List &l) -{ - detach(); - d->list.insert(d->list.begin(), l.begin(), l.end()); - return *this; -} - -template -List &List::clear() -{ - detach(); - d->clear(); - return *this; -} - -template -TagLib::uint List::size() const -{ - return d->list.size(); -} - -template -bool List::isEmpty() const -{ - return d->list.empty(); -} - -template -typename List::Iterator List::find(const T &value) -{ - detach(); - return std::find(d->list.begin(), d->list.end(), value); -} - -template -typename List::ConstIterator List::find(const T &value) const -{ - return std::find(d->list.begin(), d->list.end(), value); -} - -template -bool List::contains(const T &value) const -{ - return std::find(d->list.begin(), d->list.end(), value) != d->list.end(); -} - -template -typename List::Iterator List::erase(Iterator it) -{ - return d->list.erase(it); -} - -template -const T &List::front() const -{ - return d->list.front(); -} - -template -T &List::front() -{ - detach(); - return d->list.front(); -} - -template -const T &List::back() const -{ - return d->list.back(); -} - -template -void List::setAutoDelete(bool autoDelete) -{ - d->autoDelete = autoDelete; -} - -template -T &List::back() -{ - detach(); - return d->list.back(); -} - -template -T &List::operator[](uint i) -{ - Iterator it = d->list.begin(); - std::advance(it, i); - - return *it; -} - -template -const T &List::operator[](uint i) const -{ - ConstIterator it = d->list.begin(); - std::advance(it, i); - - return *it; -} - -template -List &List::operator=(const List &l) -{ - if(&l == this) - return *this; - - if(d->deref()) - delete d; - d = l.d; - d->ref(); - return *this; -} - -template -bool List::operator==(const List &l) const -{ - return d->list == l.d->list; -} - -template -bool List::operator!=(const List &l) const -{ - return d->list != l.d->list; -} - -//////////////////////////////////////////////////////////////////////////////// -// protected members -//////////////////////////////////////////////////////////////////////////////// - -template -void List::detach() -{ - if(d->count() > 1) { - d->deref(); - d = new ListPrivate(d->list); - } -} - -} // namespace TagLib diff --git a/3rdparty/taglib/include/taglib/tmap.h b/3rdparty/taglib/include/taglib/tmap.h deleted file mode 100644 index a7d9930..0000000 --- a/3rdparty/taglib/include/taglib/tmap.h +++ /dev/null @@ -1,199 +0,0 @@ -/*************************************************************************** - copyright : (C) 2002 - 2008 by Scott Wheeler - email : wheeler@kde.org - ***************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * - * 02110-1301 USA * - * * - * Alternatively, this file is available under the Mozilla Public * - * License Version 1.1. You may obtain a copy of the License at * - * http://www.mozilla.org/MPL/ * - ***************************************************************************/ - -#ifndef TAGLIB_MAP_H -#define TAGLIB_MAP_H - -#include - -#include "taglib.h" - -namespace TagLib { - - //! A generic, implicitly shared map. - - /*! - * This implements a standard map container that associates a key with a value - * and has fast key-based lookups. This map is also implicitly shared making - * it suitable for pass-by-value usage. - */ - - template class Map - { - public: -#ifndef DO_NOT_DOCUMENT -#ifdef WANT_CLASS_INSTANTIATION_OF_MAP - // Some STL implementations get snippy over the use of the - // class keyword to distinguish different templates; Sun Studio - // in particular finds multiple specializations in certain rare - // cases and complains about that. GCC doesn't seem to mind, - // and uses the typedefs further below without the class keyword. - // Not all the specializations of Map can use the class keyword - // (when T is not actually a class type), so don't apply this - // generally. - typedef typename std::map::iterator Iterator; - typedef typename std::map::const_iterator ConstIterator; -#else - typedef typename std::map::iterator Iterator; - typedef typename std::map::const_iterator ConstIterator; -#endif -#endif - - /*! - * Constructs an empty Map. - */ - Map(); - - /*! - * Make a shallow, implicitly shared, copy of \a m. Because this is - * implicitly shared, this method is lightweight and suitable for - * pass-by-value usage. - */ - Map(const Map &m); - - /*! - * Destroys this instance of the Map. - */ - virtual ~Map(); - - /*! - * Returns an STL style iterator to the beginning of the map. See - * std::map::iterator for the semantics. - */ - Iterator begin(); - - /*! - * Returns an STL style iterator to the beginning of the map. See - * std::map::const_iterator for the semantics. - */ - ConstIterator begin() const; - - /*! - * Returns an STL style iterator to the end of the map. See - * std::map::iterator for the semantics. - */ - Iterator end(); - - /*! - * Returns an STL style iterator to the end of the map. See - * std::map::const_iterator for the semantics. - */ - ConstIterator end() const; - - /*! - * Inserts \a value under \a key in the map. If a value for \a key already - * exists it will be overwritten. - */ - Map &insert(const Key &key, const T &value); - - /*! - * Removes all of the elements from elements from the map. This however - * will not delete pointers if the mapped type is a pointer type. - */ - Map &clear(); - - /*! - * The number of elements in the map. - * - * \see isEmpty() - */ - uint size() const; - - /*! - * Returns true if the map is empty. - * - * \see size() - */ - bool isEmpty() const; - - /*! - * Find the first occurrence of \a key. - */ - Iterator find(const Key &key); - - /*! - * Find the first occurrence of \a key. - */ - ConstIterator find(const Key &key) const; - - /*! - * Returns true if the map contains an instance of \a key. - */ - bool contains(const Key &key) const; - - /*! - * Erase the item at \a it from the list. - */ - Map &erase(Iterator it); - - /*! - * Erase the item with \a key from the list. - */ - Map &erase(const Key &key); - - /*! - * Returns a reference to the value associated with \a key. - * - * \note This has undefined behavior if the key is not present in the map. - */ - const T &operator[](const Key &key) const; - - /*! - * Returns a reference to the value associated with \a key. - * - * \note This has undefined behavior if the key is not present in the map. - */ - T &operator[](const Key &key); - - /*! - * Make a shallow, implicitly shared, copy of \a m. Because this is - * implicitly shared, this method is lightweight and suitable for - * pass-by-value usage. - */ - Map &operator=(const Map &m); - - protected: - /* - * If this List is being shared via implicit sharing, do a deep copy of the - * data and separate from the shared members. This should be called by all - * non-const subclass members. - */ - void detach(); - - private: -#ifndef DO_NOT_DOCUMENT - template class MapPrivate; - MapPrivate *d; -#endif - }; - -} - -// Since GCC doesn't support the "export" keyword, we have to include the -// implementation. - -#include "tmap.tcc" - -#endif diff --git a/3rdparty/taglib/include/taglib/tmap.tcc b/3rdparty/taglib/include/taglib/tmap.tcc deleted file mode 100644 index 8c1106d..0000000 --- a/3rdparty/taglib/include/taglib/tmap.tcc +++ /dev/null @@ -1,197 +0,0 @@ -/*************************************************************************** - copyright : (C) 2002 - 2008 by Scott Wheeler - email : wheeler@kde.org - ***************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * - * 02110-1301 USA * - * * - * Alternatively, this file is available under the Mozilla Public * - * License Version 1.1. You may obtain a copy of the License at * - * http://www.mozilla.org/MPL/ * - ***************************************************************************/ - -#include "trefcounter.h" - -namespace TagLib { - -//////////////////////////////////////////////////////////////////////////////// -// public members -//////////////////////////////////////////////////////////////////////////////// - -// BIC change to RefCounter -template -template -class Map::MapPrivate : public RefCounterOld -{ -public: - MapPrivate() : RefCounterOld() {} -#ifdef WANT_CLASS_INSTANTIATION_OF_MAP - MapPrivate(const std::map& m) : RefCounterOld(), map(m) {} - std::map map; -#else - MapPrivate(const std::map& m) : RefCounterOld(), map(m) {} - std::map map; -#endif -}; - -template -Map::Map() -{ - d = new MapPrivate; -} - -template -Map::Map(const Map &m) : d(m.d) -{ - d->ref(); -} - -template -Map::~Map() -{ - if(d->deref()) - delete(d); -} - -template -typename Map::Iterator Map::begin() -{ - detach(); - return d->map.begin(); -} - -template -typename Map::ConstIterator Map::begin() const -{ - return d->map.begin(); -} - -template -typename Map::Iterator Map::end() -{ - detach(); - return d->map.end(); -} - -template -typename Map::ConstIterator Map::end() const -{ - return d->map.end(); -} - -template -Map &Map::insert(const Key &key, const T &value) -{ - detach(); - d->map[key] = value; - return *this; -} - -template -Map &Map::clear() -{ - detach(); - d->map.clear(); - return *this; -} - -template -bool Map::isEmpty() const -{ - return d->map.empty(); -} - -template -typename Map::Iterator Map::find(const Key &key) -{ - detach(); - return d->map.find(key); -} - -template -typename Map::ConstIterator Map::find(const Key &key) const -{ - return d->map.find(key); -} - -template -bool Map::contains(const Key &key) const -{ - return d->map.find(key) != d->map.end(); -} - -template -Map &Map::erase(Iterator it) -{ - detach(); - d->map.erase(it); - return *this; -} - -template -Map &Map::erase(const Key &key) -{ - detach(); - d->map.erase(key); - return *this; -} - -template -TagLib::uint Map::size() const -{ - return d->map.size(); -} - -template -const T &Map::operator[](const Key &key) const -{ - return d->map[key]; -} - -template -T &Map::operator[](const Key &key) -{ - detach(); - return d->map[key]; -} - -template -Map &Map::operator=(const Map &m) -{ - if(&m == this) - return *this; - - if(d->deref()) - delete(d); - d = m.d; - d->ref(); - return *this; -} - -//////////////////////////////////////////////////////////////////////////////// -// protected members -//////////////////////////////////////////////////////////////////////////////// - -template -void Map::detach() -{ - if(d->count() > 1) { - d->deref(); - d = new MapPrivate(d->map); - } -} - -} // namespace TagLib diff --git a/3rdparty/taglib/include/taglib/tpropertymap.h b/3rdparty/taglib/include/taglib/tpropertymap.h deleted file mode 100644 index c1b835b..0000000 --- a/3rdparty/taglib/include/taglib/tpropertymap.h +++ /dev/null @@ -1,233 +0,0 @@ -/*************************************************************************** - copyright : (C) 2012 by Michael Helmling - email : helmling@mathematik.uni-kl.de - ***************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * - * MA 02110-1301 USA * - ***************************************************************************/ - -#ifndef TAGLIB_PROPERTYMAP_H_ -#define TAGLIB_PROPERTYMAP_H_ - -#include "tmap.h" -#include "tstringlist.h" - -namespace TagLib { - - typedef Map SimplePropertyMap; - - //! A map for format-independent tag representations. - - /*! - * This map implements a generic representation of textual audio metadata - * ("tags") realized as pairs of a case-insensitive key - * and a nonempty list of corresponding values, each value being an arbitrary - * unicode String. - * - * Note that most metadata formats pose additional conditions on the tag keys. The - * most popular ones (Vorbis, APE, ID3v2) should support all ASCII only words of - * length between 2 and 16. - * - * This class can contain any tags, but here is a list of "well-known" tags that - * you might want to use: - * - * Basic tags: - * - * - TITLE - * - ALBUM - * - ARTIST - * - ALBUMARTIST - * - SUBTITLE - * - TRACKNUMBER - * - DISCNUMBER - * - DATE - * - ORIGINALDATE - * - GENRE - * - COMMENT - * - * Sort names: - * - * - TITLESORT - * - ALBUMSORT - * - ARTISTSORT - * - ALBUMARTISTSORT - * - * Credits: - * - * - COMPOSER - * - LYRICIST - * - CONDUCTOR - * - REMIXER - * - PERFORMER: - * - * Other tags: - * - * - ISRC - * - ASIN - * - BPM - * - COPYRIGHT - * - ENCODEDBY - * - MOOD - * - COMMENT - * - MEDIA - * - LABEL - * - CATALOGNUMBER - * - BARCODE - * - * MusicBrainz identifiers: - * - * - MUSICBRAINZ_TRACKID - * - MUSICBRAINZ_ALBUMID - * - MUSICBRAINZ_RELEASEGROUPID - * - MUSICBRAINZ_WORKID - * - MUSICBRAINZ_ARTISTID - * - MUSICBRAINZ_ALBUMARTISTID - * - ACOUSTID_ID - * - ACOUSTID_FINGERPRINT - * - MUSICIP_PUID - * - */ - - class TAGLIB_EXPORT PropertyMap: public SimplePropertyMap - { - public: - - typedef SimplePropertyMap::Iterator Iterator; - typedef SimplePropertyMap::ConstIterator ConstIterator; - - PropertyMap(); - - PropertyMap(const PropertyMap &m); - - /*! - * Creates a PropertyMap initialized from a SimplePropertyMap. Copies all - * entries from \a m that have valid keys. - * Invalid keys will be appended to the unsupportedData() list. - */ - PropertyMap(const SimplePropertyMap &m); - - virtual ~PropertyMap(); - - /*! - * Inserts \a values under \a key in the map. If \a key already exists, - * then \a values will be appended to the existing StringList. - * The returned value indicates success, i.e. whether \a key is a - * valid key. - */ - bool insert(const String &key, const StringList &values); - - /*! - * Replaces any existing values for \a key with the given \a values, - * and simply insert them if \a key did not exist before. - * The returned value indicates success, i.e. whether \a key is a - * valid key. - */ - bool replace(const String &key, const StringList &values); - - /*! - * Find the first occurrence of \a key. - */ - Iterator find(const String &key); - - /*! - * Find the first occurrence of \a key. - */ - ConstIterator find(const String &key) const; - - /*! - * Returns true if the map contains values for \a key. - */ - bool contains(const String &key) const; - - /*! - * Returns true if this map contains all keys of \a other - * and the values coincide for that keys. Does not take - * the unsupportedData list into account. - */ - bool contains(const PropertyMap &other) const; - - /*! - * Erase the \a key and its values from the map. - */ - PropertyMap &erase(const String &key); - - /*! - * Erases from this map all keys that appear in \a other. - */ - PropertyMap &erase(const PropertyMap &other); - - /*! - * Merge the contents of \a other into this PropertyMap. - * If a key is contained in both maps, the values of the second - * are appended to that of the first. - * The unsupportedData() lists are concatenated as well. - */ - PropertyMap &merge(const PropertyMap &other); - - /*! - * Returns a reference to the value associated with \a key. - * - * \note: If \a key is not contained in the map, an empty - * StringList is returned without error. - */ - const StringList &operator[](const String &key) const; - - /*! - * Returns a reference to the value associated with \a key. - * - * \note: If \a key is not contained in the map, an empty - * StringList is returned. You can also directly add entries - * by using this function as an lvalue. - */ - StringList &operator[](const String &key); - - /*! - * Returns true if and only if \other has the same contents as this map. - */ - bool operator==(const PropertyMap &other) const; - - /*! - * Returns false if and only \other has the same contents as this map. - */ - bool operator!=(const PropertyMap &other) const; - - /*! - * If a PropertyMap is read from a File object using File::properties(), - * the StringList returned from this function will represent metadata - * that could not be parsed into the PropertyMap representation. This could - * be e.g. binary data, unknown ID3 frames, etc. - * You can remove items from the returned list, which tells TagLib to remove - * those unsupported elements if you call File::setProperties() with the - * same PropertyMap as argument. - */ - StringList &unsupportedData(); - const StringList &unsupportedData() const; - - /*! - * Removes all entries which have an empty value list. - */ - void removeEmpty(); - - String toString() const; - - private: - - - StringList unsupported; - }; - -} -#endif /* TAGLIB_PROPERTYMAP_H_ */ diff --git a/3rdparty/taglib/include/taglib/trefcounter.h b/3rdparty/taglib/include/taglib/trefcounter.h deleted file mode 100644 index c231779..0000000 --- a/3rdparty/taglib/include/taglib/trefcounter.h +++ /dev/null @@ -1,113 +0,0 @@ -/*************************************************************************** - copyright : (C) 2013 by Tsuda Kageyu - email : tsuda.kageyu@gmail.com - ***************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * - * 02110-1301 USA * - * * - * Alternatively, this file is available under the Mozilla Public * - * License Version 1.1. You may obtain a copy of the License at * - * http://www.mozilla.org/MPL/ * - ***************************************************************************/ - -#ifndef TAGLIB_REFCOUNTER_H -#define TAGLIB_REFCOUNTER_H - -#include "taglib_export.h" -#include "taglib.h" - -#ifdef __APPLE__ -# include -# define TAGLIB_ATOMIC_MAC -#elif defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) -# ifndef NOMINMAX -# define NOMINMAX -# endif -# include -# define TAGLIB_ATOMIC_WIN -#elif defined (__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 401) \ - && (defined(__i386__) || defined(__i486__) || defined(__i586__) || \ - defined(__i686__) || defined(__x86_64) || defined(__ia64)) \ - && !defined(__INTEL_COMPILER) -# define TAGLIB_ATOMIC_GCC -#elif defined(__ia64) && defined(__INTEL_COMPILER) -# include -# define TAGLIB_ATOMIC_GCC -#endif - -#ifndef DO_NOT_DOCUMENT // Tell Doxygen to skip this class. -/*! - * \internal - * This is just used as a base class for shared classes in TagLib. - * - * \warning This is not part of the TagLib public API! - */ -namespace TagLib -{ - - class TAGLIB_EXPORT RefCounter - { - public: - RefCounter(); - virtual ~RefCounter(); - - void ref(); - bool deref(); - int count() const; - - private: - class RefCounterPrivate; - RefCounterPrivate *d; - }; - - // BIC this old class is needed by tlist.tcc and tmap.tcc - class RefCounterOld - { - public: - RefCounterOld() : refCount(1) {} - -#ifdef TAGLIB_ATOMIC_MAC - void ref() { OSAtomicIncrement32Barrier(const_cast(&refCount)); } - bool deref() { return ! OSAtomicDecrement32Barrier(const_cast(&refCount)); } - int32_t count() { return refCount; } - private: - volatile int32_t refCount; -#elif defined(TAGLIB_ATOMIC_WIN) - void ref() { InterlockedIncrement(&refCount); } - bool deref() { return ! InterlockedDecrement(&refCount); } - long count() { return refCount; } - private: - volatile long refCount; -#elif defined(TAGLIB_ATOMIC_GCC) - void ref() { __sync_add_and_fetch(&refCount, 1); } - bool deref() { return ! __sync_sub_and_fetch(&refCount, 1); } - int count() { return refCount; } - private: - volatile int refCount; -#else - void ref() { refCount++; } - bool deref() { return ! --refCount; } - int count() { return refCount; } - private: - uint refCount; -#endif - }; - -} - -#endif // DO_NOT_DOCUMENT -#endif - diff --git a/3rdparty/taglib/include/taglib/trueaudiofile.h b/3rdparty/taglib/include/taglib/trueaudiofile.h deleted file mode 100644 index 3fc515f..0000000 --- a/3rdparty/taglib/include/taglib/trueaudiofile.h +++ /dev/null @@ -1,252 +0,0 @@ -/*************************************************************************** - copyright : (C) 2006 by Lukáš Lalinský - email : lalinsky@gmail.com - - copyright : (C) 2004 by Allan Sandfeld Jensen - email : kde@carewolf.org - (original MPC implementation) - ***************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * - * 02110-1301 USA * - * * - * Alternatively, this file is available under the Mozilla Public * - * License Version 1.1. You may obtain a copy of the License at * - * http://www.mozilla.org/MPL/ * - ***************************************************************************/ - -#ifndef TAGLIB_TRUEAUDIOFILE_H -#define TAGLIB_TRUEAUDIOFILE_H - -#include "tfile.h" -#include "trueaudioproperties.h" - -namespace TagLib { - - class Tag; - - namespace ID3v2 { class Tag; class FrameFactory; } - namespace ID3v1 { class Tag; } - - //! An implementation of TrueAudio metadata - - /*! - * This is implementation of TrueAudio metadata. - * - * This supports ID3v1 and ID3v2 tags as well as reading stream - * properties from the file. - */ - - namespace TrueAudio { - - //! An implementation of TagLib::File with TrueAudio specific methods - - /*! - * This implements and provides an interface for TrueAudio files to the - * TagLib::Tag and TagLib::AudioProperties interfaces by way of implementing - * the abstract TagLib::File API as well as providing some additional - * information specific to TrueAudio files. - */ - - class TAGLIB_EXPORT File : public TagLib::File - { - public: - /*! - * This set of flags is used for various operations and is suitable for - * being OR-ed together. - */ - enum TagTypes { - //! Empty set. Matches no tag types. - NoTags = 0x0000, - //! Matches ID3v1 tags. - ID3v1 = 0x0001, - //! Matches ID3v2 tags. - ID3v2 = 0x0002, - //! Matches all tag types. - AllTags = 0xffff - }; - - /*! - * Constructs a TrueAudio file from \a file. If \a readProperties is true - * the file's audio properties will also be read. - * - * \note In the current implementation, \a propertiesStyle is ignored. - */ - File(FileName file, bool readProperties = true, - Properties::ReadStyle propertiesStyle = Properties::Average); - - /*! - * Constructs a TrueAudio file from \a file. If \a readProperties is true - * the file's audio properties will also be read. - * - * If this file contains and ID3v2 tag the frames will be created using - * \a frameFactory. - * - * \note In the current implementation, \a propertiesStyle is ignored. - */ - File(FileName file, ID3v2::FrameFactory *frameFactory, - bool readProperties = true, - Properties::ReadStyle propertiesStyle = Properties::Average); - - /*! - * Constructs a TrueAudio file from \a stream. If \a readProperties is true - * the file's audio properties will also be read. - * - * \note TagLib will *not* take ownership of the stream, the caller is - * responsible for deleting it after the File object. - * - * \note In the current implementation, \a propertiesStyle is ignored. - */ - File(IOStream *stream, bool readProperties = true, - Properties::ReadStyle propertiesStyle = Properties::Average); - - /*! - * Constructs a TrueAudio file from \a stream. If \a readProperties is true - * the file's audio properties will also be read. - * - * \note TagLib will *not* take ownership of the stream, the caller is - * responsible for deleting it after the File object. - * - * If this file contains and ID3v2 tag the frames will be created using - * \a frameFactory. - * - * \note In the current implementation, \a propertiesStyle is ignored. - */ - File(IOStream *stream, ID3v2::FrameFactory *frameFactory, - bool readProperties = true, - Properties::ReadStyle propertiesStyle = Properties::Average); - - /*! - * Destroys this instance of the File. - */ - virtual ~File(); - - /*! - * Returns the Tag for this file. - */ - virtual TagLib::Tag *tag() const; - - /*! - * Implements the unified property interface -- export function. - * If the file contains both ID3v1 and v2 tags, only ID3v2 will be - * converted to the PropertyMap. - */ - PropertyMap properties() const; - - /*! - * Implements the unified property interface -- import function. - * Creates in ID3v2 tag if necessary. If an ID3v1 tag exists, it will - * be updated as well, within the limitations of ID3v1. - */ - PropertyMap setProperties(const PropertyMap &); - - void removeUnsupportedProperties(const StringList &properties); - - /*! - * Returns the TrueAudio::Properties for this file. If no audio properties - * were read then this will return a null pointer. - */ - virtual Properties *audioProperties() const; - - /*! - * Set the ID3v2::FrameFactory to something other than the default. - * - * \see ID3v2FrameFactory - * \deprecated This value should be passed in via the constructor - */ - void setID3v2FrameFactory(const ID3v2::FrameFactory *factory); - - /*! - * Saves the file. - */ - virtual bool save(); - - /*! - * Returns a pointer to the ID3v1 tag of the file. - * - * If \a create is false (the default) this may return a null pointer - * if there is no valid ID3v1 tag. If \a create is true it will create - * an ID3v1 tag if one does not exist and returns a valid pointer. - * - * \note This may return a valid pointer regardless of whether or not the - * file on disk has an ID3v1 tag. Use hasID3v1Tag() to check if the file - * on disk actually has an ID3v1 tag. - * - * \note The Tag is still owned by the MPEG::File and should not be - * deleted by the user. It will be deleted when the file (object) is - * destroyed. - * - * \see hasID3v1Tag() - */ - ID3v1::Tag *ID3v1Tag(bool create = false); - - /*! - * Returns a pointer to the ID3v2 tag of the file. - * - * If \a create is false (the default) this may return a null pointer - * if there is no valid ID3v2 tag. If \a create is true it will create - * an ID3v2 tag if one does not exist and returns a valid pointer. - * - * \note This may return a valid pointer regardless of whether or not the - * file on disk has an ID3v2 tag. Use hasID3v2Tag() to check if the file - * on disk actually has an ID3v2 tag. - * - * \note The Tag is still owned by the MPEG::File and should not be - * deleted by the user. It will be deleted when the file (object) is - * destroyed. - * - * \see hasID3v2Tag() - */ - ID3v2::Tag *ID3v2Tag(bool create = false); - - /*! - * This will remove the tags that match the OR-ed together TagTypes from the - * file. By default it removes all tags. - * - * \note This will also invalidate pointers to the tags - * as their memory will be freed. - * \note In order to make the removal permanent save() still needs to be called - */ - void strip(int tags = AllTags); - - /*! - * Returns whether or not the file on disk actually has an ID3v1 tag. - * - * \see ID3v1Tag() - */ - bool hasID3v1Tag() const; - - /*! - * Returns whether or not the file on disk actually has an ID3v2 tag. - * - * \see ID3v2Tag() - */ - bool hasID3v2Tag() const; - - private: - File(const File &); - File &operator=(const File &); - - void read(bool readProperties); - long findID3v1(); - long findID3v2(); - - class FilePrivate; - FilePrivate *d; - }; - } -} - -#endif diff --git a/3rdparty/taglib/include/taglib/trueaudioproperties.h b/3rdparty/taglib/include/taglib/trueaudioproperties.h deleted file mode 100644 index 4d8cd45..0000000 --- a/3rdparty/taglib/include/taglib/trueaudioproperties.h +++ /dev/null @@ -1,133 +0,0 @@ -/*************************************************************************** - copyright : (C) 2006 by Lukáš Lalinský - email : lalinsky@gmail.com - - copyright : (C) 2004 by Allan Sandfeld Jensen - email : kde@carewolf.org - (original MPC implementation) - ***************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * - * 02110-1301 USA * - * * - * Alternatively, this file is available under the Mozilla Public * - * License Version 1.1. You may obtain a copy of the License at * - * http://www.mozilla.org/MPL/ * - ***************************************************************************/ - -#ifndef TAGLIB_TRUEAUDIOPROPERTIES_H -#define TAGLIB_TRUEAUDIOPROPERTIES_H - -#include "audioproperties.h" - -namespace TagLib { - - namespace TrueAudio { - - class File; - - static const uint HeaderSize = 18; - - //! An implementation of audio property reading for TrueAudio - - /*! - * This reads the data from an TrueAudio stream found in the AudioProperties - * API. - */ - - class TAGLIB_EXPORT Properties : public AudioProperties - { - public: - /*! - * Create an instance of TrueAudio::Properties with the data read from the - * ByteVector \a data. - */ - Properties(const ByteVector &data, long streamLength, ReadStyle style = Average); - - /*! - * Destroys this TrueAudio::Properties instance. - */ - virtual ~Properties(); - - /*! - * Returns the length of the file in seconds. The length is rounded down to - * the nearest whole second. - * - * \note This method is just an alias of lengthInSeconds(). - * - * \deprecated - */ - virtual int length() const; - - /*! - * Returns the length of the file in seconds. The length is rounded down to - * the nearest whole second. - * - * \see lengthInMilliseconds() - */ - // BIC: make virtual - int lengthInSeconds() const; - - /*! - * Returns the length of the file in milliseconds. - * - * \see lengthInSeconds() - */ - // BIC: make virtual - int lengthInMilliseconds() const; - - /*! - * Returns the average bit rate of the file in kb/s. - */ - virtual int bitrate() const; - - /*! - * Returns the sample rate in Hz. - */ - virtual int sampleRate() const; - - /*! - * Returns the number of audio channels. - */ - virtual int channels() const; - - /*! - * Returns the number of bits per audio sample. - */ - int bitsPerSample() const; - - /*! - * Returns the total number of sample frames - */ - uint sampleFrames() const; - - /*! - * Returns the major version number. - */ - int ttaVersion() const; - - private: - Properties(const Properties &); - Properties &operator=(const Properties &); - - void read(const ByteVector &data, long streamLength); - - class PropertiesPrivate; - PropertiesPrivate *d; - }; - } -} - -#endif diff --git a/3rdparty/taglib/include/taglib/tstring.h b/3rdparty/taglib/include/taglib/tstring.h deleted file mode 100644 index 8b73988..0000000 --- a/3rdparty/taglib/include/taglib/tstring.h +++ /dev/null @@ -1,583 +0,0 @@ -/*************************************************************************** - copyright : (C) 2002 - 2008 by Scott Wheeler - email : wheeler@kde.org - ***************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * - * 02110-1301 USA * - * * - * Alternatively, this file is available under the Mozilla Public * - * License Version 1.1. You may obtain a copy of the License at * - * http://www.mozilla.org/MPL/ * - ***************************************************************************/ - -#ifndef TAGLIB_STRING_H -#define TAGLIB_STRING_H - -#include "taglib_export.h" -#include "taglib.h" -#include "tbytevector.h" - -#include -#include - -/*! - * \relates TagLib::String - * - * Converts a QString to a TagLib::String without a requirement to link to Qt. - * - * \note consider conversion via usual char-by-char for loop to avoid UTF16->UTF8->UTF16 - * conversion happening in the background - */ - -#if defined(QT_VERSION) && (QT_VERSION >= 0x040000) -#define QStringToTString(s) TagLib::String(s.toUtf8().data(), TagLib::String::UTF8) -#else -#define QStringToTString(s) TagLib::String(s.utf8().data(), TagLib::String::UTF8) -#endif - -/*! - * \relates TagLib::String - * - * Converts a TagLib::String to a QString without a requirement to link to Qt. - * - * \note consider conversion via usual char-by-char for loop to avoid UTF16->UTF8->UTF16 - * conversion happening in the background - * - */ - -#define TStringToQString(s) QString::fromUtf8(s.toCString(true)) - -namespace TagLib { - - class StringList; - - //! A \e wide string class suitable for unicode. - - /*! - * This is an implicitly shared \e wide string. For storage it uses - * TagLib::wstring, but as this is an implementation detail this of - * course could change. Strings are stored internally as UTF-16(without BOM/ - * CPU byte order) - * - * The use of implicit sharing means that copying a string is cheap, the only - * \e cost comes into play when the copy is modified. Prior to that the string - * just has a pointer to the data of the \e parent String. This also makes - * this class suitable as a function return type. - * - * In addition to adding implicit sharing, this class keeps track of four - * possible encodings, which are the four supported by the ID3v2 standard. - */ - - class TAGLIB_EXPORT String - { - public: - -#ifndef DO_NOT_DOCUMENT - typedef std::basic_string::iterator Iterator; - typedef std::basic_string::const_iterator ConstIterator; -#endif - - /** - * The four types of string encodings supported by the ID3v2 specification. - * ID3v1 is assumed to be Latin1 and Ogg Vorbis comments use UTF8. - */ - enum Type { - /*! - * IS08859-1, or Latin1 encoding. 8 bit characters. - */ - Latin1 = 0, - /*! - * UTF16 with a byte order mark. 16 bit characters. - */ - UTF16 = 1, - /*! - * UTF16 big endian. 16 bit characters. This is the encoding used - * internally by TagLib. - */ - UTF16BE = 2, - /*! - * UTF8 encoding. Characters are usually 8 bits but can be up to 32. - */ - UTF8 = 3, - /*! - * UTF16 little endian. 16 bit characters. - */ - UTF16LE = 4 - }; - - /*! - * Constructs an empty String. - */ - String(); - - /*! - * Make a shallow, implicitly shared, copy of \a s. Because this is - * implicitly shared, this method is lightweight and suitable for - * pass-by-value usage. - */ - String(const String &s); - - /*! - * Makes a deep copy of the data in \a s. - * - * \note This should only be used with the 8-bit codecs Latin1 and UTF8, when - * used with other codecs it will simply print a warning and exit. - */ - String(const std::string &s, Type t = Latin1); - - /*! - * Makes a deep copy of the data in \a s. - * - * /note If \a t is UTF16LE, the byte order of \a s will be swapped regardless - * of the CPU byte order. If UTF16BE, it will not be swapped. This behavior - * will be changed in TagLib2.0. - */ - String(const wstring &s, Type t = UTF16BE); - - /*! - * Makes a deep copy of the data in \a s. - * - * /note If \a t is UTF16LE, the byte order of \a s will be swapped regardless - * of the CPU byte order. If UTF16BE, it will not be swapped. This behavior - * will be changed in TagLib2.0. - */ - String(const wchar_t *s, Type t = UTF16BE); - - /*! - * Makes a deep copy of the data in \a c. - * - * \note This should only be used with the 8-bit codecs Latin1 and UTF8, when - * used with other codecs it will simply print a warning and exit. - */ - String(char c, Type t = Latin1); - - /*! - * Makes a deep copy of the data in \a c. - */ - String(wchar_t c, Type t = Latin1); - - /*! - * Makes a deep copy of the data in \a s. - * - * \note This should only be used with the 8-bit codecs Latin1 and UTF8, when - * used with other codecs it will simply print a warning and exit. - */ - String(const char *s, Type t = Latin1); - - /*! - * Makes a deep copy of the data in \a v. - */ - String(const ByteVector &v, Type t = Latin1); - - /*! - * Destroys this String instance. - */ - virtual ~String(); - - /*! - * Returns a deep copy of this String as an std::string. The returned string - * is encoded in UTF8 if \a unicode is true, otherwise Latin1. - * - * \see toCString() - */ - std::string to8Bit(bool unicode = false) const; - - /*! - * Returns a deep copy of this String as a wstring. The returned string is - * encoded in UTF-16 (without BOM/CPU byte order), not UTF-32 even if wchar_t - * is 32-bit wide. - * - * \see toCWString() - */ - wstring toWString() const; - - /*! - * Creates and returns a standard C-style (null-terminated) version of this - * String. The returned string is encoded in UTF8 if \a unicode is true, - * otherwise Latin1. - * - * The returned string is still owned by this String and should not be deleted - * by the user. - * - * The returned pointer remains valid until this String instance is destroyed - * or toCString() is called again. - * - * \warning This however has the side effect that the returned string will remain - * in memory in addition to other memory that is consumed by this - * String instance. So, this method should not be used on large strings or - * where memory is critical. Consider using to8Bit() instead to avoid it. - * - * \see to8Bit() - */ - const char *toCString(bool unicode = false) const; - - /*! - * Returns a standard C-style (null-terminated) wide character version of - * this String. The returned string is encoded in UTF-16 (without BOM/CPU byte - * order), not UTF-32 even if wchar_t is 32-bit wide. - * - * The returned string is still owned by this String and should not be deleted - * by the user. - * - * The returned pointer remains valid until this String instance is destroyed - * or any other method of this String is called. - * - * \note This returns a pointer to the String's internal data without any - * conversions. - * - * \see toWString() - */ - const wchar_t *toCWString() const; - - /*! - * Returns an iterator pointing to the beginning of the string. - */ - Iterator begin(); - - /*! - * Returns a const iterator pointing to the beginning of the string. - */ - ConstIterator begin() const; - - /*! - * Returns an iterator pointing to the end of the string (the position - * after the last character). - */ - Iterator end(); - - /*! - * Returns a const iterator pointing to the end of the string (the position - * after the last character). - */ - ConstIterator end() const; - - /*! - * Finds the first occurrence of pattern \a s in this string starting from - * \a offset. If the pattern is not found, -1 is returned. - */ - int find(const String &s, int offset = 0) const; - - /*! - * Finds the last occurrence of pattern \a s in this string, searched backwards, - * either from the end of the string or starting from \a offset. If the pattern - * is not found, -1 is returned. - */ - int rfind(const String &s, int offset = -1) const; - - /*! - * Splits the string on each occurrence of \a separator. - */ - StringList split(const String &separator = " ") const; - - /*! - * Returns true if the strings starts with the substring \a s. - */ - bool startsWith(const String &s) const; - - /*! - * Extract a substring from this string starting at \a position and - * continuing for \a n characters. - */ - String substr(uint position, uint n = 0xffffffff) const; - - /*! - * Append \a s to the current string and return a reference to the current - * string. - */ - String &append(const String &s); - - /*! - * Returns an upper case version of the string. - * - * \warning This only works for the characters in US-ASCII, i.e. A-Z. - */ - String upper() const; - - /*! - * Returns the size of the string. - */ - uint size() const; - - /*! - * Returns the length of the string. Equivalent to size(). - */ - uint length() const; - - /*! - * Returns true if the string is empty. - * - * \see isNull() - */ - bool isEmpty() const; - - /*! - * Returns true if this string is null -- i.e. it is a copy of the - * String::null string. - * - * \note A string can be empty and not null. - * \see isEmpty() - */ - bool isNull() const; - - /*! - * Returns a ByteVector containing the string's data. If \a t is Latin1 or - * UTF8, this will return a vector of 8 bit characters, otherwise it will use - * 16 bit characters. - * - * \note If \a t is UTF16, the returned data is encoded in little-endian - * format and has a BOM. - * - * \note The returned data is not null terminated. - */ - ByteVector data(Type t) const; - - /*! - * Convert the string to an integer. - * - * Returns the integer if the conversion was successful or 0 if the - * string does not represent a number. - */ - // BIC: merge with the method below - int toInt() const; - - /*! - * Convert the string to an integer. - * - * If the conversion was successful, it sets the value of \a *ok to - * true and returns the integer. Otherwise it sets \a *ok to false - * and the result is undefined. - */ - int toInt(bool *ok) const; - - /*! - * Returns a string with the leading and trailing whitespace stripped. - */ - String stripWhiteSpace() const; - - /*! - * Returns true if the file only uses characters required by Latin1. - */ - bool isLatin1() const; - - /*! - * Returns true if the file only uses characters required by (7-bit) ASCII. - */ - bool isAscii() const; - - /*! - * Converts the base-10 integer \a n to a string. - */ - static String number(int n); - - /*! - * Returns a reference to the character at position \a i. - */ - wchar &operator[](int i); - - /*! - * Returns a const reference to the character at position \a i. - */ - const wchar &operator[](int i) const; - - /*! - * Compares each character of the String with each character of \a s and - * returns true if the strings match. - */ - bool operator==(const String &s) const; - - /*! - * Compares each character of the String with each character of \a s and - * returns false if the strings match. - */ - bool operator!=(const String &s) const; - - /*! - * Compares each character of the String with each character of \a s and - * returns true if the strings match. - */ - bool operator==(const char *s) const; - - /*! - * Compares each character of the String with each character of \a s and - * returns false if the strings match. - */ - bool operator!=(const char *s) const; - - /*! - * Compares each character of the String with each character of \a s and - * returns true if the strings match. - */ - bool operator==(const wchar_t *s) const; - - /*! - * Compares each character of the String with each character of \a s and - * returns false if the strings match. - */ - bool operator!=(const wchar_t *s) const; - - /*! - * Appends \a s to the end of the String. - */ - String &operator+=(const String &s); - - /*! - * Appends \a s to the end of the String. - */ - String &operator+=(const wchar_t* s); - - /*! - * Appends \a s to the end of the String. - */ - String &operator+=(const char* s); - - /*! - * Appends \a s to the end of the String. - */ - String &operator+=(wchar_t c); - - /*! - * Appends \a c to the end of the String. - */ - String &operator+=(char c); - - /*! - * Performs a shallow, implicitly shared, copy of \a s, overwriting the - * String's current data. - */ - String &operator=(const String &s); - - /*! - * Performs a deep copy of the data in \a s. - */ - String &operator=(const std::string &s); - - /*! - * Performs a deep copy of the data in \a s. - */ - String &operator=(const wstring &s); - - /*! - * Performs a deep copy of the data in \a s. - */ - String &operator=(const wchar_t *s); - - /*! - * Performs a deep copy of the data in \a s. - */ - String &operator=(char c); - - /*! - * Performs a deep copy of the data in \a s. - */ - String &operator=(wchar_t c); - - /*! - * Performs a deep copy of the data in \a s. - */ - String &operator=(const char *s); - - /*! - * Performs a deep copy of the data in \a v. - */ - String &operator=(const ByteVector &v); - - /*! - * To be able to use this class in a Map, this operator needed to be - * implemented. Returns true if \a s is less than this string in a byte-wise - * comparison. - */ - bool operator<(const String &s) const; - - /*! - * A null string provided for convenience. - */ - static String null; - - protected: - /*! - * If this String is being shared via implicit sharing, do a deep copy of the - * data and separate from the shared members. This should be called by all - * non-const subclass members. - */ - void detach(); - - private: - /*! - * Converts a \e Latin-1 string into \e UTF-16(without BOM/CPU byte order) - * and copies it to the internal buffer. - */ - void copyFromLatin1(const char *s, size_t length); - - /*! - * Converts a \e UTF-8 string into \e UTF-16(without BOM/CPU byte order) - * and copies it to the internal buffer. - */ - void copyFromUTF8(const char *s, size_t length); - - /*! - * Converts a \e UTF-16 (with BOM), UTF-16LE or UTF16-BE string into - * \e UTF-16(without BOM/CPU byte order) and copies it to the internal buffer. - */ - void copyFromUTF16(const wchar_t *s, size_t length, Type t); - - /*! - * Converts a \e UTF-16 (with BOM), UTF-16LE or UTF16-BE string into - * \e UTF-16(without BOM/CPU byte order) and copies it to the internal buffer. - */ - void copyFromUTF16(const char *s, size_t length, Type t); - - /*! - * Indicates which byte order of UTF-16 is used to store strings internally. - * - * \note \e String::UTF16BE or \e String::UTF16LE - */ - static const Type WCharByteOrder; - - class StringPrivate; - StringPrivate *d; - }; -} - -/*! - * \relates TagLib::String - * - * Concatenates \a s1 and \a s2 and returns the result as a string. - */ -TAGLIB_EXPORT const TagLib::String operator+(const TagLib::String &s1, const TagLib::String &s2); - -/*! - * \relates TagLib::String - * - * Concatenates \a s1 and \a s2 and returns the result as a string. - */ -TAGLIB_EXPORT const TagLib::String operator+(const char *s1, const TagLib::String &s2); - -/*! - * \relates TagLib::String - * - * Concatenates \a s1 and \a s2 and returns the result as a string. - */ -TAGLIB_EXPORT const TagLib::String operator+(const TagLib::String &s1, const char *s2); - - -/*! - * \relates TagLib::String - * - * Send the string to an output stream. - */ -TAGLIB_EXPORT std::ostream &operator<<(std::ostream &s, const TagLib::String &str); - -#endif diff --git a/3rdparty/taglib/include/taglib/tstringlist.h b/3rdparty/taglib/include/taglib/tstringlist.h deleted file mode 100644 index 41b7f6e..0000000 --- a/3rdparty/taglib/include/taglib/tstringlist.h +++ /dev/null @@ -1,115 +0,0 @@ -/*************************************************************************** - copyright : (C) 2002 - 2008 by Scott Wheeler - email : wheeler@kde.org - ***************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * - * 02110-1301 USA * - * * - * Alternatively, this file is available under the Mozilla Public * - * License Version 1.1. You may obtain a copy of the License at * - * http://www.mozilla.org/MPL/ * - ***************************************************************************/ - -#ifndef TAGLIB_STRINGLIST_H -#define TAGLIB_STRINGLIST_H - -#include "tstring.h" -#include "tlist.h" -#include "tbytevectorlist.h" -#include "taglib_export.h" - -#include - -namespace TagLib { - - //! A list of strings - - /*! - * This is a specialization of the List class with some members convention for - * string operations. - */ - - class TAGLIB_EXPORT StringList : public List - { - public: - - /*! - * Constructs an empty StringList. - */ - StringList(); - - /*! - * Make a shallow, implicitly shared, copy of \a l. Because this is - * implicitly shared, this method is lightweight and suitable for - * pass-by-value usage. - */ - StringList(const StringList &l); - - /*! - * Constructs a StringList with \a s as a member. - */ - StringList(const String &s); - - /*! - * Makes a deep copy of the data in \a vl. - * - * \note This should only be used with the 8-bit codecs Latin1 and UTF8, when - * used with other codecs it will simply print a warning and exit. - */ - StringList(const ByteVectorList &vl, String::Type t = String::Latin1); - - /*! - * Destroys this StringList instance. - */ - virtual ~StringList(); - - /*! - * Concatenate the list of strings into one string separated by \a separator. - */ - String toString(const String &separator = " ") const; - - /*! - * Appends \a s to the end of the list and returns a reference to the - * list. - */ - StringList &append(const String &s); - - /*! - * Appends all of the values in \a l to the end of the list and returns a - * reference to the list. - */ - StringList &append(const StringList &l); - - /*! - * Splits the String \a s into several strings at \a pattern. This will not include - * the pattern in the returned strings. - */ - static StringList split(const String &s, const String &pattern); - - private: - class StringListPrivate; - StringListPrivate *d; - }; - -} - -/*! - * \related TagLib::StringList - * Send the StringList to an output stream. - */ -std::ostream &operator<<(std::ostream &s, const TagLib::StringList &l); - -#endif diff --git a/3rdparty/taglib/include/taglib/uniquefileidentifierframe.h b/3rdparty/taglib/include/taglib/uniquefileidentifierframe.h deleted file mode 100644 index decf1b0..0000000 --- a/3rdparty/taglib/include/taglib/uniquefileidentifierframe.h +++ /dev/null @@ -1,123 +0,0 @@ -/*************************************************************************** - copyright : (C) 2002 - 2008 by Scott Wheeler - email : wheeler@kde.org - ***************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * - * 02110-1301 USA * - * * - * Alternatively, this file is available under the Mozilla Public * - * License Version 1.1. You may obtain a copy of the License at * - * http://www.mozilla.org/MPL/ * - ***************************************************************************/ - -#ifndef TAGLIB_UNIQUEFILEIDENTIFIERFRAME -#define TAGLIB_UNIQUEFILEIDENTIFIERFRAME - -#include "id3v2frame.h" - -namespace TagLib { - - namespace ID3v2 { - - /*! - * This is an implementation of ID3v2 unique file identifier frames. This - * frame is used to identify the file in an arbitrary database identified - * by the owner field. - */ - - //! An implementation of ID3v2 unique identifier frames - - class TAGLIB_EXPORT UniqueFileIdentifierFrame : public ID3v2::Frame - { - friend class FrameFactory; - - public: - /*! - * Creates a unique file identifier frame based on \a data. - */ - UniqueFileIdentifierFrame(const ByteVector &data); - - /*! - * Creates a unique file identifier frame with the owner \a owner and - * the identification \a id. - */ - UniqueFileIdentifierFrame(const String &owner, const ByteVector &id); - - /*! - * Destroys the frame. - */ - ~UniqueFileIdentifierFrame(); - - /*! - * Returns the owner for the frame; essentially this is the key for - * determining which identification scheme this key belongs to. This - * will usually either be an email address or URL for the person or tool - * used to create the unique identifier. - * - * \see setOwner() - */ - String owner() const; - - /*! - * Returns the unique identifier. Though sometimes this is a text string - * it also may be binary data and as much should be assumed when handling - * it. - */ - ByteVector identifier() const; - - /*! - * Sets the owner of the identification scheme to \a s. - * - * \see owner() - */ - void setOwner(const String &s); - - /*! - * Sets the unique file identifier to \a v. - * - * \see identifier() - */ - void setIdentifier(const ByteVector &v); - - virtual String toString() const; - - PropertyMap asProperties() const; - - /*! - * UFID frames each have a unique owner. This searches for a UFID - * frame with the owner \a o and returns a pointer to it. - * - * \see owner() - */ - static UniqueFileIdentifierFrame *findByOwner(const Tag *tag, const String &o); - - protected: - virtual void parseFields(const ByteVector &data); - virtual ByteVector renderFields() const; - - private: - UniqueFileIdentifierFrame(const UniqueFileIdentifierFrame &); - UniqueFileIdentifierFrame &operator=(const UniqueFileIdentifierFrame &); - - UniqueFileIdentifierFrame(const ByteVector &data, Header *h); - - class UniqueFileIdentifierFramePrivate; - UniqueFileIdentifierFramePrivate *d; - }; - } -} - -#endif diff --git a/3rdparty/taglib/include/taglib/unknownframe.h b/3rdparty/taglib/include/taglib/unknownframe.h deleted file mode 100644 index 6559f4e..0000000 --- a/3rdparty/taglib/include/taglib/unknownframe.h +++ /dev/null @@ -1,79 +0,0 @@ -/*************************************************************************** - copyright : (C) 2002 - 2008 by Scott Wheeler - email : wheeler@kde.org - ***************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * - * 02110-1301 USA * - * * - * Alternatively, this file is available under the Mozilla Public * - * License Version 1.1. You may obtain a copy of the License at * - * http://www.mozilla.org/MPL/ * - ***************************************************************************/ - -#ifndef TAGLIB_UNKNOWNFRAME_H -#define TAGLIB_UNKNOWNFRAME_H - -#include "id3v2frame.h" -#include "taglib_export.h" - -namespace TagLib { - - namespace ID3v2 { - - //! A frame type \e unknown to TagLib. - - /*! - * This class represents a frame type not known (or more often simply - * unimplemented) in TagLib. This is here provide a basic API for - * manipulating the binary data of unknown frames and to provide a means - * of rendering such \e unknown frames. - * - * Please note that a cleaner way of handling frame types that TagLib - * does not understand is to subclass ID3v2::Frame and ID3v2::FrameFactory - * to have your frame type supported through the standard ID3v2 mechanism. - */ - - class TAGLIB_EXPORT UnknownFrame : public Frame - { - friend class FrameFactory; - - public: - UnknownFrame(const ByteVector &data); - virtual ~UnknownFrame(); - - virtual String toString() const; - - /*! - * Returns the field data (everything but the header) for this frame. - */ - ByteVector data() const; - - protected: - virtual void parseFields(const ByteVector &data); - virtual ByteVector renderFields() const; - - private: - UnknownFrame(const ByteVector &data, Header *h); - UnknownFrame(const UnknownFrame &); - UnknownFrame &operator=(const UnknownFrame &); - - class UnknownFramePrivate; - UnknownFramePrivate *d; - }; - - } -} -#endif diff --git a/3rdparty/taglib/include/taglib/unsynchronizedlyricsframe.h b/3rdparty/taglib/include/taglib/unsynchronizedlyricsframe.h deleted file mode 100644 index dad67c7..0000000 --- a/3rdparty/taglib/include/taglib/unsynchronizedlyricsframe.h +++ /dev/null @@ -1,179 +0,0 @@ -/*************************************************************************** - copyright : (C) 2002 - 2008 by Scott Wheeler - email : wheeler@kde.org - copyright : (C) 2006 by Urs Fleisch - email : ufleisch@users.sourceforge.net - ***************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * - * 02110-1301 USA * - * * - * Alternatively, this file is available under the Mozilla Public * - * License Version 1.1. You may obtain a copy of the License at * - * http://www.mozilla.org/MPL/ * - ***************************************************************************/ - -#ifndef TAGLIB_UNSYNCHRONIZEDLYRICSFRAME_H -#define TAGLIB_UNSYNCHRONIZEDLYRICSFRAME_H - -#include "id3v2frame.h" - -namespace TagLib { - - namespace ID3v2 { - - //! ID3v2 unsynchronized lyrics frame - /*! - * An implementation of ID3v2 unsynchronized lyrics. - */ - class TAGLIB_EXPORT UnsynchronizedLyricsFrame : public Frame - { - friend class FrameFactory; - - public: - /*! - * Construct an empty unsynchronized lyrics frame that will use the text encoding - * \a encoding. - */ - explicit UnsynchronizedLyricsFrame(String::Type encoding = String::Latin1); - - /*! - * Construct a unsynchronized lyrics frame based on the data in \a data. - */ - explicit UnsynchronizedLyricsFrame(const ByteVector &data); - - /*! - * Destroys this UnsynchronizedLyricsFrame instance. - */ - virtual ~UnsynchronizedLyricsFrame(); - - /*! - * Returns the text of this unsynchronized lyrics frame. - * - * \see text() - */ - virtual String toString() const; - - /*! - * Returns the language encoding as a 3 byte encoding as specified by - * ISO-639-2. - * - * \note Most taggers simply ignore this value. - * - * \see setLanguage() - */ - ByteVector language() const; - - /*! - * Returns the description of this unsynchronized lyrics frame. - * - * \note Most taggers simply ignore this value. - * - * \see setDescription() - */ - String description() const; - - /*! - * Returns the text of this unsynchronized lyrics frame. - * - * \see setText() - */ - String text() const; - - /*! - * Set the language using the 3 byte language code from - * ISO-639-2 to - * \a languageCode. - * - * \see language() - */ - void setLanguage(const ByteVector &languageCode); - - /*! - * Sets the description of the unsynchronized lyrics frame to \a s. - * - * \see description() - */ - void setDescription(const String &s); - - /*! - * Sets the text portion of the unsynchronized lyrics frame to \a s. - * - * \see text() - */ - virtual void setText(const String &s); - - /*! - * Returns the text encoding that will be used in rendering this frame. - * This defaults to the type that was either specified in the constructor - * or read from the frame when parsed. - * - * \see setTextEncoding() - * \see render() - */ - String::Type textEncoding() const; - - /*! - * Sets the text encoding to be used when rendering this frame to - * \a encoding. - * - * \see textEncoding() - * \see render() - */ - void setTextEncoding(String::Type encoding); - - - /*! Parses this frame as PropertyMap with a single key. - * - if description() is empty or "LYRICS", the key will be "LYRICS" - * - if description() is not a valid PropertyMap key, the frame will be - * marked unsupported by an entry "USLT/" in the unsupportedData() - * attribute of the returned map. - * - otherwise, the key will be "LYRICS:" - * - The single value will be the frame's text(). - * Note that currently the language() field is not supported by the PropertyMap - * interface. - */ - PropertyMap asProperties() const; - - /*! - * LyricsFrames each have a unique description. This searches for a lyrics - * frame with the description \a d and returns a pointer to it. If no - * frame is found that matches the given description null is returned. - * - * \see description() - */ - static UnsynchronizedLyricsFrame *findByDescription(const Tag *tag, const String &d); - - protected: - // Reimplementations. - - virtual void parseFields(const ByteVector &data); - virtual ByteVector renderFields() const; - - private: - /*! - * The constructor used by the FrameFactory. - */ - UnsynchronizedLyricsFrame(const ByteVector &data, Header *h); - UnsynchronizedLyricsFrame(const UnsynchronizedLyricsFrame &); - UnsynchronizedLyricsFrame &operator=(const UnsynchronizedLyricsFrame &); - - class UnsynchronizedLyricsFramePrivate; - UnsynchronizedLyricsFramePrivate *d; - }; - - } -} -#endif diff --git a/3rdparty/taglib/include/taglib/urllinkframe.h b/3rdparty/taglib/include/taglib/urllinkframe.h deleted file mode 100644 index 7ac966b..0000000 --- a/3rdparty/taglib/include/taglib/urllinkframe.h +++ /dev/null @@ -1,189 +0,0 @@ -/*************************************************************************** - copyright : (C) 2002 - 2008 by Scott Wheeler - email : wheeler@kde.org - copyright : (C) 2006 by Urs Fleisch - email : ufleisch@users.sourceforge.net - ***************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * - * 02110-1301 USA * - * * - * Alternatively, this file is available under the Mozilla Public * - * License Version 1.1. You may obtain a copy of the License at * - * http://www.mozilla.org/MPL/ * - ***************************************************************************/ - -#ifndef TAGLIB_URLLINKFRAME_H -#define TAGLIB_URLLINKFRAME_H - -#include "id3v2frame.h" - -namespace TagLib { - - namespace ID3v2 { - - //! ID3v2 URL frame - /*! - * An implementation of ID3v2 URL link frames. - */ - class TAGLIB_EXPORT UrlLinkFrame : public Frame - { - friend class FrameFactory; - - public: - /*! - * This is a dual purpose constructor. \a data can either be binary data - * that should be parsed or (at a minimum) the frame ID. - */ - explicit UrlLinkFrame(const ByteVector &data); - - /*! - * Destroys this UrlLinkFrame instance. - */ - virtual ~UrlLinkFrame(); - - /*! - * Returns the URL. - */ - virtual String url() const; - - /*! - * Sets the URL to \a s. - */ - virtual void setUrl(const String &s); - - // Reimplementations. - - virtual void setText(const String &s); - virtual String toString() const; - PropertyMap asProperties() const; - - protected: - virtual void parseFields(const ByteVector &data); - virtual ByteVector renderFields() const; - - /*! - * The constructor used by the FrameFactory. - */ - UrlLinkFrame(const ByteVector &data, Header *h); - - private: - UrlLinkFrame(const UrlLinkFrame &); - UrlLinkFrame &operator=(const UrlLinkFrame &); - - class UrlLinkFramePrivate; - UrlLinkFramePrivate *d; - }; - - //! ID3v2 User defined URL frame - - /*! - * This is a specialization of URL link frames that allows for - * user defined entries. Each entry has a description in addition to the - * normal list of fields that a URL link frame has. - * - * This description identifies the frame and must be unique. - */ - class TAGLIB_EXPORT UserUrlLinkFrame : public UrlLinkFrame - { - friend class FrameFactory; - - public: - /*! - * Constructs an empty user defined URL link frame. For this to be - * a useful frame both a description and text must be set. - */ - explicit UserUrlLinkFrame(String::Type encoding = String::Latin1); - - /*! - * This is a dual purpose constructor. \a data can either be binary data - * that should be parsed or (at a minimum) the frame ID. - */ - explicit UserUrlLinkFrame(const ByteVector &data); - - /*! - * Destroys this UserUrlLinkFrame instance. - */ - virtual ~UserUrlLinkFrame(); - - // Reimplementations. - - virtual String toString() const; - - /*! - * Returns the text encoding that will be used in rendering this frame. - * This defaults to the type that was either specified in the constructor - * or read from the frame when parsed. - * - * \see setTextEncoding() - * \see render() - */ - String::Type textEncoding() const; - - /*! - * Sets the text encoding to be used when rendering this frame to - * \a encoding. - * - * \see textEncoding() - * \see render() - */ - void setTextEncoding(String::Type encoding); - - /*! - * Returns the description for this frame. - */ - String description() const; - - /*! - * Sets the description of the frame to \a s. \a s must be unique. - */ - void setDescription(const String &s); - - /*! - * Parses the UserUrlLinkFrame as PropertyMap. The description() is taken as key, - * and the URL as single value. - * - if description() is empty, the key will be "URL". - * - otherwise, if description() is not a valid key (e.g. containing non-ASCII - * characters), the returned map will contain an entry "WXXX/" - * in its unsupportedData() list. - */ - PropertyMap asProperties() const; - - /*! - * Searches for the user defined url frame with the description \a description - * in \a tag. This returns null if no matching frames were found. - */ - static UserUrlLinkFrame *find(Tag *tag, const String &description); - - protected: - virtual void parseFields(const ByteVector &data); - virtual ByteVector renderFields() const; - - /*! - * The constructor used by the FrameFactory. - */ - UserUrlLinkFrame(const ByteVector &data, Header *h); - - private: - UserUrlLinkFrame(const UserUrlLinkFrame &); - UserUrlLinkFrame &operator=(const UserUrlLinkFrame &); - - class UserUrlLinkFramePrivate; - UserUrlLinkFramePrivate *d; - }; - - } -} -#endif diff --git a/3rdparty/taglib/include/taglib/vorbisfile.h b/3rdparty/taglib/include/taglib/vorbisfile.h deleted file mode 100644 index 48d9d7c..0000000 --- a/3rdparty/taglib/include/taglib/vorbisfile.h +++ /dev/null @@ -1,152 +0,0 @@ -/*************************************************************************** - copyright : (C) 2002 - 2008 by Scott Wheeler - email : wheeler@kde.org - ***************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * - * 02110-1301 USA * - * * - * Alternatively, this file is available under the Mozilla Public * - * License Version 1.1. You may obtain a copy of the License at * - * http://www.mozilla.org/MPL/ * - ***************************************************************************/ - -#ifndef TAGLIB_VORBISFILE_H -#define TAGLIB_VORBISFILE_H - -#include "taglib_export.h" -#include "oggfile.h" -#include "xiphcomment.h" - -#include "vorbisproperties.h" - -namespace TagLib { - -/* - * This is just to make this appear to be in the Ogg namespace in the - * documentation. The typedef below will make this work with the current code. - * In the next BIC version of TagLib this will be really moved into the Ogg - * namespace. - */ - -#ifdef DOXYGEN - namespace Ogg { -#endif - - //! A namespace containing classes for Vorbis metadata - - namespace Vorbis { - - - //! An implementation of Ogg::File with Vorbis specific methods - - /*! - * This is the central class in the Ogg Vorbis metadata processing collection - * of classes. It's built upon Ogg::File which handles processing of the Ogg - * logical bitstream and breaking it down into pages which are handled by - * the codec implementations, in this case Vorbis specifically. - */ - - class TAGLIB_EXPORT File : public Ogg::File - { - public: - /*! - * Constructs a Vorbis file from \a file. If \a readProperties is true the - * file's audio properties will also be read. - * - * \note In the current implementation, \a propertiesStyle is ignored. - */ - File(FileName file, bool readProperties = true, - Properties::ReadStyle propertiesStyle = Properties::Average); - - /*! - * Constructs a Vorbis file from \a stream. If \a readProperties is true the - * file's audio properties will also be read. - * - * \note TagLib will *not* take ownership of the stream, the caller is - * responsible for deleting it after the File object. - * - * \note In the current implementation, \a propertiesStyle is ignored. - */ - File(IOStream *stream, bool readProperties = true, - Properties::ReadStyle propertiesStyle = Properties::Average); - - /*! - * Destroys this instance of the File. - */ - virtual ~File(); - - /*! - * Returns the XiphComment for this file. XiphComment implements the tag - * interface, so this serves as the reimplementation of - * TagLib::File::tag(). - */ - virtual Ogg::XiphComment *tag() const; - - - /*! - * Implements the unified property interface -- export function. - * This forwards directly to XiphComment::properties(). - */ - PropertyMap properties() const; - - /*! - * Implements the unified tag dictionary interface -- import function. - * Like properties(), this is a forwarder to the file's XiphComment. - */ - PropertyMap setProperties(const PropertyMap &); - - /*! - * Returns the Vorbis::Properties for this file. If no audio properties - * were read then this will return a null pointer. - */ - virtual Properties *audioProperties() const; - - /*! - * Save the file. - * - * This returns true if the save was successful. - * - * \warning In the current implementation, it's dangerous to call save() - * repeatedly. It leads to a segfault. - */ - virtual bool save(); - - private: - File(const File &); - File &operator=(const File &); - - void read(bool readProperties); - - class FilePrivate; - FilePrivate *d; - }; - } - -/* - * To keep compatibility with the current version put Vorbis in the Ogg namespace - * only in the docs and provide a typedef to make it work. In the next BIC - * version this will be removed and it will only exist in the Ogg namespace. - */ - -#ifdef DOXYGEN - } -#else - namespace Ogg { namespace Vorbis { typedef TagLib::Vorbis::File File; } } -#endif - -} - -#endif diff --git a/3rdparty/taglib/include/taglib/vorbisproperties.h b/3rdparty/taglib/include/taglib/vorbisproperties.h deleted file mode 100644 index 9da0ac9..0000000 --- a/3rdparty/taglib/include/taglib/vorbisproperties.h +++ /dev/null @@ -1,160 +0,0 @@ -/*************************************************************************** - copyright : (C) 2002 - 2008 by Scott Wheeler - email : wheeler@kde.org - ***************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * - * 02110-1301 USA * - * * - * Alternatively, this file is available under the Mozilla Public * - * License Version 1.1. You may obtain a copy of the License at * - * http://www.mozilla.org/MPL/ * - ***************************************************************************/ - -#ifndef TAGLIB_VORBISPROPERTIES_H -#define TAGLIB_VORBISPROPERTIES_H - -#include "taglib_export.h" -#include "audioproperties.h" - -namespace TagLib { - -/* - * This is just to make this appear to be in the Ogg namespace in the - * documentation. The typedef below will make this work with the current code. - * In the next BIC version of TagLib this will be really moved into the Ogg - * namespace. - */ - -#ifdef DOXYGEN - namespace Ogg { -#endif - - namespace Vorbis { - - class File; - - //! An implementation of audio property reading for Ogg Vorbis - - /*! - * This reads the data from an Ogg Vorbis stream found in the AudioProperties - * API. - */ - - class TAGLIB_EXPORT Properties : public AudioProperties - { - public: - /*! - * Create an instance of Vorbis::Properties with the data read from the - * Vorbis::File \a file. - */ - Properties(File *file, ReadStyle style = Average); - - /*! - * Destroys this VorbisProperties instance. - */ - virtual ~Properties(); - - /*! - * Returns the length of the file in seconds. The length is rounded down to - * the nearest whole second. - * - * \note This method is just an alias of lengthInSeconds(). - * - * \deprecated - */ - virtual int length() const; - - /*! - * Returns the length of the file in seconds. The length is rounded down to - * the nearest whole second. - * - * \see lengthInMilliseconds() - */ - // BIC: make virtual - int lengthInSeconds() const; - - /*! - * Returns the length of the file in milliseconds. - * - * \see lengthInSeconds() - */ - // BIC: make virtual - int lengthInMilliseconds() const; - - /*! - * Returns the average bit rate of the file in kb/s. - */ - virtual int bitrate() const; - - /*! - * Returns the sample rate in Hz. - */ - virtual int sampleRate() const; - - /*! - * Returns the number of audio channels. - */ - virtual int channels() const; - - /*! - * Returns the Vorbis version, currently "0" (as specified by the spec). - */ - int vorbisVersion() const; - - /*! - * Returns the maximum bitrate as read from the Vorbis identification - * header. - */ - int bitrateMaximum() const; - - /*! - * Returns the nominal bitrate as read from the Vorbis identification - * header. - */ - int bitrateNominal() const; - - /*! - * Returns the minimum bitrate as read from the Vorbis identification - * header. - */ - int bitrateMinimum() const; - - private: - Properties(const Properties &); - Properties &operator=(const Properties &); - - void read(File *file); - - class PropertiesPrivate; - PropertiesPrivate *d; - }; - } - -/* - * To keep compatibility with the current version put Vorbis in the Ogg namespace - * only in the docs and provide a typedef to make it work. In the next BIC - * version this will be removed and it will only exist in the Ogg namespace. - */ - -#ifdef DOXYGEN - } -#else - namespace Ogg { namespace Vorbis { typedef TagLib::AudioProperties AudioProperties; } } -#endif - -} - -#endif diff --git a/3rdparty/taglib/include/taglib/wavfile.h b/3rdparty/taglib/include/taglib/wavfile.h deleted file mode 100644 index 129d953..0000000 --- a/3rdparty/taglib/include/taglib/wavfile.h +++ /dev/null @@ -1,191 +0,0 @@ -/*************************************************************************** - copyright : (C) 2008 by Scott Wheeler - email : wheeler@kde.org -***************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * - * 02110-1301 USA * - * * - * Alternatively, this file is available under the Mozilla Public * - * License Version 1.1. You may obtain a copy of the License at * - * http://www.mozilla.org/MPL/ * - ***************************************************************************/ - -#ifndef TAGLIB_WAVFILE_H -#define TAGLIB_WAVFILE_H - -#include "rifffile.h" -#include "id3v2tag.h" -#include "infotag.h" -#include "wavproperties.h" - -namespace TagLib { - - namespace RIFF { - - //! An implementation of WAV metadata - - /*! - * This is implementation of WAV metadata. - * - * This supports an ID3v2 tag as well as reading stream from the ID3 RIFF - * chunk as well as properties from the file. - */ - - namespace WAV { - - //! An implementation of TagLib::File with WAV specific methods - - /*! - * This implements and provides an interface for WAV files to the - * TagLib::Tag and TagLib::AudioProperties interfaces by way of implementing - * the abstract TagLib::File API as well as providing some additional - * information specific to WAV files. - */ - - class TAGLIB_EXPORT File : public TagLib::RIFF::File - { - public: - enum TagTypes { - //! Empty set. Matches no tag types. - NoTags = 0x0000, - //! Matches ID3v2 tags. - ID3v2 = 0x0001, - //! Matches INFO tags. - Info = 0x0002, - //! Matches all tag types. - AllTags = 0xffff - }; - - /*! - * Constructs a WAV file from \a file. If \a readProperties is true the - * file's audio properties will also be read. - * - * \note In the current implementation, \a propertiesStyle is ignored. - */ - File(FileName file, bool readProperties = true, - Properties::ReadStyle propertiesStyle = Properties::Average); - - /*! - * Constructs a WAV file from \a stream. If \a readProperties is true the - * file's audio properties will also be read. - * - * \note TagLib will *not* take ownership of the stream, the caller is - * responsible for deleting it after the File object. - * - * \note In the current implementation, \a propertiesStyle is ignored. - */ - File(IOStream *stream, bool readProperties = true, - Properties::ReadStyle propertiesStyle = Properties::Average); - - /*! - * Destroys this instance of the File. - */ - virtual ~File(); - - /*! - * Returns the ID3v2 Tag for this file. - * - * \note This method does not return all the tags for this file for - * backward compatibility. Will be fixed in TagLib 2.0. - */ - ID3v2::Tag *tag() const; - - /*! - * Returns the ID3v2 Tag for this file. - * - * \note This always returns a valid pointer regardless of whether or not - * the file on disk has an ID3v2 tag. Use hasID3v2Tag() to check if the - * file on disk actually has an ID3v2 tag. - * - * \see hasID3v2Tag() - */ - ID3v2::Tag *ID3v2Tag() const; - - /*! - * Returns the RIFF INFO Tag for this file. - * - * \note This always returns a valid pointer regardless of whether or not - * the file on disk has a RIFF INFO tag. Use hasInfoTag() to check if the - * file on disk actually has a RIFF INFO tag. - * - * \see hasInfoTag() - */ - Info::Tag *InfoTag() const; - - /*! - * Implements the unified property interface -- export function. - * This method forwards to ID3v2::Tag::properties(). - */ - PropertyMap properties() const; - - void removeUnsupportedProperties(const StringList &properties); - - /*! - * Implements the unified property interface -- import function. - * This method forwards to ID3v2::Tag::setProperties(). - */ - PropertyMap setProperties(const PropertyMap &); - - /*! - * Returns the WAV::Properties for this file. If no audio properties - * were read then this will return a null pointer. - */ - virtual Properties *audioProperties() const; - - /*! - * Saves the file. - */ - virtual bool save(); - - bool save(TagTypes tags, bool stripOthers = true, int id3v2Version = 4); - - /*! - * Returns whether or not the file on disk actually has an ID3v2 tag. - * - * \see ID3v2Tag() - */ - bool hasID3v2Tag() const; - - /*! - * Returns whether or not the file on disk actually has a RIFF INFO tag. - * - * \see InfoTag() - */ - bool hasInfoTag() const; - - private: - File(const File &); - File &operator=(const File &); - - void read(bool readProperties); - - void strip(TagTypes tags); - - /*! - * Returns the index of the chunk that its name is "LIST" and list type is "INFO". - */ - uint findInfoTagChunk(); - - friend class Properties; - - class FilePrivate; - FilePrivate *d; - }; - } - } -} - -#endif diff --git a/3rdparty/taglib/include/taglib/wavpackfile.h b/3rdparty/taglib/include/taglib/wavpackfile.h deleted file mode 100644 index 2451158..0000000 --- a/3rdparty/taglib/include/taglib/wavpackfile.h +++ /dev/null @@ -1,220 +0,0 @@ -/*************************************************************************** - copyright : (C) 2006 by Lukáš Lalinský - email : lalinsky@gmail.com - - copyright : (C) 2004 by Allan Sandfeld Jensen - email : kde@carewolf.org - (original MPC implementation) - ***************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * - * 02110-1301 USA * - * * - * Alternatively, this file is available under the Mozilla Public * - * License Version 1.1. You may obtain a copy of the License at * - * http://www.mozilla.org/MPL/ * - ***************************************************************************/ - -#ifndef TAGLIB_WVFILE_H -#define TAGLIB_WVFILE_H - -#include "tfile.h" -#include "taglib_export.h" -#include "wavpackproperties.h" - -namespace TagLib { - - class Tag; - - namespace ID3v1 { class Tag; } - namespace APE { class Tag; } - - //! An implementation of WavPack metadata - - /*! - * This is implementation of WavPack metadata. - * - * This supports ID3v1 and APE (v1 and v2) style comments as well as reading stream - * properties from the file. - */ - - namespace WavPack { - - //! An implementation of TagLib::File with WavPack specific methods - - /*! - * This implements and provides an interface for WavPack files to the - * TagLib::Tag and TagLib::AudioProperties interfaces by way of implementing - * the abstract TagLib::File API as well as providing some additional - * information specific to WavPack files. - */ - - class TAGLIB_EXPORT File : public TagLib::File - { - public: - /*! - * This set of flags is used for various operations and is suitable for - * being OR-ed together. - */ - enum TagTypes { - //! Empty set. Matches no tag types. - NoTags = 0x0000, - //! Matches ID3v1 tags. - ID3v1 = 0x0001, - //! Matches APE tags. - APE = 0x0002, - //! Matches all tag types. - AllTags = 0xffff - }; - - /*! - * Constructs a WavPack file from \a file. If \a readProperties is true the - * file's audio properties will also be read using \a propertiesStyle. If - * false, \a propertiesStyle is ignored - */ - File(FileName file, bool readProperties = true, - Properties::ReadStyle propertiesStyle = Properties::Average); - - /*! - * Constructs an WavPack file from \a file. If \a readProperties is true the - * file's audio properties will also be read using \a propertiesStyle. If - * false, \a propertiesStyle is ignored. - * - * \note TagLib will *not* take ownership of the stream, the caller is - * responsible for deleting it after the File object. - */ - File(IOStream *stream, bool readProperties = true, - Properties::ReadStyle propertiesStyle = Properties::Average); - - /*! - * Destroys this instance of the File. - */ - virtual ~File(); - - /*! - * Returns the Tag for this file. This will be an APE tag, an ID3v1 tag - * or a combination of the two. - */ - virtual TagLib::Tag *tag() const; - - /*! - * Implements the unified property interface -- export function. - * If the file contains both an APE and an ID3v1 tag, only APE - * will be converted to the PropertyMap. - */ - PropertyMap properties() const; - - void removeUnsupportedProperties(const StringList &properties); - - /*! - * Implements the unified property interface -- import function. - * Creates an APE tag if it does not exists and calls setProperties() on - * that. Any existing ID3v1 tag will be updated as well. - */ - PropertyMap setProperties(const PropertyMap&); - - /*! - * Returns the MPC::Properties for this file. If no audio properties - * were read then this will return a null pointer. - */ - virtual Properties *audioProperties() const; - - /*! - * Saves the file. - * - * This returns true if the save was successful. - * - * \warning In the current implementation, it's dangerous to call save() - * repeatedly. At worst it will corrupt the file. - */ - virtual bool save(); - - /*! - * Returns a pointer to the ID3v1 tag of the file. - * - * If \a create is false (the default) this may return a null pointer - * if there is no valid ID3v1 tag. If \a create is true it will create - * an ID3v1 tag if one does not exist and returns a valid pointer. - * - * \note This may return a valid pointer regardless of whether or not the - * file on disk has an ID3v1 tag. Use hasID3v1Tag() to check if the file - * on disk actually has an ID3v1 tag. - * - * \note The Tag is still owned by the MPEG::File and should not be - * deleted by the user. It will be deleted when the file (object) is - * destroyed. - * - * \see hasID3v1Tag() - */ - ID3v1::Tag *ID3v1Tag(bool create = false); - - /*! - * Returns a pointer to the APE tag of the file. - * - * If \a create is false (the default) this may return a null pointer - * if there is no valid APE tag. If \a create is true it will create - * an APE tag if one does not exist and returns a valid pointer. - * - * \note This may return a valid pointer regardless of whether or not the - * file on disk has an APE tag. Use hasAPETag() to check if the file - * on disk actually has an APE tag. - * - * \note The Tag is still owned by the MPEG::File and should not be - * deleted by the user. It will be deleted when the file (object) is - * destroyed. - * - * \see hasAPETag() - */ - APE::Tag *APETag(bool create = false); - - /*! - * This will remove the tags that match the OR-ed together TagTypes from the - * file. By default it removes all tags. - * - * \note This will also invalidate pointers to the tags - * as their memory will be freed. - * \note In order to make the removal permanent save() still needs to be called - */ - void strip(int tags = AllTags); - - /*! - * Returns whether or not the file on disk actually has an ID3v1 tag. - * - * \see ID3v1Tag() - */ - bool hasID3v1Tag() const; - - /*! - * Returns whether or not the file on disk actually has an APE tag. - * - * \see APETag() - */ - bool hasAPETag() const; - - private: - File(const File &); - File &operator=(const File &); - - void read(bool readProperties); - long findID3v1(); - long findAPE(); - - class FilePrivate; - FilePrivate *d; - }; - } -} - -#endif diff --git a/3rdparty/taglib/include/taglib/wavpackproperties.h b/3rdparty/taglib/include/taglib/wavpackproperties.h deleted file mode 100644 index 2955b1d..0000000 --- a/3rdparty/taglib/include/taglib/wavpackproperties.h +++ /dev/null @@ -1,149 +0,0 @@ -/*************************************************************************** - copyright : (C) 2006 by Lukáš Lalinský - email : lalinsky@gmail.com - - copyright : (C) 2004 by Allan Sandfeld Jensen - email : kde@carewolf.org - (original MPC implementation) - ***************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * - * 02110-1301 USA * - * * - * Alternatively, this file is available under the Mozilla Public * - * License Version 1.1. You may obtain a copy of the License at * - * http://www.mozilla.org/MPL/ * - ***************************************************************************/ - -#ifndef TAGLIB_WVPROPERTIES_H -#define TAGLIB_WVPROPERTIES_H - -#include "taglib_export.h" -#include "audioproperties.h" - -namespace TagLib { - - namespace WavPack { - - class File; - - static const uint HeaderSize = 32; - - //! An implementation of audio property reading for WavPack - - /*! - * This reads the data from an WavPack stream found in the AudioProperties - * API. - */ - - class TAGLIB_EXPORT Properties : public AudioProperties - { - public: - /*! - * Create an instance of WavPack::Properties with the data read from the - * ByteVector \a data. - * - * \deprecated This constructor will be dropped in favor of the one below - * in a future version. - */ - Properties(const ByteVector &data, long streamLength, ReadStyle style = Average); - - /*! - * Create an instance of WavPack::Properties. - */ - // BIC: merge with the above constructor - Properties(File *file, long streamLength, ReadStyle style = Average); - - /*! - * Destroys this WavPack::Properties instance. - */ - virtual ~Properties(); - - /*! - * Returns the length of the file in seconds. The length is rounded down to - * the nearest whole second. - * - * \note This method is just an alias of lengthInSeconds(). - * - * \deprecated - */ - virtual int length() const; - - /*! - * Returns the length of the file in seconds. The length is rounded down to - * the nearest whole second. - * - * \see lengthInMilliseconds() - */ - // BIC: make virtual - int lengthInSeconds() const; - - /*! - * Returns the length of the file in milliseconds. - * - * \see lengthInSeconds() - */ - // BIC: make virtual - int lengthInMilliseconds() const; - - /*! - * Returns the average bit rate of the file in kb/s. - */ - virtual int bitrate() const; - - /*! - * Returns the sample rate in Hz. 0 means unknown or custom. - */ - virtual int sampleRate() const; - - /*! - * Returns the number of audio channels. - */ - virtual int channels() const; - - /*! - * Returns the number of bits per audio sample. - */ - int bitsPerSample() const; - - /*! - * Returns whether or not the file is lossless encoded. - */ - bool isLossless() const; - - /*! - * Returns the total number of audio samples in file. - */ - uint sampleFrames() const; - - /*! - * Returns WavPack version. - */ - int version() const; - - private: - Properties(const Properties &); - Properties &operator=(const Properties &); - - void read(File *file, long streamLength); - uint seekFinalIndex(File *file, long streamLength); - - class PropertiesPrivate; - PropertiesPrivate *d; - }; - } -} - -#endif diff --git a/3rdparty/taglib/include/taglib/wavproperties.h b/3rdparty/taglib/include/taglib/wavproperties.h deleted file mode 100644 index 1fd6a13..0000000 --- a/3rdparty/taglib/include/taglib/wavproperties.h +++ /dev/null @@ -1,163 +0,0 @@ -/*************************************************************************** - copyright : (C) 2008 by Scott Wheeler - email : wheeler@kde.org -***************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * - * 02110-1301 USA * - * * - * Alternatively, this file is available under the Mozilla Public * - * License Version 1.1. You may obtain a copy of the License at * - * http://www.mozilla.org/MPL/ * - ***************************************************************************/ - -#ifndef TAGLIB_WAVPROPERTIES_H -#define TAGLIB_WAVPROPERTIES_H - -#include "taglib.h" -#include "audioproperties.h" - -namespace TagLib { - - class ByteVector; - - namespace RIFF { - - namespace WAV { - - class File; - - //! An implementation of audio property reading for WAV - - /*! - * This reads the data from an WAV stream found in the AudioProperties - * API. - */ - - class TAGLIB_EXPORT Properties : public AudioProperties - { - public: - /*! - * Create an instance of WAV::Properties with the data read from the - * ByteVector \a data. - * - * \deprecated - */ - Properties(const ByteVector &data, ReadStyle style); - - /*! - * Create an instance of WAV::Properties with the data read from the - * ByteVector \a data and the length calculated using \a streamLength. - * - * \deprecated - */ - Properties(const ByteVector &data, uint streamLength, ReadStyle style); - - /*! - * Create an instance of WAV::Properties with the data read from the - * WAV::File \a file. - */ - Properties(File *file, ReadStyle style); - - /*! - * Destroys this WAV::Properties instance. - */ - virtual ~Properties(); - - /*! - * Returns the length of the file in seconds. The length is rounded down to - * the nearest whole second. - * - * \note This method is just an alias of lengthInSeconds(). - * - * \deprecated - */ - virtual int length() const; - - /*! - * Returns the length of the file in seconds. The length is rounded down to - * the nearest whole second. - * - * \see lengthInMilliseconds() - */ - // BIC: make virtual - int lengthInSeconds() const; - - /*! - * Returns the length of the file in milliseconds. - * - * \see lengthInSeconds() - */ - // BIC: make virtual - int lengthInMilliseconds() const; - - /*! - * Returns the average bit rate of the file in kb/s. - */ - virtual int bitrate() const; - - /*! - * Returns the sample rate in Hz. - */ - virtual int sampleRate() const; - - /*! - * Returns the number of audio channels. - */ - virtual int channels() const; - - /*! - * Returns the number of bits per audio sample. - */ - int bitsPerSample() const; - - /*! - * Returns the number of bits per audio sample. - * - * \note This method is just an alias of bitsPerSample(). - * - * \deprecated - */ - int sampleWidth() const; - - /*! - * Returns the number of sample frames. - */ - uint sampleFrames() const; - - /*! - * Returns the format ID of the file. - * 0 for unknown, 1 for PCM, 2 for ADPCM, 3 for 32/64-bit IEEE754, and - * so forth. - * - * \note For further information, refer to the WAVE Form Registration - * Numbers in RFC 2361. - */ - int format() const; - - private: - Properties(const Properties &); - Properties &operator=(const Properties &); - - void read(File *file); - - class PropertiesPrivate; - PropertiesPrivate *d; - }; - } - } -} - -#endif diff --git a/3rdparty/taglib/include/taglib/xingheader.h b/3rdparty/taglib/include/taglib/xingheader.h deleted file mode 100644 index cd41715..0000000 --- a/3rdparty/taglib/include/taglib/xingheader.h +++ /dev/null @@ -1,129 +0,0 @@ -/*************************************************************************** - copyright : (C) 2003 by Ismael Orenstein - email : orenstein@kde.org - ***************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * - * 02110-1301 USA * - * * - * Alternatively, this file is available under the Mozilla Public * - * License Version 1.1. You may obtain a copy of the License at * - * http://www.mozilla.org/MPL/ * - ***************************************************************************/ - -#ifndef TAGLIB_XINGHEADER_H -#define TAGLIB_XINGHEADER_H - -#include "mpegheader.h" -#include "taglib_export.h" - -namespace TagLib { - - class ByteVector; - - namespace MPEG { - - class File; - - //! An implementation of the Xing/VBRI headers - - /*! - * This is a minimalistic implementation of the Xing/VBRI VBR headers. - * Xing/VBRI headers are often added to VBR (variable bit rate) MP3 streams - * to make it easy to compute the length and quality of a VBR stream. Our - * implementation is only concerned with the total size of the stream (so - * that we can calculate the total playing time and the average bitrate). - * It uses - * this text and the XMMS sources as references. - */ - - class TAGLIB_EXPORT XingHeader - { - public: - /*! - * The type of the VBR header. - */ - enum HeaderType - { - /*! - * Invalid header or no VBR header found. - */ - Invalid = 0, - - /*! - * Xing header. - */ - Xing = 1, - - /*! - * VBRI header. - */ - VBRI = 2, - }; - - /*! - * Parses an Xing/VBRI header based on \a data which contains the entire - * first MPEG frame. - */ - XingHeader(const ByteVector &data); - - /*! - * Destroy this XingHeader instance. - */ - virtual ~XingHeader(); - - /*! - * Returns true if the data was parsed properly and if there is a valid - * Xing/VBRI header present. - */ - bool isValid() const; - - /*! - * Returns the total number of frames. - */ - uint totalFrames() const; - - /*! - * Returns the total size of stream in bytes. - */ - uint totalSize() const; - - /*! - * Returns the type of the VBR header. - */ - HeaderType type() const; - - /*! - * Returns the offset for the start of this Xing header, given the - * version and channels of the frame - * - * \deprecated Always returns 0. - */ - static int xingHeaderOffset(TagLib::MPEG::Header::Version v, - TagLib::MPEG::Header::ChannelMode c); - - private: - XingHeader(const XingHeader &); - XingHeader &operator=(const XingHeader &); - - void parse(const ByteVector &data); - - class XingHeaderPrivate; - XingHeaderPrivate *d; - }; - } -} - -#endif diff --git a/3rdparty/taglib/include/taglib/xiphcomment.h b/3rdparty/taglib/include/taglib/xiphcomment.h deleted file mode 100644 index 54f3070..0000000 --- a/3rdparty/taglib/include/taglib/xiphcomment.h +++ /dev/null @@ -1,225 +0,0 @@ -/*************************************************************************** - copyright : (C) 2002 - 2008 by Scott Wheeler - email : wheeler@kde.org - ***************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * - * 02110-1301 USA * - * * - * Alternatively, this file is available under the Mozilla Public * - * License Version 1.1. You may obtain a copy of the License at * - * http://www.mozilla.org/MPL/ * - ***************************************************************************/ - -#ifndef TAGLIB_VORBISCOMMENT_H -#define TAGLIB_VORBISCOMMENT_H - -#include "tag.h" -#include "tlist.h" -#include "tmap.h" -#include "tstring.h" -#include "tstringlist.h" -#include "tbytevector.h" -#include "taglib_export.h" - -namespace TagLib { - - namespace Ogg { - - /*! - * A mapping between a list of field names, or keys, and a list of values - * associated with that field. - * - * \see XiphComment::fieldListMap() - */ - typedef Map FieldListMap; - - //! Ogg Vorbis comment implementation - - /*! - * This class is an implementation of the Ogg Vorbis comment specification, - * to be found in section 5 of the Ogg Vorbis specification. Because this - * format is also used in other (currently unsupported) Xiph.org formats, it - * has been made part of a generic implementation rather than being limited - * to strictly Vorbis. - * - * Vorbis comments are a simple vector of keys and values, called fields. - * Multiple values for a given key are supported. - * - * \see fieldListMap() - */ - - class TAGLIB_EXPORT XiphComment : public TagLib::Tag - { - public: - /*! - * Constructs an empty Vorbis comment. - */ - XiphComment(); - - /*! - * Constructs a Vorbis comment from \a data. - */ - XiphComment(const ByteVector &data); - - /*! - * Destroys this instance of the XiphComment. - */ - virtual ~XiphComment(); - - virtual String title() const; - virtual String artist() const; - virtual String album() const; - virtual String comment() const; - virtual String genre() const; - virtual uint year() const; - virtual uint track() const; - - virtual void setTitle(const String &s); - virtual void setArtist(const String &s); - virtual void setAlbum(const String &s); - virtual void setComment(const String &s); - virtual void setGenre(const String &s); - virtual void setYear(uint i); - virtual void setTrack(uint i); - - virtual bool isEmpty() const; - - /*! - * Returns the number of fields present in the comment. - */ - uint fieldCount() const; - - /*! - * Returns a reference to the map of field lists. Because Xiph comments - * support multiple fields with the same key, a pure Map would not work. - * As such this is a Map of string lists, keyed on the comment field name. - * - * The standard set of Xiph/Vorbis fields (which may or may not be - * contained in any specific comment) is: - * - *
    - *
  • TITLE
  • - *
  • VERSION
  • - *
  • ALBUM
  • - *
  • ARTIST
  • - *
  • PERFORMER
  • - *
  • COPYRIGHT
  • - *
  • ORGANIZATION
  • - *
  • DESCRIPTION
  • - *
  • GENRE
  • - *
  • DATE
  • - *
  • LOCATION
  • - *
  • CONTACT
  • - *
  • ISRC
  • - *
- * - * For a more detailed description of these fields, please see the Ogg - * Vorbis specification, section 5.2.2.1. - * - * \note The Ogg Vorbis comment specification does allow these key values - * to be either upper or lower case. However, it is conventional for them - * to be upper case. As such, TagLib, when parsing a Xiph/Vorbis comment, - * converts all fields to uppercase. When you are using this data - * structure, you will need to specify the field name in upper case. - * - * \warning You should not modify this data structure directly, instead - * use addField() and removeField(). - */ - const FieldListMap &fieldListMap() const; - - /*! - * Implements the unified property interface -- export function. - * The result is a one-to-one match of the Xiph comment, since it is - * completely compatible with the property interface (in fact, a Xiph - * comment is nothing more than a map from tag names to list of values, - * as is the dict interface). - */ - PropertyMap properties() const; - - /*! - * Implements the unified property interface -- import function. - * The tags from the given map will be stored one-to-one in the file, - * except for invalid keys (less than one character, non-ASCII, or - * containing '=' or '~') in which case the according values will - * be contained in the returned PropertyMap. - */ - PropertyMap setProperties(const PropertyMap&); - - /*! - * Check if the given String is a valid Xiph comment key. - */ - static bool checkKey(const String&); - - /*! - * Returns the vendor ID of the Ogg Vorbis encoder. libvorbis 1.0 as the - * most common case always returns "Xiph.Org libVorbis I 20020717". - */ - String vendorID() const; - - /*! - * Add the field specified by \a key with the data \a value. If \a replace - * is true, then all of the other fields with the same key will be removed - * first. - * - * If the field value is empty, the field will be removed. - */ - void addField(const String &key, const String &value, bool replace = true); - - /*! - * Remove the field specified by \a key with the data \a value. If - * \a value is null, all of the fields with the given key will be removed. - */ - void removeField(const String &key, const String &value = String::null); - - /*! - * Returns true if the field is contained within the comment. - * - * \note This is safer than checking for membership in the FieldListMap. - */ - bool contains(const String &key) const; - - /*! - * Renders the comment to a ByteVector suitable for inserting into a file. - */ - ByteVector render() const; // BIC: remove and merge with below - - /*! - * Renders the comment to a ByteVector suitable for inserting into a file. - * - * If \a addFramingBit is true the standard Vorbis comment framing bit will - * be appended. However some formats (notably FLAC) do not work with this - * in place. - */ - ByteVector render(bool addFramingBit) const; - - protected: - /*! - * Reads the tag from the file specified in the constructor and fills the - * FieldListMap. - */ - void parse(const ByteVector &data); - - private: - XiphComment(const XiphComment &); - XiphComment &operator=(const XiphComment &); - - class XiphCommentPrivate; - XiphCommentPrivate *d; - }; - } -} - -#endif diff --git a/3rdparty/taglib/include/taglib/xmfile.h b/3rdparty/taglib/include/taglib/xmfile.h deleted file mode 100644 index ae48a51..0000000 --- a/3rdparty/taglib/include/taglib/xmfile.h +++ /dev/null @@ -1,108 +0,0 @@ -/*************************************************************************** - copyright : (C) 2011 by Mathias Panzenböck - email : grosser.meister.morti@gmx.net - ***************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * - * MA 02110-1301 USA * - ***************************************************************************/ - -#ifndef TAGLIB_XMFILE_H -#define TAGLIB_XMFILE_H - -#include "tfile.h" -#include "audioproperties.h" -#include "taglib_export.h" -#include "modfilebase.h" -#include "modtag.h" -#include "xmproperties.h" - -namespace TagLib { - - namespace XM { - - class TAGLIB_EXPORT File : public Mod::FileBase { - public: - /*! - * Constructs an Extended Module file from \a file. - * - * \note In the current implementation, both \a readProperties and - * \a propertiesStyle are ignored. The audio properties are always - * read. - */ - File(FileName file, bool readProperties = true, - AudioProperties::ReadStyle propertiesStyle = - AudioProperties::Average); - - /*! - * Constructs an Extended Module file from \a stream. - * - * \note In the current implementation, both \a readProperties and - * \a propertiesStyle are ignored. The audio properties are always - * read. - * - * \note TagLib will *not* take ownership of the stream, the caller is - * responsible for deleting it after the File object. - */ - File(IOStream *stream, bool readProperties = true, - AudioProperties::ReadStyle propertiesStyle = - AudioProperties::Average); - - /*! - * Destroys this instance of the File. - */ - virtual ~File(); - - Mod::Tag *tag() const; - - /*! - * Implements the unified property interface -- export function. - * Forwards to Mod::Tag::properties(). - */ - PropertyMap properties() const; - - /*! - * Implements the unified property interface -- import function. - * Forwards to Mod::Tag::setProperties(). - */ - PropertyMap setProperties(const PropertyMap &); - - /*! - * Returns the XM::Properties for this file. If no audio properties - * were read then this will return a null pointer. - */ - XM::Properties *audioProperties() const; - - /*! - * Save the file. - * This is the same as calling save(AllTags); - * - * \note Saving Extended Module tags is not supported. - */ - bool save(); - - private: - File(const File &); - File &operator=(const File &); - - void read(bool readProperties); - - class FilePrivate; - FilePrivate *d; - }; - } -} - -#endif diff --git a/3rdparty/taglib/include/taglib/xmproperties.h b/3rdparty/taglib/include/taglib/xmproperties.h deleted file mode 100644 index f929982..0000000 --- a/3rdparty/taglib/include/taglib/xmproperties.h +++ /dev/null @@ -1,81 +0,0 @@ -/*************************************************************************** - copyright : (C) 2011 by Mathias Panzenböck - email : grosser.meister.morti@gmx.net - ***************************************************************************/ - -/*************************************************************************** - * This library is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License version * - * 2.1 as published by the Free Software Foundation. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * - * MA 02110-1301 USA * - ***************************************************************************/ - -#ifndef TAGLIB_XMPROPERTIES_H -#define TAGLIB_XMPROPERTIES_H - -#include "taglib.h" -#include "tstring.h" -#include "audioproperties.h" - -namespace TagLib { - namespace XM { - class TAGLIB_EXPORT Properties : public AudioProperties { - friend class File; - public: - /*! Flag bits. */ - enum { - LinearFreqTable = 1 // otherwise its the amiga freq. table - }; - - Properties(AudioProperties::ReadStyle propertiesStyle); - virtual ~Properties(); - - int length() const; - int lengthInSeconds() const; - int lengthInMilliseconds() const; - int bitrate() const; - int sampleRate() const; - int channels() const; - - ushort lengthInPatterns() const; - ushort version() const; - ushort restartPosition() const; - ushort patternCount() const; - ushort instrumentCount() const; - uint sampleCount() const; - ushort flags() const; - ushort tempo() const; - ushort bpmSpeed() const; - - void setChannels(int channels); - - void setLengthInPatterns(ushort lengthInPatterns); - void setVersion(ushort version); - void setRestartPosition(ushort restartPosition); - void setPatternCount(ushort patternCount); - void setInstrumentCount(ushort instrumentCount); - void setSampleCount(uint sampleCount); - void setFlags(ushort flags); - void setTempo(ushort tempo); - void setBpmSpeed(ushort bpmSpeed); - - private: - Properties(const Properties&); - Properties &operator=(const Properties&); - - class PropertiesPrivate; - PropertiesPrivate *d; - }; - } -} - -#endif diff --git a/3rdparty/taglib/lib/pkgconfig/taglib.pc b/3rdparty/taglib/lib/pkgconfig/taglib.pc deleted file mode 100644 index a79207e..0000000 --- a/3rdparty/taglib/lib/pkgconfig/taglib.pc +++ /dev/null @@ -1,11 +0,0 @@ -prefix=C:/Users/milo/Documents/vvave/3rdparty/taglib -exec_prefix=C:/Users/milo/Documents/vvave/3rdparty/taglib -libdir=C:/Users/milo/Documents/vvave/3rdparty/taglib/lib -includedir=C:/Users/milo/Documents/vvave/3rdparty/taglib/include - -Name: TagLib -Description: Audio meta-data library -Requires: -Version: 1.10 -Libs: -LC:/Users/milo/Documents/vvave/3rdparty/taglib/lib -ltag -Cflags: -IC:/Users/milo/Documents/vvave/3rdparty/taglib/include/taglib diff --git a/3rdparty/taglib/lib/pkgconfig/taglib_c.pc b/3rdparty/taglib/lib/pkgconfig/taglib_c.pc deleted file mode 100644 index 10cca9b..0000000 --- a/3rdparty/taglib/lib/pkgconfig/taglib_c.pc +++ /dev/null @@ -1,12 +0,0 @@ -prefix=C:/Users/milo/Documents/vvave/3rdparty/taglib -exec_prefix=C:/Users/milo/Documents/vvave/3rdparty/taglib -libdir=C:/Users/milo/Documents/vvave/3rdparty/taglib/lib -includedir=C:/Users/milo/Documents/vvave/3rdparty/taglib/include - - -Name: TagLib C Bindings -Description: Audio meta-data library (C bindings) -Requires: taglib -Version: 1.10 -Libs: -LC:/Users/milo/Documents/vvave/3rdparty/taglib/lib -ltag_c -Cflags: -IC:/Users/milo/Documents/vvave/3rdparty/taglib/include/taglib diff --git a/CMakeLists.txt b/CMakeLists.txt index 646e07a..4d16cf2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,91 +1,91 @@ project(vvave) cmake_minimum_required(VERSION 3.0) find_package(ECM 1.7.0 REQUIRED NO_MODULE) set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${ECM_MODULE_PATH}) set(CMAKE_CXX_STANDARD 17) find_package(MauiKit REQUIRED) find_package(Qt5 REQUIRED NO_MODULE COMPONENTS Qml Quick Network WebSockets Sql QuickControls2 Xml Multimedia Widgets DBus Svg) find_package(KF5 ${KF5_VERSION} REQUIRED COMPONENTS I18n Notifications Config KIO Attica SyntaxHighlighting) include(KDEInstallDirs) include(KDECompilerSettings NO_POLICY_SCOPE) include(KDECMakeSettings) include(ECMInstallIcons) include(FeatureSummary) include(ECMAddAppIcon) set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTORCC ON) include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/services/web ${CMAKE_CURRENT_BINARY_DIR}/services/web ) add_executable(vvave qml.qrc main.cpp vvave.cpp # pulpo/services/geniusService.cpp # pulpo/services/deezerService.cpp pulpo/services/lastfmService.cpp # pulpo/services/lyricwikiaService.cpp # pulpo/services/spotifyService.cpp # pulpo/services/musicbrainzService.cpp pulpo/pulpo.cpp pulpo/htmlparser.cpp pulpo/service.cpp services/local/taginfo.cpp services/local/player.cpp services/local/youtubedl.cpp # services/local/linking.cpp # services/local/socket.cpp services/web/youtube.cpp -# services/web/NextCloud/nextmusic.cpp -# services/web/abstractmusicprovider.cpp + services/web/NextCloud/nextmusic.cpp + services/web/abstractmusicprovider.cpp # services/web/Spotify/spotify.cpp db/collectionDB.cpp # utils/brain.cpp models/tracks/tracksmodel.cpp models/playlists/playlistsmodel.cpp models/albums/albumsmodel.cpp -# models/cloud/cloud.cpp + models/cloud/cloud.cpp ) if (ANDROID) find_package(Qt5 REQUIRED COMPONENTS AndroidExtras WebView Xml) find_package(OpenSSL REQUIRED) include(ExternalProject) externalproject_add(taglib URL http://taglib.org/releases/taglib-1.11.1.tar.gz CMAKE_ARGS -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} ) set(TAGLIB_INCLUDE_DIRS ${CMAKE_INSTALL_PREFIX}/include ${CMAKE_INSTALL_PREFIX}/include/taglib) set(TAGLIB_LIBRARIES ${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}/libtag.a) target_link_libraries(vvave MauiKit Qt5::AndroidExtras Qt5::WebView Qt5::Xml OpenSSL::SSL) add_dependencies(vvave taglib) kde_source_files_enable_exceptions(vvave) else() find_package(Taglib REQUIRED) find_package(Qt5 REQUIRED COMPONENTS WebEngine) target_sources(vvave PRIVATE kde/mpris2.cpp kde/notify.cpp ) target_link_libraries(vvave Qt5::WebEngine KF5::ConfigCore KF5::Notifications KF5::KIOCore KF5::I18n Qt5::DBus KF5::Attica KF5::SyntaxHighlighting) endif() target_include_directories(vvave PRIVATE ${TAGLIB_INCLUDE_DIRS}) target_link_libraries(vvave MauiKit Qt5::Network Qt5::Sql Qt5::WebSockets Qt5::Qml Qt5::Xml Qt5::Multimedia Qt5::Widgets Qt5::QuickControls2 ${TAGLIB_LIBRARIES}) install(TARGETS vvave ${KDE_INSTALL_TARGETS_DEFAULT_ARGS}) install(FILES org.kde.vvave.desktop DESTINATION ${XDG_APPS_INSTALL_DIR}) #TODO: port to ecm_install_icons() install(FILES assets/vvave.svg DESTINATION ${KDE_INSTALL_ICONDIR}/hicolor/scalable/apps) install(FILES org.kde.vvave.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR}) feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES) diff --git a/main.cpp b/main.cpp index 52f3d93..579b2e1 100644 --- a/main.cpp +++ b/main.cpp @@ -1,126 +1,124 @@ #include #include #include #include #include #include #include #include #include #ifdef STATIC_KIRIGAMI #include "3rdparty/kirigami/src/kirigamiplugin.h" #endif #ifdef STATIC_MAUIKIT #include "3rdparty/mauikit/src/mauikit.h" #endif #ifdef Q_OS_ANDROID #include #include #include #include "mauiandroid.h" #else #include #ifdef Q_OS_LINUX #include #endif #endif #include "vvave.h" #include "utils/bae.h" #include "services/web/youtube.h" #include "services/local/player.h" #include "models/tracks/tracksmodel.h" #include "models/albums/albumsmodel.h" #include "models/playlists/playlistsmodel.h" -//#include "models/cloud/cloud.h" -#include "taglib/tag.h" -#include "taglib/fileref.h" +#include "models/cloud/cloud.h" #ifdef Q_OS_ANDROID Q_DECL_EXPORT #endif int main(int argc, char *argv[]) { QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); #ifdef Q_OS_ANDROID QGuiApplication app(argc, argv); if (!MAUIAndroid::checkRunTimePermissions()) return -1; #else QApplication app(argc, argv); #endif app.setApplicationName(BAE::appName); app.setApplicationVersion(BAE::version); app.setApplicationDisplayName(BAE::displayName); app.setOrganizationName(BAE::orgName); app.setOrganizationDomain(BAE::orgDomain); app.setWindowIcon(QIcon("qrc:/assets/vvave.png")); QCommandLineParser parser; parser.setApplicationDescription(BAE::description); const QCommandLineOption versionOption = parser.addVersionOption(); parser.process(app); const QStringList args = parser.positionalArguments(); QStringList urls; if(!args.isEmpty()) urls = args; vvave vvave; /* Services */ YouTube youtube; // Spotify spotify; QFontDatabase::addApplicationFont(":/assets/materialdesignicons-webfont.ttf"); QQmlApplicationEngine engine; QObject::connect(&engine, &QQmlApplicationEngine::objectCreated, [&]() { qDebug()<<"FINISHED LOADING QML APP"; const auto currentSources = vvave.getSourceFolders(); vvave.scanDir(currentSources.isEmpty() ? BAE::defaultSources : currentSources); if(!urls.isEmpty()) vvave.openUrls(urls); }); auto context = engine.rootContext(); context->setContextProperty("vvave", &vvave); context->setContextProperty("youtube", &youtube); qmlRegisterType("TracksList", 1, 0, "Tracks"); qmlRegisterType("PlaylistsList", 1, 0, "Playlists"); qmlRegisterType("AlbumsList", 1, 0, "Albums"); -// qmlRegisterType("CloudList", 1, 0, "Cloud"); + qmlRegisterType("CloudList", 1, 0, "Cloud"); qmlRegisterType("Player", 1, 0, "Player"); #ifdef STATIC_KIRIGAMI KirigamiPlugin::getInstance().registerTypes(); #endif #ifdef STATIC_MAUIKIT MauiKit::getInstance().registerTypes(); #endif #ifdef Q_OS_ANDROID QtWebView::initialize(); #elif defined Q_OS_LINUX QtWebEngine::initialize(); #endif engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); if (engine.rootObjects().isEmpty()) return -1; return app.exec(); } diff --git a/main.qml b/main.qml index 35e1619..7e0ccea 100644 --- a/main.qml +++ b/main.qml @@ -1,885 +1,886 @@ import QtQuick 2.10 import QtQuick.Controls 2.10 import QtQuick.Layouts 1.3 import QtGraphicalEffects 1.0 import QtQuick.Controls.Material 2.1 import "utils" import "widgets" import "widgets/PlaylistsView" import "widgets/MainPlaylist" import "widgets/SettingsView" import "widgets/SearchView" -//import "widgets/CloudView" +import "widgets/CloudView" import "view_models" import "view_models/BabeTable" import "services/local" import "services/web" //import "services/web/Spotify" import "view_models/BabeGrid" import "widgets/InfoView" import "db/Queries.js" as Q import "utils/Help.js" as H import "utils/Player.js" as Player import org.kde.kirigami 2.7 as Kirigami import org.kde.mauikit 1.0 as Maui import Player 1.0 import AlbumsList 1.0 import TracksList 1.0 import PlaylistsList 1.0 Maui.ApplicationWindow { id: root title: qsTr("vvave") /***************************************************/ /******************** ALIASES ********************/ /*************************************************/ property alias mainPlaylist: mainPlaylist property alias selectionBar: _selectionBar property alias progressBar: progressBar property alias dialog : _dialogLoader.item Maui.App.iconName: "qrc:/assets/vvave.svg" Maui.App.description: qsTr("VVAVE will handle your whole music collection by retreaving semantic information from the web. Just relax, enjoy and discover your new music ") /***************************************************/ /******************** PLAYBACK ********************/ /*************************************************/ property bool isShuffle: Maui.FM.loadSettings("SHUFFLE","PLAYBACK", false) readonly property var currentTrack: mainlistEmpty? ({url: "", artwork: "", fav: "0", stars: "0"}) : mainPlaylist.table.listModel.get(currentTrackIndex) property int currentTrackIndex: -1 property int prevTrackIndex: 0 readonly property string currentArtwork: currentTrack.artwork readonly property bool currentBabe: currentTrack.fav == "0" ? false : true property alias durationTimeLabel: player.duration property string progressTimeLabel: player.transformTime((player.duration/1000) *(player.pos/ 1000)) property alias isPlaying: player.playing property int onQueue: 0 property bool mainlistEmpty: !mainPlaylist.table.count > 0 /***************************************************/ /******************** HANDLERS ********************/ /*************************************************/ readonly property var viewsIndex: ({ tracks: 0, albums: 1, artists: 2, playlists: 3, - folders: 4, - youtube: 5, - search: 6}) + cloud: 4, + folders: 5, + youtube: 6, + search: 7}) property string syncPlaylist: "" property bool sync: false property bool focusView : false property bool selectionMode : false /***************************************************/ /******************** UI COLORS *******************/ /*************************************************/ readonly property color babeColor: "#f84172" /*SIGNALS*/ signal missingAlert(var track) /*HANDLE EVENTS*/ onClosing: Player.savePlaylist() onMissingAlert: { var message = qsTr("Missing file...") var messageBody = track.title + " by " + track.artist + " is missing.\nDo you want to remove it from your collection?" notify("dialog-question", message, messageBody, function () { mainPlaylist.list.remove(mainPlaylist.table.currentIndex) }) } /*COMPONENTS*/ Player { id: player volume: 100 onFinishedChanged: if (!mainlistEmpty) { if (currentTrack.url) mainPlaylist.list.countUp(currentTrackIndex) Player.nextTrack() } } FloatingDisk { id: _floatingDisk opacity: 1 - _drawer.position } headBar.middleContent : Maui.ActionGroup { id: _actionGroup // Layout.fillWidth: true Layout.fillHeight: true Layout.minimumWidth: implicitWidth currentIndex : swipeView.currentIndex onCurrentIndexChanged: swipeView.currentIndex = currentIndex hiddenActions: [ + Action + { + text: qsTr("Cloud") + icon.name: "folder-cloud" + }, + Action { text: qsTr("Folders") icon.name: "folder" }, - // Action - // { - // text: qsTr("Cloud") - // icon.name: "folder-cloud" - // }, - Action { text: qsTr("YouTube") icon.name: "internet-services" } ] Action { icon.name: "view-media-track" text: qsTr("Tracks") } Action { text: qsTr("Albums") icon.name: /*"album"*/ "view-media-album-cover" } Action { text: qsTr("Artists") icon.name: "view-media-artist" } Action { text: qsTr("Playlists") icon.name: "view-media-playlist" } } onSearchButtonClicked: { _actionGroup.currentIndex = viewsIndex.search // searchView.searchInput.forceActiveFocus() } Loader { id: _dialogLoader } InfoView { id: infoView maxWidth: parent.width * 0.8 maxHeight: parent.height * 0.9 } Loader { id: _focusViewLoader active: focusView source: "widgets/FocusView.qml" } Component { id: _shareDialogComponent Maui.ShareDialog {} } Component { id: _fmDialogComponent Maui.FileDialog { } } SourcesDialog { id: sourcesDialog } mainMenu: [ // Maui.MenuItem // { // text: "Vvave Stream" // icon.name: "headphones" // onTriggered: // { // pageStack.currentIndex = 1 // currentView = viewsIndex.vvave // } // }, // Maui.MenuItem // { // text: qsTr("Linking") // icon.name: "view-links" // onTriggered: // { // pageStack.currentIndex = 1 // currentView = viewsIndex.linking // if(!isLinked) linkingView.linkingConf.open() // } // }, // Maui.MenuItem // { // text: qsTr("Cloud") // icon.name: "folder-cloud" // onTriggered: // { // pageStack.currentIndex = 1 // currentView = viewsIndex.cloud // } // }, // Maui.MenuItem // { // text: qsTr("Spotify") // icon.name: "internet-services" // onTriggered: // { // pageStack.currentIndex = 1 // currentView = viewsIndex.spotify // } // }, MenuSeparator{}, MenuItem { text: qsTr("Sources") icon.name: "folder-add" onTriggered: sourcesDialog.open() }, MenuItem { text: qsTr("Open") icon.name: "folder-add" onTriggered: { _dialogLoader.sourceComponent = _fmDialogComponent root.dialog.settings.onlyDirs = false root.dialog.currentPath = "file:///home/camilo/Music" root.dialog.settings.filterType = Maui.FMList.AUDIO console.log("SETTIGN FILTER TYPE FISR", root.dialog.settings.filterType, Maui.FMList.AUDIO) root.dialog.show(function(paths) { vvave.openUrls(paths) root.dialog.close() }) } }/*, Menu { title: qsTr("Collection") // icon.name: "settings-configure" MenuItem { text: qsTr("Re-Scan") onTriggered: bae.refreshCollection(); } MenuItem { text: qsTr("Refresh...") onTriggered: H.refreshCollection(); } MenuItem { text: qsTr("Clean") onTriggered: bae.removeMissingTracks(); } }*/ // Maui.Menu // { // title: qsTr("Settings...") // // Kirigami.Action // // { // // text: "Brainz" // // Kirigami.Action // // { // // id: brainzToggle // // text: checked ? "Turn OFF" : "Turn ON" // // checked: bae.brainzState() // // checkable: true // // onToggled: // // { // // checked = !checked // // bae.saveSetting("AUTO", checked, "BRAINZ") // //// bae.brainz(checked) // // } // // } // // } // Maui.MenuItem // { // text: "Info label" + checked ? "ON" : "OFF" // checked: infoLabels // checkable: true // onToggled: // { // infoLabels = checked // bae.saveSetting("LABELS", infoLabels ? true : false, "PLAYBACK") // } // } // Maui.MenuItem // { // text: "Autoplay" // checked: autoplay // checkable: true // onToggled: // { // autoplay = checked // bae.saveSetting("AUTOPLAY", autoplay ? true : false, "BABE") // } // } // } ] Playlists { id: playlistsList } PlaylistDialog { id: playlistDialog } sideBar: Maui.AbstractSideBar { id: _drawer focus: true width: visible ? Math.min(Kirigami.Units.gridUnit * (Kirigami.Settings.isMobile? 18 : 20), root.width) : 0 modal: !isWide closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutsideParent height: _drawer.modal ? implicitHeight - _mainPage.footer.height : implicitHeight MainPlaylist { id: mainPlaylist anchors.fill: parent Connections { target: mainPlaylist onCoverPressed: Player.appendAll(tracks) onCoverDoubleClicked: Player.playAll(tracks) } } } Maui.Page { id: _mainPage anchors.fill: parent footer: ColumnLayout { id: _footerLayout visible: !mainlistEmpty || isPlaying height: visible ? Maui.Style.toolBarHeight * 1.2 : 0 width: parent.width spacing: 0 Kirigami.Separator { Layout.fillWidth: true } Slider { id: progressBar Layout.preferredHeight: Maui.Style.unit * (Kirigami.Settings.isMobile ? 6 : 8) Layout.fillWidth: true padding: 0 from: 0 to: 1000 value: player.pos spacing: 0 focus: true onMoved: { player.pos = value } background: Rectangle { implicitWidth: progressBar.width implicitHeight: progressBar.height width: progressBar.availableWidth height: implicitHeight color: "transparent" Rectangle { width: progressBar.visualPosition * parent.width height: progressBar.height color: Kirigami.Theme.highlightColor } } handle: Rectangle { x: progressBar.leftPadding + progressBar.visualPosition * (progressBar.availableWidth - width) y: -(progressBar.height * 0.8) implicitWidth: progressBar.pressed ? Maui.Style.iconSizes.medium : 0 implicitHeight: progressBar.pressed ? Maui.Style.iconSizes.medium : 0 radius: progressBar.pressed ? Maui.Style.iconSizes.medium : 0 color: Kirigami.Theme.highlightColor } } Maui.ToolBar { Layout.fillHeight: true Layout.fillWidth: true position: ToolBar.Footer rightContent: ToolButton { icon.name: "media-speaker" onClicked: _sliderPopup.open() Popup { id: _sliderPopup height: 150 width: parent.width y: -150 x: 0 // closePolicy: Popup.CloseOnEscape | Popup.CloseOnPress Slider { id: _volumeSlider visible: true height: parent.height width: 20 anchors.horizontalCenter: parent.horizontalCenter from: 0 to: 100 value: player.volume orientation: Qt.Vertical onMoved: { player.volume = value } } } } middleContent: [ ToolButton { id: babeBtnIcon icon.name: "love" enabled: currentTrackIndex >= 0 icon.color: currentBabe ? babeColor : Kirigami.Theme.textColor onClicked: if (!mainlistEmpty) { mainPlaylist.list.fav(currentTrackIndex, !(mainPlaylist.listModel.get(currentTrackIndex).fav == "1")) currentBabe = mainPlaylist.listModel.get(currentTrackIndex).fav == "1" } }, ToolButton { icon.name: "media-skip-backward" icon.color: Kirigami.Theme.textColor onClicked: Player.previousTrack() onPressAndHold: Player.playAt(prevTrackIndex) }, ToolButton { id: playIcon enabled: currentTrackIndex >= 0 icon.color: Kirigami.Theme.textColor icon.name: isPlaying ? "media-playback-pause" : "media-playback-start" onClicked: player.playing = !player.playing }, ToolButton { id: nextBtn icon.color: Kirigami.Theme.textColor icon.name: "media-skip-forward" onClicked: Player.nextTrack() onPressAndHold: Player.playAt(Player.shuffle()) }, ToolButton { id: shuffleBtn icon.color: babeColor icon.name: isShuffle ? "media-playlist-shuffle" : "media-playlist-normal" onClicked: { isShuffle = !isShuffle Maui.FM.saveSettings("SHUFFLE", isShuffle, "PLAYBACK") } } ] } } ColumnLayout { anchors.fill: parent SwipeView { id: swipeView Layout.fillHeight: true Layout.fillWidth: true // interactive: Kirigami.Settings.isMobile currentIndex: _actionGroup.currentIndex onCurrentIndexChanged: _actionGroup.currentIndex = currentIndex clip: true onCurrentItemChanged: currentItem.forceActiveFocus() TracksView { id: tracksView Connections { target: vvave onRefreshTables: tracksView.list.refresh() } Connections { target: tracksView onRowClicked: Player.quickPlay(tracksView.listModel.get(index)) onQuickPlayTrack: Player.quickPlay(tracksView.listModel.get(index)) onAppendTrack: Player.addTrack(tracksView.listModel.get(index)) onPlayAll: Player.playAll( tracksView.listModel.getAll()) onAppendAll: Player.appendAll( tracksView.listModel.getAll()) onQueueTrack: Player.queueTracks([tracksView.listModel.get(index)], index) } } Loader { active: SwipeView.isCurrentItem || SwipeView.isNextItem || SwipeView.isPreviousItem || item sourceComponent: AlbumsView { id: albumsView holder.emoji: "qrc:/assets/dialog-information.svg" holder.isMask: false holder.title : "No Albums!" holder.body: "Add new music sources" holder.emojiSize: Maui.Style.iconSizes.huge title: count + qsTr(" albums") list.query: Albums.ALBUMS list.sortBy: Albums.ALBUM Connections { target: vvave onRefreshTables: albumsView.list.refresh() } Connections { target: albumsView onRowClicked: Player.quickPlay(track) onAppendTrack: Player.addTrack(track) onPlayTrack: Player.quickPlay(track) onAlbumCoverClicked: albumsView.populateTable(album, artist) onAlbumCoverPressedAndHold: { var query = Q.GET.albumTracks_.arg(album) query = query.arg(artist) mainPlaylist.list.clear() mainPlaylist.list.sortBy = Tracks.NONE mainPlaylist.list.query = query Player.playAt(0) } onPlayAll: Player.playAll(albumsView.listModel.getAll()) onAppendAll: Player.appendAll(albumsView.listModel.getAll()) } } } Loader { active: SwipeView.isCurrentItem || SwipeView.isNextItem || SwipeView.isPreviousItem || item sourceComponent: AlbumsView { id: artistsView holder.emoji: "qrc:/assets/dialog-information.svg" holder.isMask: false holder.title : qsTr("No Artists!") holder.body: qsTr("Add new music sources") holder.emojiSize: Maui.Style.iconSizes.huge title: count + qsTr(" artists") list.query: Albums.ARTISTS list.sortBy: Albums.ARTIST table.list.sortBy: Tracks.NONE Connections { target: vvave onRefreshTables: artistsView.list.refresh() } Connections { target: artistsView onRowClicked: Player.quickPlay(track) onAppendTrack: Player.addTrack(track) onPlayTrack: Player.quickPlay(track) onAlbumCoverClicked: artistsView.populateTable(undefined, artist) onAlbumCoverPressedAndHold: { var query = Q.GET.artistTracks_.arg(artist) mainPlaylist.list.clear() mainPlaylist.list.sortBy = Tracks.NONE mainPlaylist.list.query = query Player.playAt(0) } onPlayAll: Player.artistsView(albumsView.listModel.getAll()) onAppendAll: Player.artistsView(albumsView.listModel.getAll()) } } } Loader { active: SwipeView.isCurrentItem || SwipeView.isNextItem || SwipeView.isPreviousItem || item sourceComponent: PlaylistsView { id: playlistsView Connections { target: playlistsView onRowClicked: Player.quickPlay(track) onAppendTrack: Player.addTrack(track) onPlayTrack: Player.quickPlay(track) onAppendAll: Player.appendAll(playlistsView.listModel.getAll()) onSyncAndPlay: { Player.playAll(playlistsView.listModel.getAll()) root.sync = true root.syncPlaylist = playlist } onPlayAll: Player.playAll(playlistsView.listModel.getAll()) } } } + Loader + { + active: SwipeView.isCurrentItem || SwipeView.isNextItem || SwipeView.isPreviousItem || item + sourceComponent: CloudView + { + id: cloudView + } + } + Loader { active: SwipeView.isCurrentItem || item sourceComponent: FoldersView { id: foldersView Connections { target: vvave onRefreshTables: foldersView.populate() } Connections { target: foldersView.list onRowClicked: Player.quickPlay(foldersView.list.model.get(index)) onQuickPlayTrack: Player.quickPlay(foldersView.list.model.get(index)) onAppendTrack: Player.addTrack(foldersView.listModel.get(index)) onPlayAll: Player.playAll(foldersView.listModel.getAll()) onAppendAll: Player.appendAll(foldersView.listModel.getAll()) onQueueTrack: Player.queueTracks([foldersView.list.model.get(index)], index) } } } - // Loader - // { - // active: SwipeView.isCurrentItem || SwipeView.isNextItem || SwipeView.isPreviousItem || item - // sourceComponent: CloudView - // { - // id: cloudView - // } - // } - Loader { active: SwipeView.isCurrentItem || item sourceComponent: YouTube { id: youtubeView } } Loader { active: SwipeView.isCurrentItem || (item && item.listView.count > 0) sourceComponent: SearchTable { id: searchView Connections { target: searchView onRowClicked: Player.quickPlay(searchView.listModel.get(index)) onQuickPlayTrack: Player.quickPlay(searchView.listModel.get(index)) onAppendTrack: Player.addTrack(searchView.listModel.get(index)) onPlayAll: Player.playAll(searchView.listModel.getAll()) onAppendAll: Player.appendAll(searchView.listModel.getAll()) onArtworkDoubleClicked: { var query = Q.GET.albumTracks_.arg( searchView.listModel.get( index).album) query = query.arg(searchView.listModel.get(index).artist) mainPlaylist.list.clear() mainPlaylist.list.sortBy = Tracks.NONE mainPlaylist.list.query = query Player.playAt(0) } } } } } SelectionBar { id: _selectionBar property alias listView: _selectionBar.selectionList Layout.maximumWidth: 500 Layout.minimumWidth: 100 Layout.fillWidth: true Layout.alignment: Qt.AlignCenter Layout.margins: Maui.Style.space.big Layout.topMargin: Maui.Style.space.small Layout.bottomMargin: Maui.Style.space.big onExitClicked: { root.selectionMode = false clear() } } } } /*CONNECTIONS*/ Connections { target: vvave onRefreshTables: { if(size>0) root.notify("emblem-info", "Collection updated", size+" new tracks added...") } // onRefreshTracks: H.refreshTracks() // onRefreshAlbums: H.refreshAlbums() // onRefreshArtists: H.refreshArtists() // onCoverReady: // { // root.currentArtwork = path // currentTrack.artwork = currentArtwork // mainPlaylist.list.update(currentTrack, currentTrackIndex); // } // onTrackLyricsReady: // { // console.log(lyrics) // if (url === currentTrack.url) // Player.setLyrics(lyrics) // } // onSkipTrack: Player.nextTrack() // onBabeIt: if (!mainlistEmpty) // { // mainPlaylist.list.fav(currentTrackIndex, !(mainPlaylist.list.get(currentTrackIndex).fav == "1")) // currentBabe = mainPlaylist.list.get(currentTrackIndex).fav == "1" // } onOpenFiles: { Player.appendTracksAt(tracks, 0) Player.playAt(0) } } Component.onCompleted: { if(isAndroid) { Maui.Android.statusbarColor(Kirigami.Theme.backgroundColor, true) Maui.Android.navBarColor(Kirigami.Theme.backgroundColor, true) } } } diff --git a/services/local/taginfo.h b/services/local/taginfo.h index 5b501eb..caeb2fe 100644 --- a/services/local/taginfo.h +++ b/services/local/taginfo.h @@ -1,49 +1,52 @@ #ifndef TAGINFO_H #define TAGINFO_H #include #include #include -#if defined Q_OS_ANDROID || defined Q_OS_WIN32 +#if defined Q_OS_WIN32 #include "taglib/tag.h" #include "taglib/fileref.h" +#elif defined Q_OS_ANDROID +#include "tag.h" +#include "fileref.h" #else #include #include #endif class TagInfo : public QObject { Q_OBJECT public: TagInfo(const QString &url, QObject *parent = nullptr); ~TagInfo(); bool isNull(); QString getAlbum() const; QString getTitle() const; QString getArtist() const; int getTrack() const; QString getGenre() const; QString fileName() const; QString getComment() const; QByteArray getCover() const; int getDuration() const; uint getYear() const; void setAlbum(const QString &album) ; void setTitle(const QString &title); void setTrack(const int &track); void setArtist(const QString &artist); void setGenre(const QString &genre); void setComment(const QString &comment); void setCover(const QByteArray &array); private: TagLib::FileRef *file; QString path; wchar_t * m_path; }; #endif // TAGINFO_H diff --git a/services/web/NextCloud/nextmusic.cpp b/services/web/NextCloud/nextmusic.cpp index 390cd33..a66a9ef 100644 --- a/services/web/NextCloud/nextmusic.cpp +++ b/services/web/NextCloud/nextmusic.cpp @@ -1,247 +1,254 @@ #include "nextmusic.h" #include #include #include #include #include +#include +#include #ifdef STATIC_MAUIKIT #include "fm.h" +#include "downloader.h" #else #include +#include #endif static const inline QNetworkRequest formRequest(const QUrl &url, const QString &user, const QString &password) { if(!url.isValid() && !user.isEmpty() && !password.isEmpty()) return QNetworkRequest(); const QString concatenated = QString("%1:%2").arg(user, password); const QByteArray data = concatenated.toLocal8Bit().toBase64(); const QString headerData = "Basic " + data; // Construct new QNetworkRequest with prepared header values QNetworkRequest newRequest(url); newRequest.setRawHeader(QString("Authorization").toLocal8Bit(), headerData.toLocal8Bit()); // newRequest.setRawHeader(QByteArrayLiteral("OCS-APIREQUEST"), QByteArrayLiteral("true")); qDebug() << "headers" << newRequest.rawHeaderList() << newRequest.url(); return newRequest; } const QString NextMusic::API = QStringLiteral("https://PROVIDER/index.php/apps/music/api/"); NextMusic::NextMusic(QObject *parent) : AbstractMusicProvider(parent) {} QVariantList NextMusic::getAlbumsList() const { return this->m_albums; } QVariantList NextMusic::getArtistsList() const { qDebug () << "ASKING FOR ARISTS" << this->m_artists; return this->m_artists; } FMH::MODEL_LIST NextMusic::parseCollection(const QByteArray &array) { FMH::MODEL_LIST res; // qDebug()<< "trying to parse array" << array; QJsonParseError jsonParseError; QJsonDocument jsonResponse = QJsonDocument::fromJson(static_cast(array).toUtf8(), &jsonParseError); if (jsonParseError.error != QJsonParseError::NoError) { qDebug()<< "ERROR PARSING" << array; return res; } const auto data = jsonResponse.toVariant(); if(data.isNull() || !data.isValid()) return res; const auto list = data.toList(); qDebug()<< "SOFAR GOOD PARSING"; if(!list.isEmpty()) { for(const auto &item : list) { const auto map = item.toMap(); const auto artist = map.value("name").toString(); const auto artistId = map.value("id").toString(); this->m_artists.append(QVariantMap{{"artist", artist}, {"id", artistId}}); qDebug()<< "ARTIST" << artist << artistId; const auto albumsList = map.value("albums").toList(); for(const auto &albumItem : albumsList) { const auto albumMap = albumItem.toMap(); const auto album = albumMap.value("name").toString(); const auto albumId = albumMap.value("id").toString(); const auto albumYear = albumMap.value("year").toString(); const auto albumCover = albumMap.value("cover").toString(); this->m_albums.append(QVariantMap {{"album", album}, {"artist", artist}, {"release_date", albumYear}, {"artwork", albumCover}, {"id", albumId}}); qDebug()<< "ARTIST && ALBUM" << artist << album << artistId; const auto tracksList = albumMap.value("tracks").toList(); for(const auto &trackItem : tracksList) { const auto trackMap = trackItem.toMap(); const auto title = trackMap.value("title").toString(); const auto track = trackMap.value("number").toString(); const auto id = trackMap.value("id").toString(); const auto filesMap = trackMap.value("files").toMap(); for(const auto &fileKey : filesMap.keys()) { const auto mime = fileKey; const auto url = filesMap[fileKey].toString(); const auto trackModel = FMH::MODEL({ {FMH::MODEL_KEY::ID, url}, {FMH::MODEL_KEY::TITLE, title}, {FMH::MODEL_KEY::TRACK, track}, {FMH::MODEL_KEY::ALBUM, album}, {FMH::MODEL_KEY::ARTIST, artist}, {FMH::MODEL_KEY::ARTWORK, albumCover}, {FMH::MODEL_KEY::RELEASEDATE, albumYear}, {FMH::MODEL_KEY::SOURCE, this->m_provider} }); this->m_tracks.insert(url, trackModel); res << trackModel; } } } } } qDebug()<< res; return res; } FMH::MODEL NextMusic::getTrackItem(const QString &id) { return this->m_tracks.value(id); } void NextMusic::getTrackPath(const QString &id) { auto url = QString(NextMusic::API+"file/%1/path").replace("PROVIDER", QUrl(this->m_provider).host()).arg(id); QString concatenated = this->m_user + ":" + this->m_password; QByteArray data = concatenated.toLocal8Bit().toBase64(); QString headerData = "Basic " + data; QMap header {{"Authorization", headerData.toLocal8Bit()}}; const auto downloader = new FMH::Downloader; connect(downloader, &FMH::Downloader::dataReady, [this, id, _downloader = std::move(downloader)](QByteArray array) { QJsonParseError jsonParseError; QJsonDocument jsonResponse = QJsonDocument::fromJson(static_cast(array).toUtf8(), &jsonParseError); if (jsonParseError.error != QJsonParseError::NoError) { qDebug()<< "ERROR PARSING"; return; } const auto data = jsonResponse.toVariant(); if(data.isNull() || !data.isValid()) return; const auto map = data.toMap(); auto path = map["path"].toString(); const auto url = this->provider() + (path.startsWith("/") ? path.remove(0,1) : path); emit this->trackPathReady(id, url); }); downloader->getArray(url, header); } void NextMusic::getCollection(const std::initializer_list ¶meters) { + auto url = QString(NextMusic::API).replace("PROVIDER", QUrl(this->m_provider).host()).append("collection"); QString concatenated = this->m_user + ":" + this->m_password; QByteArray data = concatenated.toLocal8Bit().toBase64(); QString headerData = "Basic " + data; QMap header {{"Authorization", headerData.toLocal8Bit()}}; const auto downloader = new FMH::Downloader; connect(downloader, &FMH::Downloader::dataReady, [&, _downloader = std::move(downloader)](QByteArray array) { + qDebug()<< "FINISHED REQUEST WITH RESPONSEC : " << array; + const auto data = this->parseCollection(array); emit this->collectionReady(data); _downloader->deleteLater(); }); downloader->getArray(url, header); } void NextMusic::getTracks() { } void NextMusic::getTrack(const QString &id) { } void NextMusic::getArtists() { } void NextMusic::getArtist(const QString &id) { } void NextMusic::getAlbums() { } void NextMusic::getAlbum(const QString &id) { } void NextMusic::getPlaylists() { } void NextMusic::getPlaylist(const QString &id) { } void NextMusic::getFolders() { } void NextMusic::getFolder(const QString &id) { } diff --git a/view_models/BabeTable/BabeTable.qml b/view_models/BabeTable/BabeTable.qml index 26bb60a..d593c38 100644 --- a/view_models/BabeTable/BabeTable.qml +++ b/view_models/BabeTable/BabeTable.qml @@ -1,541 +1,542 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.3 import org.kde.kirigami 2.7 as Kirigami import org.kde.mauikit 1.0 as Maui import TracksList 1.0 import "../../utils/Player.js" as Player import "../../utils/Help.js" as H import "../../db/Queries.js" as Q import ".." BabeList { id: control // cacheBuffer : 300 property alias list : _tracksList property alias listModel : _tracksModel property alias removeDialog : _removeDialog property bool trackNumberVisible property bool coverArtVisible : false property bool allowMenu: true property bool showQuickActions : true property bool group : false property alias contextMenu : contextMenu property alias contextMenuItems : contextMenu.contentData // property alias playAllBtn : playAllBtn // property alias appendBtn : appendBtn signal rowClicked(int index) signal rowDoubleClicked(int index) signal rowPressed(int index) signal quickPlayTrack(int index) signal queueTrack(int index) signal appendTrack(int index) signal artworkDoubleClicked(int index) signal playAll() signal appendAll() focus: true holder.visible: list.count === 0 listView.spacing: Maui.Style.space.small * (Kirigami.Settings.isMobile ? 1.4 : 1.2) listView.header: Column { width: control.width z: listView.z + 9 visible: list.count > 0 Maui.ToolBar { Kirigami.Theme.inherit: false position: ToolBar.Header width: parent.width leftContent: [ ToolButton { id : playAllBtn icon.name : "media-playlist-play" onClicked: playAll() }, ToolButton { id: appendBtn icon.name : "media-playlist-append" onClicked: appendAll() }] middleContent: Label { + Layout.fillWidth: true text: control.title elide : Text.ElideRight font.bold : false font.weight: Font.Bold color : Kirigami.Theme.textColor font.pointSize: Maui.Style.fontSizes.big horizontalAlignment : Text.AlignHCenter verticalAlignment : Text.AlignVCenter } rightContent: [ ToolButton { icon.name: "item-select" onClicked: selectionMode = !selectionMode checkable: false checked: selectionMode }, Maui.ToolButtonMenu { id: sortBtn icon.name: "view-sort" visible: list.count > 2 MenuItem { text: qsTr("Title") checkable: true checked: list.sortBy === Tracks.TITLE onTriggered: list.sortBy = Tracks.TITLE autoExclusive: true } MenuItem { text: qsTr("Track") checkable: true checked: list.sortBy === Tracks.TRACK onTriggered: list.sortBy = Tracks.TRACK autoExclusive: true } MenuItem { text: qsTr("Artist") checkable: true checked: list.sortBy === Tracks.ARTIST onTriggered: list.sortBy = Tracks.ARTIST autoExclusive: true } MenuItem { text: qsTr("Album") checkable: true checked: list.sortBy === Tracks.ALBUM onTriggered: list.sortBy = Tracks.ALBUM autoExclusive: true } MenuItem { text: qsTr("Most played") checkable: true checked: list.sortBy === Tracks.COUNT onTriggered: list.sortBy = Tracks.COUNT autoExclusive: true } MenuItem { text: qsTr("Rate") checkable: true checked: list.sortBy === Tracks.RATE onTriggered: list.sortBy = Tracks.RATE autoExclusive: true } MenuItem { text: qsTr("Favorite") checkable: true checked: list.sortBy === Tracks.FAV onTriggered: list.sortBy = Tracks.FAV autoExclusive: true } MenuItem { text: qsTr("Release date") checkable: true checked: list.sortBy === Tracks.RELEASEDATE onTriggered: list.sortBy = Tracks.RELEASEDATE autoExclusive: true } MenuItem { text: qsTr("Add date") checkable: true checked: list.sortBy === Tracks.ADDDATE onTriggered: list.sortBy = Tracks.ADDDATE autoExclusive: true } MenuSeparator{} MenuItem { text: qsTr("Group") checkable: true checked: group onTriggered: { group = !group groupBy() } } }, ToolButton { id: _filterButton icon.name: "view-filter" checkable: true visible: list.count > 10 } ] } Maui.ToolBar { Kirigami.Theme.inherit: false // Kirigami.Theme.backgroundColor: control.Kirigami.Theme.backgroundColor visible: _filterButton.checked && _filterButton.visible width: parent.width position: ToolBar.Header middleContent: Maui.TextField { Layout.fillWidth: true onAccepted: listModel.setFilterString(text) onTextChanged: listModel.setFilterString(text) } } } Maui.Dialog { id: _removeDialog property int index title: qsTr("Remove track") message: qsTr("You can delete the file from your computer or remove it from your collection") rejectButton.text: qsTr("Delete") acceptButton.text: qsTr("Remove") page.padding: Maui.Style.space.huge onAccepted: { list.remove(listView.currentIndex) close() } onRejected: { if(Maui.FM.removeFile(list.get(index).url)) list.remove(listView.currentIndex) close() } } TableMenu { id: contextMenu MenuSeparator {} MenuItem { text: qsTr("Go to Artist") onTriggered: goToArtist() } MenuItem { text: qsTr("Go to Album") onTriggered: goToAlbum() } onFavClicked: { list.fav(listView.currentIndex, !(list.get(listView.currentIndex).fav == "1")) } onQueueClicked: Player.queueTracks([list.get(listView.currentIndex)]) onPlayClicked: quickPlayTrack(listView.currentIndex) onAppendClicked: appendTrack(listView.currentIndex) onSaveToClicked: { playlistDialog.tracks = [list.get(listView.currentIndex).url] playlistDialog.open() } onOpenWithClicked: Maui.FM.openLocation([list.get(listView.currentIndex).url]) onDeleteClicked: { _removeDialog.index= listView.currentIndex _removeDialog.open() } onRateClicked: { list.rate(listView.currentIndex, rate); } onColorClicked: { list.color(listView.currentIndex, color); } onInfoClicked: { infoView.show(list.get(listView.currentIndex)) } onCopyToClicked: { cloudView.list.upload(listView.currentIndex) } onShareClicked: { const url = list.get(listView.currentIndex).url if(isAndroid) { Maui.Android.shareDialog(url) return } _dialogLoader.sourceComponent = _shareDialogComponent root.dialog.show([url]) } } section.criteria: ViewSection.FullString section.delegate: Maui.LabelDelegate { id: _sectionDelegate label: section isSection: true width: control.width Kirigami.Theme.backgroundColor: "#333" Kirigami.Theme.textColor: "#fafafa" background: Rectangle { color: Kirigami.Theme.backgroundColor } } Maui.BaseModel { id: _tracksModel list: _tracksList recursiveFilteringEnabled: true sortCaseSensitivity: Qt.CaseInsensitive filterCaseSensitivity: Qt.CaseInsensitive } Tracks { id: _tracksList onSortByChanged: if(control.group) control.groupBy() } model: _tracksModel // property alias animBabe: delegate.animBabe delegate: TableDelegate { id: delegate width: listView.width number : trackNumberVisible ? true : false coverArt : coverArtVisible ? (control.width > 200) : coverArtVisible onPressAndHold: if(Kirigami.Settings.isMobile && allowMenu) openItemMenu(index) onRightClicked: if(allowMenu) openItemMenu(index) onLeftEmblemClicked: H.addToSelection(list.get(index)) isSelected: selectionBar.contains(model.url) sameAlbum: { if(coverArt) { if(list.get(index-1)) { if(list.get(index-1).album === album && list.get(index-1).artist === artist) true else false }else false }else false } ToolButton { Layout.fillHeight: true Layout.preferredWidth: implicitWidth visible: control.showQuickActions && (Kirigami.Settings.isMobile ? true : delegate.hovered) icon.name: "media-playlist-append" onClicked: delegate.append() opacity: delegate.hovered ? 0.8 : 0.6 } onClicked: { currentIndex = index if(selectionMode) { H.addToSelection(list.get(listView.currentIndex)) return } if(Kirigami.Settings.isMobile) rowClicked(index) } onDoubleClicked: { currentIndex = index if(!Kirigami.Settings.isMobile) rowClicked(index) } onPlay: { currentIndex = index quickPlayTrack(index) } onAppend: { currentIndex = index appendTrack(index) } onArtworkCoverClicked: { currentIndex = index goToAlbum() } Connections { target: selectionBar onUriRemoved: { if(uri === model.url) delegate.isSelected = false } onUriAdded: { if(uri === model.url) delegate.isSelected = true } onCleared: delegate.isSelected = false } } function openItemMenu(index) { currentIndex = index contextMenu.rate = list.get(currentIndex).rate contextMenu.fav = list.get(currentIndex).fav == "1" contextMenu.popup() rowPressed(index) } function saveList() { var trackList = [] if(list.count > 0) { for(var i = 0; i < list.count; ++i) trackList.push(listModel.get(i).url) playlistDialog.tracks = trackList playlistDialog.open() } } function queueList() { var trackList = [] if(list.count > 0) { for(var i = 0; i < list.count; ++i) trackList.push(list.get(i)) Player.queueTracks(trackList) } } function goToAlbum() { swipeView.currentIndex = viewsIndex.albums const item = list.get(listView.currentIndex) swipeView.currentItem.item.populateTable(item.album, item.artist) contextMenu.close() } function goToArtist() { swipeView.currentIndex = viewsIndex.artists const item = list.get(listView.currentIndex) swipeView.currentItem.item.populateTable(undefined, item.artist) contextMenu.close() } function groupBy() { var prop = "undefined" if(group) switch(list.sortBy) { case Tracks.TITLE: prop = "title" break case Tracks.ARTIST: prop = "artist" break case Tracks.ALBUM: prop = "album" break case Tracks.RATE: prop = "rate" break case Tracks.FAV: prop = "fav" break case Tracks.ADDDATE: prop = "adddate" break case Tracks.RELEASEDATE: prop = "releasedate" break; case Tracks.COUNT: prop = "count" break } section.property = prop } } diff --git a/vvave.pro b/vvave.pro index df48820..c426067 100644 --- a/vvave.pro +++ b/vvave.pro @@ -1,125 +1,125 @@ QT *= quick \ multimedia \ sql \ websockets \ network \ xml \ qml \ widgets \ quickcontrols2 \ - concurrent + concurrent \ + network TARGET = vvave TEMPLATE = app CONFIG += ordered CONFIG += c++17 CONFIG += static linux:unix:!android { message(Building for Linux KDE) include($$PWD/kde/kde.pri) LIBS += -lMauiKit } else:android|win32 { message(Building helpers for Android) android { QMAKE_LINK += -nostdlib++ QT *= androidextras webview ANDROID_PACKAGE_SOURCE_DIR = $$PWD/android_files include($$PWD/3rdparty/taglib.pri) }else:win32 { message("Using Tablib binaries for Windows") + LIBS += -L$$PWD/3rdparty/taglib/lib/ -llibtag.dll + INCLUDEPATH += $$PWD/3rdparty/taglib/include + DEPENDPATH += $$PWD/3rdparty/taglib/include } #DEFAULT COMPONENTS DEFINITIONS DEFINES *= \ # COMPONENT_EDITOR \ COMPONENT_ACCOUNTS \ COMPONENT_FM \ # COMPONENT_TERMINAL \ COMPONENT_TAGGING \ # COMPONENT_SYNCING \ MAUIKIT_STYLE include($$PWD/3rdparty/kirigami/kirigami.pri) include($$PWD/3rdparty/mauikit/mauikit.pri) DEFINES += STATIC_KIRIGAMI } else { message("Unknown configuration") } include(pulpo/pulpo.pri) # The following define makes your compiler emit warnings if you use # any feature of Qt which as been marked deprecated (the exact warnings # depend on your compiler). Please consult the documentation of the # deprecated API in order to know how to port your code away from it. DEFINES += QT_DEPRECATED_WARNINGS # You can also make your code fail to compile if you use deprecated APIs. # In order to do so, uncomment the following line. # You can also select to disable deprecated APIs only up to a certain version of Qt. #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 SOURCES += main.cpp \ db/collectionDB.cpp \ services/local/taginfo.cpp \ services/local/player.cpp \ # utils/brain.cpp \ # services/local/socket.cpp \ services/web/youtube.cpp \ vvave.cpp \ services/local/youtubedl.cpp \ # services/local/linking.cpp \ # services/web/Spotify/spotify.cpp \ models/tracks/tracksmodel.cpp \ models/playlists/playlistsmodel.cpp \ models/albums/albumsmodel.cpp \ -# services/web/NextCloud/nextmusic.cpp \ -# services/web/abstractmusicprovider.cpp \ -# models/cloud/cloud.cpp + services/web/NextCloud/nextmusic.cpp \ + services/web/abstractmusicprovider.cpp \ + models/cloud/cloud.cpp RESOURCES += qml.qrc \ # Additional import path used to resolve QML modules in Qt Creator's code model QML_IMPORT_PATH = # Additional import path used to resolve QML modules just for Qt Quick Designer QML_DESIGNER_IMPORT_PATH = HEADERS += \ db/collectionDB.h \ utils/bae.h \ services/local/fileloader.h \ services/local/taginfo.h \ services/local/player.h \ # utils/brain.h \ # services/local/socket.h \ services/web/youtube.h \ vvave.h \ services/local/youtubedl.h \ # services/local/linking.h \ # services/web/Spotify/spotify.h \ models/tracks/tracksmodel.h \ models/playlists/playlistsmodel.h \ models/albums/albumsmodel.h \ -# services/web/NextCloud/nextmusic.h \ -# services/web/abstractmusicprovider.h \ -# models/cloud/cloud.h + services/web/NextCloud/nextmusic.h \ + services/web/abstractmusicprovider.h \ + models/cloud/cloud.h -#INCLUDEPATH += \ -# $$PWD/services/web \ -# $$PWD/services/web/NextCloud +INCLUDEPATH += \ + $$PWD/services/web \ + $$PWD/services/web/NextCloud include(install.pri) - - LIBS += -L$$PWD/3rdparty/taglib/lib/ -llibtag.dll - INCLUDEPATH += $$PWD/3rdparty/taglib/include - DEPENDPATH += $$PWD/3rdparty/taglib/include