add project window location information into the project file itself [WAS RE: final Disapearing Window patch]

5 messages Options
Embed this post
Permalink
Ed Musgrove-2

add project window location information into the project file itself [WAS RE: final Disapearing Window patch]

Reply Threaded More More options
Print post
Permalink
Sorry, had to get rid of the non-topical stuff...

> > > The next step will be to add project window location information into
> > > the project file itself so that when you double-click a project file
> > > icon to launch Audacity with that file open, the project will be in
> > > the same size and location as when it was last closed. That is
> > > certainly a minor feature request and can wait until post-2.0.
> >
> > I'm still not sure this is useful or practical. What happens when you
> close the
> > project with files A, B, C open and launch Audacity by opening A? Or
> launch it
> > by opening A and D, where D was last closed in its own Audacity window?
> >
> [Ed:]
> Each _project_ would maintain its own size and location. Each time one
> opens
> a project (by any method) it would open at the same size and location as
> when last closed; we are only talking about 4 integers (plus one more for
> Maximize & Iconize if desired) to do this and 8 lines of code to
read/write
> it. My code is already able to do the rest. This is GUI 101--every major
> commercial project I use (or have programmed for) which stored anything
> like
> a project, had this minimum project memory. Most of the really biggies
also
> store much more state data--cursor location, scroll position etc.
[Ed:]

   xmlFile.WriteAttr(wxT("sel0"), mViewInfo.sel0, 10);
   xmlFile.WriteAttr(wxT("sel1"), mViewInfo.sel1, 10);
   xmlFile.WriteAttr(wxT("vpos"), mViewInfo.vpos);
   xmlFile.WriteAttr(wxT("h"), mViewInfo.h, 10);
   xmlFile.WriteAttr(wxT("zoom"), mViewInfo.zoom, 10);
   xmlFile.WriteAttr(wxT("rate"), mRate);

I'm not sure what some of the above are ("zoom" and "rate" make sense), but
we are already storing some state data.

--Ed



------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
audacity-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/audacity-devel
Martyn Shaw-2

Re: add project window location information into the project file

Reply Threaded More More options
Print post
Permalink
Hi Ed

I've been reading these threads, but not in detail...

Ed Musgrove wrote:

> Sorry, had to get rid of the non-topical stuff...
>
>>>> The next step will be to add project window location information into
>>>> the project file itself so that when you double-click a project file
>>>> icon to launch Audacity with that file open, the project will be in
>>>> the same size and location as when it was last closed. That is
>>>> certainly a minor feature request and can wait until post-2.0.
>>> I'm still not sure this is useful or practical. What happens when you
>> close the
>>> project with files A, B, C open and launch Audacity by opening A? Or
>> launch it
>>> by opening A and D, where D was last closed in its own Audacity window?
>>>
>> [Ed:]
>> Each _project_ would maintain its own size and location. Each time one
>> opens
>> a project (by any method) it would open at the same size and location as
>> when last closed; we are only talking about 4 integers (plus one more for
>> Maximize & Iconize if desired) to do this and 8 lines of code to
> read/write
>> it. My code is already able to do the rest. This is GUI 101--every major
>> commercial project I use (or have programmed for) which stored anything
>> like
>> a project, had this minimum project memory. Most of the really biggies
> also
>> store much more state data--cursor location, scroll position etc.
> [Ed:]
>
>    xmlFile.WriteAttr(wxT("sel0"), mViewInfo.sel0, 10);
>    xmlFile.WriteAttr(wxT("sel1"), mViewInfo.sel1, 10);
>    xmlFile.WriteAttr(wxT("vpos"), mViewInfo.vpos);
>    xmlFile.WriteAttr(wxT("h"), mViewInfo.h, 10);
>    xmlFile.WriteAttr(wxT("zoom"), mViewInfo.zoom, 10);
>    xmlFile.WriteAttr(wxT("rate"), mRate);
>
> I'm not sure what some of the above are ("zoom" and "rate" make sense), but
> we are already storing some state data.

The idea of adding extra state information into the project files
seems like a good one to me, and shouldn't affect backward/forward
compatibility (if done right).  Does it endanger anything for a 2.0
release?  Compatibility?

Thanks
Martyn

> --Ed
>
>
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay
> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
> http://p.sf.net/sfu/devconference
> _______________________________________________
> audacity-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/audacity-devel
>

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
audacity-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/audacity-devel
Gale (Audacity Team)

Re: add project window location information into the project file

Reply Threaded More More options
Print post
Permalink

| From Martyn Shaw <[hidden email]>
| Thu, 22 Oct 2009 23:44:36 +0100
| Subject: [Audacity-devel] add project window location information into the project file

> I've been reading these threads, but not in detail...
>
> Ed Musgrove wrote:
> > Sorry, had to get rid of the non-topical stuff...
> >
> >>>> The next step will be to add project window location information into
> >>>> the project file itself so that when you double-click a project file
> >>>> icon to launch Audacity with that file open, the project will be in
> >>>> the same size and location as when it was last closed. That is
> >>>> certainly a minor feature request and can wait until post-2.0.
> >>> I'm still not sure this is useful or practical. What happens when you
> >> close the
> >>> project with files A, B, C open and launch Audacity by opening A? Or
> >> launch it
> >>> by opening A and D, where D was last closed in its own Audacity window?
> >>>
> >> [Ed:]
> >> Each _project_ would maintain its own size and location. Each time one
> >> opens
> >> a project (by any method) it would open at the same size and location as
> >> when last closed;...

Apologies, Ed for misunderstanding. We had (I thought) previously
been talking about importing audio files into Audacity by clicking
those and having the window open large enough to view all the file
if it was stereo - not true now with the default project window size.

Yes, I'm fine with storing project window size and location, though it
might come as a surprise to some until they get used to it.


> >> This is GUI 101--every major commercial project I use (or have
> >> programmed for) which stored anything like
> >> a project, had this minimum project memory. Most of the really biggies
> >>  also store much more state data--cursor location, scroll position etc.
> > [Ed:]
> >
> >    xmlFile.WriteAttr(wxT("sel0"), mViewInfo.sel0, 10);
> >    xmlFile.WriteAttr(wxT("sel1"), mViewInfo.sel1, 10);
> >    xmlFile.WriteAttr(wxT("vpos"), mViewInfo.vpos);
> >    xmlFile.WriteAttr(wxT("h"), mViewInfo.h, 10);
> >    xmlFile.WriteAttr(wxT("zoom"), mViewInfo.zoom, 10);
> >    xmlFile.WriteAttr(wxT("rate"), mRate);
> >
> > I'm not sure what some of the above are ("zoom" and "rate" make sense), but
> > we are already storing some state data.
>
> The idea of adding extra state information into the project files
> seems like a good one to me, and shouldn't affect backward/forward
> compatibility (if done right).  Does it endanger anything for a 2.0
> release?  Compatibility?

The project files already store those six values. The  "sel0" and "sel1"
define the position of the selection region (if those values are the same,
then that is the cursor position); and "h" is the point at the timeline
where the waveform display begins.

There are limitations in that if you change those values, they aren't
counted for the undo stack. So those changes won't be stored in the
.aup file unless you have previously done something else that makes
the project "dirty" and not yet saved it.

Another limitation is that we don't store what tracks were actually
selected when the project was saved. For example, if sel0 and sel1
were the same, that cursor position will always appear on re-opening
the project in the first track, with none of the tracks selected,
irrespective.



Gale






------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
audacity-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/audacity-devel
Ed Musgrove-2

Re: add project window location information into the project file

Reply Threaded More More options
Print post
Permalink
In reply to this post by Martyn Shaw-2
> -----Original Message-----
> From: Martyn Shaw [mailto:[hidden email]]
> Sent: Thursday, October 22, 2009 3:45 PM
> To: [hidden email]
> Subject: Re: [Audacity-devel] add project window location information into
> the project file
>
> Hi Ed
>
> I've been reading these threads, but not in detail...
>
> Ed Musgrove wrote:
> > Sorry, had to get rid of the non-topical stuff...
> >
> >>>> The next step will be to add project window location information
> >>>> into the project file itself so that when you double-click a
> >>>> project file icon to launch Audacity with that file open, the
> >>>> project will be in the same size and location as when it was last
> >>>> closed. That is certainly a minor feature request and can wait until
post-

> 2.0.
> >>> I'm still not sure this is useful or practical. What happens when
> >>> you
> >> close the
> >>> project with files A, B, C open and launch Audacity by opening A? Or
> >> launch it
> >>> by opening A and D, where D was last closed in its own Audacity
> window?
> >>>
> >> [Ed:]
> >> Each _project_ would maintain its own size and location. Each time
> >> one opens a project (by any method) it would open at the same size
> >> and location as when last closed; we are only talking about 4
> >> integers (plus one more for Maximize & Iconize if desired) to do this
> >> and 8 lines of code to
> > read/write
> >> it. My code is already able to do the rest. This is GUI 101--every
> >> major commercial project I use (or have programmed for) which stored
> >> anything like a project, had this minimum project memory. Most of the
> >> really biggies
> > also
> >> store much more state data--cursor location, scroll position etc.
> > [Ed:]
> >
> >    xmlFile.WriteAttr(wxT("sel0"), mViewInfo.sel0, 10);
> >    xmlFile.WriteAttr(wxT("sel1"), mViewInfo.sel1, 10);
> >    xmlFile.WriteAttr(wxT("vpos"), mViewInfo.vpos);
> >    xmlFile.WriteAttr(wxT("h"), mViewInfo.h, 10);
> >    xmlFile.WriteAttr(wxT("zoom"), mViewInfo.zoom, 10);
> >    xmlFile.WriteAttr(wxT("rate"), mRate);
> >
> > I'm not sure what some of the above are ("zoom" and "rate" make
> > sense), but we are already storing some state data.
>
> The idea of adding extra state information into the project files seems
like a
> good one to me, and shouldn't affect backward/forward compatibility (if
> done right).  Does it endanger anything for a 2.0 release?  Compatibility?
>
[Ed:]
My understanding is that the saved project file is paired data: label/value
and is not position dependent. I cannot imagine how it could possibly
endanger compatibility. As for trying to complete this for a 2.0 release, my
only desire was to add project size and location information -- four
integers and to booleans. In dealing with the "Disappearing Windows" bug and
modifying the GUI for project windows this became a reasonable adjunct.

These functions currently exists in my patch:
AudacityProject::wxRect GetNormalizedWindowState() const { return
mNormalizedWindowState;   }
void SetNormalizedWindowState(wxRect & pSizeAndLocation) {
mNormalizedWindowState = pSizeAndLocation;   }

WxRect windowRectangle = project->GetNormalizedWindowState ();
wxRect defaultWindowRectangle = GetDefaultWindowRectangle ();
    xmlFile.WriteAttr(wxT("windowX"), windowRectangle .GetX (),
defaultWindowRectangle .GetX ());
[... Etc.]
    xmlFile.ReadAttr(wxT("windowX"), windowRectangle .SetX (),
defaultWindowRectangle .GetX ());
[... Etc.]
Project->SetNormalizedWindowState(SetNormalizedWindowState);

> Thanks
> Martyn
>
> > --Ed
> >
> >
> >
> > ----------------------------------------------------------------------
> > -------- Come build with us! The BlackBerry(R) Developer Conference in
> > SF, CA is the only developer event you need to attend this year.
> > Jumpstart your developing skills, take BlackBerry mobile applications
> > to market and stay ahead of the curve. Join us from November 9 - 12,
> > 2009. Register now!
> > http://p.sf.net/sfu/devconference
> > _______________________________________________
> > audacity-devel mailing list
> > [hidden email]
> > https://lists.sourceforge.net/lists/listinfo/audacity-devel
> >
>
>
----------------------------------------------------------------------------
--
> Come build with us! The BlackBerry(R) Developer Conference in SF, CA is
the
> only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay
> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
> http://p.sf.net/sfu/devconference
> _______________________________________________
> audacity-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/audacity-devel

--Ed



------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
audacity-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/audacity-devel
Ed Musgrove-2

Re: add project window location information into the project file

Reply Threaded More More options
Print post
Permalink
In reply to this post by Gale (Audacity Team)
> -----Original Message-----
> From: Gale Andrews [mailto:[hidden email]]
> Sent: Thursday, October 22, 2009 7:57 PM
> To: [hidden email]
> Subject: Re: [Audacity-devel] add project window location information into
> the project file
>
>
> | From Martyn Shaw <[hidden email]> Thu, 22 Oct 2009
> | 23:44:36 +0100
> | Subject: [Audacity-devel] add project window location information into
> | the project file
> > I've been reading these threads, but not in detail...
> >
> > Ed Musgrove wrote:
> > > Sorry, had to get rid of the non-topical stuff...
> > >
> > >>>> The next step will be to add project window location information
> > >>>> into the project file itself so that when you double-click a
> > >>>> project file icon to launch Audacity with that file open, the
> > >>>> project will be in the same size and location as when it was last
> > >>>> closed. That is certainly a minor feature request and can wait
until

> post-2.0.
> > >>> I'm still not sure this is useful or practical. What happens when
> > >>> you
> > >> close the
> > >>> project with files A, B, C open and launch Audacity by opening A?
> > >>> Or
> > >> launch it
> > >>> by opening A and D, where D was last closed in its own Audacity
> window?
> > >>>
> > >> [Ed:]
> > >> Each _project_ would maintain its own size and location. Each time
> > >> one opens a project (by any method) it would open at the same size
> > >> and location as when last closed;...
>
> Apologies, Ed for misunderstanding. We had (I thought) previously been
> talking about importing audio files into Audacity by clicking those and
having
> the window open large enough to view all the file if it was stereo - not
true
> now with the default project window size.
>
> Yes, I'm fine with storing project window size and location, though it
might
> come as a surprise to some until they get used to it.
>
[Ed:]
A pleasant surprise I would hope!


>
> > >> This is GUI 101--every major commercial project I use (or have
> > >> programmed for) which stored anything like a project, had this
> > >> minimum project memory. Most of the really biggies  also store much
> > >> more state data--cursor location, scroll position etc.
> > > [Ed:]
> > >
> > >    xmlFile.WriteAttr(wxT("sel0"), mViewInfo.sel0, 10);
> > >    xmlFile.WriteAttr(wxT("sel1"), mViewInfo.sel1, 10);
> > >    xmlFile.WriteAttr(wxT("vpos"), mViewInfo.vpos);
> > >    xmlFile.WriteAttr(wxT("h"), mViewInfo.h, 10);
> > >    xmlFile.WriteAttr(wxT("zoom"), mViewInfo.zoom, 10);
> > >    xmlFile.WriteAttr(wxT("rate"), mRate);
> > >
> > > I'm not sure what some of the above are ("zoom" and "rate" make
> > > sense), but we are already storing some state data.
> >
> > The idea of adding extra state information into the project files
> > seems like a good one to me, and shouldn't affect backward/forward
> > compatibility (if done right).  Does it endanger anything for a 2.0
> > release?  Compatibility?
>
> The project files already store those six values. The  "sel0" and "sel1"
> define the position of the selection region (if those values are the same,
> then that is the cursor position); and "h" is the point at the timeline
where
> the waveform display begins.
>
> There are limitations in that if you change those values, they aren't
counted
> for the undo stack. So those changes won't be stored in the .aup file
unless
> you have previously done something else that makes the project "dirty" and
> not yet saved it.
>
> Another limitation is that we don't store what tracks were actually
selected
> when the project was saved. For example, if sel0 and sel1 were the same,
> that cursor position will always appear on re-opening the project in the
first

> track, with none of the tracks selected, irrespective.
>
>
>
> Gale
>
>
>
>
>
>
>
----------------------------------------------------------------------------
--
> Come build with us! The BlackBerry(R) Developer Conference in SF, CA is
the
> only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay
> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
> http://p.sf.net/sfu/devconference
> _______________________________________________
> audacity-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/audacity-devel

--Ed



------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
audacity-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/audacity-devel