| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
#ifndef H_PROTOCOLS_WRITER |
| 14 |
#define H_PROTOCOLS_WRITER |
| 15 |
|
| 16 |
#include <smooth.h> |
| 17 |
#include <boca.h> |
| 18 |
|
| 19 |
using namespace smooth; |
| 20 |
using namespace smooth::IO; |
| 21 |
|
| 22 |
namespace BoCA |
| 23 |
{ |
| 24 |
class ProtocolData |
| 25 |
{ |
| 26 |
public: |
| 27 |
ProtocolData(Int = -1, const Array<Track> * = NIL); |
| 28 |
~ProtocolData(); |
| 29 |
|
| 30 |
Bool preliminary; |
| 31 |
Int conversionID; |
| 32 |
|
| 33 |
String fileHeader; |
| 34 |
|
| 35 |
String fileName; |
| 36 |
OutStream *fileStream; |
| 37 |
|
| 38 |
String copyName; |
| 39 |
OutStream *copyStream; |
| 40 |
|
| 41 |
const Array<Track> *trackList; |
| 42 |
String singleFileName; |
| 43 |
}; |
| 44 |
|
| 45 |
class ProtocolWriter |
| 46 |
{ |
| 47 |
private: |
| 48 |
static String GetDisplayName(const Protocol *); |
| 49 |
|
| 50 |
static String FormatHeader(const Protocol *); |
| 51 |
static Void SaveProtocol(const Protocol *, OutStream *); |
| 52 |
|
| 53 |
static Array<ProtocolData> protocolData; |
| 54 |
static Int instanceCount; |
| 55 |
|
| 56 |
Void OutputMessage(OutStream *, const String &); |
| 57 |
public: |
| 58 |
static Void SaveProtocol(const Protocol *, const String &); |
| 59 |
|
| 60 |
ProtocolWriter(); |
| 61 |
~ProtocolWriter(); |
| 62 |
|
| 63 |
String GetProtocolFileName(const Protocol *); |
| 64 |
String GetAdditionalCopyName(const Protocol *); |
| 65 |
slots: |
| 66 |
Void OnUpdateProtocolList(); |
| 67 |
Void OnUpdateProtocol(const String &); |
| 68 |
|
| 69 |
Void OnStartConversion(Int, const Array<Track> &); |
| 70 |
Void OnSingleFileConversion(Int, const String &); |
| 71 |
Void OnFinishConversion(Int); |
| 72 |
}; |
| 73 |
}; |
| 74 |
|
| 75 |
#endif |