$INCLUDE "akrip32.inc"
DECLARE SUB AddCdList
DECLARE SUB Extract
CREATE Form AS QFORM
CAPTION = "AkRip32 example"
Width = 263
Height = 200
Center
borderstyle = 3
onshow = addcdlist
CREATE Label1 AS QLABEL
CAPTION = "Extract Track"
Left = 8
Top = 80
Width = 96
END CREATE
CREATE Label2 AS QLABEL
CAPTION = "Destination file"
Left = 8
Top = 120
Width = 80
Transparent = 1
END CREATE
CREATE OvalBtn1 AS QOVALBTN
CAPTION = "Go !"
Left = 169
Top = 68
Width = 76
Height = 34
onclick = extract
END CREATE
CREATE ListBox AS QLISTBOX
Left = 8
Top = 10
width = 238
height = 50
END CREATE
CREATE Edit1 AS QEDIT
Left = 96
Top = 72
Width = 57
TabOrder = 3
END CREATE
CREATE Edit2 AS QEDIT
Left = 96
Top = 112
Width = 145
TabOrder = 4
END CREATE
CREATE GAuge AS QGAUGE
align = 2
forecolor = RGB(0,0,255)
backcolor = RGB(225,225,225)
height = 22
borderstyle = 0
min = 0
max = 100
END CREATE
END CREATE
Form.SHOWMODAL
SUB AddCdList
Listbox.clear
DIM DrivesCount AS LONG
DrivesCount = AKRIPQ_GetCdList
DIM Cdinfo AS AKRIPQ_CDREC
DIM i AS INTEGER
i = 0
DO
AKRIPQ_GetCdInfo(i, Cdinfo)
Listbox.additems(Cdinfo.id)
INC(i)
LOOP UNTIL i = DrivesCount
END SUB
SUB Extract
DIM CdHandle AS LONG
CdHandle = AKRIPQ_GetCdHandle(listbox.itemindex)
DIM TOC AS AKRIPQ_TOCINFO
AKRIPQ_ReadToc(CdHandle, TOC)
AKRIPQ_Savetrack (CdHandle, VAL(edit1.text), edit2.text)
SHOWMESSAGE "Done !"
Gauge.position = 0
Form.CAPTION = "AkRip32 example"
END SUB
FUNCTION AKRIPQ_Callback
Gauge.position = AKRIPQ_PercentageDone
Form.CAPTION = "Frame " & STR$(AKRIPQ_FramesDone) & " of " & _
STR$(AKRIPQ_FramesTotal) & ". " & STR$(AKRIPQ_FramesLeft) & _
" left"
END FUNCTION
|