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 |
|
|
| Mp3 Cleaner | |
| | Auteur | Message |
---|
Yannick
Nombre de messages : 8635 Age : 53 Localisation : Bretagne Date d'inscription : 15/02/2010
| Sujet: Mp3 Cleaner Ven 10 Oct 2014 - 23:47 | |
| Je vous livre ma dernière version de mon Mp3 Cleaner. Cette application permet de nettoyer un fichier Mp3 de ses Tags (id3v2,id3v1,APE). - Il crée une copie de votre fichier Mp3 avec seulement la bande son. - Vous pouvez choisir (menu options) de récupérer le titre de la chanson en nom de fichier sinon le fichier sera nommé "Song.mp3" ce qui sera aussi le cas si les tags correspondant au titre sont vides. - Dans le cas où il y aurait déjà un fichier du même nom, il sera nommé soit Song(x).mp3, soit "Mon_titre(MPC).mp3" Le fichier sera créé dans le répertoire du fichier d' origine. - Vous pouvez aussi choisir de détruire le fichier *.mp3 d' origine. - Vous devez modifier l' adresse de kgf.dll pour lui donner celle de votre copie. - Code:
-
dim kgf$,Path_music$,Path_out$ Kgf$ ="C:\PROGRA~2\PANORA~1\Mes_Dlls\KGF\KGF.dll" Path_music$="c:\users\yannick\music" dim clic%,M%,M2% dim Fic$ dim tf%,dep%,tf2%,i%,tab$(1000)
label clic,L1,L2 Init_TabTag() dll_on kgf$
width 0,300 : height 0,200 : Caption 0,"Mp3 Cleaner" font_name 0,"Arial"
main_menu 1 sub_menu 2 : parent 2,1 : caption 2,"Fichier" sub_menu 3 : parent 3,1 : caption 3,"Options" sub_menu 4 : parent 4,1 : caption 4,"A Propos..." : on_click 4,clic
sub_menu 5 : parent 5,2 : caption 5,"Ouvrir" : on_click 5,clic sub_menu 6 : parent 6,2 : caption 6,"-" sub_menu 7 : parent 7,2 : caption 7,"Quitter" : on_click 7,clic
sub_menu 8 : parent 8,3 : caption 8,"Titre => Nom de fichier" : on_click 8,clic sub_menu 20 : parent 20,3 : caption 20,"Effacer le fichier original" : on_click 20,clic
check 9 : top 9,10 : left 9,10 : caption 9,string$(5," ")+"id3v2" check 10 : top 10,30 : left 10,10 : caption 10,string$(5," ")+"Audio" check 11 : top 11,50 : left 11,10 : caption 11,string$(5," ")+"APE" check 12 : top 12,70 : left 12,10 : caption 12,string$(5," ")+"id3v1"
Alpha 13 : top 13,100: left 13,10 : caption 13,"" : font_color 13,0,0,200 Progress_bar 14: top 14,115: left 14,10 : width 14,width(0)-36
button 15 : top 15,80 : left 15,width(0)-100 caption 15,"Clean" : font_name 15,"Times" :font_size 15,10 : font_bold 15 cursor_point 15 : on_click 15,clic end
clic: clic%= number_click select clic% case 4 :APp() case 5 :Initialisation():Ouvrir() case 7 :Quitter() case 8 :Option_1() case 15:CleanFic(Fic$) case 20:Option_2() end_select return
Sub Init_TabTag() dim_local a$ Restore While a$<>"F" read a$ i%=i%+1 Tab$(i%)=a$ end_while end_sub
Sub APp() End_sub
Sub Ouvrir() Open_dialog 16 dir_dialog 16,Path_music$ filter 16,"*.mp3|*.mp3" Fic$=file_name$(16) delete 16 Path_out$=file_extract_path$(fic$) min 14,0 : max 14,4 : position 14,0 if Fic$<>"_" caption 13,"Détection id3v2" position 14,1 pause 1000 Detect_id3v2(Fic$) caption 13,"Détection bande audio" position 14,2 pause 1000 Detect_audio(Fic$) caption 13,"Détection APE" position 14,3 pause 1000 Detect_Ape(Fic$) caption 13,"Détection id3v1" position 14,4 pause 1000 Detect_id3v1(Fic$) caption 13,"" position 14,0 pause 1000 end_if End_sub
Sub Detect_id3v2(f$) dim_local x%,v%,a$ filebin_open_read 17,f$ tf%=filebin_size(17) for x%=0 to 2 filebin_read 17,v% a$=a$+chr$(v%) next x% if a$="ID3" : mark_on 9 : end_if inactive 9 Filebin_close 17 End_sub
Sub Detect_audio(f$) dim_local x%,v%,v1% Filebin_open_read 17,f$ for x%=0 to tf% filebin_position 17,x% filebin_read 17,v% if hex$(v%)="FF" or hex$(v%)="ff" filebin_read 17,v1% if hex$(v1%)="FB" or hex$(v1%)="fb" Mark_on 10 dep%=x% exit_for end_if end_if next x% inactive 10 filebin_close 17 End_sub
Sub Detect_Ape(f$) dim_local file$,pattern$,res% file$=f$ pattern$="APETAGEX" res% = dll_call3("SearchPatternInBinaryFile",adr(file$),adr(pattern$),0) if res%<>0 mark_on 11 tf2%=res% end_if inactive 11 End_sub
Sub Detect_id3v1(f$) dim_local id3v1%(128) filebin_open_read 17,f$ filebin_position 17,tf%-128 filebin_block_read 17,128,id3v1%(0) if chr$(id3v1%(0))+chr$(id3v1%(1))+chr$(id3v1%(2))="TAG" tf%=tf%-128 mark_on 12 end_if inactive 12 filebin_close 17 End_sub
Sub Quitter() Terminate End_sub
Sub Option_1() if M%=1 :mark_off 8 : M%=0:else:mark_on 8 : M%=1:end_if End_sub
Sub Option_2() if M%=1 :mark_off 20 : M2%=0:else:mark_on 20 : M2%=1:end_if end_sub
Sub CleanFic(f$) inactive 2 :inactive 15 dim_local ts%,title$,res%,pattern$,n%,p%,buf$,x%,f2$,v% if checked(10)=1 if checked(11)=0 ts%=tf%-(dep%-1) else ts%=tf2%-(dep%-1) end_if dim bloc%(ts%)
min 14,0 : max 14,4 : position 14,0
caption 13,"Lecture de la bande son" position 14,1 pause 1000 filebin_open_read 17,f$ filebin_position 17,dep% filebin_block_read 17,ts%,bloc%(0) filebin_close 17 caption 13,"Création du nom de fichier" position 14,2 pause 1000 if M%=1 if checked(12)=1 filebin_open_read 17,f$ filebin_position 17,tf%+3 for x%=1 to 30 filebin_read 17,v% if v%<>0 :title$=title$+chr$(v%):end_if next x% title$=trim$(title$) f2$=Path_out$+title$+".mp3" filebin_close 17 if title$="" goto L1 else if file_exists(f2$)=1 f2$=Path_out$+title$+"(MPC).mp3" end_if end_if else L1: if checked(9)=1 pattern$="TIT2" res% = dll_call3("SearchPatternInBinaryFile",adr(fic$),adr(pattern$),0) if res%<>0 n%=255 p%=res%+3 buf$=string$(255," ") res% = dll_call4("ReadBlockFromBinaryFileToString",adr(file$),n%,p%,adr(buf$)) for x%=1 to i% if instr(buf$,tab$(i%))=1 title$=left$(buf$,len(buf$)-x% exit_for end_if next i% title$=trim$(title$) f2$=Path_out$+title$+".mp3" end_if if Title$="" goto L2 else if file_exists(f2$)=1 f2$=Path_out$+title$+"(MPC).mp3" end_if end_if else goto L2 end_if end_if else L2: f2$=Path_out$+"Song.mp3" if file_exists(f2$)=1 while file_exists(f2$)=1 num%=num%+1 f2$=file_extract_path$(f2$)+"Song("+str$(num%)+").mp3" end_while end_if end_if
Caption 13,"Ecriture de la bande son" position 14,3 pause 1000
filebin_open_write 17,f2$ filebin_block_write 17,ts%,bloc%(0) filebin_close 17
Caption 13,"" position 14,4 pause 1000 position 14,0 if M2%=1 file_delete fic$ End_if active 2 : active 15 free bloc% else Message "Données audio introuvables !!!..." end_if End_sub
Sub Initialisation() dim_local x% Fic$="" tf%=0 dep%=0 tf2%=0 i%=0 M%=0 M2%=0 mark_off 8 mark_off 20 for x%=9 to 12 active x% mark_off x% next x% End_sub
DATA "AENC","APIC","COMM","COMR","ENCR","EQUA","ETCO","GEOB","GRID","IPLS","LINK" DATA "MCDI","MLLT","OWNE","PRIV","PCNT","POPM","POSS","RBUF","RVAD","RVRB","SYLT" DATA "SYTC","TALB","TBPM","TCOM","TCON","TCOP","TDAT","TDLY","TENC","TEXT","TFLT" DATA "TIME","TIT1","TIT2","TIT3","TKEY","TLAN","TLEN","TMED","TOAL","TOFN","TOLY" DATA "TOPE","TORY","TOWN","TPE1","TPE2","TPE3","TPE4","TPOS","TPUB","TRCK","TRDA" DATA "TRSN","TRSO","TSIZ","TSRC","TSSE","TYER","TXXX","UFID","USER","USLT","WCOM" DATA "WCOP","WOAF","WOAR","WOAS","WORS","WPAY","WPUB","WXXX" ' nouveaux tags (v2.4): DATA "ASPI","EQU2","TMCL","TIPL","RVA2","TDRC","TDOR","SEEK","SIGN","TDEN","TDRL" DATA "TDTG","TMCL","TMOO","TPRO","TSOA","TSOP","TSOT","TSST" ' Ajouts DATA "APETAGEX","Xing","VBRI" DATA "F" Pour donner une idée, un fichier nettoyer de ses tags peut s' alléger considérablement selon qu' il contienne la pochette de l' album ou pas. Je suis arrivé à gagner un peu plus de 500 ko sur un fichier. Je vous laisse imaginer sur plusieurs dizaines... | |
| | | Yannick
Nombre de messages : 8635 Age : 53 Localisation : Bretagne Date d'inscription : 15/02/2010
| Sujet: re Lun 20 Oct 2014 - 1:28 | |
| Voilà la suite de ma plongée dans le monde du mp3. (tiens, je n' ai plus les smileys "????" ) Ce programme permet de virer tous les tags des fichiers *.mp3 d' un dossier. Il permet de renommer un fichier voir de récupérer la pochette si elle est incluse. bref On charge le dossier, on renomme qui on veut, on récupère une pochette si elle existe, puis on lance par "Clean" et le monsieur fait le boulot...lol! A noter que je n' en serai pas arriver là sans l' aide de JL35 sur un autre post dédié au mp3 et que je me suis servis de la dll de klaus pour une question de rapidité car tout est faisable en panoramic pur. ( adresse à modifier de la dll en ligne 779 ) - Code:
-
Variables() Labels() Gui() Init_Pluggins() Create_Liste_Tag() dll_on kgf$ End
Sub Variables() dim Appli$ Appli$="Mp3 Serial Cleaner" dim Clic%,Change% dim no%,MM%,SM%(30) dim fr1%,fr2% dim E_Fic%,c_id2%,c_id1%,c_apic%,c_ape%,c_audio%,P_CCD% dim B_RecPoch%,B_Rename% dim G_Liste% dim SB%,PB%,AB% dim Liste_tag$,Path$,Nbr%,opt%(4) End_sub
Sub Labels() Label Clic,Change,erreur on_error_goto erreur End_sub
Clic: Clic%=Number_click if clic%=SM%(5): Ouvrir() :End_if if clic%=SM%(6): Clean(G_Liste%) :End_if if clic%=SM%(8): Quitter():End_if if clic%=SM%(9) if Opt%(1)=0 Opt%(1)=1 mark_on SM%(9) else Opt%(1)=0 mark_off SM%(9) end_if end_if if clic%=SM%(10) if Opt%(2)=0 Opt%(2)=1 mark_on SM%(10) else Opt%(2)=0 mark_off SM%(10) end_if end_if
if clic%=SM%(11) if Opt%(3)=0 Opt%(3)=1 mark_on SM%(11) else Opt%(3)=0 mark_off SM%(11) end_if end_if
if clic%=SM%(12) if Opt%(4)=0 Opt%(4)=1 mark_on SM%(12) else Opt%(4)=0 mark_off SM%(12) end_if end_if if clic%=G_Liste% : Select_grid(G_Liste%) : end_if if clic%=B_RecPoch% : RecupPochette() : end_if if clic%=B_Rename% : Rename_file(G_Liste%) : end_if return
erreur: exit_sub return
Change: Change%=Number_change return ' ****************************************************************************** ' INTERFACE ' ****************************************************************************** Sub Gui() O_form(0,0,1,0,0,500,980,Appli$) Menu() Frame1() Frame2() Barre_de_statut() End_sub ' - MENU Sub Menu() 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%(5)=no% O_Sub_menu(no%,SM%(1),"Ouvrir",1,1) no%=no%+1 : SM%(6)=no% O_Sub_menu(no%,SM%(1),"Clean",1,0) no%=no%+1 : SM%(7)=no% O_Sub_menu(no%,SM%(1),"-",1,1) no%=no%+1 : SM%(8)=no% O_Sub_menu(no%,SM%(1),"Quitter",1,1) no%=no%+1 : SM%(2)=no% O_Sub_menu(no%,MM%,"Options",1,1) :inactive no% no%=no%+1 : SM%(9)=no% O_Sub_menu(no%,SM%(2),"id3v2",1,1) no%=no%+1 : SM%(10)=no% O_Sub_menu(no%,SM%(2),"APE",1,1) no%=no%+1 : SM%(11)=no% O_Sub_menu(no%,SM%(2),"id3v1",1,1) no%=no%+1 : SM%(12)=no% O_Sub_menu(no%,SM%(2),"All",1,1) no%=no%+1 : SM%(3)=no% O_Sub_menu(no%,MM%,"A Propos...",1,1) no%=no%+1 : SM%(4)=no% O_Sub_menu(no%,MM%,"Aide",1,1) End_sub ' - FRAME DETAILS -------------------------------------------------------------- Sub Frame1() no%=no%+1 : Fr1%=no% O_Panel(no%,0,1,0,0,height(0)-80,300) no%=no%+1 O_Alpha(no%,fr1%,1,10,10,0,0,"Fichier :") Font_name no%,"arial" no%=no%+1 : E_Fic%=no% O_Edit(no%,fr1%,1,25,10,0,width(fr1%)-20,"",0) font_name no%,"Times new roman" : font_size no%,10 :font_color no%,0,0,200 no%=no%+1 : c_id2%=no% O_check(no%,Fr1%,1,60,10,0,0,"id3v2 dont ") font_name no%,"Times new roman": font_size no%,10 :inactive no% no%=no%+1 : c_apic%=no% O_check(no%,Fr1%,1,60,110,0,0,"APIC") font_name no%,"Times new roman": font_size no%,10 :inactive no% no%=no%+1 : c_audio%=no% O_check(no%,Fr1%,1,90,10,0,0,"Audio") font_name no%,"Times new roman": font_size no%,10 :inactive no% no%=no%+1 : c_ape%=no% O_check(no%,Fr1%,1,120,10,0,0,"APE") font_name no%,"Times new roman": font_size no%,10 :inactive no% no%=no%+1 : c_id1%=no% O_check(no%,Fr1%,1,150,10,0,0,"id3v1") font_name no%,"Times new roman": font_size no%,10 :inactive no% no%=no%+1 : P_ccd%=no% O_Picture(no%,fr1%,1,180,(width(fr1%)-200)/2,200,200,"") Color no%,100,100,100 no%=no%+1 : B_RecPoch%=no% O_Button(no%,fr1%,1,390,width(fr1%)-210,0,100,"Récup Pochette",1) font_name no%,"arial" : inactive no% no%=no%+1 : B_Rename%=no% O_Button(no%,fr1%,1,390,width(fr1%)-105,0,100,"Renommer",1) font_name no%,"arial" End_sub ' - FRAME LISTE ---------------------------------------------------------------- Sub Frame2() no%=no%+1 : Fr2%=no% O_Panel(no%,0,1,0,width(fr1%),height(0)-80,width(0)-(width(fr1%)+16)) no%=no%+1 : G_Liste%=no% Grid no% : Parent no%,fr2% top no%,5 : left no%,5 height no%,height(fr2%)-10 : width no%,width(fr2%)-10 font_name no%,"arial" on_click no%,clic Nbr%=2 Grid_row no%,2 Grid_row_height no%,20 Grid_Column no%,7 Grid_One_Column_width no%,1,20 Grid_One_Column_width no%,2,350 Grid_One_Column_width no%,3,50 Grid_One_Column_width no%,4,50 Grid_One_Column_width no%,5,50 Grid_One_Column_width no%,6,50 Grid_One_Column_width no%,7,50 Grid_write no%,1,2,"Fichier" Grid_write no%,1,3,"id3v2" Grid_write no%,1,4,"APIC" Grid_write no%,1,5,"Audio" Grid_write no%,1,6,"APE" Grid_write no%,1,7,"id3v1" End_sub ' - SATUT BAR ------------------------------------------------------------------ Sub Barre_de_statut() no%=no%+1 : SB%=no% O_Statut_Bar(no%,0,1,1) no%=no%+1 : AB%=no% O_Alpha(no%,0,1,height(0)-78,5,0,0,"") font_name no%,"Times new roman" : font_size no%,10 : font_color no%,100,100,100 no%=no%+1 : PB%=no% O_Progress_bar(no%,0,0,height(0)-78,width(0)-200,0,150) 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$ ="P:\Dlls\KGF.dll" ' bdr$ ="P:\Dlls\BDR.dll" ' ytb$ ="P:\Pluggins\YOUTUB~1.EXE" ' ffmpeg$ ="P:\Pluggins\ffmpeg.exe" ' ffprobe$ ="P:\Pluggins\ffprobe.exe" ' ffplay$ ="P:\Pluggins\ffplay.exe" ' z7$ ="P:\Pluggins\7z.exe" ' jhead$ ="P:\Pluggins\jhead.exe" ' nconv$ ="P:\Pluggins\nconvert.exe" ' pdfdetach$ ="P:\Pluggins\PDFDET~1.EXE" ' pdffont$ ="P:\Pluggins\pdffonts.exe" ' pdfimg$ ="P:\Pluggins\PDFIMA~1.EXE" ' pdfinfo$ ="P:\Pluggins\pdfinfo.exe" ' pdfhtml$ ="P:\Pluggins\PDFTOH~1.EXE" ' pdfpng$ ="P:\Pluggins\pdftopng.exe" ' pdfppm$ ="P:\Pluggins\pdftoppm.exe" ' pdftop$ ="P:\Pluggins\pdftops.exe" ' pdftext$ ="P:\Pluggins\PDFTOT~1.EXE" End_sub
Sub Ouvrir() dim_local res%,racine$,dossier$,f$,PresApic% Init_Interface(G_Liste%) inactive SM%(1):inactive SM%(3):inactive SM%(4):inactive SM%(5) racine$ =":" dossier$=String$(255," ") res% = DLL_call4("FolderSelect",adr(racine$),adr(dossier$),len(dossier$),0) dossier$= trim$(dossier$) if Dossier$<>"" Path$=dossier$+"" Caption AB%,"Listage et Analyse des fichiers..." dir_change dossier$ f$=file_find_first$ f$=file_find_next$ while f$<>"_" if upper$(right$(f$,4))=".MP3" f$=file_extract_name$(f$) Nbr%=Nbr%+1 Grid_row_insert G_Liste%,Nbr% Grid_write G_Liste%,NbR%-1,2,f$ Search_id3v2(f$) if id3v2%<>0 : Grid_write G_Liste%,NBR%-1,3,"Yes" :end_if Search_APIC(f$) Search_Audio(f$) if audio%<>0 if apic%<>0 and apic%<audio% Grid_write G_Liste%,NBR%-1,4,"Yes" PresApic%=1 end_if Grid_write G_Liste%,NBR%-1,5,"Yes" end_if Search_ape(f$) if ape%<>0 : Grid_write G_Liste%,NBR%-1,6,"Yes" :end_if Search_id3v1(f$) if id3v1%<>0 : Grid_write G_Liste%,NBR%-1,7,"Yes" :end_if Caption 0,Appli$+" ["+Path$+" ] [ "+str$(Nbr%-2)+" fichier(s)]" end_if f$=file_find_next$ end_while file_find_close Caption AB%,"" end_if if dir_exists(Path$+"Pochettes_CD")=0 : dir_make Path$+"Pochettes_CD":end_if active SM%(1):active SM%(3):active SM%(4):active SM%(5) active SM%(6) If PresAPic%=1 Message "Certains fichiers ont contiennent des images."+chr$(13)+"Si vous voulez les récupérer,"+chr$(13)+"pensez à le faire avant de lancer l' effacement des Tags !" end_if End_sub
Sub Init_Interface(G%) dim_local x%,y% if nbr% >2 for y%=3 to nbr% grid_row_delete G%,3 next y% nbr%=2 for x%=1 to 7 grid_write G%,2,x%,"" next x% end_if text E_fic%,"" mark_off c_id2% :mark_off c_apic% :mark_off c_audio% :mark_off c_ape% :mark_off c_id1% mark_off SM%(9):mark_off SM%(10):mark_off SM%(11):mark_off SM%(12) opt%(1)=0 : opt%(2)=0 : opt%(3)=0 : opt%(4)=0 inactive SM%(6) : Path$="" End_sub
Sub Search_id3v2(f$) dim_local pattern$,nom$ if variable("id3v2%")=0 then dim id3v2% id3v2%=0 nom$=f$ pattern$="ID3" id3v2% = dll_call3("SearchPatternInBinaryFile",adr(nom$),adr(pattern$),0) if id3v2%>3 : id3v2%=0 : end_if End_sub
Sub Search_APIC(f$) dim_local pattern$,nom$ if variable("apic%")=0 then dim apic% apic%=0 nom$=f$ pattern$="APIC" apic% = dll_call3("SearchPatternInBinaryFile",adr(nom$),adr(pattern$),0) End_sub
Sub Search_Audio(f$) dim_local pattern$,nom$ if variable("audio%")=0 then dim audio% audio%=0 nom$=f$ pattern$=chr$(255)+chr$(251) audio% = dll_call3("SearchPatternInBinaryFile",adr(nom$),adr(pattern$),0) End_sub
Sub Search_ape(f$) dim_local pattern$,nom$ if variable("ape%")=0 then dim ape% ape%=0 nom$=f$ pattern$="APETAGEX" ape% = dll_call3("SearchPatternInBinaryFile",adr(nom$),adr(pattern$),0) End_sub
Sub Search_id3v1(f$) dim_local nom$,tf%,v%,m$,x% if variable("id3v1%")=0 then dim id3v1% id3v1%=0 nom$=f$ no%=no%+1 filebin_open_read no%,nom$ tf%=filebin_size(no%) filebin_position no%,tf%-128 for x%=1 to 3 filebin_read no%,v% m$=m$+chr$(v%) next x% filebin_close no% no%=no%-1 if m$="TAG" : id3v1%=tf%-128 : end_if End_sub
Sub Select_grid(G%) dim_local r%,c%,t$ r%=grid_y_to_row(G%,mouse_y_position(G%)) if variable("R_sel%")=0 then dim R_sel% R_sel%=r% c%=grid_x_to_column(G%,mouse_x_position(G%)) t$=Grid_read$(G%,r%,2) if t$<>"" text E_fic%,t$ if Grid_read$(G%,r%,3)="Yes" : mark_on c_id2% : else : mark_off c_id2% : end_if if Grid_read$(G%,r%,4)="Yes" : mark_on c_apic% :active B_RecPoch% : else : mark_off c_apic% :inactive B_RecPoch% : end_if if Grid_read$(G%,r%,6)="Yes" : mark_on c_ape% : else : mark_off c_ape% : end_if if Grid_read$(G%,r%,7)="Yes" : mark_on c_id1% : else : mark_off c_id1% : end_if end_if End_sub
Sub RecupPochette() dim_local nom$,x%,PictR%,PictW%,Pict$,dep%,pattern$,fin%,v% nom$=Path$+text$(E_fic%) pict$=Path$+"Pochettes_CD"+text$(E_fic%) pict$=left$(pict$,len(pict$)-3)+"jpg" if file_exists(Pict$)=1 message "Cette pochette est déjà suvegardée"+chr$(13)+"Ou ce nom de fichier est déjà utilisé..." file_load p_ccd%,pict$ exit_sub end_if Caption AB%,"Extraction de la Pochette" Search_APIC(nom$) pattern$=chr$(255)+chr$(216) dep% = dll_call3("SearchPatternInBinaryFile",adr(nom$),adr(pattern$),apic%+2) if dep%<>0 pattern$=chr$(255)+chr$(217) fin% = dll_call3("SearchPatternInBinaryFile",adr(nom$),adr(pattern$),dep%) no%=no%+1 :PictR%=no% no%=no%+1 :PictW%=no% filebin_open_read PictR%,Nom$ filebin_open_write PictW%,Pict$ filebin_position PictR%,dep%-1 min PB%,0 : max PB%,(fin%+1)-(dep%-1) : position PB%,0 show PB% for x%=dep%-1 to fin%+1 position PB%,position(PB%)+1 display filebin_position PictR%,x% filebin_read PictR%,v% filebin_write PictW%,v% next x% filebin_close PictR% filebin_close PictW% no%=no%-2 Position PB%,0 Caption AB%,"" hide PB% file_load P_ccd%,Pict$ stretch_on p_ccd% else message "L' image n' est pas au format *.jpg !!!..." exit_sub end_if End_sub
Sub Clean(G%) dim_local x%,file$,file2$,dep%,fin%,v%,buf$,res% inactive SM%(1): inactive SM%(2) :inactive SM%(3):inactive SM%(4) inactive fr1% Min PB%,0 :Max PB%,Nbr%-2 : Position PB%,0 show PB% for x%=2 to Nbr%-1 file$=Path$+Grid_read$(G%,x%,2) file2$=Path$+"Temp" fin%=0 buf$="" Search_audio(file$) dep%=audio% Search_APE(file$) Search_id3v1(file$) if ape%<>0 fin%=ape% else if id3v1%<>0 fin%=id3v1% end_if end_if if fin%=0 fin%=dll_call1("GetBinaryFileSize",adr(file$)) end_if v%=(fin%-dep%)+1 buf$=string$(v%," ") res% = dll_call1("OpenBinaryFile",adr(file$)) res% = dll_call4("ReadBlockFromBinaryFileToString",adr(file$),v%,dep%,adr(buf$)) res% = dll_call1("CloseBinaryFile",adr(file$)) pause 50 res% = dll_call2("WriteStringToBinaryFile",adr(file2$),adr(buf$)) Grid_write G%,x%,3,"" :pause 50 Grid_write G%,x%,4,"" :pause 50 Grid_write G%,x%,6,"" :pause 50 Grid_write G%,x%,7,"" :pause 50 Position PB%,Position(PB%)+1 pause 100 file_delete file$ file_rename file2$,file$ pause 100 next x% active SM%(1): active SM%(2) :active SM%(3):active SM%(4) active fr1% Position PB%,0 : hide PB% End_sub
Sub Rename_file(G%) dim_local file$,file2$ file$=Path$+Grid_read$(G%,R_sel%,2) file2$=Path$+text$(E_fic%) if upper$(right$(file2$,3))<>"MP3" : file2$=file2$+".mp3" : end_if if file_exists(file2$)=0 file_rename file$,file2$ else message "Fichier existant !" end_if Grid_write G%,R_sel%,2,file_extract_name$(file2$) End_sub
Sub Quitter() Terminate End_sub
Sub Create_Liste_Tag() dim_local a$ restore while a$<>"TAG" : read a$ :end_while while a$<>"F" : read a$ : Liste_tag$=Liste_tag$+a$+"," :end_while End_sub DATA "TAG" DATA "AENC","APIC","COMM","COMR","ENCR","EQUA","ETCO","GEOB","GRID","IPLS","LINK" DATA "MCDI","MLLT","OWNE","PRIV","PCNT","POPM","POSS","RBUF","RVAD","RVRB","SYLT" DATA "SYTC","TALB","TBPM","TCOM","TCON","TCOP","TDAT","TDLY","TENC","TEXT","TFLT" DATA "TIME","TIT1","TIT2","TIT3","TKEY","TLAN","TLEN","TMED","TOAL","TOFN","TOLY" DATA "TOPE","TORY","TOWN","TPE1","TPE2","TPE3","TPE4","TPOS","TPUB","TRCK","TRDA" DATA "TRSN","TRSO","TSIZ","TSRC","TSSE","TYER","TXXX","UFID","USER","USLT","WCOM" DATA "WCOP","WOAF","WOAR","WOAS","WORS","WPAY","WPUB","WXXX" ' nouveaux tags (v2.4): DATA "ASPI","EQU2","TMCL","TIPL","RVA2","TDRC","TDOR","SEEK","SIGN","TDEN","TDRL" DATA "TDTG","TMCL","TMOO","TPRO","TSOA","TSOP","TSOT","TSST" DATA "F"
Pour vous donner une idée, j' ai traité 1232 fichiers dont des concerts complets en moins de 30 minutes. | |
| | | | Mp3 Cleaner | |
|
| Permission de ce forum: | Vous ne pouvez pas répondre aux sujets dans ce forum
| |
| |
| |