Changeset 340


Ignore:
Timestamp:
10/04/08 14:26:47 (16 years ago)
Author:
bjn8
Message:

Fixed timeline-infer algorithm

Location:
trunk/src_apollo/org/apollo
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src_apollo/org/apollo/audio/util/FrameLayoutDaemon.java

    r318 r340  
    665665                Integer unavilableLongestEndTimeRightPixel = null;
    666666
    667                 long firstInitiationTime = 0;
     667                NullableLong firstInitiationTime = null;
    668668                int initiationXPixel = 0;
    669669
    670670                long longestEndTime = -1;
    671671                int longestEndTimeRightPixel = 0;
     672               
    672673               
    673674                // Look for all track widgets
     
    682683                                                frame.getName());
    683684               
     685                                // Is the initiation time available?
    684686                                NullableLong it = (tgi != null) ?
    685687                                        new NullableLong(tgi.getInitiationTime()) :
    686688                                                NullableLong.fromLong(sampledTrackWidget.getInitiationTimeFromMeta());
    687689                               
     690                                // If not - keep record left-most unavilable x pixel
    688691                                if (it == null &&
    689692                                                (unavilableInitiationXPixel == null || iw.getX() < unavilableInitiationXPixel)) {
    690693                                        unavilableInitiationXPixel = iw.getX();
    691                                 } else if(it != null && it.getLongValue() < firstInitiationTime) {
    692                                         firstInitiationTime = it.getLongValue();
     694                               
     695                                // If so - check to see if it is the first initiation time on the frame
     696                                } else if(it != null && (firstInitiationTime == null ||
     697                                                it.getLongValue() < firstInitiationTime.getLongValue())) {
     698                                        firstInitiationTime = it;
    693699                                        initiationXPixel = iw.getX();
    694700                                }
     
    753759                                                (unavilableInitiationXPixel == null || iw.getX() < unavilableInitiationXPixel)) {
    754760                                        unavilableInitiationXPixel = iw.getX();
    755                                 } else if(it != null && it.getLongValue() < firstInitiationTime) {
    756                                         firstInitiationTime = it.getLongValue();
     761                                } else if(it != null && (firstInitiationTime == null ||
     762                                                it.getLongValue() < firstInitiationTime.getLongValue())) {
     763                                        firstInitiationTime = it;
    757764                                        initiationXPixel = iw.getX();
    758765                                }
     
    791798                }
    792799               
     800                if (firstInitiationTime == null) firstInitiationTime = new NullableLong(0L);
     801               
    793802                if (longestEndTime > 0) {
    794803                       
    795                         assert(longestEndTime > firstInitiationTime);
     804                        assert(longestEndTime > firstInitiationTime.getLongValue());
    796805                        assert(longestEndTimeRightPixel > initiationXPixel);
    797806                       
    798                         long rttime = longestEndTime - firstInitiationTime;
     807                        long rttime = longestEndTime - firstInitiationTime.getLongValue();
    799808                        int pxWidth = longestEndTimeRightPixel - initiationXPixel;
    800809                        if (unavilableLongestEndTime != null &&
     
    806815
    807816                        return new Timeline(
    808                                         firstInitiationTime,
     817                                        firstInitiationTime.getLongValue(),
    809818                                        rttime,
    810819                                        initiationXPixel,
  • trunk/src_apollo/org/apollo/audio/util/SoundDesk.java

    r318 r340  
    4444 *
    4545 * By Apollo API I mean the {@link org.apollo.audio} package.
     46 *
     47 * TODO: This is a mess and needs to be rethought - possibly completely removed. Originally
     48 * designed for allowing for many mix options but this is probably to confusing for the user.
    4649 *
    4750 * @author Brook Novak
  • trunk/src_apollo/org/apollo/widgets/SampledTrack.java

    r339 r340  
    13731373                                                        FrameLayoutDaemon.getInstance().getMSAtX(getX(), parent)
    13741374                                                        : 0;
    1375 
     1375                                       
    13761376                                        // Keep TrackGraphModel consistant
    13771377                                        AudioStructureModel.getInstance().onTrackWidgetAnchored(
Note: See TracChangeset for help on using the changeset viewer.