|
kwave
18.07.70
|
#include <K3BExportPlugin.h>


Classes | |
| struct | BlockInfo |
Public Types | |
| enum | export_location_t { EXPORT_TO_SAME_DIR = 0, EXPORT_TO_SUB_DIR = 1 } |
| enum | overwrite_policy_t { OVERWRITE_EXISTING_FILES = 0, USE_NEW_FILE_NAMES = 1 } |
Public Member Functions | |
| K3BExportPlugin (QObject *parent, const QVariantList &args) | |
| virtual | ~K3BExportPlugin () Q_DECL_OVERRIDE |
| virtual void | load (QStringList ¶ms) Q_DECL_OVERRIDE |
| virtual QStringList * | setup (QStringList ¶ms) Q_DECL_OVERRIDE |
| virtual int | start (QStringList ¶ms) Q_DECL_OVERRIDE |
Public Member Functions inherited from Kwave::Plugin | |
| Plugin (QObject *parent, const QVariantList &args) | |
| virtual | ~Plugin () Q_DECL_OVERRIDE |
| virtual QString | name () const |
| virtual QString | description () const |
| virtual QString | progressText () |
| virtual bool | canClose () const |
| bool | isRunning () const |
| bool | shouldStop () const |
| virtual void | unload () |
| virtual int | stop () |
| virtual void | run (QStringList params) |
| Kwave::PluginManager & | manager () const |
| Kwave::SignalManager & | signalManager () |
| QWidget * | parentWidget () const |
| QString | signalName () |
| virtual sample_index_t | signalLength () |
| virtual double | signalRate () |
| virtual const QList< unsigned int > | selectedTracks () |
| virtual sample_index_t | selection (QList< unsigned int > *tracks=Q_NULLPTR, sample_index_t *left=Q_NULLPTR, sample_index_t *right=Q_NULLPTR, bool expand_if_empty=false) |
| virtual void | selectRange (sample_index_t offset, sample_index_t length) |
| virtual void | migrateToActiveContext () |
Public Member Functions inherited from Kwave::Runnable | |
| virtual | ~Runnable () |
Static Public Member Functions | |
| static QStringList | knownPatterns () |
Protected Member Functions | |
| int | interpreteParameters (QStringList ¶ms) |
| void | scanBlocksToSave (const QString &base, sample_index_t selection_left, sample_index_t selection_right) |
| QString | createFileName (const QString &pattern, unsigned int index) |
| bool | detectBlockMetaData (const QString &text, const QString &pattern, BlockInfo &block) |
| void | saveGeneralDocumentData (QDomElement *part) |
| void | saveDocumentData (QDomElement *docElem) |
| int | saveBlocks (bool selection_only, const QString &out_dir, const QString &out_pattern) |
| int | saveK3BFile (const QString &k3b_filename) |
Protected Member Functions inherited from Kwave::Plugin | |
| int | execute (QStringList ¶ms) |
| void | emitCommand (const QString &command) |
| void | use () |
| void | setPluginManager (Kwave::PluginManager *new_plugin_manager) |
| virtual void | run_wrapper (const QVariant ¶ms) Q_DECL_OVERRIDE |
Private Attributes | |
| QUrl | m_url |
| QString | m_pattern |
| bool | m_selection_only |
| export_location_t | m_export_location |
| overwrite_policy_t | m_overwrite_policy |
| QVector< BlockInfo > | m_block_info |
Additional Inherited Members | |
Public Slots inherited from Kwave::Plugin | |
| virtual void | setProgressDialogEnabled (bool enable) |
| virtual void | updateProgress (qreal progress) |
| virtual void | cancel () |
| virtual void | close () |
| void | release () |
Signals inherited from Kwave::Plugin | |
| void | sigRunning (Kwave::Plugin *plugin) |
| void | sigDone (Kwave::Plugin *plugin) |
| void | sigClosed (Kwave::Plugin *p) |
| void | sigCommand (const QString &command) |
| void | setProgressText (const QString &text) |
Definition at line 36 of file K3BExportPlugin.h.
| Enumerator | |
|---|---|
| OVERWRITE_EXISTING_FILES | |
| USE_NEW_FILE_NAMES | |
Definition at line 46 of file K3BExportPlugin.h.
| Kwave::K3BExportPlugin::K3BExportPlugin | ( | QObject * | parent, |
| const QVariantList & | args | ||
| ) |
Constructor
| parent | reference to our plugin manager |
| args | argument list [unused] |
Definition at line 73 of file K3BExportPlugin.cpp.
|
virtual |
|
protected |
create a filename (with extension) out of a given name pattern and index
| pattern | the pattern for creating the filename |
| index | the index of the current file |
Definition at line 196 of file K3BExportPlugin.cpp.
References _, Kwave::Plugin::name(), OUTFILE_DIGITS, OUTFILE_PATTERN, and OUTFILE_SUFFIX.
Referenced by saveBlocks(), and start().


|
protected |
detects the meta data of a block from splitting the description text of a label
| text | the description of a label |
| pattern | a pattern describing the format of the text |
| block | a BlockInfo structure that receives artist and title |
Definition at line 207 of file K3BExportPlugin.cpp.
References _, Kwave::Parser::escape(), knownPatterns(), Kwave::K3BExportPlugin::BlockInfo::m_artist, and Kwave::K3BExportPlugin::BlockInfo::m_title.
Referenced by scanBlocksToSave().


|
protected |
reads values from the parameter list
Definition at line 91 of file K3BExportPlugin.cpp.
References EXPORT_TO_SAME_DIR, EXPORT_TO_SUB_DIR, m_export_location, m_overwrite_policy, m_pattern, m_selection_only, m_url, OVERWRITE_EXISTING_FILES, Kwave::Parser::unescape(), and USE_NEW_FILE_NAMES.
Referenced by setup(), and start().


|
static |
returns a list of all known detection patterns
Definition at line 777 of file K3BExportPlugin.cpp.
References _.
Referenced by detectBlockMetaData(), and Kwave::K3BExportWidget::K3BExportWidget().

|
virtual |
Reimplemented from Kwave::Plugin.
Definition at line 265 of file K3BExportPlugin.cpp.
References _, and Kwave::Plugin::emitCommand().

|
protected |
save the blocks through the saveblocks plugin
| selection_only | if true, save only the selection |
| out_dir | output directory for saving the blocks |
| out_pattern | the pattern for creating the block filenames |
Definition at line 686 of file K3BExportPlugin.cpp.
References _, createFileName(), Kwave::CodecManager::encoder(), Kwave::Parser::escape(), Kwave::Parser::escapeForFileName(), Kwave::PluginManager::executePlugin(), m_overwrite_policy, m_url, Kwave::Plugin::manager(), Kwave::SignalManager::metaData(), Kwave::CodecManager::mimeTypeOf(), Kwave::FileInfo::properties(), Kwave::MetaDataList::replace(), Kwave::FileInfo::set(), Kwave::FileInfo::setBits(), Kwave::Plugin::signalManager(), Kwave::Encoder::unsupportedProperties(), and USE_NEW_FILE_NAMES.
Referenced by start().


|
protected |
save the K3b project document data
Definition at line 410 of file K3BExportPlugin.cpp.
References _, Kwave::FileInfo::get(), GET_INF, Kwave::INF_AUTHOR, Kwave::INF_CD, Kwave::INF_COMMENTS, Kwave::INF_COPYRIGHTED, Kwave::INF_ISRC, Kwave::INF_NAME, Kwave::INF_ORGANIZATION, Kwave::INF_PERFORMER, Kwave::INF_TECHNICAN, Kwave::K3BExportPlugin::BlockInfo::m_artist, m_block_info, Kwave::K3BExportPlugin::BlockInfo::m_filename, Kwave::K3BExportPlugin::BlockInfo::m_title, saveGeneralDocumentData(), and Kwave::Plugin::signalManager().
Referenced by saveK3BFile().


|
protected |
save the "general" section
Definition at line 374 of file K3BExportPlugin.cpp.
References _.
Referenced by saveDocumentData().

|
protected |
save the *.k3b file
| k3b_filename | path to the *.k3b file |
Definition at line 735 of file K3BExportPlugin.cpp.
References _, K3B_PROJECT_MIME_TYPE, and saveDocumentData().
Referenced by start().


|
protected |
determines the blocks which should be saved, including start position, length and title.
| base | the base name, without indices, extension etc... |
| selection_left | index of the first sample |
| selection_right | index of the last sample |
Definition at line 136 of file K3BExportPlugin.cpp.
References detectBlockMetaData(), Kwave::FileInfo::get(), Kwave::INF_AUTHOR, Kwave::INF_NAME, Kwave::MetaData::isNull(), Kwave::K3BExportPlugin::BlockInfo::m_artist, m_block_info, Kwave::K3BExportPlugin::BlockInfo::m_filename, Kwave::K3BExportPlugin::BlockInfo::m_index, Kwave::K3BExportPlugin::BlockInfo::m_length, m_pattern, Kwave::K3BExportPlugin::BlockInfo::m_start, Kwave::K3BExportPlugin::BlockInfo::m_title, Kwave::Label::name(), Kwave::Label::pos(), Kwave::Plugin::signalLength(), and Kwave::Plugin::signalManager().
Referenced by start().


|
virtual |
Normally this method is used to set up all necessary parameters for executing the plugin. This plugin uses it for performing actions in the context of the GUI thread.
| params | some parameters |
Reimplemented from Kwave::Plugin.
Definition at line 280 of file K3BExportPlugin.cpp.
References _, Kwave::Plugin::description(), Kwave::Plugin::emitCommand(), Kwave::Parser::escape(), interpreteParameters(), K3B_FILE_SUFFIX, m_export_location, m_overwrite_policy, m_pattern, m_selection_only, Kwave::Plugin::name(), Kwave::Plugin::parentWidget(), Kwave::Plugin::selection(), Kwave::Plugin::signalLength(), and Kwave::Plugin::signalName().

|
virtual |
Saves the K3b project file, using the settings made in "setup()"
Reimplemented from Kwave::Plugin.
Definition at line 568 of file K3BExportPlugin.cpp.
References _, createFileName(), DBG, EXPORT_TO_SUB_DIR, interpreteParameters(), m_block_info, m_export_location, m_overwrite_policy, m_selection_only, m_url, Kwave::Plugin::name(), OUTFILE_PATTERN, OUTFILE_SUFFIX, Kwave::Plugin::parentWidget(), Kwave::MessageBox::questionYesNo(), saveBlocks(), saveK3BFile(), scanBlocksToSave(), Kwave::Plugin::selection(), Kwave::Plugin::signalLength(), Kwave::MessageBox::sorry(), and USE_NEW_FILE_NAMES.

|
private |
list of all blocks to save
Definition at line 171 of file K3BExportPlugin.h.
Referenced by saveDocumentData(), scanBlocksToSave(), and start().
|
private |
where to export the files of the tracks, subdir, same dir, ...
Definition at line 165 of file K3BExportPlugin.h.
Referenced by interpreteParameters(), setup(), and start().
|
private |
overwrite existing files or create a new file name
Definition at line 168 of file K3BExportPlugin.h.
Referenced by interpreteParameters(), saveBlocks(), setup(), and start().
|
private |
pattern for detecting title and artist
Definition at line 159 of file K3BExportPlugin.h.
Referenced by interpreteParameters(), scanBlocksToSave(), and setup().
|
private |
if true, export only the selected range
Definition at line 162 of file K3BExportPlugin.h.
Referenced by interpreteParameters(), setup(), and start().
|
private |
the URL of the project file
Definition at line 156 of file K3BExportPlugin.h.
Referenced by interpreteParameters(), saveBlocks(), and start().