Shortcut : fit track(width) into view?

Foo-Bar wrote on 2/16/2023, 5:48 AM

Is there, by any means, a shortcut for fitting the complete project into the view / width of my monitor?

When I am zoomed in to a track, I want to press X so Vegas zooms out and shows the project from 00:00 to "the end", fitting in the boundaries of my monitor.

Now I have to zoom out manually, adjust the zoom factor, select the zoom-tool, define the area I want to zoom / fit and release the mouse.

Would be nice if there is a dedicated "fit track (or project) into view" shortcut.

Comments

jetdv wrote on 2/16/2023, 9:00 AM

Save this as "Fit Project to View.cs" in [My Documents]\Vegas Script Menu

Then assign this script to a keypress.
 

using ScriptPortal.Vegas;

public class EntryPoint
{
    public void FromVegas(Vegas vegas)
    {
            Vegas myVegas = vegas;

            Timecode cursorPos = myVegas.Transport.CursorPosition;
            myVegas.Transport.SelectionStart = Timecode.FromFrames(0);
            myVegas.Transport.SelectionLength = myVegas.Project.Length;
            myVegas.UpdateUI();
            myVegas.Transport.ZoomSelection();
            myVegas.Transport.SelectionLength = Timecode.FromFrames(0);
            myVegas.Transport.CursorPosition = cursorPos;
    }
}

What did you have in mind for "Fit Track"?

rraud wrote on 2/16/2023, 10:16 AM

Does not 'Ctrl+ Down Arrow' do approximately the same?

jetdv wrote on 2/16/2023, 10:48 AM

@rraud, it's very close. The script version fills up more of the timeline width but it is very close.

DMT3 wrote on 2/16/2023, 10:52 AM

Another quick way, but not as glamorous as a script, is to drag the zoom line.

Former user wrote on 2/16/2023, 11:16 AM

Another quick way, but not as glamorous as a script, is to drag the zoom line.

@DMT3 Hi, or just double click on it, although I read the op's post as wanting a keyboard shortcut not a mouse one

jetdv wrote on 2/16/2023, 11:51 AM

Let's look at the various options:

Mouse Wheel:

CTRL-Down Arrow:

Double-click:

Script:

So if you want to fill the screen width to the fullest really fast, the script option is the way to go. But, at least, there are several other options available that get you close.

Former user wrote on 2/16/2023, 12:01 PM

@jetdv Hi, different PC's, I don't get that generous space at the end with double click.

I zoomed in with the mouse wheel, then double clicked the slider at the bottom.

jetdv wrote on 2/16/2023, 12:08 PM

@Former user it may depend on other factors as well but that's what I get every time with that project when I double-click. The only way to "quickly" fill the entire width is with the script. All other options give what I showed in the images above. Now, I can drag and get it even tighter but it's not "fast".

Foo-Bar wrote on 2/16/2023, 12:09 PM

Save this as "Fit Project to View.cs" in [My Documents]\Vegas Script Menu

Then assign this script to a keypress.
 

using ScriptPortal.Vegas;

public class EntryPoint
{
    public void FromVegas(Vegas vegas)
    {
            Vegas myVegas = vegas;

            Timecode cursorPos = myVegas.Transport.CursorPosition;
            myVegas.Transport.SelectionStart = Timecode.FromFrames(0);
            myVegas.Transport.SelectionLength = myVegas.Project.Length;
            myVegas.UpdateUI();
            myVegas.Transport.ZoomSelection();
            myVegas.Transport.SelectionLength = Timecode.FromFrames(0);
            myVegas.Transport.CursorPosition = cursorPos;
    }
}

What did you have in mind for "Fit Track"?

This script is absolutely the best solution, period.

Place the script in;

C:\Program Files\VEGAS\VEGAS Pro 20.0\Script Menu\

And I did attach "global CTRL + F" to it (F from "fit"), since I don't use the default "F" shortcuts.

It's a bit slow (like it takes one second to proceed all the actions in the queue), but it (punt inteded) fits the job.

All the other solutions (some of I was aware of, some where new to me) left a lot of wasted space;


I solely work with one (audio) track, using Vegas as a DAW avant-la-lettre (hey, it started as a DAW and I use Vegas since version 3).

And when I want a "complete overview" of the project (one track, masterbus, some enveloppes) I don't want to click my way around until it (doesn't) fit.

The script above also uses the "wasted space" which gives me more (again, punt intended) headroom to view at (or screen real estate, if you want).

Foo-Bar wrote on 2/16/2023, 12:15 PM

@jetdv Hi, different PC's, I don't get that generous space at the end with double click.

I zoomed in with the mouse wheel, then double clicked the slider at the bottom.

When I do so, I have about 50 to 35% unused space.

Maybe because I have a two monitor setup and Vegas renders the project for the smallest monitor?

The space left is exact the difference between monitor I and II in my set-up.

So consider it (another) bug, maybe...

Foo-Bar wrote on 2/16/2023, 12:18 PM

@Former user it may depend on other factors as well but that's what I get every time with that project when I double-click. The only way to "quickly" fill the entire width is with the script. All other options give what I showed in the images above. Now, I can drag and get it even tighter but it's not "fast".

The situation with my default setup is even worse, leaving me with about 50 to 35% empty scrollbar / track / thumb before the project "fits".

Looks like the algorithm for scaling over the x-axis is not made relative, but absolute.

 

john_dennis wrote on 2/16/2023, 1:16 PM

If I only had a penny for each time I've done this in Sound Forge and Vegas Pro since 1990-something...

Triple Left-Click

Right-Click Zoom Selection

VEGASDerek wrote on 2/16/2023, 1:40 PM

It appears there is an issue with setting the timeline size when you open a saved project. We have added that to our bug backlog.

DMT3 wrote on 2/16/2023, 1:58 PM

@Former user did not know about double-click, thanks. I usually just ctrl-home and then roll mouse wheel until screen is full. There are a lot of ways. It would be nice to have a one-click option, and using a device like Contour Shuttle, this could be done.

Former user wrote on 2/16/2023, 2:22 PM

@DMT3 Yeah, Magix Movie Studio has just that button 👍

VEGASDerek wrote on 2/16/2023, 4:15 PM

Looked into the code...the fact the double click is not accurately resizing has to do with a remnant of the audio beginnings of VEGAS. Anyway, the extra buffer added to the timeline after a project is opened is actually a bug. The code being executed that added this buffer at the end of the timeline is actually supposed to be called when we are in the process of recording audio to an audio track. Anyway, I have this fixed and it will be remedied in the next update.

Foo-Bar wrote on 2/16/2023, 5:09 PM

If I only had a penny for each time I've done this in Sound Forge and Vegas Pro since 1990-something...

Triple Left-Click

Right-Click Zoom Selection

That works as well :-)

But the thing is, you have to click inside the selection for being able to trigger the popup menu that contains the command.

In my case / workflow the track with "content" (events) is not so high as the other (enveloppe) tracks and those do not contain any content to select... so the popup menu is never shown (which forces me to click very carefully in the right track, in the exact height of my mouse cursor).

I simple shortcut (press F to fit) would be nice!

Foo-Bar wrote on 2/16/2023, 5:13 PM

Looked into the code...the fact the double click is not accurately resizing has to do with a remnant of the audio beginnings of VEGAS. Anyway, the extra buffer added to the timeline after a project is opened is actually a bug. The code being executed that added this buffer at the end of the timeline is actually supposed to be called when we are in the process of recording audio to an audio track. Anyway, I have this fixed and it will be remedied in the next update.

The weird thing is that some projects behave like they should;

  • Open the project
  • Doubleclick scrollbar (x-axis) to fit in width
  • 100% match in width

But other project behave like;

  • Open the project
  • Doubleclick scrollbar (x-axis) to fit in width
  • 65% to 75% match in width (or something like that)

Can't figure out why this happens on some and not on other files.