mirror of
https://github.com/vale981/openAV-Luppp
synced 2025-03-05 09:01:39 -05:00
Resolves #136: saveDirectory
This commit is Geralds work, as sent by pull-request https://github.com/openAVproductions/openAV-Luppp/pull/136 It had to be rebased, so this is a new commit of his changes.
This commit is contained in:
parent
c360dad709
commit
917e61a0ac
4 changed files with 31 additions and 4 deletions
|
@ -102,6 +102,17 @@ int DiskReader::loadPreferences()
|
||||||
LUPPP_NOTE("No default controllers active.");
|
LUPPP_NOTE("No default controllers active.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
cJSON* projDir=cJSON_GetObjectItem(preferencesJson,"saveDirectory");
|
||||||
|
string dir=getenv("HOME");
|
||||||
|
if(projDir)
|
||||||
|
{
|
||||||
|
stringstream s;
|
||||||
|
s<<dir<<"/"<<projDir->valuestring;
|
||||||
|
dir=s.str();
|
||||||
|
}
|
||||||
|
gui->setProjectsDir(dir);
|
||||||
|
|
||||||
//Enable per track send and resturn jack ports?
|
//Enable per track send and resturn jack ports?
|
||||||
cJSON* jackPerTrackOutput=cJSON_GetObjectItem(preferencesJson,"enablePerTrackOutput");
|
cJSON* jackPerTrackOutput=cJSON_GetObjectItem(preferencesJson,"enablePerTrackOutput");
|
||||||
if(jackPerTrackOutput)
|
if(jackPerTrackOutput)
|
||||||
|
|
|
@ -126,7 +126,7 @@ void DiskWriter::initialize(std::string path, std::string name )
|
||||||
if ( sessionDirError )
|
if ( sessionDirError )
|
||||||
{
|
{
|
||||||
// handle by using different filename?
|
// handle by using different filename?
|
||||||
LUPPP_WARN("Error creating session directory");
|
LUPPP_WARN("Error creating session directory. Does the path: %s exist?",path.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
stringstream audioDirStream;
|
stringstream audioDirStream;
|
||||||
|
|
14
src/gui.cxx
14
src/gui.cxx
|
@ -145,7 +145,7 @@ static void gui_header_callback(Fl_Widget *w, void *data)
|
||||||
std::string tmp;
|
std::string tmp;
|
||||||
{
|
{
|
||||||
// Create the file chooser, and show it
|
// Create the file chooser, and show it
|
||||||
Fl_File_Chooser chooser(getenv("HOME"),
|
Fl_File_Chooser chooser(gui->getProjectsDir().c_str(),
|
||||||
"*",
|
"*",
|
||||||
Fl_File_Chooser::DIRECTORY,
|
Fl_File_Chooser::DIRECTORY,
|
||||||
"Load Session");
|
"Load Session");
|
||||||
|
@ -195,7 +195,7 @@ static void gui_header_callback(Fl_Widget *w, void *data)
|
||||||
const char* name = fl_input( "Save session as", gui->getDiskWriter()->getLastSaveName().c_str() );
|
const char* name = fl_input( "Save session as", gui->getDiskWriter()->getLastSaveName().c_str() );
|
||||||
if ( name )
|
if ( name )
|
||||||
{
|
{
|
||||||
gui->getDiskWriter()->initialize( getenv("HOME"), name );
|
gui->getDiskWriter()->initialize( gui->getProjectsDir().c_str(), name );
|
||||||
LUPPP_NOTE("%s %s","Saving session as ", name );
|
LUPPP_NOTE("%s %s","Saving session as ", name );
|
||||||
EventStateSave e;
|
EventStateSave e;
|
||||||
writeToDspRingbuffer( &e );
|
writeToDspRingbuffer( &e );
|
||||||
|
@ -252,6 +252,16 @@ void Gui::selectLoadController(Fl_Widget* w, void*)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Gui::setProjectsDir(string dir)
|
||||||
|
{
|
||||||
|
lupppProjectsDir=dir;
|
||||||
|
}
|
||||||
|
|
||||||
|
string Gui::getProjectsDir()
|
||||||
|
{
|
||||||
|
return lupppProjectsDir;
|
||||||
|
}
|
||||||
|
|
||||||
void Gui::selectSaveSample( int track, int scene )
|
void Gui::selectSaveSample( int track, int scene )
|
||||||
{
|
{
|
||||||
EventStateSaveBuffer e;
|
EventStateSaveBuffer e;
|
||||||
|
|
|
@ -96,7 +96,11 @@ class Gui
|
||||||
/// current special clip:
|
/// current special clip:
|
||||||
int specialTrack;
|
int specialTrack;
|
||||||
int specialScene;
|
int specialScene;
|
||||||
|
|
||||||
|
/// The project directory is the default directoy which is shown upon load/save
|
||||||
|
void setProjectsDir(string dir);
|
||||||
|
string getProjectsDir();
|
||||||
|
|
||||||
// save a particular sample to path
|
// save a particular sample to path
|
||||||
std::string saveBufferPath;
|
std::string saveBufferPath;
|
||||||
|
|
||||||
|
@ -109,6 +113,8 @@ class Gui
|
||||||
|
|
||||||
OptionsWindow* optionWindow;
|
OptionsWindow* optionWindow;
|
||||||
|
|
||||||
|
std::string lupppProjectsDir;
|
||||||
|
|
||||||
AudioEditor* audioEditor;
|
AudioEditor* audioEditor;
|
||||||
|
|
||||||
DiskReader* diskReader;
|
DiskReader* diskReader;
|
||||||
|
|
Loading…
Add table
Reference in a new issue