On 09/22/2017 06:30 PM, Pascal via Gnoga-list wrote:
> Have you a small test code to try on other configurations?

This should do it:

with Ada.Exceptions;

with Gnoga.Application.Singleton;
with Gnoga.Gui.Base;
with Gnoga.Gui.Element.Common;
with Gnoga.Gui.Element.Multimedia;
with Gnoga.Gui.View;
with Gnoga.Gui.Window;

procedure Ding is
   Window  : Gnoga.Gui.Window.Window_Type;
   View    : Gnoga.Gui.View.View_Type;
   Player  : Gnoga.Gui.Element.Multimedia.Audio_Type;
   Play    : Gnoga.Gui.Element.Common.Button_Type;
   Quit    : Gnoga.Gui.Element.Common.Button_Type;
   
   procedure Play_Sound (Object : in out Gnoga.Gui.Base.Base_Type'Class) is
      -- Empty;
   begin -- Play_Sound
      Player.Media_Source (Source => "glass.ogg");
      Gnoga.Log (Message => Player.Media_Source & Integer'Image 
(Player.Media_Duration) );
      Player.Play;
   exception -- Play_Sound
   when E : others =>
      Gnoga.Log (Message => "Play_Sound: " & 
Ada.Exceptions.Exception_Information (E) );
   end Play_Sound;

   procedure Quit_Now (Object : in out Gnoga.Gui.Base.Base_Type'Class) is
      -- Empty;
   begin -- Quit_Now
      Gnoga.Application.Singleton.End_Application;
   exception -- Quit_Now
   when E : others =>
      Gnoga.Log (Message => "Quit_Now: " & Ada.Exceptions.Exception_Information 
(E) );
   end Quit_Now;
begin -- Ding
   Gnoga.Application.Title ("Ding");
   Gnoga.Application.HTML_On_Close ("Ding ended.");
   Gnoga.Application.Singleton.Initialize (Main_Window => Window);
   View.Create (Parent => Window);
   View.Text_Alignment (Value => Gnoga.Gui.Element.Center);
   Player.Create (Parent => View, Preload => True);
   View.New_Line;
   Play.Create (Parent => View, Content => "Play");
   Play.On_Click_Handler (Handler => Play_Sound'Unrestricted_Access);
   Quit.Create (Parent => View, Content => "Quit");
   Quit.On_Click_Handler (Handler => Quit_Now'Unrestricted_Access);
   Gnoga.Application.Singleton.Message_Loop;
exception -- Ding
when E : others =>
   Gnoga.Log (Message => Ada.Exceptions.Exception_Information (E) );
end Ding;

with "../gnoga/src/gnoga.gpr";

project Ding is
   for Languages use ("Ada");
   for Source_Dirs use (".");
   for Object_Dir use ".";
   for Exec_Dir use ".";
   for Main use ("ding.adb");

   package Binder is
      for Default_Switches ("ada") use ("-E");
   end Binder;

   package Builder is
      for Default_Switches ("ada") use ("-gnatan", "-gnato2", "-O2", 
"-fstack-check");
   end Builder;
end Ding;

You can get glass.ogg from Chattanooga. On Firefox, the total time shows as zero
until the sound has played. Clicking on Play logs

2017-09-22 22:30:00.68 : Error jQuery_Execute converting to Integer (forced to 
0).
2017-09-22 22:30:00.68 : raised CONSTRAINT_ERROR : bad input for 'Value: "NaN"
Call stack traceback locations:
0x7f422f8981c1 0x7f422f896d8e 0x7f422f896dcb 0x55c103624eab 0x55c10361b6f5
0x55c1036303c8 0x55c1035e22b7 0x55c10361db1e 0x55c1036213b9 0x55c1036ef22e
0x7f422fbc0222 0x7f422ee106d8 0x7f422f12fd7d 0xfffffffffffffffe

2017-09-22 22:30:00.73 : http://127.0.0.1:8080/glass.ogg 0

To my surprise, though, I get similar results on Chromium, including the
exception msg, except that the total time remains zero after the sound has
played, too. My larger application displays the total time correctly on
Chromium. But as it's the behavior on Firefox that interests me, I guess it
doesn't matter what it does on Chromium.

HTH

-- 
Jeff Carter
"Blessed is just about anyone with a vested interest in the status quo."
Monty Python's Life of Brian
73



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gnoga-list mailing list
Gnoga-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gnoga-list

Reply via email to