[Gambas-user] Grabbing certain data from a stream, help a newb

lawrence pires piresl at ...626...
Sat Jan 5 21:43:05 CET 2008


Hi All,

I only recently found Gambas, but I got to say its amazing & addictive.

This is what I have at the moment:

EXEC [dvdmovie, Textbox1.Text] FOR READ AS "Contents"

PUBLIC SUB Contents_Read()

DIM hFile AS File
DIM sLine AS String

 READ #LAST, sLine, Lof(LAST)
 sOutput &= sLine

hFile = OPEN "/home/lop/Desktop/test88" FOR CREATE
WRITE #hFile, sOutput, Len(sOutput)
CLOSE #hFile
END

& this is stream written to test88

VDec: vo config request - 616 x 252 (preferred colorspace: Planar YV12)
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is 2.44:1 - prescaling to correct movie aspect.
videocodec: libavcodec (720x576 fourcc=3267706d [mpg2])
Pos:   0.0s      1f ( 0%)  0.00fps Trem:   0min   0mb  A-V:0.000 [0:0]
Writing header...
INITV: 0.200, 0.160, fps: 25.000
Pos:   0.1s      2f ( 0%)  0.00fps Trem:   0min   0mb  A-V:0.004 [0:0]
Pos:   0.1s      3f ( 0%)  0.00fps Trem:   0min   0mb  A-V:0.008 [0:0]


the output from the shell is directed to the test88 file creating a new line
every time.

'Pos:   0.1s      3f ( 0%)  0.00fps Trem:   0min   0mb  A-V:0.008 [0:0'

Now I need to grab the percentage (0%) this will change as the exec command
completes the process,

The only command I can find close is Split, to spilt the string/stream, but
this creates a massive array, so i dont think this is a good path to take,
(What do you think?).

The reason why I want to grab the percentage is so that I can correctly
setup the progress bar, Im thinking that the only way the progress bar will
be correct in showing the progress of the exec command is to grab the
percentage of completion from the stream, somehow convert the string into an
integer and then do something like this

ProgressBar1.Visible = TRUE
ProgressBar1.Value += PERCENTAGE FROM STREAM
ProgressBar1.Refresh


***The only reason im writing to file atm is so that I can debug, I would
like to do this on the fly really.


Has anyone got any ideas or tips?, how would you do it?, Am I going in the
right direction?, im totally lost at spitting the stream, getting the right
bit and then changing a string to an integer so I can use it for the
progress bar? any help would be amazing

Thanks 2 Gamabs



More information about the User mailing list