mirror of
https://github.com/vale981/openAV-Luppp
synced 2025-03-05 09:01:39 -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()
|
||||
{
|
||||
initialize( getenv("HOME"), "sessionName" );
|
||||
};
|
||||
|
||||
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 );
|
||||
|
||||
|
||||
|
||||
// de allocate the AudioBuffer here!!
|
||||
|
||||
delete ab;
|
||||
}
|
||||
|
||||
void DiskWriter::writeSession( std::string path, std::string sessionName )
|
||||
|
|
|
@ -114,7 +114,9 @@ class EventSave : public EventBase
|
|||
int type() { return int(SAVE); }
|
||||
uint32_t size() { return sizeof(EventSave); }
|
||||
|
||||
EventSave(){};
|
||||
int waste;
|
||||
|
||||
EventSave() : waste(0) {}
|
||||
};
|
||||
|
||||
class EventSaveFinish : public EventBase
|
||||
|
|
11
src/gui.cxx
11
src/gui.cxx
|
@ -92,10 +92,13 @@ static void gui_header_callback(Fl_Widget *w, void *data)
|
|||
else if ( strcmp(m->label(), "Save ") == 0 ) {
|
||||
|
||||
const char* name = fl_input( "Save session as", "lupppSession" );
|
||||
cout << "Save clicked, name = " << name << endl;
|
||||
|
||||
EventSave e;
|
||||
//writeToDspRingbuffer( &e );
|
||||
if ( name )
|
||||
{
|
||||
cout << "Save clicked, name = " << name << endl;
|
||||
gui->getDiskWriter()->initialize( getenv("HOME"), name );
|
||||
EventSave e;
|
||||
writeToDspRingbuffer( &e );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -19,8 +19,9 @@ void SaveAble::done()
|
|||
{
|
||||
savesDone++;
|
||||
|
||||
if ( savesDone == jack->getSave()->getNumSaveables() )
|
||||
if ( savesDone >= jack->getSave()->getNumSaveables() )
|
||||
{
|
||||
jack->getSave()->finish();
|
||||
savesDone = 0; // reset in case of another save before quit
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue