furnace/src/engine/export.h

92 lines
2.2 KiB
C
Raw Normal View History

2023-03-13 05:20:54 -04:00
/**
* Furnace Tracker - multi-system chiptune tracker
2024-01-16 21:26:57 -05:00
* Copyright (C) 2021-2024 tildearrow and contributors
2023-03-13 05:20:54 -04:00
*
* 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.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef _EXPORT_H
#define _EXPORT_H
#include "song.h"
2023-03-13 15:17:05 -04:00
#include <initializer_list>
2023-09-20 01:24:55 -04:00
#include "../pch.h"
2023-03-13 05:20:54 -04:00
class DivEngine;
enum DivROMExportOptions {
DIV_ROM_ABSTRACT=0,
DIV_ROM_AMIGA_VALIDATION,
DIV_ROM_MAX
};
struct DivROMExportOutput {
String name;
SafeWriter* data;
DivROMExportOutput(String n, SafeWriter* d):
name(n),
data(d) {}
DivROMExportOutput():
name(""),
data(NULL) {}
};
struct DivROMExportProgress {
String name;
float amount;
};
2023-03-13 05:20:54 -04:00
class DivROMExport {
protected:
std::vector<String> exportLog;
std::vector<DivROMExportOutput> output;
std::mutex logLock;
void logAppend(String what);
2023-03-13 15:17:05 -04:00
public:
virtual bool go(DivEngine* eng);
virtual void abort();
virtual void wait();
std::vector<DivROMExportOutput>& getResult();
virtual bool hasFailed();
2024-08-10 20:38:50 -04:00
virtual bool isRunning();
virtual DivROMExportProgress getProgress();
2023-03-13 15:17:05 -04:00
virtual ~DivROMExport() {}
};
struct DivROMExportDef {
2023-03-13 05:20:54 -04:00
const char* name;
const char* author;
const char* description;
DivSystem requisites[32];
int requisitesLen;
bool multiOutput;
2023-03-13 15:17:05 -04:00
DivROMExportDef(const char* n, const char* a, const char* d, std::initializer_list<DivSystem> req, bool multiOut):
name(n),
author(a),
description(d),
multiOutput(multiOut) {
requisitesLen=0;
memset(requisites,0,32*sizeof(DivSystem));
for (DivSystem i: req) {
requisites[requisitesLen++]=i;
}
}
2023-03-13 05:20:54 -04:00
};
#endif