parent
06dfb7e803
commit
8ab97a959c
8 changed files with 35 additions and 10 deletions
|
|
@ -3,6 +3,7 @@
|
|||
#include "instrument.h"
|
||||
#include "safeReader.h"
|
||||
#include "../ta-log.h"
|
||||
#include "../fileutils.h"
|
||||
#include "../audio/sdl.h"
|
||||
#include <cstddef>
|
||||
#include <stdexcept>
|
||||
|
|
@ -2260,7 +2261,7 @@ void DivEngine::notifyWaveChange(int wave) {
|
|||
|
||||
bool DivEngine::saveConf() {
|
||||
configFile=configPath+String(CONFIG_FILE);
|
||||
FILE* f=fopen(configFile.c_str(),"wb");
|
||||
FILE* f=ps_fopen(configFile.c_str(),"wb");
|
||||
if (f==NULL) {
|
||||
logW("could not write config file! %s\n",strerror(errno));
|
||||
return false;
|
||||
|
|
@ -2280,7 +2281,7 @@ bool DivEngine::saveConf() {
|
|||
bool DivEngine::loadConf() {
|
||||
char line[4096];
|
||||
configFile=configPath+String(CONFIG_FILE);
|
||||
FILE* f=fopen(configFile.c_str(),"rb");
|
||||
FILE* f=ps_fopen(configFile.c_str(),"rb");
|
||||
if (f==NULL) {
|
||||
logI("creating default config.\n");
|
||||
return saveConf();
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
#include "engine.h"
|
||||
#include "instrument.h"
|
||||
#include "../ta-log.h"
|
||||
#include "../fileutils.h"
|
||||
|
||||
void DivInstrument::putInsData(SafeWriter* w) {
|
||||
w->write("INST",4);
|
||||
|
|
@ -159,7 +160,7 @@ bool DivInstrument::save(const char* path) {
|
|||
|
||||
putInsData(w);
|
||||
|
||||
FILE* outFile=fopen(path,"wb");
|
||||
FILE* outFile=ps_fopen(path,"wb");
|
||||
if (outFile==NULL) {
|
||||
logE("could not save instrument: %s!\n",strerror(errno));
|
||||
w->finish();
|
||||
|
|
@ -171,4 +172,4 @@ bool DivInstrument::save(const char* path) {
|
|||
fclose(outFile);
|
||||
w->finish();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
#include "engine.h"
|
||||
#include "wavetable.h"
|
||||
#include "../ta-log.h"
|
||||
#include "../fileutils.h"
|
||||
|
||||
void DivWavetable::putWaveData(SafeWriter* w) {
|
||||
w->write("WAVE",4);
|
||||
|
|
@ -30,7 +31,7 @@ bool DivWavetable::save(const char* path) {
|
|||
|
||||
putWaveData(w);
|
||||
|
||||
FILE* outFile=fopen(path,"wb");
|
||||
FILE* outFile=ps_fopen(path,"wb");
|
||||
if (outFile==NULL) {
|
||||
logE("could not save wavetable: %s!\n",strerror(errno));
|
||||
w->finish();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue