PlayerLoadEvent.hx 1.3 KB

1234567891011121314151617181920212223242526272829303132
  1. //
  2. // WAV/AU Flash player with resampler
  3. //
  4. // Copyright (c) 2009, Anton Fedorov <datacompboy@call2ru.com>
  5. //
  6. /* This code is free software; you can redistribute it and/or modify it
  7. * under the terms of the GNU General Public License version 2 only, as
  8. * published by the Free Software Foundation.
  9. *
  10. * This code is distributed in the hope that it will be useful, but WITHOUT
  11. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  12. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  13. * version 2 for more details (a copy is included in the LICENSE file that
  14. * accompanied this code).
  15. */
  16. // Events, fired by Player to notify about it state
  17. class PlayerLoadEvent extends PlayerEvent {
  18. static public inline var LOAD : String = "PLAYER_LOAD";
  19. public var SecondsLoaded : Float;
  20. public var SecondsTotal : Float;
  21. public function new(type : String, ?bubbles : Bool, ?cancelable : Bool, SecondsLoaded: Float, SecondsTotal: Float) {
  22. super(type, bubbles, cancelable);
  23. this.SecondsLoaded = SecondsLoaded;
  24. this.SecondsTotal = SecondsTotal;
  25. }
  26. public override function toString(): String {
  27. var res = super.toString();
  28. return res.substr(0, res.length-1)+" SecondsLoaded="+SecondsLoaded+" SecondsTotal="+SecondsTotal+"]";
  29. }
  30. }