kwave  18.07.70
K3BExportPlugin.h
Go to the documentation of this file.
1 /*************************************************************************
2  * K3BExportPlugin.h - export of K3b project files
3  * -------------------
4  * begin : Thu Apr 13 2017
5  * copyright : (C) 2017 by Thomas Eschenbacher
6  * email : Thomas.Eschenbacher@gmx.de
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #ifndef K3B_EXPORT_PLUGIN_H
19 #define K3B_EXPORT_PLUGIN_H
20 
21 #include "config.h"
22 
23 #include <QObject>
24 #include <QStringList>
25 #include <QUrl>
26 #include <QVariantList>
27 #include <QVector>
28 
29 #include "libkwave/Plugin.h"
30 
31 class QDomElement;
32 
33 namespace Kwave
34 {
35 
37  {
38  Q_OBJECT
39  public:
40 
41  typedef enum {
45 
46  typedef enum {
50 
56  K3BExportPlugin(QObject *parent, const QVariantList &args);
57 
59  virtual ~K3BExportPlugin() Q_DECL_OVERRIDE;
60 
62  virtual void load(QStringList &params) Q_DECL_OVERRIDE;
63 
72  virtual QStringList *setup(QStringList &params) Q_DECL_OVERRIDE;
73 
78  virtual int start(QStringList &params) Q_DECL_OVERRIDE;
79 
81  static QStringList knownPatterns();
82 
83  protected:
84 
85  typedef struct {
86  unsigned int m_index;
87  QString m_filename;
90  QString m_title;
91  QString m_artist;
92  } BlockInfo;
93 
95  int interpreteParameters(QStringList &params);
96 
104  void scanBlocksToSave(const QString &base,
105  sample_index_t selection_left,
106  sample_index_t selection_right);
107 
115  QString createFileName(const QString &pattern, unsigned int index);
116 
125  bool detectBlockMetaData(const QString &text,
126  const QString &pattern,
127  BlockInfo &block);
128 
130  void saveGeneralDocumentData(QDomElement *part);
131 
133  void saveDocumentData(QDomElement *docElem);
134 
142  int saveBlocks(bool selection_only,
143  const QString &out_dir,
144  const QString &out_pattern);
145 
151  int saveK3BFile(const QString &k3b_filename);
152 
153  private:
154 
156  QUrl m_url;
157 
159  QString m_pattern;
160 
163 
166 
169 
171  QVector<BlockInfo> m_block_info;
172  };
173 }
174 
175 #endif /* K3B_EXPORT_PLUGIN_H */
176 
177 //***************************************************************************
178 //***************************************************************************
179 
int saveK3BFile(const QString &k3b_filename)
K3BExportPlugin(QObject *parent, const QVariantList &args)
overwrite_policy_t m_overwrite_policy
Definition: App.h:33
export_location_t m_export_location
quint64 sample_index_t
Definition: Sample.h:28
QString createFileName(const QString &pattern, unsigned int index)
virtual int start(QStringList &params) Q_DECL_OVERRIDE
void saveDocumentData(QDomElement *docElem)
int interpreteParameters(QStringList &params)
void saveGeneralDocumentData(QDomElement *part)
virtual void load(QStringList &params) Q_DECL_OVERRIDE
static QStringList knownPatterns()
void scanBlocksToSave(const QString &base, sample_index_t selection_left, sample_index_t selection_right)
virtual QStringList * setup(QStringList &params) Q_DECL_OVERRIDE
bool detectBlockMetaData(const QString &text, const QString &pattern, BlockInfo &block)
QVector< BlockInfo > m_block_info
virtual ~K3BExportPlugin() Q_DECL_OVERRIDE
int saveBlocks(bool selection_only, const QString &out_dir, const QString &out_pattern)