[Csnd-dev] Temporary Csound files
Date | 2016-03-31 13:06 |
From | Tarmo Johannes |
Subject | [Csnd-dev] Temporary Csound files |
Hi,
what do you think, it rose from discussion by issue https://github.com/CsoundQt/CsoundQt/issues/208
Felipe suggested: I think the real fix is to have csoundqt save to a temporary file instead of the real file when running a file. So what do you think, what should happen if a user presses "Open template" Now a "Save As" dialog is immediately open not to overwrite the template. From here another thought: What if, there is a untitled.cd (like after New) in the editor and user presses Run, a Save dialog is opened. But maybe user just wants to try out a snippet and is not interested in keeping the file at all? Should there be perhaps a dialog "Run as temporary file (Press No if you want to save and use later)" - it would be faster to try out snippets (like copied from e-mail etc). tarmo |
Date | 2016-03-31 13:32 |
From | Felipe Sateler |
Subject | Re: [Csnd-dev] Temporary Csound files |
Hi, I think the long-term ideal solution would be that: 1. CsoundQT does not save any file (not only templates) on Run. 2. On Run, if the file has been changed, CsoundQT creates a temporary file in the same directory (if at all possible), and runs that file. 2a. Not sure how possible this is, but maybe it would be possible to not actually save any file, and just pass the file contents to csound via the API? 3. If the file is not modifiable (eg, it is a template shipped in /usr from an install package), then CsoundQT should open the file in read-only-mode. The file would only be modifiable after saving on a writable location. If 2a is possible, that would be the best option. Saludos On 31 March 2016 at 09:06, Tarmo Johannes <trmjhnns@gmail.com> wrote:
Saludos, Felipe Sateler |
Date | 2016-03-31 14:33 |
From | Tarmo Johannes |
Subject | Re: [Csnd-dev] Temporary Csound files |
Hi, Thanks for the suggestions! I am in differekt opinion - I hink the automatic Save on Run is very good since if Csound ceashes, you have the last version saved to debug. Of course you can say that there is somewhere a temporary file saved and there could be use a crash restore feature but this way it is safer. Or if you just forget to press Save, your work is not lost. But there could be a possibility to use a temporary file that you should not worry about. Sending orchestra and score to running Csound instance without saving is not probably that easy since score needs preprocessing and samplerate etc must be known when Csound is started. So I think using CsoundCompile with the csd file is better that sending orc and sco as strings. As much I understand. Others, what do you think? Also I am thinking, I should add Templates and Scripts (if built with PythonQt) to the make install target, so they get installed to /usr/share/qutecsound. We could have more templates - for live input, for Midi driven instruments etc. Or it is not worth the effort? Perhaps it could be a student or community work to invent and prepare them? Maybe should discuss it also in users list... Best! |
Date | 2016-04-07 13:59 |
From | Tarmo Johannes |
Subject | Re: [Csnd-dev] Temporary Csound files |
Hi, Tarmo 31.03.2016 16:33 kirjutas kuupäeval "Tarmo Johannes" <trmjhnns@gmail.com>:
|
Date | 2016-04-07 14:01 |
From | Tarmo Johannes |
Subject | Re: [Csnd-dev] Temporary Csound files |
Sorry, 07.04.2016 15:59 kirjutas kuupäeval "Tarmo Johannes" <trmjhnns@gmail.com>:
|
Date | 2016-04-07 17:35 |
From | Rory Walsh |
Subject | Re: [Csnd-dev] Temporary Csound files |
I'm curious have you tried this Windows? It might not be so easy to create the temporary file there. Anyhow, I meant to say that I agreed with you about 'enforcing' save. This feature has saved many a student from losing work when a crash takes place. Saving in Cabbage doubles as the recompile command, so it's impossible to lose any code. It's saved me on occasion too! On 7 April 2016 at 14:01, Tarmo Johannes <trmjhnns@gmail.com> wrote:
|
Date | 2016-04-08 08:27 |
From | Tarmo Johannes |
Subject | Re: [Csnd-dev] Temporary Csound files |
Yes, it works on Windows. Well it is not strictly speaking a real temporary file but a file in temporary folder that gets overwritten next time the same solution is used.
Luckily Qt takes care for finding the correct folder. All I need to do is to use
QString temporaryPath = QStandardPaths::writableLocation(QStandardPaths::TempLocation);
And Qt finds it for me on every platform.
But the "real" temporary files (used for example for running examples that are embedded in the program binary, Qt resources system) works flawlessly as well:
QTemporaryFile csdFile; tmpFileName += QString("csound-tmpXXXXXXXX.csd"); csdFile.setFileTemplate(tmpFileName); // etc
Greetings, tarmo 2016-04-07 19:35 GMT+03:00 Rory Walsh <rorywalsh@ear.ie>:
|