diff --git a/.gitignore b/.gitignore index bba14b9..ec15721 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,4 @@ buildTest/* /src/Makefile CMakeFiles/* src/CMakeFiles/* +/src/version.hxx diff --git a/archive.sh b/archive.sh index e58908e..d3a0fe1 100755 --- a/archive.sh +++ b/archive.sh @@ -1,3 +1,4 @@ +#!/bin/bash - -git archive HEAD --format=zip > lupppGit_`date +"%m-%d-%Y"`_`git log --pretty=format:"%h" | head -n1`.zip +./version.sh +git archive HEAD --format=zip > lupppGit_`date +"%d-%m-%Y"`_`git log --pretty=format:"%h" | head -n1`.zip diff --git a/src/diskwriter.cxx b/src/diskwriter.cxx index b0f4a70..9a27aaf 100644 --- a/src/diskwriter.cxx +++ b/src/diskwriter.cxx @@ -218,13 +218,36 @@ int DiskWriter::writeControllerFile(std::string name , if ( infile.good() ) { // file exists: ask user overwrite or rename? - LUPPP_WARN("Controller filename exists: prompting user to overwrite y/n?"); - int overwrite = fl_choice("Controller filename exists, overwrite?", "no", "yes", 0); - if ( !overwrite ) + //LUPPP_WARN("Controller filename exists: prompting user to overwrite y/n?"); + int action = fl_choice("Controller exists, action?", "Cancel", "Rename", "Overwrite"); + if ( action == 0 ) { - // return OK, as user has chosen to *not* write the file + // return OK, as user has chosen to cancel writing the file return LUPPP_RETURN_OK; } + else if ( action == 1 ) + { + // rename here + const char* name = fl_input("New name for .ctlr file:"); + if ( name ) + { + // clear the filename + controllerCfgPath.str( "" ); + controllerCfgPath << getenv("HOME") << "/.config/openAV/luppp/controllers/" << name << ".ctlr"; + LUPPP_NOTE( "New .ctlr filename %s", controllerCfgPath.str().c_str() ); + } + else + { + LUPPP_NOTE("No name entered for .ctlr file, canceling!"); + return LUPPP_RETURN_ERROR; + } + } + else + { + // just overwrite the file, no action + } + + } LUPPP_NOTE("Writing .ctlr file to disk"); diff --git a/src/main.cxx b/src/main.cxx index 85ca412..f755fea 100644 --- a/src/main.cxx +++ b/src/main.cxx @@ -1,5 +1,6 @@ #include "config.hxx" +#include "version.hxx" #include #include @@ -32,6 +33,8 @@ void signalHanlder(int signum) int main(int argc, char** argv) { + LUPPP_NOTE("%s", GIT_VERSION ); + bool runTests = false; bool stopAfterTest = false; if(runTests == stopAfterTest){} // warning diff --git a/src/observer/midi.cxx b/src/observer/midi.cxx index 4d96c07..8d38e21 100644 --- a/src/observer/midi.cxx +++ b/src/observer/midi.cxx @@ -18,7 +18,7 @@ MidiIO::~MidiIO() { jack->unregisterMidiIO( this ); - LUPPP_NOTE("~MidiIO unregistring ports"); + //LUPPP_NOTE("~MidiIO unregistring ports"); jack_port_unregister( jack->getJackClientPointer(), jackInputPort ); jack_port_unregister( jack->getJackClientPointer(), jackOutputPort ); } diff --git a/version.sh b/version.sh new file mode 100755 index 0000000..c7c9156 --- /dev/null +++ b/version.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +# this file writes src/version.h from the git commit +echo " +#ifndef GIT_VERSION +#define GIT_VERSION \"`date +\"%d-%m-%Y\"` `git log --pretty=format:"%h" | head -n1`\" +#endif" > src/version.hxx