Mai 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 | 31 | | | Calendrier |
|
| | tag mp3 | |
| | |
Auteur | Message |
---|
JL35
Nombre de messages : 7095 Localisation : 77 Date d'inscription : 29/11/2007
| Sujet: Re: tag mp3 Dim 28 Sep 2014 - 23:05 | |
| Euh... le genre est bien différent en fonction des morceaux, rock, classique, chanson, etc. etc., chaque genre est représenté par une valeur sur un octet et c'est cette valeur qui est en dernière position et qu'il faut bien traduire en clair (éventuellement).
Et ton match n'est pas fini... | |
| | | Yannick
Nombre de messages : 8611 Age : 53 Localisation : Bretagne Date d'inscription : 15/02/2010
| Sujet: re Lun 29 Sep 2014 - 1:02 | |
| @JL35, Je suis bien d' accord avec toi. Ce sont les valeurs attribuées à chaque genre qui ne diffèrent pas selon les normes de tags mais plutôt entre les lecteurs. - genres :
0. Blues 1. Classic Rock 2. Country 3. Dance 4. Disco 5. Funk 6. Grunge 7. Hip-Hop 8. Jazz 9. Metal 10. New Age 11. Oldies 12. Other 13. Pop 14. R&B 15. Rap 16. Reggae 17. Rock 18. Techno 19. Industrial 20. Alternative 21. Ska 22. Death Metal 23. Pranks 24. Soundtrack 25. Euro-Techno 26. Ambient 27. Trip-Hop 28. Vocal 29. Jazz+Funk 30. Fusion 31. Trance 32. Classical 33. Instrumental 34. Acid 35. House 36. Game 37. Sound Clip 38. Gospel 39. Noise 40. AlternRock 41. Bass 42. Soul 43. Punk 44. Space 45. Meditative 46. Instrumental Pop 47. Instrumental Rock 48. Ethnic 49. Gothic 50. Darkwave 51. Techno-Industrial 52. Electronic 53. Pop-Folk 54. Eurodance 55. Dream 56. Southern Rock 57. Comedy 58. Cult 59. Gangsta 60. Top 40 61. Christian Rap 62. Pop/Funk 63. Jungle 64. Native American 65. Cabaret 66. New Wave 67. Psychadelic 68. Rave 69. Showtunes 70. Trailer 71. Lo-Fi 72. Tribal 73. Acid Punk 74. Acid Jazz 75. Polka 76. Retro 77. Musical 78. Rock & Roll 79. Hard Rock
--- extensions en plus pour winamp ---
80. Folk 81. Folk-Rock 82. National Folk 83. Swing 84. Fast Fusion 85. Bebob 86. Latin 87. Revival 88. Celtic 89. Bluegrass 90. Avantgarde 91. Gothic Rock 92. Progressive Rock 93. Psychedelic Rock 94. Symphonic Rock 95. Slow Rock 96. Big Band 97. Chorus 98. Easy Listening 99. Acoustic 100. Humour 101. Speech 102. Chanson 103. Opera 104. Chamber Music 105. Sonata 106. Symphony 107. Booty Bass 108. Primus 109. Porn Groove 110. Satire 111. Slow Jam 112. Club 113. Tango 114. Samba 115. Folklore 116. Ballad 117. Power Ballad 118. Rhythmic Soul 119. Freestyle 120. Duet 121. Punk Rock 122. Drum Solo 123. A capella 124. Euro-House 125. Dance Hall
Bon j' expose ici comment je compte m' y prendre : 1/ definir le nombre d' octets dédiés aux tags en trouvant le séparateur 2/ placer ces octets dans une variable $ 3/ placer les octets restants dans une autre variable $ 4/ faire un tableau à deux dimensions colonne 1 les marqueurs, colonne 2 la valeur $ du marqueur 5/ Remplir la colonne 2 du tableau grâce à une boucle ( à définir ) Pour le reste, j' attendrai de voir déjà les résultats de cette première partie... | |
| | | JL35
Nombre de messages : 7095 Localisation : 77 Date d'inscription : 29/11/2007
| Sujet: Re: tag mp3 Lun 29 Sep 2014 - 13:11 | |
| En fait, finalement, je ne sais pas trop ce que tu cherches à faire... Dans mon idée, c'était uniquement lire/créer/modifier éventuellement les tags ID3v1 d'un mp3, c'est à dire ceux toujours situés dans les 128 derniers octets du fichier: - titre - interprète - album - année - commentaire - genre et ça c'est très facile à faire en panoramic pur.
Mais peut-être veux-tu pouvoir aussi modifier les tags ID3v2, qui eux sont en tête du fichier, et ça c'est plus compliqué... | |
| | | Yannick
Nombre de messages : 8611 Age : 53 Localisation : Bretagne Date d'inscription : 15/02/2010
| Sujet: re Lun 29 Sep 2014 - 17:10 | |
| Je veux exactement faire celà JL35. Mais sur les id3v2.3 en entête qui sont ceux pris en compte par les lecteurs les plus récents. Si tu regardes bien les tables sur wikipedia, c' est l' inverse. id3v2.3 est à la fin et id3v1 ou 1.1 sont en en-tête. | |
| | | JL35
Nombre de messages : 7095 Localisation : 77 Date d'inscription : 29/11/2007
| Sujet: Re: tag mp3 Lun 29 Sep 2014 - 17:21 | |
| Là tu remets en doute mes certitudes, il me semblait avoir lu sur wipedia justement que id3v1 était toujours en fin (128 octets), pour garder la compatibilité avec les anciens fichiers (ce qui parait normal), et id3v2 en tête, de longueur variable. - Citation :
- ID3v2
Les limitations de l'ID3v1, aussi bien dans la variété des informations que dans la taille de chacune des étiquettes, incitèrent plusieurs développeurs à rechercher une solution plus souple. ID3v2 est donc une version apportant beaucoup de changements. Elle a ajouté un certain nombre de champs d'informations pour y intégrer les paroles et même des images. Contrairement à la version 1, les informations sont placées au début du fichier et la taille des tags ID3 est variable. ID3v2 supporte les caractères Unicode. on ne parle pas du déplacement des infos id3v1 en tête...? Maintenant que les lecteurs modernes se basent sur id3v2 je veux bien le croire. Mais pour afficher où ? sur un baladeur mp3 par exemple ? Et s'il n'y a pas d'infos ID3v2 dans le fichier, est-ce que les lecteurs, même modernes, ne vont pas les chercher dans ID3v1, si elles existent ? | |
| | | Yannick
Nombre de messages : 8611 Age : 53 Localisation : Bretagne Date d'inscription : 15/02/2010
| Sujet: re Lun 29 Sep 2014 - 18:41 | |
| | |
| | | JL35
Nombre de messages : 7095 Localisation : 77 Date d'inscription : 29/11/2007
| Sujet: Re: tag mp3 Lun 29 Sep 2014 - 20:45 | |
| Eh oui mon ami, tout est relatif !
Il y a même un octet supplémentaire en 126 qui est le numéro de la piste (?), et du coup le champ 'commentaire' ne fait plus que 28 octets au lieu de 30 (l'octet 125, séparateur, est à zéro). | |
| | | Yannick
Nombre de messages : 8611 Age : 53 Localisation : Bretagne Date d'inscription : 15/02/2010
| Sujet: re Lun 29 Sep 2014 - 21:40 | |
| Je commence à traiter les id3v1 et voilà ce que cela donne : - Mp3 Tagger:
- 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% dim PathFic$,Enrgt% Enrgt%=3 dim id3v1%(128),tf% End_sub Sub Labels() Label Clic,Change End_sub
Clic: Clic%=Number_click if clic%=SM%(4) :Ouvrir() :end_if if clic%=SM%(5) :Enregistrer(0) :end_if if clic%=SM%(7) :Quitter() :end_if 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 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 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 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 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 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 End_sub
Sub DefineGenre(G$) dim_local x% Genre$=G$ if Genre$="<Supprimer>" Genre%=126 Genre$="" else for x%=1 to 125 if TabGenre$(x%)=Genre$ Genre%=x% exit_for end_if next x% end_if End_sub
Sub Ouvrir() if Enrgt%=0 if message_warning_yes_no("Les tags n'ont pas été enregistrer !"+chr$(13)+"Vos changement ne seront pas pris en compte."+chr$(13)+"Souhaitez vous quitter l' application ?...")=1 Enregistrer(1) else OpenFile() end_if else OpenFile() end_if End_sub
Sub OpenFile() dim_local dd$ Enrgt%=0 text objurl%,"" text ObjTitre%,"" text ObjArtist%,"" text ObjAlbum%,"" text ObjYear%,"" text ObjCom%,"" text ObjTrack%,"" text ObjGenre%,"" if PathFic$="" dd$="C:\" else dd$=PathFic$ end_if no%=no%+1 O_Open_dialog(no%,0,dd$,"*.mp3|*.mp3",5) text objUrl%,file_extract_name$(file$) PathFic$=file_extract_path$(file$) no%=no%-1 if file$<>"" detectId3() end_if End_sub
Sub DetectId3() dim_local x%,t$ no%=no%+1 filebin_open_read no%,file$ tf%=filebin_size(no%) filebin_position no%,tf%-128 filebin_block_read no%,128,id3v1%(0) if chr$(id3v1%(0))+chr$(id3v1%(1))+chr$(id3v1%(2))="TAG" Caption 0,"Mp3 Tagger (id3v1 detected)" ' recup du titre t$="" for x%=3 to 32:t$=t$+chr$(id3v1%(x%)):next x% :text objtitre%,t$ :title$=t$ ' recup de l'artiste t$="" for x%=33 to 62:t$=t$+chr$(id3v1%(x%)):next x% :text objartist%,t$ :artist$=t$ ' recup de l' album t$="" for x%=63 to 92:t$=t$+chr$(id3v1%(x%)):next x% :text objalbum%,t$ :album$=t$ ' recup de l' année t$="" for x%=93 to 96:t$=t$+chr$(id3v1%(x%)):next x% :text objyear%,t$ :year$=t$ ' recup de du commentaire t$="" for x%=97 to 125:t$=t$+chr$(id3v1%(x%)):next x% :text objcom%,t$ :com$=t$ ' recup de la piste t$="" t$=chr$(id3v1%(126)):text objtrack%,t$ :Track$=t$ ' recup du genre genre%=id3v1%(127) if genre%<125 genre$=tabgenre$(genre%) text objgenre%,genre$ end_if end_if filebin_close no% End_sub
Sub Enregistrer(mode%) dim_local x%,v%,i%,g$ ' initialisation du tableau binaire for x%=0 to 128 :id3v1%(x%)=0:next x% ' remplissage du tableau id3v1%(0)=asc("T") id3v1%(1)=asc("A") id3v1%(2)=asc("G") if title$<>"" i%=2 for x%=1 to len(title$) :v%=asc(mid$(title$,x%,1)) :i%=i%+1: id3v1%(i%)=v% :next x% end_if if artist$<>"" i%=32 for x%=1 to len(artist$):v%=asc(mid$(artist$,x%,1)):i%=i%+1: id3v1%(i%)=v% :next x% end_if if album$<>"" i%=62 for x%=1 to len(album$) :v%=asc(mid$(album$,x%,1)) :i%=i%+1: id3v1%(i%)=v% :next x% end_if if year$<>"" i%=92 for x%=1 to len(year$) :v%=asc(mid$(year$,x%,1)) :i%=i%+1 :id3v1%(i%)=v% :next x% end_if if com$<>"" i%=96 for x%=1 to len(com$) :v%=asc(mid$(com$,x%,1)) :i%=i%+1 :id3v1%(i%)=v% :next x% end_if if track$<>"" i%=124 for x%=1 to len(track$) :v%=asc(mid$(track$,x%,1)) :i%=i%+1 :id3v1%(i%)=v% :next x% end_if if genre$<>"" v%=asc(str$(genre%)): id3v1%(127)=v% end_if no%=no%+1 filebin_open_write no%,file$ filebin_position no%,tf%-128 filebin_block_write no%,128,id3v1%(0) filebin_close no% Enrgt%=1 Caption 0,"Tags id3v1 Enregistrés" wait 3000 Caption 0,"Mp3 Tagger (id3v1 detected)" if mode%=1 :OpenFile() :end_if End_sub
Sub Quitter() if Enrgt%=0 if message_warning_yes_no("Les tags n'ont pas été enregistrer !"+chr$(13)+"Vos changement ne seront pas pris en compte."+chr$(13)+"Souhaitez vous enregistrez vos modifications ?...")=1 Enregistrer(0) else Terminate end_if else Terminate end_if End_sub
Pour l' instant, je récupère seulement les tags en id3v1.
Dernière édition par ygeronimi le Mar 30 Sep 2014 - 0:16, édité 1 fois (Raison : Mise à jour du source Lecture/Edition) | |
| | | JL35
Nombre de messages : 7095 Localisation : 77 Date d'inscription : 29/11/2007
| Sujet: Re: tag mp3 Lun 29 Sep 2014 - 21:53 | |
| J'ai mis dans 'bavardages...' deux petites subs de lecture et modification des seuls tags id3v1... | |
| | | Yannick
Nombre de messages : 8611 Age : 53 Localisation : Bretagne Date d'inscription : 15/02/2010
| Sujet: re Mar 30 Sep 2014 - 0:19 | |
| J' ai mis mon source à jour dans le poste plus haut : Lecture des tags id3v1 Edition des tags id3v1 Je vais voir ce qui se passe pour les tags id3v2.3 maintenant... (...ne serait ce que pour récupérer la jaquette du disque ) | |
| | | JL35
Nombre de messages : 7095 Localisation : 77 Date d'inscription : 29/11/2007
| Sujet: Re: tag mp3 Mar 30 Sep 2014 - 14:01 | |
| Et là tu t'attaques à un morceau énorme, à mon avis. Si je regarde les spécifications: http://en.wikipedia.org/wiki/ID3 ... Il peut y avoir 83 types de champs, dont le total ne doit pas dépasser 256 M, un champ pouvant atteindre 16 M ! Évidemment, si ça peut contenir des images, mais sous quelle forme ? | |
| | | Yannick
Nombre de messages : 8611 Age : 53 Localisation : Bretagne Date d'inscription : 15/02/2010
| Sujet: Re Mar 30 Sep 2014 - 15:19 | |
| Je suis entrain de revoir mon interface qui est un peu trop minimaliste pour gérer les deux. Puis je verrai bien ce que je trouve et comment je vais gérer ces marqueurs... mais j' ai ma petite idée sauf que je n' ai toujours pas trouvé le séparateur de fin des tags... | |
| | | JL35
Nombre de messages : 7095 Localisation : 77 Date d'inscription : 29/11/2007
| Sujet: Re: tag mp3 Mar 30 Sep 2014 - 15:55 | |
| Je n'arrive même pas à trouver dans mes archives un mp3 qui ait des tags ID3v2... Pardon, si quand même, mais je cherchais une image de pochette et là y'en a pas. J'ai l'impression qu'il n'y a pas de séparateurs de champs, regarde sur un dump, la fin d'un champ c'est le champ suivant. Je vois dans l'ordre par exemple TSSE, TLEN, TCON (pardon ), TRCK, TLAN etc. etc. | |
| | | Yannick
Nombre de messages : 8611 Age : 53 Localisation : Bretagne Date d'inscription : 15/02/2010
| Sujet: re Mar 30 Sep 2014 - 21:27 | |
| @JL35, Tu utilise qui comme logiciel de dump ?... ca à l' air sympa. Pour la pochette, il te suffit d' en scanner une au format jpg et tu peu l' ajouter avec Windows média player. Enfin, en attendant qu' on est réussi à faire notre propre sauce... | |
| | | JL35
Nombre de messages : 7095 Localisation : 77 Date d'inscription : 29/11/2007
| Sujet: Re: tag mp3 Mar 30 Sep 2014 - 22:15 | |
| Bonsoir ygeronimi, toujours la tête dans le guidon ? 1) pour le dump, j'en ai fait un en panoramic mais finalement j'utilise surtout celui-ci, qui est bien pratique: Frhed, que tu dois pouvoir trouver ici: http://frhed.sourceforge.net/ (gratos évidemment). 2) j'ai trouvé plusieurs sites assez détaillés sur la structure des tags de l'en-tête, en particulier: http://id3.org/id3v2.4.0-frameset https://mail.gnome.org/archives/easytag-list/2013-March/msg00008.htmlet je m'intéresse surtout en ce moment à la balise APIC: image intégrée, pour l'extraire éventuellement. j'ai trouvé une série de fichiers mp3 de test, bien pratiques pour bricoler: http://homepage.hispeed.ch/joos/oliver/APIC-Test.zipet je crois que j'ai à peu près compris comment est insérée l'image et comment l'extraire. Pour le moment je peux le faire avec exiftool, mais je ne garantis pas que ça marche dans tous les cas (s'il y en a plusieurs ?): - Code:
-
SUB ExtImgMp3(f$,fr$) ' Extraction d'une image intégrée dans un mp3 f$, -> image résultante dans fr$ DIM_LOCAL exf$ exf$ = "C:\UTIL\exiftool.exe " EXECUTE_WAIT "CMD.exe /c "+exf$+" -picture -b "+f$+" > "+fr$ END_SUB mais on doit pouvoir le faire en panoramic pur. Quant à ajouter une image, ça je crois que c'est une autre paire de manches, ça me paraît très difficile. Pour extraire l'image en panoramic, je ne m'en sors pas avec tous ces champs de longueur variable, on ne sait pas où ça commence et où ça finit, pourtant je vois bien l'image dans le fichier, mais les délimiteurs sont plutôt flous, et pour la découper par programme... La nuit porte conseil dit-on... mais là j'ai des doutes ! | |
| | | Yannick
Nombre de messages : 8611 Age : 53 Localisation : Bretagne Date d'inscription : 15/02/2010
| Sujet: re Mer 1 Oct 2014 - 0:24 | |
| Pour ma part, j' ai refait mon interface pour être plus à l' aise avec la manipulation des fichiers etc... cela donne cela : - Mp3 Tagger vs 0.2:
- Code:
-
' ****************************************************************************** ' --- MAIN --- ' ******************************************************************************
Variables() Labels() InitGenre() Gui()
End
' ****************************************************************************** ' --- DECLARATION DES VARIABLES GLOBALES --- ' ******************************************************************************
Sub Variables() ' version dim version$ : version$="0.2" ' pluggins dim kgf$ : kgf$="C:\PROGRA~2\PANORA~1\Mes_Dlls\KGF\KGF.dll" dll_on kgf$ ' labels dim Clic%,Change% ' objets dim no% dim MM%,SM%(20) dim F1%,F2% dim A_Dir%,L_Fic% dim E_title%,E_artist%,E_album%,E_year%,E_com%,E_track%,C_genre%,B_Enrgt% dim SB%,PB%,AB% ' fonctions dim PathFile$,id3v1%(128),tf% dim TabGenre$(125) dim NbR%,SelectGridLine% dim Title$,Artist$,Album$,Year$,Com$,Track$,Genre$,Genre%,Piste% dim chgt%,file$ End_sub
' ****************************************************************************** ' --- DECLARATION DES LABELS --- ' ******************************************************************************
Sub Labels() Label Clic,Change End_sub
' ****************************************************************************** ' --- MENUS --- ' ******************************************************************************
Clic: Clic%=Number_click
if clic%=SM%(2) if chgt% >6 if message_warning_yes_no("Vous n' avez pas enregistrer vôtre travail !..."+chr$(13)+"Voulez vous enregistrer vos modifications ?")=1 Enrgt_id3v1() Enrgt_id3v2() Chgt%=0 Ouvrir() else Chgt%=0 Ouvrir() end_if else chgt%=0 Ouvrir() end_if End_if
if clic%=SM%(4) Quitter() End_if if clic%=B_Enrgt% Enrgt_id3v1() Enrgt_id3v2() Chgt%=0 End_if if clic%=L_fic% if chgt% >6 if message_warning_yes_no("Vous n' avez pas enregistrer vôtre travail !..."+chr$(13)+"Voulez vous enregistrer vos modifications ?")=1 Enrgt_id3v1() Enrgt_id3v2() Chgt%=0 SelectFile() else chgt%=0 SelectFile() end_if else chgt%=0 SelectFile() end_if End_if if clic%=C_Genre% chgt%=chgt%+1 SelectGenre() end_if return
Change: Change%=Number_change
if change%=E_Title% chgt%=chgt%+1 if len(text$(E_Title%))>30 Message "Espace limité à 30 caractères !" Text E_Title%,left$(text$(E_Title%),30) end_if Title$=text$(E_title%) end_if if change%=E_Artist% chgt%=chgt%+1 if len(text$(E_artist%))>30 Message "Espace limité à 30 caractères !" Text E_artist%,left$(text$(E_artist%),30) end_if Artist$=text$(E_Artist%) end_if if change%=E_Album% chgt%=chgt%+1 if len(text$(E_album%))>30 Message "Espace limité à 30 caractères !" Text E_album%,left$(text$(E_album%),30) end_if Album$=text$(E_Album%) end_if if change%=E_Year% chgt%=chgt%+1 if len(text$(E_year%))>4 Message "Espace limité à 4 caractères !" Text E_year%,left$(text$(E_year%),4) end_if Year$=text$(E_Year%) end_if if change%=E_Com% chgt%=chgt%+1 if len(text$(E_com%))>28 Message "Espace limité à 28 caractères !" Text E_com%,left$(text$(E_com%),28) end_if Com$=text$(E_Com%) end_if if change%=E_Track% chgt%=chgt%+1 Track$=text$(E_Track%) end_if return
' ****************************************************************************** ' --- INTERFACE UTILISATEUR --- ' ******************************************************************************
Sub Gui()
O_Form(0,0,1,0,0,500,1000,"Mp3 Tagger vs "+version$) font_name 0,"Times new roman"
' 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%(2)=no% O_Sub_menu(no%,SM%(1),"Ouvrir",1,1) no%=no%+1 : SM%(3)=no% O_Sub_menu(no%,SM%(1),"-",1,1) no%=no%+1 : SM%(4)=no% O_Sub_menu(no%,SM%(1),"Quitter",1,1) no%=no%+1 : SM%(5)=no% O_Sub_Menu(no%,MM%,"A Propos...",1,1) no%=no%+1 : SM%(6)=no% O_Sub_Menu(no%,MM%,"Aide",1,1)
' Frame 1 détail d'un fichier no%=no%+1 : F1%=no% O_Panel(no%,0,1,0,0,height(0)-80,width(0)/3)
no%=no%+1 O_Alpha(no%,F1%,1,5,5,0,0,"Titre :"): font_bold no% no%=no%+1 : E_title%=no% O_Edit(no%,F1%,1,20,5,0,width(f1%)-50,"",1)
no%=no%+1 O_Alpha(no%,F1%,1,45,5,0,0,"Interprète :"): font_bold no% no%=no%+1 :E_artist%=no% O_Edit(no%,F1%,1,60,5,0,width(f1%)-50,"",1)
no%=no%+1 O_Alpha(no%,F1%,1,85,5,0,0,"Album :"): font_bold no% no%=no%+1 :E_album%=no% O_Edit(no%,F1%,1,100,5,0,width(f1%)-50,"",1)
no%=no%+1 O_Alpha(no%,F1%,1,125,5,0,0,"Année :"): font_bold no% no%=no%+1 :E_year%=no% O_Edit(no%,F1%,1,140,5,0,60,"",1)
no%=no%+1 O_Alpha(no%,F1%,1,165,5,0,0,"Commentaire :"): font_bold no% no%=no%+1 :E_com%=no% O_Edit(no%,F1%,1,180,5,0,width(f1%)-50,"",1)
no%=no%+1 O_Alpha(no%,F1%,1,205,5,0,0,"Piste :"): font_bold no% no%=no%+1 :E_track%=no% O_Edit(no%,F1%,1,220,5,0,30,"",1)
no%=no%+1 O_Alpha(no%,F1%,1,245,5,0,0,"Genre :"): font_bold no% no%=no%+1 :C_genre%=no% O_Combo(no%,F1%,1,260,5,0,150,"",1) Remp_combo()
no%=no%+1 : B_Enrgt%=no% O_Button(no%,F1%,1,height(f1%)-30,width(f1%)-105,0,100,"Enregistrer",1) font_bold no%
' Frame 2 liste des fichiers d' un dossier no%=no%+1 : F2%=no% O_Panel(no%,0,1,0,width(F1%),height(0)-80,(width(0)*2/3)-16) no%=no%+1 : A_Dir%=no% O_Alpha(no%,F2%,1,5,10,0,0,"C:\..........") : font_bold no% : font_color no%,0,0,200 no%=no%+1 : L_Fic%=no% Grid no% Parent no%,F2% : top no%,20 : left no%,10 : height no%,height(F2%)-30 : width no%,width(F2%)-20 Grid_column no%,9 ' taille des colonnes Grid_one_column_width no%,1,30 Grid_one_column_width no%,2,150 Grid_one_column_width no%,3,150 Grid_one_column_width no%,4,150 Grid_one_column_width no%,5,150 Grid_one_column_width no%,6,50 Grid_one_column_width no%,7,150 Grid_one_column_width no%,8,50 Grid_one_column_width no%,9,100 ' entêtes de colonne Grid_write no%,1,2,"Fichier" Grid_write no%,1,3,"Titre" Grid_write no%,1,4,"Interprète" Grid_write no%,1,5,"Album" Grid_write no%,1,6,"Année" Grid_write no%,1,7,"Commentaire" Grid_write no%,1,8,"Piste" Grid_write no%,1,9,"Genre" ' lignes NbR%=2 Grid_row no%,NbR% Grid_row_height no%,20 On_click no%,clic ' Barre de statut no%=no%+1 : SB%=no% O_Statut_Bar(no%,0,1,1)
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
' ****************************************************************************** ' --- FONCTIONS --- ' ******************************************************************************
Sub InitGenre() dim_local x%,a$ restore while a$<>"Genres" : read a$ : end_while for x%=0 to 125 read a$ TabGenre$(x%)=a$ next x% Data "Genres","Blues","Classic Rock","Country","Dance","Disco","Funk","Grunge" Data "Hip-Hop","Jazz","Metal","New Age","Oldies","Other","Pop","R&B","Rap","Reggae" Data "Rock","Techno","Industrial","Alternative","Ska","Death Metal","Pranks" Data "Soundtrack","Euro-Techno","Ambient","Trip-Hop","Vocal","Jazz+Funk","Fusion" Data "Trance","Classical","Instrumental","Acid","House","Game","Sound Clip","Gospel" Data "Noise","AlternRock","Bass","Soul","Punk","Space","Meditative","Instrumental Pop" Data "Instrumental Rock","Ethnic","Gothic","Darkwave","Techno-Industrial","Electronic" Data "Pop-Folk","Eurodance","Dream","Southern Rock","Comedy","Cult","Gangsta","Top 40" Data "Christian Rap","Pop/Funk","Jungle","Native American","Cabaret","New Wave" Data "Psychadelic","Rave","Showtunes","Trailer","Lo-Fi","Tribal","Acid Punk","Acid Jazz" Data "Polka","Retro","Musical","Rock & Roll","Hard Rock" ' genres supplémentaires pour winamp Data "Folk","Folk-Rock","National Folk","Swing","Fast Fusion","Bebob","Latin" Data "Revival","Celtic","Bluegrass","Avantgarde","Gothic Rock","Progressive Rock" Data "Psychedelic Rock","Symphonic Rock","Slow Rock","Big Band","Chorus" Data "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" Data "Freestyle","Duet","Punk Rock","Drum Solo","A capella","Euro-House","Dance Hall" End_sub
Sub Remp_Combo() dim_local x% for x%=0 to 125 item_add C_Genre%,TabGenre$(x%) next x% End_sub
Sub Ouvrir() dim_local res%,racine$,dossier$,fic$,r%,t$,x%,t%,y% r%=2
' initialisation de l' interface if NbR% >2 for x%=3 to NbR% Grid_row_delete L_Fic%,3 for y%=2 to 9 : grid_write L_fic%,2,y%,"" :next y% next x% End_if text E_title%,"" text E_artist%,"" text E_album%,"" text E_year%,"" text E_com%,"" text E_track%,"" text C_genre%,"" ' Ouverture du dossier des mp3 dossier$=string$(255," ") res% = DLL_call4("FolderSelect",adr(Racine$),adr(dossier$),len(dossier$),0) dossier$=trim$(dossier$) ' detection des tags if dossier$<>"" PathFile$=dossier$ Caption A_dir%, PathFile$ dir_change PathFile$ fic$=file_find_first$ fic$=file_find_next$ while fic$<>"_" if file_extract_extension$(fic$)=".mp3" no%=no%+1 filebin_open_read no%,fic$ tf%=filebin_size(no%) filebin_position no%,tf%-128 filebin_block_read no%,128,id3v1%(0) if chr$(id3v1%(0))+chr$(id3v1%(1))+chr$(id3v1%(2))="TAG" grid_write L_Fic%,r%,2,file_extract_name$(fic$) t$="" for x%=3 to 32:t$=t$+chr$(id3v1%(x%)):next x% grid_write L_Fic%,r%,3,t$ t$="" for x%=33 to 62:t$=t$+chr$(id3v1%(x%)):next x% grid_write L_Fic%,r%,4,t$ t$="" for x%=63 to 92:t$=t$+chr$(id3v1%(x%)):next x% grid_write L_Fic%,r%,5,t$ t$="" for x%=93 to 96:t$=t$+chr$(id3v1%(x%)):next x% grid_write L_Fic%,r%,6,t$ t$="" for x%=97 to 125:t$=t$+chr$(id3v1%(x%)):next x% grid_write L_Fic%,r%,7,t$ t$="" piste%=id3v1%(126) t$=str$(piste%) grid_write L_Fic%,r%,8,t$ t$="" genre%=id3v1%(127) if genre%<125 t$=TabGenre$(genre%) grid_write L_Fic%,r%,9,t$ end_if r%=r%+1 NbR%=r% grid_row_insert L_Fic%,r% end_if filebin_close no% no%=no%-1 end_if fic$=file_find_next$ end_while file_find_close end_if End_sub
Sub SelectFile() dim_local L%,x% L%=grid_y_to_row(L_Fic%,mouse_y_position(L_fic%)) SelectGridLine%=L% File$ =PathFile$+""+grid_read$(L_fic%,L%,2) title$ =grid_read$(L_fic%,L%,3) : Text E_title%,title$ Artist$ =grid_read$(L_fic%,L%,4) : Text E_Artist%,Artist$ Album$ =grid_read$(L_fic%,L%,5) : Text E_Album%,Album$ Year$ =grid_read$(L_fic%,L%,6) : Text E_Year%,Year$ Com$ =grid_read$(L_fic%,L%,7) : Text E_Com%,Com$ Track$ =grid_read$(L_fic%,L%,8) : Text E_Track%,Track$ Genre$ =grid_read$(L_fic%,L%,9) : Text C_Genre%,Genre$ if Genre$<>"" for x%=0 to 125 if TabGenre$(x%)=Genre$ Genre%=x% exit_for end_if next x% end_if End_sub
Sub SelectGenre() dim_local x% Genre$=text$(C_Genre%) for x%=0 to 125 if Tabgenre$(x%)=Genre$ Genre%=x% exit_for end_if next x% End_sub
Sub Enrgt_id3v1() dim_local x%,v%,i%,g$,L% L%=SelectGridLine% ' initialisation du tableau binaire for x%=0 to 128 :id3v1%(x%)=0:next x% ' remplissage du tableau id3v1%(0)=asc("T") id3v1%(1)=asc("A") id3v1%(2)=asc("G") if title$<>"" i%=2 for x%=1 to len(title$) :v%=asc(mid$(title$,x%,1)) :i%=i%+1: id3v1%(i%)=v% :next x% grid_write L_fic%,L%,3,title$ end_if if artist$<>"" i%=32 for x%=1 to len(artist$):v%=asc(mid$(artist$,x%,1)):i%=i%+1: id3v1%(i%)=v% :next x% grid_write L_fic%,L%,4,artist$ end_if if album$<>"" i%=62 for x%=1 to len(album$) :v%=asc(mid$(album$,x%,1)) :i%=i%+1: id3v1%(i%)=v% :next x% grid_write L_fic%,L%,5,album$ end_if if year$<>"" i%=92 for x%=1 to len(year$) :v%=asc(mid$(year$,x%,1)) :i%=i%+1 :id3v1%(i%)=v% :next x% grid_write L_fic%,L%,6,year$ end_if if com$<>"" i%=96 for x%=1 to len(com$) :v%=asc(mid$(com$,x%,1)) :i%=i%+1 :id3v1%(i%)=v% :next x% grid_write L_fic%,L%,7,com$ end_if if track$<>"" piste%=val(track$) v%=asc(chr$(piste%)) id3v1%(126)=v% grid_write L_fic%,L%,8,track$ end_if if genre$<>"" v%=asc(chr$(genre%)) id3v1%(127)=v% grid_write L_fic%,L%,9,genre$ end_if no%=no%+1 filebin_open_write no%,file$ filebin_position no%,tf%-128 filebin_block_write no%,128,id3v1%(0) filebin_close no% no%=no%-1 End_sub
Sub Enrgt_id3v2() End_sub
Sub Quitter() Terminate End_sub
Je me sers de kgf pour la sélection des dossiers, cela est plus propre qu' un open_dialog. Maintenant, je vais faire de la lecture de tout ce que tu m' a posté...
Dernière édition par ygeronimi le Mer 1 Oct 2014 - 1:35, édité 1 fois (Raison : correction d' un bug - des noeuds entre str$ et chr$ lol!) | |
| | | JL35
Nombre de messages : 7095 Localisation : 77 Date d'inscription : 29/11/2007
| Sujet: Re: tag mp3 Mer 1 Oct 2014 - 11:41 | |
| ah ah ! donc il faut déjà une ressource externe... | |
| | | Yannick
Nombre de messages : 8611 Age : 53 Localisation : Bretagne Date d'inscription : 15/02/2010
| Sujet: re Mer 1 Oct 2014 - 13:09 | |
| @JL35, On peut remplacer par un open_dialog mais c' est cheloup de devoir sélectionner un fichier dans un dossier alors que l' on veut récupérer le nom du dossier.... As tu essayé ? le folderselect est plus adapté non ?... Mais je te le promets, dès que Jack nous sort la commande, je le remplace. | |
| | | JL35
Nombre de messages : 7095 Localisation : 77 Date d'inscription : 29/11/2007
| Sujet: Re: tag mp3 Mer 1 Oct 2014 - 13:29 | |
| Je sais bien, je suis souvent confronté à ça, obligé de cliquer un fichier pour sélectionner un dossier, dommage, mais je m'y suis habitué. C'est plus embêtant si le programme est destiné à d'autres, ça leur paraîtra moins évident. | |
| | | Klaus
Nombre de messages : 12295 Age : 74 Localisation : Ile de France Date d'inscription : 29/12/2009
| Sujet: Re: tag mp3 Mer 1 Oct 2014 - 13:39 | |
| En Panoramic pur, tu as aussi Dir_Dialog. Mais c'est beaucoup moins souple. Et de mémoire, tu ne peux pas créer de dossiers dans ce dialogue... | |
| | | JL35
Nombre de messages : 7095 Localisation : 77 Date d'inscription : 29/11/2007
| Sujet: Re: tag mp3 Mer 1 Oct 2014 - 14:15 | |
| Tiens, c'est vrai, je ne l'ai jamais utilisé celui-là, mais effectivement ça ne semble pas très pratique... on veut choisir un répertoire mais on ne veut pas forcément que ça devienne le répertoire courant. | |
| | | Yannick
Nombre de messages : 8611 Age : 53 Localisation : Bretagne Date d'inscription : 15/02/2010
| Sujet: re Mer 1 Oct 2014 - 14:54 | |
| Heu... je ne te suis pas trop là... Dans l' appel tu as un paramètre pour le répertoire de départ je l' ai mis sur "C:\" et chaque fois que tu cherches un dossier tu démarres depuis "C:\" tu peux choisir de mettre un fichier param pour sauvegarder un autre point de départ. Par exemple: "Ma Musique" si tout tes fichiers audio sont dans le même répertoire. | |
| | | JL35
Nombre de messages : 7095 Localisation : 77 Date d'inscription : 29/11/2007
| Sujet: Re: tag mp3 Mer 1 Oct 2014 - 15:12 | |
| D'après la doc, le Dir_Dialog sert à attribuer un répertoire à un objet panoramic.
Mon usage à moi est de demander à l'utilisateur dans quel répertoire chercher les objets à traiter. Par exemple l'utilisateur veut traiter les images d'un répertoire particulier, le programme demande à l'utilisateur quel est ce répertoire, et ensuite le programme liste les images de ce répertoire. Je ne vois pas bien comment faire ça avec Dir_Dialog.
Je répète, le programme ne sait pas du tout quel est ce répertoire, qui peut être n'importe où, une clé usb, une carte mémoire, etc. c'est l'utilisateur qui décide. | |
| | | Yannick
Nombre de messages : 8611 Age : 53 Localisation : Bretagne Date d'inscription : 15/02/2010
| Sujet: re Mer 1 Oct 2014 - 15:53 | |
| Ha... Ok !!... tu parlais du "opendialog"... je croyais que tu parlais de la dll.. Par open dialog, il faut sélectionner un fichier du dossier et en extraire le dossier, du moins son chemin par file_extract_path$ ( une pirouette ) mais pas très clean pour un utilisateur lambda qui va chercher à sélectionner un dossier et pas un fichier du dossier pour finir par ce dire qu' il y a un bug. c' est pour cela que j' utilise la dll de klaus qui est plus clean pour cela. il nous faudrait une commande Folder_dialog qui fasse ce que fait la fonction de la dll. | |
| | | Yannick
Nombre de messages : 8611 Age : 53 Localisation : Bretagne Date d'inscription : 15/02/2010
| Sujet: re Mer 1 Oct 2014 - 15:58 | |
| Je viens de lister les Marqueurs pour id3v2.3, la 2.4 n' est pas universelle pour les appareils, j' en ai compté 74 . | |
| | | Contenu sponsorisé
| Sujet: Re: tag mp3 | |
| |
| | | | tag mp3 | |
|
| Permission de ce forum: | Vous ne pouvez pas répondre aux sujets dans ce forum
| |
| |
| |