kwave  18.07.70
MultiStreamWriter.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  MultiStreamWriter.cpp - stream writer for multi-track signals
3  -------------------
4  begin : Sun Aug 23 2009
5  copyright : (C) 2009 by Thomas Eschenbacher
6  email : Thomas Eschenbacher <thomas.eschenbacher@gmx.de>
7 
8  ***************************************************************************/
9 
10 /***************************************************************************
11  * *
12  * This program is free software; you can redistribute it and/or modify *
13  * it under the terms of the GNU General Public License as published by *
14  * the Free Software Foundation; either version 2 of the License, or *
15  * (at your option) any later version. *
16  * *
17  ***************************************************************************/
18 
19 #include "config.h"
20 
21 #include <new>
22 
24 #include "libkwave/StreamWriter.h"
25 
26 //***************************************************************************
28  :Kwave::MultiWriter()
29 {
30  for (unsigned int index = 0; index < tracks; index++) {
31  Kwave::StreamWriter *s = new(std::nothrow) Kwave::StreamWriter();
32  if (s) {
33  insert(index, s);
34  } else {
35  // out of memory or aborted
36  qWarning("MultiStreamWriter constructor: "\
37  "out of memory or aborted");
38  clear();
39  break;
40  }
41  }
42 }
43 
44 //***************************************************************************
46 {
47  clear();
48 }
49 
50 //***************************************************************************
51 //***************************************************************************
virtual unsigned int tracks() const Q_DECL_OVERRIDE
Definition: App.h:33
MultiStreamWriter(unsigned int tracks)
virtual bool insert(unsigned int track, Kwave::Writer *writer) Q_DECL_OVERRIDE
Definition: MultiWriter.cpp:37
virtual void clear() Q_DECL_OVERRIDE
Definition: MultiWriter.cpp:97