Re: [mpg123-devel] Please test new network code in/out of mpg123 (now with HTTPS support)!
Brought to you by:
sobukus
From: Dave Y. <dav...@gm...> - 2022-05-16 18:30:35
|
On 05/16/22 10:45 AM, Thomas Orgis wrote: > [OK to take it back on-list? You probably replied to my single off-list > answer?] Habit, pressed reply instead of reply all. > > Am Mon, 16 May 2022 09:33:57 -0700 > schrieb Dave Yeo <dav...@gm...>: > > OK, so these would be minimal snippets to get key reads … > >> #define INCL_KBD >> #define INCL_DOSPROCESS >> #include <os2.h> > >> DosSleep(5); >>> if(!KbdCharIn(&key,IO_NOWAIT,0) && key.chChar) >>> { >>> *val = key.chChar; >>> return 1; >>> } > > Well, I integrated that into mpg123 trunk now. Can we settle the > DosSleep() value? It should match the timeout used for select with > POSIX. > > Please report back if control now works. Or about a new error. Control is mostly working fine. Display not so much. pressing h lists the commands, which scroll of the window and doesn't return to the usual output. "p" seems to keep playing the same frame, most of the other keys work, "+" for increasing the volume, but not "-", this is probably a driver issue, even the system volume control is erratic, seems our port of Alsa doesn't get the mixer right a lot of the time. No progress bar or even time count. Kind of surprised the term stuff doesn't work. > >> Almost, > >> H:\tmp>test.exe >> terminal fd: 0 >> got key: Î >> got key: a >> got key: s >> got key: f >> got key: d >> got key: q >> >> Keep getting that Î on program start before pressing a key. > > Well, we could workaround this and just ignore the value. This is what > mpg123 does with unknown keys. But figuring out where it comes from and > how to deal with it properly would be better. Also: If you press an > actual multibyte character, what happens here? Get upper ASCII characters, see if Thunderbird will display them, No, doesn't survive converting to unicode, I see a face and playing card symbols on a quick test > >> Leaving it running without the DosSleep(5) does block things badly, > > DosSleep(5) is 5 … microseconds? Nanoseconds? From the docs, <quote> Suspends the current thread for a specified time interval. #define INCL_DOSPROCESS #include <os2.h> ULONG msec; /* The time, in milliseconds, for which the calling thread's execution will be suspended. */ APIRET ulrc; /* Return Code. */ ulrc = DosSleep(msec); </quote> Also the time is approximate depending on clock tick length, rounded up. > >> ps Term is set to os2 > > Does it react to escape sequences for reverse video and hiding cursor? > Mpg123 will attempt to use those. No, though I would expect it to, curses and such do work IIRC. > > > So … have a go with current trunk, please. Report how things look. If a > progress bar is drawn … might upload a Video someplace to demonstrate > some future retro computing;-) > No progress bar, timer etc. Basically in the console, [H:\tmp\mpg123\bin]mpg123 "F:\sounds\mp3\09 What God Wants, Part II.mp3" High Performance MPEG 1.0/2.0/2.5 Audio Player for Layers 1, 2 and 3 version 1.30.0; written and copyright by Michael Hipp and others free software (LGPL) without any warranty but with best wishes Terminal control enabled, press 'h' for listing of keys and functions. Playing MPEG stream 1 of 1: F:\sounds\mp3\09 What God Wants, Part II.mp3 ... MPEG 1.0 L III cbr192 44100 stereo Title: What God Wants, Part II Artist: Roger Waters Comment: 14+72A131497B2DAEF0B4F49F4DE34C9DCD+1033766 Album: Amused To Death Year: 1992 Genre: Rock, [3:41] Decoding of F:\sounds\mp3\09 What God Wants, Part II.mp3 finished. Dave |