Consider a project of only unmodified tracks to be "clean"

Anything you think is missing, or needs enhancement, goes here.

If you require help using Audacity, please post on the forum board relevant to your operating system:
Windows
Mac OS X
GNU/Linux and Unix-like

Re: Consider a project of only unmodified tracks to be "clea

Permanent link to this post Posted by Edgar » Tue Nov 08, 2016 2:35 pm

Gale Andrews wrote:I think it would help if Ed would provide his patch with the GUI options removed

It REALLY goes against the grain for me to do something like this when I strongly disapprove! Nevertheless, I'll revisit the code today; I have neither the time nor the desire to figure out how to Git so someone else will need to do that part of it.
-Edgar
compiling Audacity daily
64-bit Windows 7
Edgar
Forum Crew
 
Posts: 1479
Joined: Thu Sep 03, 2009 9:13 pm
Operating System: Windows 7

Re: Consider a project of only unmodified tracks to be "clea

Permanent link to this post Posted by Gale Andrews » Tue Nov 08, 2016 4:48 pm

Edgar wrote:
Gale Andrews wrote:I think it would help if Ed would provide his patch with the GUI options removed

It REALLY goes against the grain for me to do something like this when I strongly disapprove! Nevertheless, I'll revisit the code today; I have neither the time nor the desire to figure out how to Git so someone else will need to do that part of it.

I understand that, Ed. I would not have asked if I could have linked to tcbrack's commit, but I'm guessing it would take me more time to figure how to comment out the GUI parts properly than it would take you.

Given the opposition expressed here, there won't be any strong recommendation from me to commit the patch as is, but some developer could think "as is" is better than nothing. I still think that, but committing "as is" wouldn't close the enhancement issue.


Gale
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * * Tips * * * * * Tutorials * * * * * Quick Start Guide * * * * * Audacity Manual
Gale Andrews
Quality Assurance
 
Posts: 26093
Joined: Fri Jul 27, 2007 12:02 am
Operating System: Windows 10

Re: Consider a project of only unmodified tracks to be "clea

Permanent link to this post Posted by Edgar » Tue Nov 08, 2016 8:02 pm

I've got working code of the "hidden preference" variety. Ignoring about 20 lines which need to be indented an extra tab, it boils down to about nine lines of code.

Unfortunately, this thread has gotten so long and ancient that I no longer really know exactly what Gale wants. My current code does this:
1) examine audacity.CFG for the entry:
[Warnings]
SaveProjectNag=XXX
2) if the value represented above as XXX is 1* then NEVER display the nag dialog; if it is 0 or not present then ALWAYS display the nag dialog.
No matter what, if XXX is 0 or not present the nag dialog will always display.

Potential options for if XXX resolves to TRUE (i.e. NEVER display) and the Project is NOT empty:
1) if the only user action has been to Import Audio then do NOT display the dialog
1a) if Preference setting Normalize on Import is YES then do NOT display the dialog
or
1b) if Preference setting Normalize on Import is YES then DISPLAY the dialog


* wxWidgets as a strange concept of what a Boolean Preference value is:
if XXX is 1 then the Boolean is "true"
if XXX is 0 then the Boolean is "false"
if XXX is 2 then the Boolean is "true"
if XXX is test then the Boolean is "false"
if XXX is true then the Boolean is "false"
-Edgar
compiling Audacity daily
64-bit Windows 7
Edgar
Forum Crew
 
Posts: 1479
Joined: Thu Sep 03, 2009 9:13 pm
Operating System: Windows 7

Re: Consider a project of only unmodified tracks to be "clea

Permanent link to this post Posted by Edgar » Tue Nov 08, 2016 10:30 pm

I pulled Head off of GitHub this morning (8 November 2016).
@Gale – Ignoring about 20 lines of re-indentation this is about nine lines of code in two files.
https://www.dropbox.com/s/tmnxbymqadgbw4o/nagGale.zip?dl=0
This is the very bare minimum – no GUI, uses a hidden preference and ubiquitously defeats the nagging dialog.

@Steve – 3 files; two of which have only one statement added to each.
https://www.dropbox.com/s/alyi9r7bxgfoc7e/nagging.zip?dl=0
This one adds a GUI checkbox to Preferences and has some code for exploring the History/Undo buffer. This one ONLY defeats the nagging dialog if the user exercises the checkbox in Preferences AND if Import (and potentially the Automatic Normalization thereof) is the only item(s) on the buffer.

There's one additional Preference setting which I have not explored – the nag about saving empty Projects. I suspect that it will interact with Steve's logic but not Gale's.

For Steve's eyes only <grin>:
To make it easier to find where I made changes I did one of two things:
if it was only a single line of code it has a comment added that looks like this:
Code: Select all
bool CleanEnough ();//don't nag to save empty project


if there are multiple lines affected code it looks like this:

Code: Select all
   if (!CleanEnough()) {//start don't nag to save empty project
         […]
   }//end don't nag to save empty project


if the code (all of it multiple lines) pertains only to Steve's request it looks like this:
Code: Select all
      //start for Steve don't nag to save empty project
      S.TieCheckBox(_("nagging to save empty project"),
         wxT("/Warnings/SaveProjectNag"),
         false);
      //end for Steve don't nag to save empty project

except the code at the very bottom of Project.cpp which looks like this:
Code: Select all
//start don't nag to save empty project
bool AudacityProject::CleanEnough() {
[…]
      //For Steve
[…]
      //End for Steve
[…]
//end don't nag to save empty project
-Edgar
compiling Audacity daily
64-bit Windows 7
Edgar
Forum Crew
 
Posts: 1479
Joined: Thu Sep 03, 2009 9:13 pm
Operating System: Windows 7

Re: Consider a project of only unmodified tracks to be "clea

Permanent link to this post Posted by steve » Wed Nov 09, 2016 9:21 am

Thanks for the code hints Edgar. That's saved me a lot of searching.
I'm not keen on using the "short description" to identify the undo event, because it could be a translated string (and for "Import" I think it is). Even if we use translated strings where necessary, it still makes the code fragile as we have no guarantee that descriptions won't be updated (and who would think of looking here before updating a command's description?).

Nevertheless, it seems easy enough to implement either "Never prompt to save project", or "Don't prompt to save unmodified import". Making the option more selective (allow some commands and not others) looks a lot messier as we need to uniquely identify each white-listed command in a robust way, then check that all commands in the undo stack are white-listed.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
steve
Site Admin
 
Posts: 44458
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Consider a project of only unmodified tracks to be "clea

Permanent link to this post Posted by steve » Wed Nov 09, 2016 12:41 pm

Unfortunately, with the prompt to save (the "nag") removed, this bug occurs much more frequently (about 90% of the time on my machine): http://bugzilla.audacityteam.org/show_bug.cgi?id=1545

I don't know why this happens, I guess it's a race condition and 'not stopping to nag' is tipping the balance. I don't think we can proceed with this until bug 1545 is fixed.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
steve
Site Admin
 
Posts: 44458
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Consider a project of only unmodified tracks to be "clea

Permanent link to this post Posted by Gale Andrews » Wed Nov 09, 2016 1:57 pm

Thanks, Ed and Steve. My only problems with the Preferences checkboxes were that I thought it dangerous to just put the control(s) directly in Warnings Preferences or in a new "Advanced" node in the Preferences tree. I think you said that trying to hide the controls behind an "Advanced..." button inside a Preferences pane meant that cancelling Preferences would not throw out the changes made in the "Advanced" dialogue.

"Never prompt to save project", or "Don't prompt to save unmodified import" seem to be good choices. Ideally I think the user should be able to choose between those two or always prompting. If we can only implement one choice I think it would have to be "never prompt" because otherwise it won't fully stop the "complaints".

If I get this bug 1545 crash on Windows or Mac I will comment in the bug report.


Gale
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * * Tips * * * * * Tutorials * * * * * Quick Start Guide * * * * * Audacity Manual
Gale Andrews
Quality Assurance
 
Posts: 26093
Joined: Fri Jul 27, 2007 12:02 am
Operating System: Windows 10

Re: Consider a project of only unmodified tracks to be "clea

Permanent link to this post Posted by steve » Wed Nov 09, 2016 2:14 pm

Gale Andrews wrote: If we can only implement one choice I think it would have to be "never prompt" because otherwise it won't fully stop the "complaints".

Conversely, "never prompt" is far more likely to lead to complaints about lost data. Personally I'd rather have people complain about the massive inconvenience and RSI of having to click the "No" button than complaints about lost data.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
steve
Site Admin
 
Posts: 44458
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Consider a project of only unmodified tracks to be "clea

Permanent link to this post Posted by Gale Andrews » Wed Nov 09, 2016 2:59 pm

steve wrote:
Gale Andrews wrote: If we can only implement one choice I think it would have to be "never prompt" because otherwise it won't fully stop the "complaints".

Conversely, "never prompt" is far more likely to lead to complaints about lost data. Personally I'd rather have people complain about the massive inconvenience and RSI of having to click the "No" button than complaints about lost data.

That's why I thought any of these options should be behind an Advanced... button (or safer,"hidden") ;)


Gale
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * * Tips * * * * * Tutorials * * * * * Quick Start Guide * * * * * Audacity Manual
Gale Andrews
Quality Assurance
 
Posts: 26093
Joined: Fri Jul 27, 2007 12:02 am
Operating System: Windows 10

Re: Consider a project of only unmodified tracks to be "clea

Permanent link to this post Posted by Edgar » Wed Nov 09, 2016 3:08 pm

steve wrote:I'm not keen on using the "short description" to identify the undo event, because it could be a translated string (and for "Import" I think it is). Even if we use translated strings where necessary, it still makes the code fragile as we have no guarantee that descriptions won't be updated (and who would think of looking here before updating a command's description?).

Sorry, I completely forgot about translating the strings – I've been working on a few large projects which do not do language localization. If we stick with the Short Description we need to use:
wxT("Import") and wxT("Normalize")

For a more robust solution we need to add a Boolean to the Effect class, along the lines of:
in Effect.h:
bool mAssumeClean
in Effect.cpp initialize it:
mAssumeClean = false

That way its classification is easily controlled and identified.
-Edgar
compiling Audacity daily
64-bit Windows 7
Edgar
Forum Crew
 
Posts: 1479
Joined: Thu Sep 03, 2009 9:13 pm
Operating System: Windows 7

PreviousNext

Return to Adding Features to Audacity



Who is online

Users browsing this forum: No registered users and 2 guests