Page 1 of 3
Exported Spectrum overwrites existing file.
Posted: Wed Sep 04, 2013 1:15 pm
by steve
Slit from:
http://forum.audacityteam.org/viewtopic ... 01#p221901
Robert J. H. wrote:I forgot that the spectrum export appends data on existing files.
It would be very easy to add an option for overwriting rather than appending the file. The difficult part is "where to put the option".
Putting it in "Edit menu > Preferences > Import/Export" would be easy to do, but not very convenient if you want to change it - does that matter?
Putting the option in the export dialogue is much more difficult because currently a standard "save file" dialogue is used - creating a new export dialogue would be a lot more work.
Putting the option into the Plot Spectrum interface would be convenient, but there is little space to put it.
Any other ideas?
Personally I'd be happy to always overwrite the file, but I doubt that would be an acceptable change because someone somewhere in the world may rely on the current behaviour.
Re: Exported Spectrum overwrites existing file.
Posted: Wed Sep 04, 2013 1:53 pm
by steve
Here's a patch that provides the option in Preferences > Import/Export
Re: Exported Spectrum overwrites existing file.
Posted: Wed Sep 04, 2013 4:08 pm
by Robert J. H.
I always wonder that no warning is given out "File exists already. Overwrite it?".
That's the moment where I recall that the spectrum is automatically appended.
I don't need this feature either. It only leads to confusion and mistakes. I repeatedly use the same name and just copy the content of the file into Excel (a matter of enhanced navigation). Sometimes I do forget to delete the file or its content...
It would be possible to show the above quasi-standard message with 3 instead of two buttons:
- Overwrite
- Append
- Cancel
- ...and a suitable message of course.
The drawback is that you have to decide anew, each time an existing spectrum is encountered.
I am sure that Gayle will find a dozen people who relie on the current append-behaviour...

Re: Exported Spectrum overwrites existing file.
Posted: Wed Sep 04, 2013 4:37 pm
by steve
Robert J. H. wrote:The drawback is that you have to decide anew, each time an existing spectrum is encountered.
Which would soon become very tedious.
Re: Exported Spectrum overwrites existing file.
Posted: Wed Sep 04, 2013 4:42 pm
by steve
Robert J. H. wrote:I am sure that Gayle will find a dozen people who relie on the current append-behaviour...

But I guarantee that he'll not find a single user that frequently switches between "append" and "overwrite" (because up 'till now there's been no choice but to append).
I'd like to just set it once, then leave it.
Users that can't find the option in Preferences will retain the behaviour that has been in Audacity since Export spectrum data was first introduced - so nothing lost there.
Re: Exported Spectrum overwrites existing file.
Posted: Wed Sep 04, 2013 5:58 pm
by Robert J. H.
steve wrote:Robert J. H. wrote:I am sure that Gayle will find a dozen people who relie on the current append-behaviour...

But I guarantee that he'll not find a single user that frequently switches between "append" and "overwrite" (because up 'till now there's been no choice but to append).
I'd like to just set it once, then leave it.
Users that can't find the option in Preferences will retain the behaviour that has been in Audacity since Export spectrum data was first introduced - so nothing lost there.
I fully agree.
But the old problem is: "Who gonaa tell it to Mum?", will mean, that there is a huge opposition against additional options in preferences.
Re: Exported Spectrum overwrites existing file.
Posted: Wed Sep 04, 2013 11:28 pm
by Edgar
I often wonder, is it the users or the Developers who are so dead set against additional preferences? In my, admittedly highly biased opinion (IMHBO?) this fanatical abhorrence to additional preferences on the part of a majority of the Developers is groundless. If Audacity was a very simple application with a very narrow range of users it might be reasonable, but I do not believe that is the case.
In my personalized version of Audacity I have a new Warning Dialog class which provides a Preferences-based option to the user. The dialog has a string which explains the dichotomous conflict and offers the user the three choices: Cancel and the two potential resolutions to the conflict. The dialog also has a checkbox for "Don't ask me again"; this user's choice is represented in Preferences by three checkboxes: Do it one way; Do it the other way; Ask me again the next time it comes up.
Re: Exported Spectrum overwrites existing file.
Posted: Thu Sep 05, 2013 6:07 am
by Robert J. H.
Edgar wrote:I often wonder, is it the users or the Developers who are so dead set against additional preferences? In my, admittedly highly biased opinion (IMHBO?) this fanatical abhorrence to additional preferences on the part of a majority of the Developers is groundless. If Audacity was a very simple application with a very narrow range of users it might be reasonable, but I do not believe that is the case.
In my personalized version of Audacity I have a new Warning Dialog class which provides a Preferences-based option to the user. The dialog has a string which explains the dichotomous conflict and offers the user the three choices: Cancel and the two potential resolutions to the conflict. The dialog also has a checkbox for "Don't ask me again"; this user's choice is represented in Preferences by three checkboxes: Do it one way; Do it the other way; Ask me again the next time it comes up.
This is a quite reasonable behaviour for the plot Spectrum dialog and congruent with similar events.
The Plot Spectrum is all in all a fine feature but unfortunately not very accessible. I have to call it a couple of times to eventually have the spectrum exported. It throws me out (changes the focus) as soon as I select an entry in any of the drop down lists.
I actually do not need a separate file, it would be more convenient for me to simply have copied the data to the clipboard in order to paste it in a work sheet.
I'd implement most functions in a Nyquist plug-in (and send the data to the debug screen), but it is a lot of work and the debug screen may not hold enough characters.
The advantage would be that I can pre-process the data and sort it after my liking, e.g. list the prominent peaks/pitches at the top.
Re: Exported Spectrum overwrites existing file.
Posted: Thu Sep 05, 2013 1:24 pm
by steve
Edgar wrote:The dialog has a string which explains the dichotomous conflict and offers the user the three choices: Cancel and the two potential resolutions to the conflict. The dialog also has a checkbox for "Don't ask me again"; this user's choice is represented in Preferences by three checkboxes: Do it one way; Do it the other way; Ask me again the next time it comes up.
That's the most versatile solution - overkill for my needs but it makes the option "more visible". I'm not sure that we really need the extra dialogue, given that exporting spectrum data is an "advanced" feature.
Re: Exported Spectrum overwrites existing file.
Posted: Fri Sep 06, 2013 1:10 am
by Edgar
steve wrote:Edgar wrote:The dialog has a string which explains the dichotomous conflict … has a checkbox for "Don't ask me again"
That's the most versatile solution - overkill for my needs but it makes the option "more visible". I'm not sure that we really need the extra dialogue, given that exporting spectrum data is an "advanced" feature.
The code started out as a method of the Export class but I now have three or four different situations where it's in use so it made sense for me to make it a separate class. As a developer (nota bene: not an Audacity Developer) my guiding light is to empower the user.