Skip to content
A-MC Creative Development

A-MC Creative Development

Programming, Music, Tech, Hardware, Amiga, Commodore, Retrogaming and probably much more :)

  • Home
  • SOFTWARE
    • Hollywood Source & Libraries
    • APPBuilder Tool
    • HFinder 2017
    • HGUI
    • GEMZ
    • White Dot
  • Allanon’s Music Corner
  • About Me
  • MANUALS
  • Hire Me!
  • Privacy Policy
  • Toggle search form

gSoX : progress report #1

Posted on November 22, 2022November 22, 2022 By allanon No Comments on gSoX : progress report #1

I’ve done some progresses on the Gui for SoX as I said in my previous post, here is a screenshot that shows some informations retrieved invoking sox with the –info argument followed by the file name to scan:

As you can see it works, at least on Windows, but I’ve used a trick because using the more logical command Execute() it was failing without giving any hints, so here is the trick, maybe it could be useful for other Hollywood coders 🙂

Instead of using Execute(), which executes a program synchronously (read: it stops the main program execution flow until the executed program has finished), I’ve used the command Run() to run asynchronously sox.

The first idea was to redirect the output to a temporary file but with Run() there is the possibility to install an event handler that automatically grabs the executed program’s output for you. 

I’ve also installed another event handler to signal to my program when sox has finished, so at the end, this is the best solution for me because if sox detects errors they will be grabbed and printed out in the gui like this:

Here is a snippet of the code I used to:

  • Install the event handler
  • Run an external program
  • Wait the program to finish
  • Unistall the event handler

Note that while waiting for the program to finish the gui and all the callback functions are still responding to the user’s input!

————————–

; Read source informations
Local waitFinish = True
Local soxInfos = “”

; To grab the output we will install two event handlers,
; one to grab the output
; one to signal that sox has returned

InstallEventHandler(
 { RunOutput =
   Function(args)
     soxInfos = soxInfos .. args.output
   EndFunction,

    RunFinished =
   Function()
      waitFinish = False
   EndFunction })

; Time to execute sox and grab the informations
Run(app.prefs.sox_path, “–info ” .. file)

; Wait until sox has finished
While waitFinish
 CheckEvents()
Wend

; Remove the previously installed handlers
InstallEventHandler(
 { RunOutput = 0,
   RunFinished = 0 })

————————–

That’s all for this update 🙂

Hollywood

Post navigation

Previous Post: A new adventure with a little guy
Next Post: gSoX : progress report #2

Related Posts

Let’s build a Dungeon Crawler with Hollywood-MAL! (part 3, Designing the game) Hollywood
ANSI Lib released Hollywood
Dungeon Crawler RPG Engine Generic RPG Engine : Dev Log #1 Hollywood
EmuLA development, new year update Emula
Dungeon Crawler RPG Engine Let’s build a Dungeon Crawler with Hollywood-MAL! (part 3) Hollywood
Free downloads? Oh, Yes! It’s an EmuLa feature! Emula

Leave a ReplyCancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Support me on Patreon!

My Patreon PageSupport me on Patreon!

Support with PayPal

Support me with a small donation!

Recent Posts

  • 2026 Update : run baby, run!
  • The last progress report of the year!
  • November’s round up!
  • Progress Report: September

Categories

Archives

Recent Comments

  • allanon on AmiCloud Beta 04 released! The DropBox alternative
  • Paul Issegalö on AmiCloud Beta 04 released! The DropBox alternative
  • allanon on AppBuilder v2.0 released

My Music Page on Facebook

My Music Page on Facebook

My Twitter

My Tweets

I’m on Spotify and Soundcloud!

My Spotify PageListen to my music!
My Soundcloud PageListen to my music!
Privacy & Cookies : This site use cookies. Please take a moment to review our privacy policy. Our Cookie and Privacy Policy

Follow me on Mastodon

Mastodon.Uno

Copyright © 2026 A-MC Creative Development.

Powered by PressBook Masonry Dark