mirror of
https://github.com/vale981/openAV-Luppp
synced 2025-03-05 09:01:39 -05:00
-Clip name is saved / restored
This commit is contained in:
parent
7b70072aac
commit
84b220728e
2 changed files with 9 additions and 4 deletions
|
@ -168,8 +168,12 @@ int DiskReader::loadSample( int track, int scene, string path )
|
|||
if ( sample )
|
||||
{
|
||||
cJSON* beats = cJSON_GetObjectItem( sample, "beats" );
|
||||
cJSON* name = cJSON_GetObjectItem( sample, "name" );
|
||||
//cout << "Clip @ " << track << " " << scene << " gets " << beats->valuedouble << " beats."<< endl;
|
||||
ab->setBeats( beats->valuedouble );
|
||||
if ( beats )
|
||||
ab->setBeats( beats->valuedouble );
|
||||
if ( name )
|
||||
gui->getTrack(track)->getClipSelector()->clipName( scene, name->valuestring );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -174,7 +174,6 @@ int DiskWriter::writeAudioBuffer(int track, int scene, AudioBuffer* ab )
|
|||
return LUPPP_RETURN_ERROR;
|
||||
}
|
||||
|
||||
// get the filename
|
||||
stringstream filename;
|
||||
filename << "t_" << track << "_s_" << scene << ".wav";
|
||||
|
||||
|
@ -186,11 +185,13 @@ int DiskWriter::writeAudioBuffer(int track, int scene, AudioBuffer* ab )
|
|||
cJSON_AddItemToObject(audioJson, filename.str().c_str(), sampleClip );
|
||||
cJSON_AddNumberToObject(sampleClip,"beats", ab->getBeats() );
|
||||
|
||||
// get pretty name from GUI
|
||||
std::string clipName = gui->getTrack(track)->getClipSelector()->clipName( scene );
|
||||
cJSON_AddItemToObject ( sampleClip, "name", cJSON_CreateString( clipName.c_str() ));
|
||||
|
||||
// write the AudioBuffer contents to <path>/audio/ as <name>.wav
|
||||
// or alternatively t_<track>_s_<scene>.wav
|
||||
|
||||
// FIXME: trim trailing / sessionPath from session path if its there
|
||||
|
||||
stringstream path;
|
||||
path << audioDir << "/" << filename.str();
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue