Transferred from the Adobe Open Source Subversion Repository

Revision: 16696
Author:   cframpto@adobe.com
Date:     2010-06-28T14:48:27.485336Z

Log Message:
-----------
The following changes apply to Spark DataGrid only.   Code reviews have been deferred until the implementation is closer to completion.

Initial pass at getting the column header bar mouse event handlers framework set up for both header and separator events.  The header events use the grid events and there is a new set of events for the separators (in GridEvent for now).  In Grid, added resizeableColumns.  For a column to resize, this must be true and the individual column must be resizeable.  Added getColumnIndexAt() to GridLayout.  Added columnResizeIndicator to the CHB skin.

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/Grid.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/events/GridEvent.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/ColumnHeaderBar.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/skins/spark/ColumnHeaderBarSkin.mxml</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/GridLayout.as</path>

git-svn-id: 7146a936b37d36e51ea0d66f8acbe0b8281bc7b7@1281604 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/spark/src/spark/components/gridClasses/GridLayout.as
+++ frameworks/projects/spark/src/spark/components/gridClasses/GridLayout.as
@@ -1547,6 +1547,23 @@
     }

     /**
+     *  Returns the index of the column at the specified coordinates.
+     *
+     *  @param x The pixel's x coordinate relative to the grid.
+     *  @param y The pixel's y coordinate relative to the grid.
+     *  @return the index of the column or -1 if the coordinates are out of bounds.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 2.0
+     *  @productversion Flex 4.5
+     */
+    public function getColumnIndexAt(x:Number, y:Number):int
+    {
+        return gridDimensions.getColumnIndexAt(x, y);
+    }
+
+    /**
      *  Return the row and column indices of the cell that overlaps the pixel at the
      *  specified grid coordinate as an Object with "rowIndex" and "columnIndex" properties.
      *  If no such cell exists, null is returned.


rm obsolete hola_set_timeout

rm obsolete hola_set_timeout

--- src/org/mangui/hls/loader/FragmentLoader.as
+++ src/org/mangui/hls/loader/FragmentLoader.as
@@ -105,13 +105,6 @@
         private static var hola_api_inited:Boolean;
         public static var g_bandwidth:Number = 0;

-        private static function timerHandler():void {
-            ExternalInterface.call('window.hola_jwplayer_timer');
-        }
-        private static function hola_set_timeout(ms:Number) : void
-        {
-            setTimeout(timerHandler, ms);
-        }
         private static function hola_setBandwidth(bandwidth:Number) : void
         {
             g_bandwidth = bandwidth;
@@ -126,7 +119,6 @@
             {
                 ExternalInterface.call('console.log', 'FragmentLoader hola_api_inited');
                 hola_api_inited = true;
-                ExternalInterface.addCallback("hola_set_timeout", FragmentLoader.hola_set_timeout);
                 ExternalInterface.addCallback("hola_setBandwidth", FragmentLoader.hola_setBandwidth);
                 ExternalInterface.addCallback("hola_hls_set_bandwidth", FragmentLoader.hola_hls_set_bandwidth);
              }


FragmentLoader.as: get rid of _seqnum

FragmentLoader.as: get rid of _seqnum

--- src/org/mangui/hls/stream/FragmentLoader.as
+++ src/org/mangui/hls/stream/FragmentLoader.as
@@ -41,8 +41,6 @@
         private var _last_loaded_level : int = 0;
         /** Callback for passing forward the fragment tags. **/
         private var _tags_callback : Function;
-        /** sequence number that's currently loading. **/
-        private var _seqnum : int;
         /** Quality level of the last fragment load. **/
         private var _level : int;
         /* overrided quality_manual_level level */
@@ -287,8 +285,6 @@
                 /* exponential increase of retry timeout, capped to fragmentLoadMaxRetryTimeout */
                 _retry_count++;
                 _retry_timeout = Math.min(HLSSettings.fragmentLoadMaxRetryTimeout, 2 * _retry_timeout);
-                // in case IO Error reload same fragment
-                _seqnum--;
             } else {
                 var hlsError : HLSError = new HLSError(HLSError.FRAGMENT_LOADING_ERROR, _frag_current.url, "I/O Error :" + message);
                 _hls.dispatchEvent(new HLSEvent(HLSEvent.ERROR, hlsError));
@@ -348,7 +344,7 @@
                 CONFIG::LOGGING {
                     Log.warn("fragment size is null, invalid it and load next one");
                 }
-                _levels[_level].updateFragment(_seqnum, false);
+                _levels[_level].updateFragment(_frag_current.seqnum, false);
                 _frag_loading = false;
                 return;
             }
@@ -572,10 +568,9 @@
             position = seek_position;

             var frag : Fragment = _levels[level].getFragmentBeforePosition(position);
-            _seqnum = frag.seqnum;
             _hasDiscontinuity = true;
             CONFIG::LOGGING {
-                Log.debug("Loading       " + _seqnum + " of [" + (_levels[level].start_seqnum) + "," + (_levels[level].end_seqnum) + "],level " + level);
+                Log.debug("Loading       " + frag.seqnum + " of [" + (_levels[level].start_seqnum) + "," + (_levels[level].end_seqnum) + "],level " + level);
             }
             _loadfragment(frag);
             return 0;
@@ -592,7 +587,7 @@
             var frag : Fragment;

             if (_switchlevel == false || frag_previous.continuity == -1) {
-                last_seqnum = _seqnum;
+                last_seqnum = frag_previous.seqnum;
             } else {
                 // level switch
                 // trust program-time : if program-time defined in previous loaded fragment, try to find seqnum matching program-time in new level.
@@ -628,7 +623,7 @@
                             return 1;
                         }
                         /* when probing PTS, take previous sequence number as reference if possible */
-                        new_seqnum = Math.min(_seqnum + 1, _levels[level].getLastSeqNumfromContinuity(frag_previous.continuity));
+                        new_seqnum = Math.min(frag_previous.seqnum + 1, _levels[level].getLastSeqNumfromContinuity(frag_previous.continuity));
                         new_seqnum = Math.max(new_seqnum, _levels[level].getFirstSeqNumfromContinuity(frag_previous.continuity));
                         _pts_loading_in_progress = true;
                         log_prefix = "analyzing PTS ";
@@ -665,10 +660,9 @@
                     log_prefix = "Loading       ";
                 }
             }
-            _seqnum = new_seqnum;
-            frag = _levels[level].getFragmentfromSeqNum(_seqnum);
-            CONFIG::LOGGING {
-                Log.debug(log_prefix + _seqnum + " of [" + (_levels[level].start_seqnum) + "," + (_levels[level].end_seqnum) + "],level " + level);
+            frag = _levels[level].getFragmentfromSeqNum(new_seqnum);
+            CONFIG::LOGGING {
+                Log.debug(log_prefix + new_seqnum + " of [" + (_levels[level].start_seqnum) + "," + (_levels[level].end_seqnum) + "],level " + level);
             }
             _loadfragment(frag);
             return 0;
@@ -791,10 +785,10 @@

                     if (_pts_loading_in_progress == true) {
                         _pts_loading_in_progress = false;
-                        _levels[_level].updateFragment(_seqnum, true, fragData.pts_min, fragData.pts_min + _frag_current.duration * 1000);
+                        _levels[_level].updateFragment(_frag_current.seqnum, true, fragData.pts_min, fragData.pts_min + _frag_current.duration * 1000);
                         /* in case we are probing PTS, retrieve PTS info and synchronize playlist PTS / sequence number */
                         CONFIG::LOGGING {
-                            Log.debug("analyzed  PTS " + _seqnum + " of [" + (_levels[_level].start_seqnum) + "," + (_levels[_level].end_seqnum) + "],level " + _level + " m PTS:" + fragData.pts_min);
+                            Log.debug("analyzed  PTS " + _frag_current.seqnum + " of [" + (_levels[_level].start_seqnum) + "," + (_levels[_level].end_seqnum) + "],level " + _level + " m PTS:" + fragData.pts_min);
                         }
                         /* check if fragment loaded for PTS analysis is the next one
                         if this is the expected one, then continue
@@ -804,10 +798,10 @@
                         // CONFIG::LOGGING {
                         // Log.info("seq/next:"+ _seqnum+"/"+ next_seqnum);
                         // }
-                        if (next_seqnum != _seqnum) {
+                        if (next_seqnum != _frag_current.seqnum) {
                             _pts_just_loaded = true;
                             CONFIG::LOGGING {
-                                Log.debug("PTS analysis done on " + _seqnum + ", matching seqnum is " + next_seqnum + " of [" + (_levels[_level].start_seqnum) + "," + (_levels[_level].end_seqnum) + "],cancel loading and get new one");
+                                Log.debug("PTS analysis done on " + _frag_current.seqnum + ", matching seqnum is " + next_seqnum + " of [" + (_levels[_level].start_seqnum) + "," + (_levels[_level].end_seqnum) + "],cancel loading and get new one");
                             }
                             // cancel loading
                             _stop_load();
@@ -898,9 +892,9 @@
             try {
                 _switchlevel = false;
                 CONFIG::LOGGING {
-                    Log.debug("Loaded        " + _seqnum + " of [" + (_levels[_level].start_seqnum) + "," + (_levels[_level].end_seqnum) + "],level " + _level + " m/M PTS:" + fragData.pts_min + "/" + fragData.pts_max);
-                }
-                var start_offset : Number = _levels[_level].updateFragment(_seqnum, true, fragData.pts_min, fragData.pts_max);
+                    Log.debug("Loaded        " + _frag_current.seqnum + " of [" + (_levels[_level].start_seqnum) + "," + (_levels[_level].end_seqnum) + "],level " + _level + " m/M PTS:" + fragData.pts_min + "/" + fragData.pts_max);
+                }
+                var start_offset : Number = _levels[_level].updateFragment(_frag_current.seqnum, true, fragData.pts_min, fragData.pts_max);
                 _hls.dispatchEvent(new HLSEvent(HLSEvent.PLAYLIST_DURATION_UPDATED, _levels[_level].duration));
                 _frag_loading = false;