The error message is still a bit strange if trying to overwrite
a different project when the current project has been saved,
(why would you do that?), but probably not worth complicating
the message for such a fringe case.
... In particular, narrowing integer conversions are done only in
sampleCount::as_size_t which asserts correctness.
... And the overuse of that type is now corrected. size_t is now used for any
number of samples that fits in memory or a block file. sampleCount is reserved
to describe an offset into an audio file or wave track or clip, or the
difference of two such. sampleCount is signed, but size_t of course is not.
sampleCount is 64 bits wide, but size_t is narrower (in 32 bit executables,
such as we still build).
Hide implicit conversions sampleCount <-> floating point, -> integer
Change sampleCount arguments, variables, return values to size_t...
Make many conversions sampleCount->size_t are explicit and checked...
Convert sampleCount <-> floating or -> long long explicitly ...
Assert that sampleCount doesn't narrow converting to 3d party types
Define sampleCount as a class, not a type alias...
... whenever they really describe the size of a buffer that fits in memory, or
of a block file (which is never now more than a megabyte and so could be fit in
memory all at once), or a part thereof.
... with run-time assertions.
I examined each place and reasoned that the narrowing was safe, and commented
why so.
Again, there are places where the sampleCount variable will later be changed
to have a different type, and they are not changed here.
... A non-narrowing conversion out to long long is a necessity, but the
conversions to float and double are simply conveniences.
Conversion from floating is explicit, to avoid unintended consequences with
arithmetic operators, when later sampleCount ceases to be an alias for an
integral type.
Some conversions are not made explicit, where I expect to change the type of
the variable later to have mere size_t width.
... Define lots of operators for disambiguation, but they will go away after
all conversions from sampleCount to built-in numerical types are forced
to be explicit.
Having lots of rules in RuleTable may lead to an assertion failure on opening preferences dialog:
> assert "sz.x <= 1000 && sz.y <= 750" failed in
> PrefsDialog::PrefsDialog(): Preferences dialog exceeds max size
This change will make the RuleTable scrollable (as it is/was when creating many rules) instead of expanding the dialog size.
Further I had to fix the calculation of the clicked row from the given coords. Even without this proposed change for scrolling, the calculated row has always been the one above the clicked row - maybe this changed in wxWidgets 3.0.
Now it uses CalcUnscrolledPosition() which seems to work fine even without scrolling.
Last change is for drag and drop mode: rules are not being copied, but moved on dnd - I changed this to reflect this mode on the cursor while dragging an item.
Adds a configuration for appVeyor triggering a build of the release
version for each new commit. Needs registering at ci.appveyor.com with
the github account. Debug is not built, due to time limit of the free
version of appVeyor. Release build takes at least 30 minutes and up to
45 minutes. The time limit is 60 minutes.
Uses the undocumented possibility of building wxWidgets as dynamic
library by specifying "DLL Release" as configuration. The method in the
install instructions is impossible to automate as far as I could find
out.
Builds all targets except of "help" and "locale", because locale took
too long for the complete build to succeed the time limit.
This is not satisfying as new targets must be added manually to the
build. If this does not happen, the build will not fail, although the
new target could possibly fail building.
Unfortunately their seems to be no way to build the default targets
while excluding specific ones.
Adding target "help" was not tested.
Possible improvement: Put the complete "install" part into a install
script. That would help people easily building audacity and prevent
outdated install instruction as is the case at the moment.
I am not sure if renaming wx/setup_redirect.h into wx/setup.h is the
correct way, but it seems to work. Following the install instructions
resulted in missing wx/setup.h.
Thanks to Darrell Walisser for the outline of the problem, which was causing laggy dragging of stereo track sizes in spectrogram view.
This was caused by refreshing the horizontal ruler unnecessarily.