Novembre 2024 | Lun | Mar | Mer | Jeu | Ven | Sam | Dim |
---|
| | | | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | | Calendrier |
|
|
| Pb retour de sub | |
| | Auteur | Message |
---|
JL35
Nombre de messages : 7112 Localisation : 77 Date d'inscription : 29/11/2007
| Sujet: Pb retour de sub Lun 29 Sep 2014 - 16:35 | |
| J'ai un problème avec le petit programme suivant: lecture des tags d'un fichier mp3 (coucou ygeronimi): - Code:
-
DIM f$ f$ = "Z:\Unenoix.mp3" LirTagMp3(f$) MESSAGE CLIPBOARD_STRING_PASTE$ TERMINATE ' ============================================================================== SUB LirTagMp3(f$) ' infos d'un MP3: Lecture des tags ID3v1 (128 derniers octets du fichier) ' résultat dans le clipboard. DIM_LOCAL a$,b$,d$,rc$,sz%,i%,v%(128),gnr$(255) DATA "Genres_MP3" DATA "Blues","Classic Rock","Country","Dance","Disco","Funk","Grunge","Hip-Hop" DATA "Jazz","Metal","New Age","Oldies","Other","Pop","R&B","Rap","Reggae","Rock" DATA "Techno","Industrial","Alternative","Ska","Death Metal","Pranks","Soundtrack" DATA "Euro-Techno","Ambient","Trip-Hop","Vocal","Jazz+Funk","Fusion","Trance","Classical" DATA "Instrumental","Acid","House","Game","Sound Clip","Gospel","Noise","AlternRock" DATA "Bass","Soul","Punk","Space","Meditative","Instrumental Pop","Instrumental Rock" DATA "Ethnic","Gothic","Darkwave","Techno-Industrial","Electronic","Pop-Folk","Eurodance" DATA "Dream","Southern Rock","Comedy","Cult","Gangsta","Top 40","Christian Rap" DATA "Pop/Funk","Jungle","Native American","Cabaret","New Wave","Psychadelic","Rave" DATA "Showtunes","Trailer","Lo-Fi","Tribal","Acid Punk","Acid Jazz","Polka","Retro" DATA "Musical","Rock & Roll","Hard Rock","Folk","Folk/Rock","National Folk","Swing" DATA "Fast-Fusion","Bebob","Latin","Revival","Celtic","Bluegrass","Avantgarde","Gothic Rock" DATA "Progressive Rock","Psychedelic Rock","Symphonic Rock","Slow Rock","Big Band" DATA "Chorus","Easy Listening","Acoustic","Humour","Speech","Chanson","Opera","Chamber Music" DATA "Sonata","Symphony","Booty Bass","Primus","Porn Groove","Satire","Slow Jam" DATA "Club","Tango","Samba","Folklore","Ballad","Power Ballad","Rhythmic Soul","Freestyle" DATA "Duet","Punk Rock","Drum Solo","A capella","Euro-House","Dance Hall","Goa" DATA "Drum & Bass","Club House","Hardcore","Terror","Indie","BritPop","NegerPunk" DATA "Polsk Punk","Beat","Christian Gangsta","Heavy Metal","Black Metal","Crossover" DATA "Contemporary C","Christian Rock","Merengue","Salsa","Thrash Metal","Anime" DATA "JPop","SynthPop","" READ a$: WHILE a$<>"Genres_MP3": READ a$: END_WHILE READ a$: WHILE a$<>"": gnr$(i%)=a$: READ a$: END_WHILE rc$ = CHR$(13)+CHR$(10) FILEBIN_OPEN_READ 9,f$: sz% = FILEBIN_SIZE(9) FILEBIN_POSITION 9,sz%-128: FILEBIN_BLOCK_READ 9,128,v%(0): ' 128 derniers octets FILEBIN_CLOSE 9 a$ = "": FOR i% = 0 TO 127: a$=a$+CHR$(v%(i%)): NEXT i% i% = INSTR(a$,"TAG") IF i%=0 THEN CLIPBOARD_STRING_COPY "Pas de Tags": EXIT_SUB: ' pas de balise 'TAG' a$ = MID$(a$,i%,128) b$="Titre: ": d$=MID$(a$,4,30): i%=INSTR(d$,CHR$(0)): IF i%>1 THEN b$=b$+LEFT$(d$,i%-1) b$=b$+rc$+"Artiste: ": d$=MID$(a$,34,30): i%=INSTR(d$,CHR$(0)): IF i%>1 THEN b$=b$+LEFT$(d$,i%-1) b$=b$+rc$+"Album: ": d$=MID$(a$,64,30): i%=INSTR(d$,CHR$(0)): IF i%>1 THEN b$=b$+LEFT$(d$,i%-1) b$ = b$+rc$+"Année: ": d$=MID$(a$,94,4): IF LEFT$(d$,1)<>CHR$(0) THEN b$=b$+d$ b$ = b$+rc$+"Comment: ": d$=MID$(a$,98,30): i%=INSTR(d$,CHR$(0)): IF i%>1 THEN b$=b$+LEFT$(d$,i%-1) b$ = b$+rc$+"Piste: "+STR$(ASC(MID$(a$,127,1))) i% = ASC(MID$(a$,128,1)): b$ = b$+rc$+"Genre: "+gnr$(i%) CLIPBOARD_STRING_COPY b$ ' message b$ END_SUB La sub se déroule bien et fait bien son travail (si je décoche le 'message' à la fin, le résultat est normal), mais je tombe sur un 'Access violation' juste au moment du END_SUB, comme si on avait perdu l'adresse de retour de la sub... Mais je ne vois vraiment pas comment je peux la modifier, elle doit se trouver dans des tables internes... Il me semble que c'est apparu quand j'ai ajouté la longue série de datas, mais je ne vois pas pourquoi... rien n'interdit de mettre des datas dans les subs (si c'est ça). Edit: Je crois que j'ai mis le doigt dessus: c'est le fait de déclarer en dim_local dans la sub deux tableaux de types différents, % et $, panoramic n'aime pas du tout, access violation suivi de runtime error: - Code:
-
Masub() PRINT "Retour!" END ' ============================================================================== SUB Masub() DIM_LOCAL v%(10),b$(100) END_SUB je vais le signaler dans les bugs, à tout hasard. Et en attendant, il faut que je trouve une autre solution...
Dernière édition par JL35 le Lun 29 Sep 2014 - 17:04, édité 1 fois | |
| | | Yannick
Nombre de messages : 8635 Age : 53 Localisation : Bretagne Date d'inscription : 15/02/2010
| Sujet: re Lun 29 Sep 2014 - 17:03 | |
| @JL35, Les datas peuvent être sans problèmes à l' interieur d' une Sub : - Mp3Tagger.bas:
- Code:
-
Variables() Labels() Gui()
End
Sub Variables() dim Clic%,Change% dim no%,MM%,SM%(7),ObjUrl%,ObjCont%,ObjTitre%,ObjArtist%,ObjAlbum% dim ObjYear%,ObjCom%,ObjTrack%,ObjGenre%,ObjJaq% dim title$,artist$,album$,year$,Com$,Track$,Genre$ dim TabGenre$(125),Genre% End_sub Sub Labels() Label Clic,Change End_sub
Clic: Clic%=Number_click if clic%=objtitre% :DefineTitle(2) :end_if if clic%=objartist% :DefineArtist(2):end_if if clic%=objAlbum% :DefineAlbum(2) :end_if if clic%=objYear% :DefineYear(2) :end_if if clic%=objCom% :DefineCom(2) :end_if if clic%=objTrack% :DefineTrack(2) :end_if if clic%=objGenre% :DefineGenre(text$(ObjGenre%)) :end_if return
Change: Change%=Number_change if change%=objtitre% : DefineTitle(1) :end_if if change%=objartist% : DefineArtist(1):end_if if change%=objAlbum% : DefineAlbum(1) :end_if if change%=objYear% : DefineYear(1) :end_if if change%=objCom% : DefineCom(1) :end_if if change%=objTrack% : DefineTrack(1) :end_if if change%=objGenre% : DefineGenre(text$(ObjGenre%)) :end_if return Sub Gui() O_Form(0,0,1,5,5,530,400,"Mp3 Tagger") font_name no%,"arial"
no%=no%+1 : MM%=no% O_Main_Menu(no%,0) no%=no%+1 : SM%(1)=no% O_Sub_Menu(no%,MM%,"Fichier",1,1) no%=no%+1 : SM%(4)=no% O_Sub_Menu(no%,SM%(1),"Ouvrir",1,1) no%=no%+1 : SM%(5)=no% O_Sub_Menu(no%,SM%(1),"Enregistrer",1,1) no%=no%+1 : SM%(6)=no% O_Sub_Menu(no%,SM%(1),"-",1,1) no%=no%+1 : SM%(7)=no% O_Sub_Menu(no%,SM%(1),"Quitter",1,1) no%=no%+1 : SM%(2)=no% O_Sub_Menu(no%,MM%,"A Propos...",1,1) no%=no%+1 : SM%(3)=no% O_Sub_Menu(no%,MM%,"Aide",1,1)
no%=no%+1 O_Alpha(no%,0,1,10,10,0,0,"Url :"): font_bold no% no%=no%+1 : ObjUrl%=no% O_Edit(no%,0,1,25,10,0,width(0)-36,"",0)
no%=no%+1 : ObjCont%=no% O_Container(no%,0,1,60,10,400,width(0)-36," Tags ")
no%=no%+1 O_Alpha(no%,ObjCont%,1,30,5,0,0,"Titre :"): font_bold no% no%=no%+1 : ObjTitre%=no% O_Combo(no%,objCont%,1,45,5,0,width(ObjCont%)-10,"",1) Remp_Combo(no%) On_change no%,Change
no%=no%+1 O_Alpha(no%,ObjCont%,1,70,5,0,0,"Artiste :"): font_bold no% no%=no%+1 : ObjArtist%=no% O_Combo(no%,objCont%,1,85,5,0,width(ObjCont%)-70,"",1) Remp_Combo(no%) On_change no%,Change
no%=no%+1 O_Alpha(no%,ObjCont%,1,110,5,0,0,"Album :"): font_bold no% no%=no%+1 : ObjAlbum%=no% O_Combo(no%,objCont%,1,125,5,0,width(ObjCont%)-70,"",1) Remp_Combo(no%) On_change no%,Change
no%=no%+1 O_Alpha(no%,ObjCont%,1,150,5,0,0,"Année :"): font_bold no% no%=no%+1 : ObjYear%=no% O_Combo(no%,objCont%,1,165,5,0,70,"",1) Remp_Combo(no%) On_change no%,Change
no%=no%+1 O_Alpha(no%,ObjCont%,1,190,5,0,0,"Commentaire :"): font_bold no% no%=no%+1 : ObjCom%=no% O_Combo(no%,objCont%,1,205,5,0,width(ObjCont%)-10,"",1) Remp_Combo(no%) On_change no%,Change
no%=no%+1 O_Alpha(no%,ObjCont%,1,230,5,0,0,"Piste :"): font_bold no% no%=no%+1 : ObjTrack%=no% O_Combo(no%,objCont%,1,245,5,0,60,"",1) Remp_Combo(no%) On_change no%,Change
no%=no%+1 O_Alpha(no%,ObjCont%,1,270,5,0,0,"Genre :"): font_bold no% no%=no%+1 : ObjGenre%=no% O_Combo(no%,objCont%,1,285,5,0,200,"",1) Remp_Combo(no%) On_change no%,Change
no%=no%+1 : ObjJaq%=no% O_Picture(no%,objCont%,1,245,210,140,140,"")
End_sub ' ****************************************************************************** ' BIBLIOTHEQUE OBJETS ' ******************************************************************************
Sub O_Form(No%,P%,V%,T%,L%,H%,W%,C$) if No%> 0 then FORM No% if P% > 0 then Parent No%,P% If V% = 0 Then hide No% If H% > 0 Then Height No%,H% If W% > 0 Then Width No%,W% If T% > 0 : Top No%,T% : Else : Top No%,(Screen_y-H%)/2 : End_If If L% > 0 : Left No%,L%: Else : Left No%,(Screen_x-W%)/2: End_If if C$<>"" then Caption No%,C$ End_Sub ' ______________________________________________________________________________ Sub O_Alpha(No%,P%,V%,T%,L%,H%,W%,C$) ALPHA No% if P% > 0 then Parent No%,P% If V% = 0 Then hide No% If H% > 0 Then Height No%,H% If W% > 0 Then Width No%,W% If T% > 0 Then Top No%,T% If L% > 0 Then Left No%,L% if C$<>"" then Caption No%,C$ End_Sub ' ______________________________________________________________________________ Sub O_Edit(No%,P%,V%,T%,L%,H%,W%,T$,Ch%) EDIT No% if P% > 0 then Parent No%,P% If V% = 0 Then hide No% If H% > 0 Then Height No%,H% If W% > 0 Then Width No%,W% If T% > 0 Then Top No%,T% If L% > 0 Then Left No%,L% If T$<>"" Then Text No%,T$ If Ch%=1 Then On_Change No%,Change End_Sub ' ______________________________________________________________________________ Sub O_Button(No%,P%,V%,T%,L%,H%,W%,C$,Cl%) BUTTON No% if P% > 0 then Parent No%,P% If V% = 0 Then hide No% If H% > 0 Then Height No%,H% If W% > 0 Then Width No%,W% If T% > 0 Then Top No%,T% If L% > 0 Then Left No%,L% if C$<>"" then Caption No%,C$ if Cl%> 0 then on_click No%,Clic cursor_point No% End_Sub ' ______________________________________________________________________________ Sub O_Container(No%,P%,V%,T%,L%,H%,W%,C$) CONTAINER No% if P% > 0 then Parent No%,P% If V% = 0 Then hide No% If H% > 0 Then Height No%,H% If W% > 0 Then Width No%,W% If T% > 0 Then Top No%,T% If L% > 0 Then Left No%,L% if C$<>"" then Caption No%,C$ End_Sub ' ______________________________________________________________________________ Sub O_Memo(No%,P%,V%,T%,L%,H%,W%,F$) MEMO No% if P% > 0 then Parent No%,P% If V% = 0 Then hide No% If H% > 0 Then Height No%,H% If W% > 0 Then Width No%,W% If T% > 0 Then Top No%,T% If L% > 0 Then Left No%,L% if F$<>"" if file_exists(F$)=1 then file_load No%,F$ end_if End_Sub ' ______________________________________________________________________________ Sub O_Combo(No%,P%,V%,T%,L%,H%,W%,F$,Cl%) COMBO No% if P% > 0 then Parent No%,P% If V% = 0 Then hide No% If H% > 0 Then Height No%,H% If W% > 0 Then Width No%,W% If T% > 0 Then Top No%,T% If L% > 0 Then Left No%,L% if F$<>"" if file_exists(F$)=1 then file_load No%,F$ end_if if Cl%> 0 then on_click No%,Clic End_Sub ' ______________________________________________________________________________ Sub O_List(No%,P%,V%,T%,L%,H%,W%,F$,Cl%) LIST No% if P% > 0 then Parent No%,P% If V% = 0 Then hide No% If H% > 0 Then Height No%,H% If W% > 0 Then Width No%,W% If T% > 0 Then Top No%,T% If L% > 0 Then Left No%,L% if F$<>"" if file_exists F$ then file_load No%,F$ end_if if Cl%> 0 then on_click No%,Clic End_Sub ' ______________________________________________________________________________ Sub O_Picture(No%,P%,V%,T%,L%,H%,W%,P$) PICTURE No% if P% > 0 then Parent No%,P% If V% = 0 Then hide No% If H% > 0 Then Height No%,H% If W% > 0 Then Width No%,W% If T% > 0 Then Top No%,T% If L% > 0 Then Left No%,L% if P$<>"" then File_load No%,P$ End_Sub ' ______________________________________________________________________________ Sub O_Check(No%,P%,V%,T%,L%,H%,W%,C$) CHECK No% if P% > 0 then Parent No%,P% If V% = 0 Then hide No% If H% > 0 Then Height No%,H% If W% > 0 Then Width No%,W% If T% > 0 Then Top No%,T% If L% > 0 Then Left No%,L% if C$<>"" then Caption No%,C$ End_Sub ' ______________________________________________________________________________ Sub O_Option(No%,P%,V%,T%,L%,H%,W%,C$) OPTION No% if P% > 0 then Parent No%,P% If V% = 0 Then hide No% If H% > 0 Then Height No%,H% If W% > 0 Then Width No%,W% If T% > 0 Then Top No%,T% If L% > 0 Then Left No%,L% if C$<>"" then Caption No%,C$ End_Sub ' ______________________________________________________________________________ Sub O_Main_Menu(No%,P%) MAIN_MENU No% if P% > 0 then Parent No%,P% End_Sub ' ______________________________________________________________________________ Sub O_Sub_Menu(No%,P%,C$,Cl%,A%) SUB_MENU No% if P% > 0 then Parent No%,P% if C$<>"" then Caption No%,C$ If Cl%=1 : on_click No%,Clic : end_if If Cl%=2 : on_click No%,Clic2 : end_if If Cl%=3 : on_click No%,Clic3 : end_if If Cl%=4 : on_click No%,Clic4 : end_if If A%=0 then inactive No% End_Sub ' ______________________________________________________________________________ Sub O_Open_Dialog(No%,Out%,DD$,Filtre$,O%) dim_local F$ If Object_Exists(No%)=0 OPEN_DIALOG No% End_if if DD$<>"" then Dir_Dialog No%,DD$ if filtre$<>"" then Filter No%,Filtre$+"|"+Filtre$ F$=File_name$(No%) if variable("File$")=0:Dim File$:End_If if F$<>"_" if O%=1 then text out%,F$ if O%=2 then Caption Out%,F$ if O%=3 then item_add Out%,F$ if O%=4 then file_load Out%,F$ if O%=5 then File$=F$ end_if Delete No% End_Sub ' ______________________________________________________________________________ Sub O_Save_Dialog(No%,NOut%,DD$,Filtre$,ext$) dim_local F$,i%,ext% If Object_Exists(No%)=0 SAVE_DIALOG No% End_If If DD$<>"" then Dir_Dialog No%,DD$ If filtre$<>"" then Filter No%,Filtre$ F$=file_name$(No%) If F$<>"_" for i%=1 to len(F$) if mid$(f$,i%,1)=".":ext%=1:exit_for:end_if next i% if ext%=1 File_Save NOut%,F$ else File_save NOut%,F$+ext$ end_if End_If Delete No% End_Sub ' ______________________________________________________________________________ Sub O_Progress_Bar(No%,P%,V%,T%,L%,H%,W%) PROGRESS_BAR No% if P% > 0 then Parent No%,P% If V% = 0 Then hide No% If H% > 0 Then Height No%,H% If W% > 0 Then Width No%,W% If T% > 0 Then Top No%,T% If L% > 0 Then Left No%,L% End_Sub ' ______________________________________________________________________________ Sub O_Dlist(No%,F$) dim_local Fic$ Fic$=F$ DLIST No% if F$<>"" if file_exists(Fic$)=1 : then file_load No%,Fic$ : end_if end_if End_Sub ' ______________________________________________________________________________ Sub O_Container_Option(No%,P%,V%,T%,L%,H%,W%,C$) CONTAINER_OPTION No% if P% > 0 then Parent No%,P% If V% = 0 Then hide No% If H% > 0 Then Height No%,H% If W% > 0 Then Width No%,W% If T% > 0 Then Top No%,T% If L% > 0 Then Left No%,L% if C$<>"" then Caption No%,C$ End_Sub ' ______________________________________________________________________________ Sub O_Statut_Bar(No%,P%,V%,M%) Dim_Local No2% ,x% ,a% ,Pa%,OSB2% Pa%=P% :No2%=No% for x%=1 to Number_Objects:If Object_Type(x%)=13 :a%=1:End_If:Next x% If M%=0 O_Picture(No2%,P%,V%,Height(P%)-61,0,23,width(P%)-16,"") Else if M%=1 O_Picture(No2%,P%,V%,Height(P%)-81,0,23,width(P%)-16,"") else O_Picture(No2%,P%,V%,height(P%)-81,0,23,width(P%)-16,"") end_if End_If OSB2%=No2% Adaptation_OSB(No2%,Pa%) End_Sub ' ______________________________________________________________________________ Sub O_Button_Picture(num_obj%,No_b%,P%,V1%,V2%,T%,L%,H%,W%,Pict$,Pict2$) O_Picture(num_obj%+1,P%,V2%,T%,L%,H%,W%,Pict2$):cursor_point num_obj% +1 O_Picture(num_obj%,P%,V1%,T%,L%,H%,W%,Pict$):On_click num_obj%,Clic:cursor_point num_obj% obj% = obj%+1 if variable("No2%")=0 : dim No2% :No2%=7000 :End_if if Variable("R%")=0 :dim R% :R%=1:else :R%=R%+1 :end_if if Object_exists(7000)=0 :O_Edit(7000,P%,0,-190,-200,0,0):End_If If Variable("KGF_res%")=0 then dim KGF_res% KGF_res% = dll_call2("ClickSetHook",handle(P%),handle(No2%)) KGF_res% = dll_call5("ClickDefineRect",R%,L%,T%,W%,H%)
No2%=No_b% O_Button(No2%,P%,0,-200,-200,0,0,"",1) KGF_res% = dll_call3("ClickSetLinkRect",handle(No2%),0-5,R%)
No2%=No_b%+1 O_Button(No2%,P%,0,-200,-200,0,0,"",1) KGF_res% = dll_call3("ClickSetLinkRect",handle(No2%),0-6,R%) End_Sub ' ______________________________________________________________________________ Sub Adaptation_OSB(No%,P%) Dim_Local x% ,y% ,z% ,t$ ,R_osb% ,G_osb% ,B_osb% color No%,235,235,239 : y%=width(P%)-27 Restore while t$<>"OSB_Corps.bmp" :read t$:End_while Read R_osb% :Read G_osb% :Read B_osb% 2d_target_is No% : 2d_pen_color R_osb%,G_osb%,B_osb% for x%=0 to y% :2d_point x%,z% :next x% Restore while t$<>"OSB_Fin.bmp" :read t$:End_while for x%=y% to y%+10 for z%=0 to 22 Read R_osb% :Read G_osb% :Read B_osb% 2d_target_is No% : 2d_pen_color R_osb%,G_osb%,B_osb% 2d_point x%,z% next z% next x% Data "OSB_Corps.bmp" data 170,165,162 data "OSB_Fin.bmp" data 170,165,162 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 242,239,239 data 239,235,235 data 239,235,235 data 170,165,162 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 242,239,239 data 170,165,162 data 239,235,235 data 239,235,235 data 170,165,162 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 242,239,239 data 170,165,162 data 170,165,162 data 239,235,235 data 239,235,235 data 170,165,162 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 242,239,239 data 239,235,235 data 239,235,235 data 242,239,239 data 239,235,235 data 239,235,235 data 170,165,162 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 242,239,239 data 170,165,162 data 239,235,235 data 242,239,239 data 170,165,162 data 239,235,235 data 239,235,235 data 170,165,162 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 242,239,239 data 170,165,162 data 170,165,162 data 242,239,239 data 170,165,162 data 170,165,162 data 239,235,235 data 239,235,235 data 170,165,162 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 242,239,239 data 239,235,235 data 239,235,235 data 242,239,239 data 239,235,235 data 239,235,235 data 242,239,239 data 239,235,235 data 239,235,235 data 170,165,162 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 242,239,239 data 170,165,162 data 239,235,235 data 242,239,239 data 170,165,162 data 239,235,235 data 242,239,239 data 170,165,162 data 239,235,235 data 239,235,235 data 170,165,162 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 242,239,239 data 170,165,162 data 170,165,162 data 242,239,239 data 170,165,162 data 170,165,162 data 242,239,239 data 170,165,162 data 170,165,162 data 239,235,235 data 239,235,235 data 170,165,162 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 170,165,162 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 data 239,235,235 End_Sub ' ------------------------------------------------------------------------------ Sub O_Timer(No%,OO%,Inter%) TIMER No% if OO%=1 then timer_on No% if OO%=0 then timer_off No% if inter%>0 then timer_interval No%,inter% End_Sub ' ------------------------------------------------------------------------------ Sub O_Spin(No%,P%,V%,T%,L%,H%,W%,Mi%,Ma%,C%) SPIN No% if P% > 0 then Parent No%,P% If V% = 0 Then hide No% If H% > 0 Then Height No%,H% If W% > 0 Then Width No%,W% If T% > 0 Then Top No%,T% If L% > 0 Then Left No%,L% Min No%,Mi% Max No%,Ma% if C% > 0 Then on_change No%,Change End_sub ' ------------------------------------------------------------------------------ Sub O_Panel(No%,P%,V%,T%,L%,H%,W%) Panel no% if P% > 0 then Parent No%,P% If V% = 0 Then hide No% If H% > 0 Then Height No%,H% If W% > 0 Then Width No%,W% If T% > 0 Then Top No%,T% If L% > 0 Then Left No%,L% End_sub ' ****************************************************************************** ' INITIALISATION DES PLUGGINS ' ******************************************************************************
Sub Init_pluggins()
dim kgf$,bdr$ dim ffmpeg$,ytb$,ffprobe$,ffplay$ dim z7$ dim jhead$ dim nconv$ dim pdfdetach$,pdffont$,pdfing$,pdfinfo$,pdfhtml$,pdfpng$,pdfppm$,pdftop$,pdftext$,pdfimg$
kgf$ ="C:\PROGRA~2\PANORA~1\Mes_Dlls\KGF\KGF.dll" bdr$ ="C:\PROGRA~2\PANORA~1\KGF\BDR.dll" ytb$ ="C:\PROGRA~2\PANORA~1\MES_PL~1\YOUTUB~1.EXE" ffmpeg$ ="C:\PROGRA~2\PANORA~1\MES_PL~1\ffmpeg.exe" ffprobe$ ="C:\PROGRA~2\PANORA~1\MES_PL~1\ffprobe.exe" ffplay$ ="C:\PROGRA~2\PANORA~1\MES_PL~1\ffplay.exe" z7$ ="C:\PROGRA~2\PANORA~1\MES_PL~1\7z.exe" jhead$ ="C:\PROGRA~2\PANORA~1\MES_PL~1\jhead.exe" nconv$ ="C:\PROGRA~2\PANORA~1\MES_PL~1\nconvert.exe" pdfdetach$ ="C:\PROGRA~2\PANORA~1\MES_PL~1\PDFDET~1.EXE" pdffont$ ="C:\PROGRA~2\PANORA~1\MES_PL~1\pdffonts.exe" pdfimg$ ="C:\PROGRA~2\PANORA~1\MES_PL~1\PDFIMA~1.EXE" pdfinfo$ ="C:\PROGRA~2\PANORA~1\MES_PL~1\pdfinfo.exe" pdfhtml$ ="C:\PROGRA~2\PANORA~1\MES_PL~1\PDFTOH~1.EXE" pdfpng$ ="C:\PROGRA~2\PANORA~1\MES_PL~1\pdftopng.exe" pdfppm$ ="C:\PROGRA~2\PANORA~1\MES_PL~1\pdftoppm.exe" pdftop$ ="C:\PROGRA~2\PANORA~1\MES_PL~1\pdftops.exe" pdftext$ ="C:\PROGRA~2\PANORA~1\MES_PL~1\PDFTOT~1.EXE" End_sub Sub Remp_Combo(C%) dim_local x%,i$ if c%<>ObjGenre% item_add c%,"<Supprimer>" else item_add c%,"<Supprimer>" restore while i$<>"Genres" : read i$ : end_while for x%=1 to 126 read i$ item_add c%,i$ TabGenre$(x%-1)=i$ next x% end_if Data "Genres" Data "Blues" Data "Classic Rock" Data "Country" Data "Dance" Data "Disco" Data "Funk" Data "Grunge" Data "Hip-Hop" Data "Jazz" Data "Metal" Data "New Age" Data "Oldies" Data "Other" Data "Pop" Data "R&B" Data "Rap" Data "Reggae" Data "Rock" Data "Techno" Data "Industrial" Data "Alternative" Data "Ska" Data "Death Metal" Data "Pranks" Data "Soundtrack" Data "Euro-Techno" Data "Ambient" Data "Trip-Hop" Data "Vocal" Data "Jazz+Funk" Data "Fusion" Data "Trance" Data "Classical" Data "Instrumental" Data "Acid" Data "House" Data "Game" Data "Sound Clip" Data "Gospel" Data "Noise" Data "AlternRock" Data "Bass" Data "Soul" Data "Punk" Data "Space" Data "Meditative" Data "Instrumental Pop" Data "Instrumental Rock" Data "Ethnic" Data "Gothic" Data "Darkwave" Data "Techno-Industrial" Data "Electronic" Data "Pop-Folk" Data "Eurodance" Data "Dream" Data "Southern Rock" Data "Comedy" Data "Cult" Data "Gangsta" Data "Top 40" Data "Christian Rap" Data "Pop/Funk" Data "Jungle" Data "Native American" Data "Cabaret" Data "New Wave" Data "Psychadelic" Data "Rave" Data "Showtunes" Data "Trailer" Data "Lo-Fi" Data "Tribal" Data "Acid Punk" Data "Acid Jazz" Data "Polka" Data "Retro" Data "Musical" Data "Rock & Roll" Data "Hard Rock" ' genres supplémentaires pour winamp Data "Folk" Data "Folk-Rock" Data "National Folk" Data "Swing" Data "Fast Fusion" Data "Bebob" Data "Latin" Data "Revival" Data "Celtic" Data "Bluegrass" Data "Avantgarde" Data "Gothic Rock" Data "Progressive Rock" Data "Psychedelic Rock" Data "Symphonic Rock" Data "Slow Rock" Data "Big Band" Data "Chorus" Data "Easy Listening" Data "Acoustic" Data "Humour" Data "Speech" Data "Chanson" Data "Opera" Data "Chamber Music" Data "Sonata" Data "Symphony" Data "Booty Bass" Data "Primus" Data "Porn Groove" Data "Satire" Data "Slow Jam" Data "Club" Data "Tango" Data "Samba" Data "Folklore" Data "Ballad" Data "Power Ballad" Data "Rhythmic Soul" Data "Freestyle" Data "Duet" Data "Punk Rock" Data "Drum Solo" Data "A capella" Data "Euro-House" Data "Dance Hall" end_sub
Sub DefineTitle(m%) if m%=1 if Text$(objtitre%)<>"<Supprimer>" title$=Text$(objtitre%) end_if else if Text$(objtitre%)="<Supprimer>" title$="" end_if end_if caption 0,"titre : "+title$ End_sub
Sub DefineArtist(m%) if m%=1 if Text$(objartist%)<>"<Supprimer>" Artist$=Text$(objartist%) end_if else if Text$(objartist%)="<Supprimer>" Artist$="" end_if end_if caption 0,"Artiste : "+Artist$ End_sub
Sub DefineAlbum(m%) if m%=1 if Text$(objalbum%)<>"<Supprimer>" Album$=Text$(objAlbum%) end_if else if Text$(objAlbum%)="<Supprimer>" Album$="" end_if end_if caption 0,"Album : "+Album$ End_sub
Sub DefineYear(m%) if m%=1 if Text$(objyear%)<>"<Supprimer>" year$=Text$(objyear%) end_if else if Text$(objyear%)="<Supprimer>" year$="" end_if end_if caption 0,"Année : "+year$ End_sub
Sub DefineCom(m%) if m%=1 if Text$(objcom%)<>"<Supprimer>" com$=Text$(objcom%) end_if else if Text$(objcom%)="<Supprimer>" com$="" end_if end_if caption 0,"Commentaire : "+com$ End_sub
Sub DefineTrack(m%) if m%=1 if Text$(objTrack%)<>"<Supprimer>" Track$=Text$(objTrack%) end_if else if Text$(objTrack%)="<Supprimer>" Track$="" end_if end_if caption 0,"Piste : "+Track$ End_sub
Sub DefineGenre(G$) dim_local x% Genre$=G$ if Genre$="<Supprimer>" Genre%=126 else for x%=1 to 125 if TabGenre$(x%)=Genre$ Genre%=x% exit_for end_if next x% end_if Caption 0,"Genre : "+str$(Genre%)+" - "+Genre$ End_sub
Ceci est une ébauche de l' interface graphique vs0.1. Ne regarde pas l' adressage des pluggins, la sub n' est pas à jour mais comme j' essai le tout Panoramic... | |
| | | JL35
Nombre de messages : 7112 Localisation : 77 Date d'inscription : 29/11/2007
| Sujet: Re: Pb retour de sub Lun 29 Sep 2014 - 17:06 | |
| On s'est croisés ygeronimi, je savais pour les datas, mais comme tu vois j'ai trouvé le hic.
J'ai fait deux subs en tout panoramic, sub lecture des tags et sub modification/mise à jour, c'est simple à faire. Mais tu veux certainement quelque chose de plus sophistiqué. | |
| | | Yannick
Nombre de messages : 8635 Age : 53 Localisation : Bretagne Date d'inscription : 15/02/2010
| Sujet: re Lun 29 Sep 2014 - 17:15 | |
| Perso, je mets mes tableaux en "dim" et j' initialise ou pas au besoin. | |
| | | JL35
Nombre de messages : 7112 Localisation : 77 Date d'inscription : 29/11/2007
| Sujet: Re: Pb retour de sub Lun 29 Sep 2014 - 18:07 | |
| Là je ne vois pas bien comment je peux mettre mes 200 éléments environ en dim... et les retrouver à partir de leur index. Non, j'ai supprimé le tableau ascii et tout lu les datas dans un Dlist, c'est plus pratique, pour l'indexation.
Je regardais ton ébauche, c'est pas mal, et même bien, visuellement. Mais dans le programme, toujours ces longues séries de datas, ça fait un sacré volume de lignes... | |
| | | Yannick
Nombre de messages : 8635 Age : 53 Localisation : Bretagne Date d'inscription : 15/02/2010
| Sujet: re Lun 29 Sep 2014 - 18:32 | |
| @ JL35,
Le nombre de ligne pour les datas, c' est une convenance personnelle. Tu peux en mettre plusieurs sur la même ligne, du moment que tu respectes l' ordre dans lequel ils sont ( pour la mise en tableau, TabGenre$(125), que je fais en même temps que le remplissage du Combo.
heu...quand je dis en dim, c' est le tableau que je déclare en variable constante par dim au lieu de dim_local puisque je sais, au départ, que je vais en avoir besoin pour le reste du programme. | |
| | | Contenu sponsorisé
| Sujet: Re: Pb retour de sub | |
| |
| | | | Pb retour de sub | |
|
Sujets similaires | |
|
| Permission de ce forum: | Vous ne pouvez pas répondre aux sujets dans ce forum
| |
| |
| |