PLangHQ / plang

The code repository from plang programming language
GNU Lesser General Public License v2.1
51 stars 5 forks source link

Add IOutputParser to terminal module #53

Open ingig opened 1 month ago

ingig commented 1 month ago

Let say we want to run ffmpeg, convert wav to mp3, the plang code would be

Start
- ffmpeg -i input.wav -codec:a libmp3lame -qscale:a 2 output.mp3
     write to %output%, %error%, %outDelta%, %errorDelta%
- write out %output% %error%

this would be the output from the console {628D38B3-C90B-4AB9-92BA-C5A61DB37ACD}

if you could inject a IOutputParser, and that object knows how to parse the output and can me usefull information, such as

Duration, Stream, Output metadata, Output stream, etc.

if you could inject a parser, the output object would be

Start
- ffmpeg -i input.wav -codec:a libmp3lame -qscale:a 2 output.mp3
    use the ffmpeg parser
     write to %output%, %error%, %outDelta%, %errorDelta%
- write out %output.Duration% %output.Stream%,, etc.

the parse would also be able to know how to ask the user, something that gets ignored today

Maybe there should be an IInputParser, but I dont see point in it