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.");
|
||||
}
|
||||
|
||||
|
||||
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?
|
||||
cJSON* jackPerTrackOutput=cJSON_GetObjectItem(preferencesJson,"enablePerTrackOutput");
|
||||
if(jackPerTrackOutput)
|
||||
|
|
|
@ -126,7 +126,7 @@ void DiskWriter::initialize(std::string path, std::string name )
|
|||
if ( sessionDirError )
|
||||
{
|
||||
// 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;
|
||||
|
|
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;
|
||||
{
|
||||
// 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,
|
||||
"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() );
|
||||
if ( name )
|
||||
{
|
||||
gui->getDiskWriter()->initialize( getenv("HOME"), name );
|
||||
gui->getDiskWriter()->initialize( gui->getProjectsDir().c_str(), name );
|
||||
LUPPP_NOTE("%s %s","Saving session as ", name );
|
||||
EventStateSave 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 )
|
||||
{
|
||||
EventStateSaveBuffer e;
|
||||
|
|
|
@ -97,6 +97,10 @@ class Gui
|
|||
int specialTrack;
|
||||
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
|
||||
std::string saveBufferPath;
|
||||
|
||||
|
@ -109,6 +113,8 @@ class Gui
|
|||
|
||||
OptionsWindow* optionWindow;
|
||||
|
||||
std::string lupppProjectsDir;
|
||||
|
||||
AudioEditor* audioEditor;
|
||||
|
||||
DiskReader* diskReader;
|
||||
|
|
Loading…
Add table
Reference in a new issue