Audacity Bug Summary
••• Introduction •••
••• Keywords •••
    Audacity 3.0.3 development began 19th April 2021

Audacity Bugzilla



Bug 1765 - Using File > Open to import audio gives wrong zoom level and no scroll bar slider
Using File > Open to import audio gives wrong zoom level and no scroll bar sl...
Status: RESOLVED FIXED
Product: Audacity
Classification: Unclassified
Component: User Interface
2.2.0
Per OS All
: P4 Repeatable
Assigned To: Default Assignee for New Bugs
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2017-11-01 13:25 UTC by Peter Sampson
Modified: 2018-08-20 11:51 UTC (History)
7 users (show)

See Also:
Steps To Reproduce:
1) Launch Audacity 2) Use File > Open to open (or rather implied import) a 3 minute WAV file 3) File is imported with Zoom level at normal zoom 8 secs or so showing (in 2.1.3 and earlier zoom to fit obtained) 4) observe too that there is no scroll bar slider to access the audio beyond the first 8 seconds or so
Release Note:
Group: Imports and Exports *When using File>Open to import an audio file , the file will be imported showing at normal zoom level (In earlier Audacity versions the audio was zoomed to fit the Audacity window). Also the zoom toolbar may not show the scroll-slider in the horizontal scroll-bar. **Workaround *** Use Play or any zoom to restore the scroll-slider to the scroll-bar ***Use the "Fit project in Window" button in the Edit toolbar (or its shortcut Ctrl+F, Cmd+F on Mac) to restore the zoom level obtaining in earlier Audacity versions.
First Git SHA:
Group: ---
Workaround:
Closed: 2018-08-20 00:00:00
petersampsonaudacity: Regression+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Sampson 2017-11-01 13:25:16 UTC
As per the release notes.

Note that this is a regression on 2.1.3 and earlier where this command always zoomed to fit the entire audio file to the window.

Note too the using File>Import or drag&drop to import an audio file does still zoom to fit window size.
Comment 1 Peter Sampson 2017-11-01 13:32:31 UTC
Note that pressing Play od any of the zoom buttons/commands restores the scroll widget/slider in the horizontal scroll bar.

Note too that using a second File>Open for the same audio file to open a new project and import the WAV fil, will still import at normal zoom level byt the second project does show the scroll widget/slider in the horizontal scroll bar
Comment 2 Peter Sampson 2017-11-01 13:47:02 UTC
David Bailes wrote by email:

looks like the behaviour was changed by this commit:
Author:		Paul Licameli <paul.licameli@gmail.com>
Date:		3 months ago (20/07/2017 02:01:18)
Commit hash:	cfab325af2b8f656945344d4e770604589341c92
Children:	cfeb7bced1
Parent(s):	f725e937a4

Never permit import of MIDI as audio...

... It was seen to happen, at least for some MIDI files on Windows, because
the FFmpeg library may render them without reporting an error, but the rendering
was really bad!

Contained in branches: startend, mixerboard, meterenter, master, floating3, floating2, floating, auStaticText
Contained in tags: Audacity-2.2.0-rc1, Audacity-2.2.0-beta-20170924, Audacity-2.2.0-beta-20170901
Comment 3 Steve Daulton 2017-11-01 16:31:07 UTC
(In reply to Peter Sampson from comment #2)
Looks like it can be fixed by adding:
OnZoomFit();
just before line 4179 in Projec.cpp

#endif

   OnZoomFit();

   if (initiallyEmpty && mDirManager->GetProjectName() == wxT("")) {
      wxString name = fileName.AfterLast(wxFILE_SEP_PATH).BeforeLast(wxT('.'));
      mFileName =::wxPathOnly(fileName) + wxFILE_SEP_PATH + name + wxT(".aup");
      mbLoadedFromAup = false;
      SetProjectTitle();
   }
Comment 4 David Bailes 2017-11-02 04:11:42 UTC
(In reply to Peter Sampson from comment #2)
> David Bailes wrote by email:
> 
> looks like the behaviour was changed by this commit:
> Author:		Paul Licameli <paul.licameli@gmail.com>
> Date:		3 months ago (20/07/2017 02:01:18)
> Commit hash:	cfab325af2b8f656945344d4e770604589341c92
> Children:	cfeb7bced1
> Parent(s):	f725e937a4
> 
> Never permit import of MIDI as audio...
> 
> ... It was seen to happen, at least for some MIDI files on Windows, because
> the FFmpeg library may render them without reporting an error, but the
> rendering
> was really bad!
> 
> Contained in branches: startend, mixerboard, meterenter, master, floating3,
> floating2, floating, auStaticText
> Contained in tags: Audacity-2.2.0-rc1, Audacity-2.2.0-beta-20170924,
> Audacity-2.2.0-beta-20170901

As pointed out by Paul, the change was caused by the commit following the one above, that is:

Author:		Paul Licameli <paul.licameli@gmail.com>
Author date:	4 months ago (20/07/2017 02:51:48)
Commit date:	4 months ago (20/07/2017 03:10:22)
Commit hash:	cfeb7bced169f960e71275a90bfd6f3ad88e501c
Children:	6d47a79d3e
Parent(s):	cfab325af2

Zoom to fit after any import (labels, audio, or midi)

Contained in branches: startend, mixerboard, meterenter, master, floating3, floating2, floating, auStaticText
Contained in tags: Audacity-2.2.0-rc1, Audacity-2.2.0-beta-20170924, Audacity-2.2.0-beta-20170901
Comment 5 David Bailes 2017-11-02 08:08:29 UTC
Simple fix in this commit in myfork:
https://github.com/DavidBailes/audacity/commit/0ed8fa27644c3c045c11a8962a57be61e13fdd40
Comment 6 David Bailes 2017-11-02 08:16:06 UTC
(In reply to David Bailes from comment #5)
> Simple fix in this commit in myfork:
> https://github.com/DavidBailes/audacity/commit/
> 0ed8fa27644c3c045c11a8962a57be61e13fdd40

Note that there is a related bug in AudacityProject::OnImportRaw(), which could be fixed by replacing HandleResize() with ZoomAfterImport(nullptr).
Comment 7 David Bailes 2017-11-02 08:17:16 UTC
(In reply to Steve Daulton from comment #3)
> (In reply to Peter Sampson from comment #2)
> Looks like it can be fixed by adding:
> OnZoomFit();
> just before line 4179 in Projec.cpp
> 
> #endif
> 
>    OnZoomFit();
> 
>    if (initiallyEmpty && mDirManager->GetProjectName() == wxT("")) {
>       wxString name =
> fileName.AfterLast(wxFILE_SEP_PATH).BeforeLast(wxT('.'));
>       mFileName =::wxPathOnly(fileName) + wxFILE_SEP_PATH + name +
> wxT(".aup");
>       mbLoadedFromAup = false;
>       SetProjectTitle();
>    }

Yes, probably could be, but would cause OnZoomFit() to be called more than necessary in some circumstances.
Comment 8 Peter Sampson 2017-11-05 10:53:25 UTC
Tested on W10 Home on 2.2.1 build provided bu James.

File > Open now correctly zoomed to fit and the horizontal zoom slider is present and works.

Also testedv that File > Import continues to Zoom to fit - as does using File>Open to "import" a WAV file.
Comment 10 Peter Sampson 2017-11-07 06:07:36 UTC
(In reply to James Crook from comment #9)
Testing on macOS 10.13 High Sierra with macos-nightly-2.2.1-26a6815.dmg installed in the Applications folder.

Using File>Open to import WAV files, I Imported a three minute song and a four-hour file - both were zoomed yo fit ion import.

Looks to be OK on both Windows and Mac
Comment 11 Paul L 2017-11-07 08:47:15 UTC
Did you pay attention to the horizontal scrollbars?  It was part of the complaint too that the thumb sizes were wrong.
Comment 12 Steve Daulton 2017-11-07 08:59:01 UTC
(In reply to Paul L from comment #11)
What's wrong with the scroll bars Paul?
Comment 13 Peter Sampson 2017-11-07 09:14:09 UTC
(In reply to Paul L from comment #11)
Of course I paid attention to the horizontal scroll bar.

In four File > Open use cases
1) 3 minute WAV on W10
2) 3 hour WAV on W10
3) 3 minute WAV on macOS  HS
4) 3 hour WAV on macOS  HS

The horizontal scroll bar is displayed with the slider displayed.  At this zoom level the slider occupies the first 85% of the scroll bat - that is to be expected as that is what you get say if tou open a project and generate something or if you are normal zoom and then zoom to fit.

The slider works in all four cases - moving it to the right shows the empty space beyond the end of the audio and pushes the beginning of the audio at the left off the screen - also expected and consistent behavior.
Comment 14 Peter Sampson 2017-11-07 09:16:18 UTC
(In reply to Steve Daulton from comment #12)
Nothing now - but with the bug not only did you only get 7-12 seconds (normal zoom)
you did *not* get the slider in the horizontal scroll bar so you couldn't see how to access the rest of your audio (but it works now after the fix)
Comment 15 Peter Sampson 2017-11-07 09:16:50 UTC
@Steve:  so does this work OK on Linux?
Comment 16 Steve Daulton 2017-11-07 09:31:20 UTC
(In reply to Peter Sampson from comment #14)
I'm aware that there was a problem with the scroll bar, because the release note says:
"Also the zoom toolbar may not show the scroll-slider in the horizontal scroll-bar."

I don't understand why Paul has doubts about the scroll bar. Perhaps you can elaborate Paul.

Yes it looks fine on Linux.
Comment 17 Steve Daulton 2017-11-30 08:21:28 UTC
Reopened. The issue is not fixed in the case of files imported by a Chain.

Priority lowered to P4 as user impact is reduced.
It is still a regression against Audacity 2.1.2.
Comment 18 Steve Daulton 2017-12-03 08:36:51 UTC
(In reply to Steve Daulton from comment #17)
Paul L suggests that the "residual" issue is actually a different issue, so re-closing the bug, and logging as bug 1793.