diff --git a/src/avtk/clipselector.cxx b/src/avtk/clipselector.cxx index d95360b..4def601 100644 --- a/src/avtk/clipselector.cxx +++ b/src/avtk/clipselector.cxx @@ -222,7 +222,7 @@ void ClipSelector::draw() if ( i == special ) { cairo_rectangle( cr, x+2, drawY, clipWidth -1, clipHeight - 3 ); - cairo_set_source_rgba(cr, 1.0, 0.408, 0.0, alpha); + cairo_set_source_rgba(cr, 0.0, 153 / 255.f, 1.0, alpha); cairo_stroke( cr ); } @@ -285,7 +285,8 @@ int ClipSelector::handle(int event) Fl_Menu_Item rclick_menu[] = { { "Load" }, - { "Beats", 0, 0, 0, FL_SUBMENU }, + { "Special"}, + { "Beats", 0, 0, 0, FL_SUBMENU | FL_MENU_DIVIDER }, {"1 "}, {"2"}, {"4"}, @@ -296,8 +297,7 @@ int ClipSelector::handle(int event) {0}, //{ "Record" }, { "Use as tempo" }, - { "Special select"}, - { "Rename" }, + { "Rename", 0, 0, 0, FL_MENU_DIVIDER}, { "Clear" }, { 0 } }; @@ -337,7 +337,7 @@ int ClipSelector::handle(int event) EventLooperUseAsTempo e (ID, clipNum); writeToDspRingbuffer( &e ); } - else if ( strcmp(m->label(), "Special select") == 0 ) + else if ( strcmp(m->label(), "Special") == 0 ) { //printf("special selected %i, %i\n", ID, clipNum ); EventGridSelectNewChosen e( ID, clipNum); diff --git a/src/controllerupdater.cxx b/src/controllerupdater.cxx index dcb406c..2f73f7f 100644 --- a/src/controllerupdater.cxx +++ b/src/controllerupdater.cxx @@ -14,7 +14,7 @@ void ControllerUpdater::registerController( Controller* controller ) if (!controller) LUPPP_ERROR("Register Controller passed NULL controller!"); - LUPPP_NOTE("Registering controller %s", controller->getName().c_str() ); + //LUPPP_NOTE("Registering controller %s", controller->getName().c_str() ); // store the controller instance c.push_back( controller ); diff --git a/src/diskreader.cxx b/src/diskreader.cxx index a6c7794..357dff9 100644 --- a/src/diskreader.cxx +++ b/src/diskreader.cxx @@ -26,6 +26,8 @@ using namespace std; DiskReader::DiskReader() { + // FIXME: could use a config item of sample location? + lastLoadedSamplePath = getenv("HOME"); } int DiskReader::loadPreferences() @@ -266,6 +268,10 @@ int DiskReader::loadSample( int track, int scene, string path ) // write audioBuffer to DSP EventLooperLoad e = EventLooperLoad( track, scene, ab ); writeToDspRingbuffer( &e ); + + char* tmp = strdup( path.c_str() ); + lastLoadedSamplePath = dirname( tmp ); + free(tmp); } else { @@ -277,6 +283,11 @@ int DiskReader::loadSample( int track, int scene, string path ) } +std::string DiskReader::getLastLoadedSamplePath() +{ + return lastLoadedSamplePath; +} + int DiskReader::readSession( std::string path ) { cout << "DiskReader::readSession() " << path << endl; diff --git a/src/diskreader.hxx b/src/diskreader.hxx index 41ecd9e..b060448 100644 --- a/src/diskreader.hxx +++ b/src/diskreader.hxx @@ -30,6 +30,7 @@ class DiskReader /// loads a sample into a new AudioBuffer, returning the buffer int loadSample( int track, int scene, std::string path ); + std::string getLastLoadedSamplePath(); /// reads a session from disk, parsing and restoring state int readSession( std::string path ); @@ -51,6 +52,9 @@ class DiskReader // ui show editor int showAudioEditor(AudioBuffer* ); + + // sample load dialog + std::string lastLoadedSamplePath; }; #endif // LUPPP_DISK_READER_H diff --git a/src/goptions.cxx b/src/goptions.cxx index bf5ac6c..f432ef1 100644 --- a/src/goptions.cxx +++ b/src/goptions.cxx @@ -157,7 +157,7 @@ static void selectLoadController(Fl_Widget* w, void* data) if ( strcmp( path.c_str(), "" ) == 0 ) return; - LUPPP_NOTE("%s","ADD Controller cb"); + //LUPPP_NOTE("%s","ADD Controller cb"); GenericMIDI* c = new GenericMIDI( path ); if ( c->status() == Controller::CONTROLLER_OK ) diff --git a/src/gui.cxx b/src/gui.cxx index 505fb37..ae83812 100644 --- a/src/gui.cxx +++ b/src/gui.cxx @@ -246,7 +246,10 @@ void Gui::selectLoadSample( int track, int scene ) fnfc.title("Pick a file"); fnfc.type(Fl_Native_File_Chooser::BROWSE_FILE); fnfc.filter("Wav\t*.wav"); - fnfc.directory( getenv("HOME") ); // default directory to use + + std::string defLoadPath = gui->getDiskReader()->getLastLoadedSamplePath(); + fnfc.directory( defLoadPath.c_str() ); // default directory to use + // Show native chooser switch ( fnfc.show() ) { case -1: printf("ERROR: %s\n", fnfc.errmsg()); break; // ERROR diff --git a/src/looperclip.cxx b/src/looperclip.cxx index e202909..5c9f79d 100644 --- a/src/looperclip.cxx +++ b/src/looperclip.cxx @@ -108,10 +108,12 @@ void LooperClip::load( AudioBuffer* ab ) // set the endpoint to the buffer's size _recordhead = _buffer->getData().size(); +#ifdef DEBUG_BUFFER char buffer [50]; sprintf (buffer, "LC::load() t %i, s %i, aF %i",track, scene, int(_buffer->getAudioFrames()) ); EventGuiPrint e( buffer ); writeToGuiRingbuffer( &e ); +#endif } void LooperClip::setRequestedBuffer( AudioBuffer* ab ) @@ -155,7 +157,10 @@ void LooperClip::recieveSaveBuffer( AudioBuffer* saveBuffer ) } else { - LUPPP_ERROR("LooperClip @ %i, %i could not save, save buffer too small!", track, scene); + char buffer [50]; + sprintf (buffer, "LC:: %i, s: can't save, buf too small",track, scene ); + EventGuiPrint e( buffer ); + writeToGuiRingbuffer( &e ); Stately::error(""); } }