2007/8/22, Chris Cannam <[EMAIL PROTECTED]>:
>
> On Wednesday 22 August 2007 08:28, Heikki Johannes Junes wrote:
> > I have tried to make several attempts to determine the timeT at the
> edges
> > of the visible part of notation view. How to find the time at the left
> and
> > right edges in visible part of notation view?
>
> What exactly do you need them for?


To switch between visible segments in NotationView (currently
Alt+PageUp/PageDown).
This work may be called as an attempt towards "single staff polyphony",
although
the work applies also to "single staff monophony" with multiple segments.

Part of the problem is that the question is not terribly well defined.


I agree. Maybe it is better to switch between segments at a specific time.

First, it only makes sense in linear mode -- in continuous page mode the
> left
> and right extents are those of the entire segment; in multiple page mode
> there is no meaningful answer at all in the case where a page is cut off
> in
> the middle on one side.


I am trying to make better use of RawNoteRuler. One could click it in order
to switch between overlapping segments.

Also, if you have multiple segments in one or more staffs, they could have
> different timeT extents.  There is no uniform way to "interpolate" timeTs
> into the gaps between individual notes: one would normally consider the
> extents of a visible region to be "snapped" to the individual note times,
> and
> if segments have differently timed notes at their edges, their "snapped"
> extents may differ.


Ok. That is the reason why I sometimes get unpredictable rendering results
with segments whose starting time is not at a bar line.

I see Pedro has answered with one suggestion.  That method (following
> NotationCanvasView::contentsMousePressEvent) should return timings of the
> nearest canvas objects to the extents, which is more or less what I
> referred
> to in the previous para above.


It is enough, although I was looking for exact timeT.

An alternative would be to get the canvas coordinates of the visible area
> (using QCanvasView methods as described by Pedro), then use
> NotationStaff::getLayoutCoordsForCanvasCoords to convert those coordinates
> to
> layout coordinates (which are linear within a staff, they don't "wrap" at
> line breaks), then NotationHLayout::getTimeForX on the returned layout
> coords.  That last call works by interpolating between bar locations, and
> is
> the method used by e.g. the raw note ruler.  It might be more reliable if
> there are few objects near the canvas edges, but it could also give
> incorrect
> results if the objects within a bar are layed out at X coordinates that
> significantly diverge from positions proportional to their time within the
> bar (as happens quite often).
>
> Chris
>

I will change the problem from "change to the next segment in the visible
part of
notation view" to "change to the next segment at timeT". The specific timeT
is
then determined from the click to the RawNoteRuler, or, from the current
position
of the insert cursor.

Best regards,
Heikki
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Rosegarden-devel mailing list
[email protected] - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-devel

Reply via email to