mirror of
https://github.com/vale981/openAV-Luppp
synced 2025-03-06 01:21:38 -05:00
-Saving error checking added, cleaning up writing code
This commit is contained in:
parent
e436154bc3
commit
78b8a17df0
4 changed files with 13 additions and 10 deletions
|
@ -13,7 +13,6 @@ using namespace std;
|
||||||
|
|
||||||
DiskWriter::DiskWriter()
|
DiskWriter::DiskWriter()
|
||||||
{
|
{
|
||||||
initialize( getenv("HOME"), "sessionName" );
|
|
||||||
};
|
};
|
||||||
|
|
||||||
void DiskWriter::initialize(std::string path, std::string name )
|
void DiskWriter::initialize(std::string path, std::string name )
|
||||||
|
@ -64,10 +63,8 @@ void DiskWriter::writeAudioBuffer(int track, int scene, AudioBuffer* ab )
|
||||||
|
|
||||||
Worker::writeSample( path.str(), ab );
|
Worker::writeSample( path.str(), ab );
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// de allocate the AudioBuffer here!!
|
// de allocate the AudioBuffer here!!
|
||||||
|
delete ab;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DiskWriter::writeSession( std::string path, std::string sessionName )
|
void DiskWriter::writeSession( std::string path, std::string sessionName )
|
||||||
|
|
|
@ -114,7 +114,9 @@ class EventSave : public EventBase
|
||||||
int type() { return int(SAVE); }
|
int type() { return int(SAVE); }
|
||||||
uint32_t size() { return sizeof(EventSave); }
|
uint32_t size() { return sizeof(EventSave); }
|
||||||
|
|
||||||
EventSave(){};
|
int waste;
|
||||||
|
|
||||||
|
EventSave() : waste(0) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
class EventSaveFinish : public EventBase
|
class EventSaveFinish : public EventBase
|
||||||
|
|
|
@ -92,10 +92,13 @@ static void gui_header_callback(Fl_Widget *w, void *data)
|
||||||
else if ( strcmp(m->label(), "Save ") == 0 ) {
|
else if ( strcmp(m->label(), "Save ") == 0 ) {
|
||||||
|
|
||||||
const char* name = fl_input( "Save session as", "lupppSession" );
|
const char* name = fl_input( "Save session as", "lupppSession" );
|
||||||
|
if ( name )
|
||||||
|
{
|
||||||
cout << "Save clicked, name = " << name << endl;
|
cout << "Save clicked, name = " << name << endl;
|
||||||
|
gui->getDiskWriter()->initialize( getenv("HOME"), name );
|
||||||
EventSave e;
|
EventSave e;
|
||||||
//writeToDspRingbuffer( &e );
|
writeToDspRingbuffer( &e );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -19,8 +19,9 @@ void SaveAble::done()
|
||||||
{
|
{
|
||||||
savesDone++;
|
savesDone++;
|
||||||
|
|
||||||
if ( savesDone == jack->getSave()->getNumSaveables() )
|
if ( savesDone >= jack->getSave()->getNumSaveables() )
|
||||||
{
|
{
|
||||||
jack->getSave()->finish();
|
jack->getSave()->finish();
|
||||||
|
savesDone = 0; // reset in case of another save before quit
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue