9
* Copyright (C) 2003-2007 Urs Fleisch
11
* This file is part of Kid3.
13
* Kid3 is free software; you can redistribute it and/or modify
14
* it under the terms of the GNU General Public License as published by
15
* the Free Software Foundation; either version 2 of the License, or
16
* (at your option) any later version.
18
* Kid3 is distributed in the hope that it will be useful,
19
* but WITHOUT ANY WARRANTY; without even the implied warranty of
20
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21
* GNU General Public License for more details.
23
* You should have received a copy of the GNU General Public License
24
* along with this program. If not, see <http://www.gnu.org/licenses/>.
27
#ifndef IMPORTPARSER_H
28
#define IMPORTPARSER_H
33
#include "qtcompatmac.h"
34
/** The list type depends on the Qt version. */
35
#if QT_VERSION >= 0x040000
37
typedef QList<int> TrackDurationList;
39
#include <qvaluelist.h>
40
typedef QValueList<int> TrackDurationList;
43
class FrameCollection;
53
* @param fmt format regexp
54
* @param enableTrackIncr enable automatic track increment if no %t is found
56
void setFormat(const QString& fmt, bool enableTrackIncr = false);
59
* Get next tags in text buffer.
61
* @param text text buffer containing data from file or clipboard
62
* @param frames frames for output
63
* @param pos current position in buffer, will be updated to point
64
* behind current match (to be used for next call)
65
* @return true if tags found (pos is index behind match).
67
bool getNextTags(const QString& text, FrameCollection& frames, int& pos);
70
* Get list with track durations.
72
* @return list with track durations.
74
TrackDurationList* getTrackDurations() { return &m_trackDuration; }
77
* Get help text for format codes supported by setFormat().
81
static QString getFormatToolTip();
84
/** track regexp pattern */
88
/** true if automatic track number incrementing is used */
89
bool m_trackIncrEnabled;
90
/** automatically incremented track number */
92
QMap<QString, int> m_codePos;
93
TrackDurationList m_trackDuration;