Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

[0faa96]: libkwave / MultiWriter.h Maximize Restore History

Download this file

MultiWriter.h    110 lines (80 with data), 2.9 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
/***************************************************************************
MultiWriter.h - writer for multi-track processing
-------------------
begin : Sun Aug 23 2009
copyright : (C) 2009 by Thomas Eschenbacher
email : Thomas Eschenbacher <thomas.eschenbacher@gmx.de>
***************************************************************************/
/***************************************************************************
* *
* 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 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef _MULTI_WRITER_H_
#define _MULTI_WRITER_H_
#include "config.h"
#include <QObject>
#include <QList>
#include <kdemacros.h>
#include "libkwave/MultiTrackSink.h"
#include "libkwave/Writer.h"
class MultiTrackReader;
namespace Kwave {
/**
* A MultiWriter encapsulates a set of <c>Writer</c>s for
* easier use of multi-track signals.
*/
class KDE_EXPORT MultiWriter: public Kwave::MultiTrackSink<Kwave::Writer>
{
Q_OBJECT
public:
/** Default constructor */
MultiWriter();
/** Destructor */
virtual ~MultiWriter();
/** Returns the last sample index of all streams */
virtual sample_index_t last() const;
/** Flushes all streams */
virtual void flush();
/** @see Kwave::MultiTrackSink<Kwave::Writer>::clear() */
virtual void clear();
/** @see Kwave::MultiTrackSink<Kwave::Writer>::insert() */
virtual bool insert(unsigned int track, Kwave::Writer *writer);
/** returns true if the transfer has been canceled */
inline bool isCanceled() const { return m_canceled; }
signals:
/**
* Emits the current progress in percent, if the writers
* are in "overwrite" mode
* @see written for insert and append mode
*/
void progress(qreal percent);
/**
* Emitts the currently written samples, summed up over all
* tracks, if the writers are in "insert" or "append" mode
* @see progress for overwrite mode
*/
void written(quint64 samples);
public slots:
/**
* Can be connected to some progress dialog to cancel the current
* transfer.
*/
void cancel();
private slots:
/**
* Connected to each Writer to get informed about their progress.
*/
void proceeded();
protected:
/**
* Initialized as false, will be true if the transfer has
* been canceled
*/
bool m_canceled;
};
}
#endif /* _MULTI_WRITER_H_ */