Avril 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 |
|
| | a l'aide klaus | |
| | |
Auteur | Message |
---|
pascal10000
Nombre de messages : 812 Localisation : Troyes Date d'inscription : 05/02/2011
| Sujet: a l'aide klaus Jeu 7 Déc 2017 - 17:55 | |
| bsr j'ai un erreur dans mon code
j'essai de manipuler une 2 eme dll en même que kgf
voici le code qui est la cause
*************************** Sub NiveauSon() ' RECUPERE LE NIVEAU ACTUEL DU SON FonctionWinmm$="waveOutGetVolume,"+Str$(0)+","+Str$(volume%) Res% = dll_call2("TargetDLL",hnd_dll%,adr(FonctionWinmm$)) Res% = dll_call3("CallDLL3",1,2,3) End_Sub
NiveauSon: GaucheVol%=position(5) If GaucheVol%<0 Then GaucheVol%=0 If GaucheVol%>65535 Then GaucheVol%=65535 FonctionWinmm$="waveOutSetVolume,"+Str$(0)+","+Str$(GaucheVol%) res% = dll_call2("TargetDLL",hnd_dll%,adr(FonctionWinmm$)) Res% = dll_call3("CallDLL3",1,2,3) ' <- signal de lérreur Return
****************************
sinon est ce bien codé? | |
| | | Klaus
Nombre de messages : 12274 Age : 74 Localisation : Ile de France Date d'inscription : 29/12/2009
| Sujet: Re: a l'aide klaus Jeu 7 Déc 2017 - 19:02 | |
| 1. Avant de pouvoir utiliser une autre DLL avec KGF.dll, il fait déclarer cette DLL (une seule fois): - Code:
-
dll$ = "Nom_et_chemin_de_la_DLL.dll" res% = dll_call1("LoadDLL",adr(dll$)) 2. Ensuite, tu dois déclarer la fonction que tu veux appeler, mais sans les paramètres: - Code:
-
FonctionWinmm$="waveOutGetVolume" Res% = dll_call2("TargetDLL",hnd_dll%,adr(FonctionWinmm$)) 3. Puis tu peux appeler cette fonction autant de fois que tu veux, jusqu'à ce que tu doives changer de fonction. Et là, tu passes les paramètres: - Code:
-
Res% = dll_call3("CallDLL3",1,2,3) dans cet exemple, les valeurs 1,2 et 3 représentent les paramètres qui seront passés à la fonction waveOutGetVolume. Je ne connais pas vraiment cette fonction, mais je doute que ce soient les valeurs correctes... 4. Pour appeler une autre fonction, repasser par la case (2). 5. Finalement, on déconnecte la DLL si elle n'est plus utile: - Code:
-
res% = dll_call1("UnLoadDLL",hnd_dll%%) Voilà. J'espère que ce sera plus clair comme ça... | |
| | | pascal10000
Nombre de messages : 812 Localisation : Troyes Date d'inscription : 05/02/2011
| Sujet: Re: a l'aide klaus Jeu 7 Déc 2017 - 19:24 | |
| trèd clair klaus mrc enfin jespére
FonctionWinmm$="waveOutGetVolume" Res% = dll_call2("TargetDLL",hnd_dll%,adr(FonctionWinmm$)) Res% = dll_call2("CallDLL2",0,volume%) c'est ce que j'ai compris.. | |
| | | Klaus
Nombre de messages : 12274 Age : 74 Localisation : Ile de France Date d'inscription : 29/12/2009
| Sujet: Re: a l'aide klaus Jeu 7 Déc 2017 - 21:07 | |
| C'est plus compliqué que ça. Voici ce que dit la doc de MSDN (MicroSoft): - Citation :
- Syntax
C++
MMRESULT waveOutGetVolume( HWAVEOUT hwo, LPDWORD pdwVolume );
Parameters
hwo
Handle to an open waveform-audio output device. This parameter can also be a device identifier. pdwVolume
Pointer to a variable to be filled with the current volume setting. The low-order word of this location contains the left-channel volume setting, and the high-order word contains the right-channel setting. A value of 0xFFFF represents full volume, and a value of 0x0000 is silence.
If a device does not support both left and right volume control, the low-order word of the specified location contains the mono volume level.
The full 16-bit setting(s) set with the waveOutSetVolume function is returned, regardless of whether the device supports the full 16 bits of volume-level control.
J'ai mis le mot important en rouge gras. En fait, il faudrait faire: - Code:
-
dim FonctionWinmm, volume% FonctionWinmm$="waveOutGetVolume" Res% = dll_call2("TargetDLL",hnd_dll%,adr(FonctionWinmm$)) Res% = dll_call2("CallDLL2",0,adr(volume%)) Au retour, s'il n'y a pas d'erreur d'exécution, la variable volume% contient la valeur du vomume, selon le format hexa "RRRRLLLL". Donc, tu peux récupérer les deux valeurs de la manière suivante: - Code:
-
dim VouleLeft%, VolumeRight% VolumeLeft% = bin_and(volume%,hex("FFFF")) VolumeRight% = bin_and(volume%,hex("FFFF0000"))/65536 Bonne chance ! | |
| | | pascal10000
Nombre de messages : 812 Localisation : Troyes Date d'inscription : 05/02/2011
| Sujet: Re: a l'aide klaus Jeu 7 Déc 2017 - 23:19 | |
| ben je ne me suis pas trompé mon raisonnement était bon!! | |
| | | Klaus
Nombre de messages : 12274 Age : 74 Localisation : Ile de France Date d'inscription : 29/12/2009
| Sujet: Re: a l'aide klaus Jeu 7 Déc 2017 - 23:37 | |
| Oui, sauf pour le passage des paramètres... | |
| | | pascal10000
Nombre de messages : 812 Localisation : Troyes Date d'inscription : 05/02/2011
| Sujet: Re: a l'aide klaus Ven 8 Déc 2017 - 0:26 | |
| encore un probleme Erreur externe line 128 Violation d'acced à l'adresse 00000000 lecture de l'adresse 0000 - Code:
-
' / GESTIONS DU VOLUME / *********************************************************** NiveauSon: GaucheVol%=position(5) FonctionWinmm$="waveOutSetVolume," If GaucheVol%<0 Then GaucheVol%=0 If GaucheVol%>65535 Then GaucheVol%=65535
Res% = dll_call2("TargetDLL",hnd_dll%,adr(FonctionWinmm$)) Res% = dll_call2("CallDLL2",0,GaucheVol%) DroitVol%=position(5) If DroitVol%<0 Then DroitVol%=0 If DroitVol%>65535 Then DroitVol%=65535
Res% = dll_call2("TargetDLL",hnd_dll%,adr(FonctionWinmm$)) Res% = dll_call2("CallDLL2",0,GaucheVol%+DroitVol%) Return
Sub NiveauSon() ' RECUPERE LE NIVEAU ACTUEL DU SON FonctionWinmm$="waveOutGetVolume Res% = dll_call2("TargetDLL",hnd_dll%,adr(FonctionWinmm$)) Res% = dll_call2("CallDLL2",0,Volume%) : ' <--erreur de violation ici GaucheVol% = bin_and(volume%,hex("0000FFFF")) DroitVol% = bin_and(volume%,hex("FFFF0000"))/65536 End_Sub
************************************************************
sinon les deux canal de ma carte fonctionne comme je le voulais a ce post là voir ici https://panoramic.1fr1.net/t5540-carte-son#67469a l'exemple de papydall seul le cote gauche fonctionnait | |
| | | Klaus
Nombre de messages : 12274 Age : 74 Localisation : Ile de France Date d'inscription : 29/12/2009
| Sujet: Re: a l'aide klaus Ven 8 Déc 2017 - 0:39 | |
| | |
| | | pascal10000
Nombre de messages : 812 Localisation : Troyes Date d'inscription : 05/02/2011
| Sujet: Re: a l'aide klaus Ven 8 Déc 2017 - 0:56 | |
| l'erreur est à le sub NiveauSon() sinon je suivrait tes conseil mais a priori le source que jai fourni au poste carte son fonctionne | |
| | | Klaus
Nombre de messages : 12274 Age : 74 Localisation : Ile de France Date d'inscription : 29/12/2009
| Sujet: Re: a l'aide klaus Ven 8 Déc 2017 - 0:59 | |
| Bien, alors je recopie ici ceque j'ai mis dans l'autre post: - Code:
-
' / GESTIONS DU VOLUME / *********************************************************** dim TotalVol% NiveauSon: GaucheVol%=position(5) FonctionWinmm$="waveOutSetVolume," If GaucheVol%<0 Then GaucheVol%=0 If GaucheVol%>65535 Then GaucheVol%=65535
Res% = dll_call2("TargetDLL",hnd_dll%,adr(FonctionWinmm$)) Res% = dll_call2("CallDLL2",0,GaucheVol%) DroitVol%=position(5) If DroitVol%<0 Then DroitVol%=0 If DroitVol%>65535 Then DroitVol%=65535
' Il faut respecter le format de codage: ' RRRRLLLL en hexa, pas une simple addition ! TotalVol% = bin_or(GaucheVol%,DroitVol%*65536) ' la ligne suivante est unitile ici, car il s'agit le ma même fonction ! ' Res% = dll_call2("TargetDLL",hnd_dll%,adr(FonctionWinmm$)) ' il faut passer le second paramètre sous forme d'adresse, pas valeur ! Res% = dll_call2("CallDLL2",0,adr(TotalVol%)) Return
Sub NiveauSon() ' RECUPERE LE NIVEAU ACTUEL DU SON FonctionWinmm$="waveOutGetVolume Res% = dll_call2("TargetDLL",hnd_dll%,adr(FonctionWinmm$)) Res% = dll_call2("CallDLL2",0,Volume%) ' <--erreur de violation ici GaucheVol% = bin_and(volume%,hex("0000FFFF")) DroitVol% = bin_and(volume%,hex("FFFF0000"))/65536 End_Sub
************************************************************ Les explications sont dans les commentaires. | |
| | | pascal10000
Nombre de messages : 812 Localisation : Troyes Date d'inscription : 05/02/2011
| Sujet: Re: a l'aide klaus Ven 8 Déc 2017 - 1:02 | |
| bon puisque c'est ça je te donne le code complet - Code:
-
Dim Station$,url$,Frequence%,Q%,LeftD% ,res%,WB% Dim Volume%,GaucheVol%,DroitVol%,Min_Track5%,Max_Track5%,Hnd_Dll% Dim Winmm$,FonctionWinmm$
Label Choix,Plus,Moin,Lecture,Etein Label NiveauSon
Color 0,0,0,0 Height 0,180 Width 0,530 Caption 0,"Radio FM" Font_Size 0,10 Font_Bold 0 Font_Color 0,0,255,0 On_Close 0,Etein
' resize off form 0 If File_exists("D:\Programmation\Projet Panoramic\poste radio\form.dll")=1 Dll_On "D:\Programmation\Projet Panoramic\poste radio\form.dll" res% = DLL_CALL2("SetSize",HANDLE(0),0) Width 0,531 Dll_Off End_if
' création browser Dll_On "D:\Programmation\Projet Panoramic\poste radio\kgf.dll" WB% = dll_call1("WB_Create",Handle(0)) res% = dll_call5("WB_Locate",WB%,10,50,0,0) Winmm$="Winmm.Dll" Hnd_Dll% = dll_call1("LoadDLL",adr(Winmm$))
Alpha 1 Left 1,200
' liste des stations List 2 Top 2,40 Left 2,260 Height 2,80 Color 2,0,0,0 Font_Color 2,0,255,0 File_Load 2,"D:\Programmation\Projet Panoramic\poste radio\stations.txt" On_Click 2,Choix Alpha 3 Left 3,260 : Top 3,20 Caption 3,"Stations:"
Track_Bar 5 Left 5,20: Top 5,85 Width 5,222: Height 5,26 Min 5,0 :Max 5,65535 On_Change 5,NiveauSon Progress_Bar 6 Left 6,20: Top 6,120 Width 6,222: Height 6,10
' Tableau FREQUENCE Container 10 Caption 10,"FREQUENCE" Left 10,20 :Top 10,20 Width 10,200 : Height 10,52 Hide 10
LeftD%=-10 For Q%=11 to 16 LeftD%=LeftD%+30 DIGIT1 Q% Parent Q%,10 Top Q%,15 Width Q%,20 Height Q%,34 Left Q%,LeftD% Color Q%,0,255,0 Caption Q%,"" Next Q% Show 10
Button 20 Left 20,221 : Top 20,28 Width 20,21 : Height 20,21 Font_Size 20,16 Font_Bold 20 Caption 20,"+" On_Click 20,Plus
Button 30 Left 30,221 : Top 30,52 Width 30,21 : Height 30,21 Font_Size 30,20 Font_Bold 30 Caption 30,"-" On_Click 30,Moin
Frequence%=0 End
' selection des fréquences + ou - Plus: Set_Focus 10 Frequence%=Frequence%+1 If Frequence%=>42 Then Frequence%=1 Item_Select 2,Frequence% Gosub Choix Return
Moin: Set_Focus 10 Frequence%=Frequence%-1 If Frequence%=<0 Then Frequence%=42 Item_Select 2,Frequence% Gosub Choix Return
' selection des stations Choix: Caption 11,"" : Caption 12,"" : Caption 13,"" : Caption 14,"" : Caption 15,"" : Caption 16,""
If Clicked(2)=1 Then Frequence%=Item_Index(2) Select Frequence% Case 1 : Station$="France-Inter" Caption 13,"8" : Caption 14,"7" : Caption 15,"-" : Caption 16,"8" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/france-inter/" Case 2 : Station$="Générations" Caption 13,"8" : Caption 14,"8" : Caption 15,"-" : Caption 16,"2" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/generations/" Case 3 : Station$="Nostalgie" Caption 13,"9" : Caption 14,"0" : Caption 15,"-" : Caption 16,"4" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/nostalgie/" Case 4 : Station$="Chante-France" Caption 13,"9" : Caption 14,"0" : Caption 15,"-" : Caption 16,"9" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/chante-france/" Case 5 : Station$="Contact-Fm" Caption 13,"9" : Caption 14,"1" : Caption 15,"-" : Caption 16,"4" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/contact-fm/" Case 6 : Station$="Cherie-Fm" Caption 12,"9" : Caption 13,"1." : Caption 14,"7" : Caption 15,"-" : Caption 16,"1" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/cherie/" Case 7 : Station$="France-Musique" Caption 12,"9" : Caption 13,"2." : Caption 14,"0" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/france-musique/" Case 8 : Station$="France-culture" Caption 12,"9" : Caption 13,"3." : Caption 14,"5" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/france-culture/" Case 9 : Station$="Orient-Fm" Caption 12,"9" : Caption 13,"4." : Caption 14,"3" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/orient/" Case 10 : Station$="Galaxie FM France" Caption 12,"9" : Caption 13,"5." : Caption 14,"3" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/galaxie/" Case 11 : Station$="Puls Radio" Caption 12,"9" : Caption 13,"5." : Caption 14,"4" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/puls/" Case 12 : Station$="Jazz" Caption 12,"9" : Caption 13,"5." : Caption 14,"7" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/jazz/" Case 13 : Station$="Skyrock" Caption 12,"9" : Caption 13,"6." : Caption 14,"0" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/skyrock/" Case 14 : Station$="Voltage" Caption 12,"9" : Caption 13,"6." : Caption 14,"9" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/voltage/" Case 15 : Station$="Rire et chanson" Caption 12,"9" : Caption 13,"7." : Caption 14,"4" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/rire-et-chanson/" Case 16 : Station$="Metropolys" Caption 12,"9" : Caption 13,"7." : Caption 14,"6" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/metropolys/" Case 17 : Station$="FG DJ Radio" Caption 12,"9" : Caption 13,"8." : Caption 14,"2" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/fg-dj/" Case 18 : Station$="Vibration FM" Caption 12,"9" : Caption 13,"8." : Caption 14,"7" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/vibration/" Case 19 : Station$="Latina" Caption 12,"9" : Caption 13,"9." : Caption 14,"0" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/latina/" Case 20 : Station$="France Maghreb 2 France" Caption 12,"9" : Caption 13,"9." : Caption 14,"5" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/maghreb-2/" Case 21 : Station$="NRJ" Caption 11,"1" : Caption 12,"0" : Caption 13,"0." : Caption 14,"3" : Caption 15,"-" : Caption 16,"1" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/nrj-france/" Case 22 : Station$="Alouette France" Caption 11,"1" : Caption 12,"0" : Caption 13,"0." : Caption 14,"3" : Caption 15,"-" : Caption 16,"2" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/alouette/" Case 23 : Station$="Fun Radio" Caption 11,"1" : Caption 12,"0" : Caption 13,"1." : Caption 14,"9" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/fun/" Case 24 : Station$="Oui FM" Caption 11,"1" : Caption 12,"0" : Caption 13,"2." : Caption 14,"3" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="" Case 25 : Station$="MFM Radio France" Caption 11,"1" : Caption 12,"0" : Caption 13,"2." : Caption 14,"7" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/mfm/" Case 26 : Station$="Gold FM" Caption 11,"1" : Caption 12,"0" : Caption 13,"3." : Caption 14,"3" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/gold-fm/" Case 27 : Station$="Virgin" Caption 11,"1" : Caption 12,"0" : Caption 13,"3." : Caption 14,"5" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/virgin/" Case 28 : Station$="RFM" Caption 11,"1" : Caption 12,"0" : Caption 13,"3." : Caption 14,"9" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/rfm/" Case 29 : Station$="Hit West France" Caption 11,"1" : Caption 12,"0" : Caption 13,"4." : Caption 14,"1" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/hit-west/" Case 30 : Station$="RTL" Caption 11,"1" : Caption 12,"0" : Caption 13,"4." : Caption 14,"3" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/rtl/" Case 31 : Station$="Europe 1" Caption 11,"1" : Caption 12,"0" : Caption 13,"4." : Caption 14,"7" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/europe/" Case 32 : Station$="Radio FIP" Caption 11,"1" : Caption 12,"0" : Caption 13,"5." : Caption 14,"1" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/fip/" Case 33 : Station$="France-Info" Caption 11,"1" : Caption 12,"0" : Caption 13,"5." : Caption 14,"5" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/france-info/" Case 34 : Station$="RTL2" Caption 11,"1" : Caption 12,"0" : Caption 13,"5." : Caption 14,"9" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/rtl2/" Case 35 : Station$="Beur FM France" Caption 11,"1" : Caption 12,"0" : Caption 13,"6." : Caption 14,"7" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/beur/" Case 36 : Station$="France-Bleu" Caption 11,"1" : Caption 12,"0" : Caption 13,"7." : Caption 14,"1" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/france-bleu/" Case 37 : Station$="RFI France" Caption 11,"1" : Caption 12,"0" : Caption 13,"7." : Caption 14,"9" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/rfi/" Case 38 : Station$="Radio Meuh France" Caption 12,"9" : Caption 13,"9" : Caption 14,"9." : Caption 15,"0" : Caption 16,"1" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/meuh/" Case 39 : Station$="Enjoy Radio" Caption 12,"9" : Caption 13,"9" : Caption 14,"9." : Caption 15,"0" : Caption 16,"2" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/enjoy/" Case 40 : Station$="La Grosse Radio France" Caption 12,"9" : Caption 13,"9" : Caption 14,"9." : Caption 15,"0" : Caption 16,"3" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/la-grosse/" Case 41 : Station$="Africa-1-France" Caption 12,"9" : Caption 13,"9" : Caption 14,"9." : Caption 15,"0" : Caption 16,"4" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/africa-1-france/" Case 42 : Station$="Swigg Radio" Caption 12,"9" : Caption 13,"9" : Caption 14,"9." : Caption 15,"0" : Caption 16,"5" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/ado/" End_Select gosub Lecture Return
Lecture: res% = dll_call2("WB_Url",WB%,adr(url$)) NiveauSon() Return
' / GESTIONS DU VOLUME / *********************************************************** NiveauSon: GaucheVol%=position(5) FonctionWinmm$="waveOutSetVolume," If GaucheVol%<0 Then GaucheVol%=0 If GaucheVol%>65535 Then GaucheVol%=65535
Res% = dll_call2("TargetDLL",hnd_dll%,adr(FonctionWinmm$)) Res% = dll_call2("CallDLL2",0,GaucheVol%) DroitVol%=position(5) If DroitVol%<0 Then DroitVol%=0 If DroitVol%>65535 Then DroitVol%=65535
Res% = dll_call2("TargetDLL",hnd_dll%,adr(FonctionWinmm$)) Res% = dll_call2("CallDLL2",0,GaucheVol%+DroitVol%) Return
Sub NiveauSon() ' RECUPERE LE NIVEAU ACTUEL DU SON FonctionWinmm$="waveOutGetVolume Res% = dll_call2("TargetDLL",hnd_dll%,adr(FonctionWinmm$)) Res% = dll_call2("CallDLL2",0,adr(Volume%) : ' <--erreur de violation ici GaucheVol% = bin_and(volume%,hex("0000FFFF")) DroitVol% = bin_and(volume%,hex("FFFF0000"))/65536 End_Sub
************************************************************
Etein: res% = dll_call1("WB_Delete",WB%) res% = dll_call1("UnLoadDLL",Hnd_Dll%) Dll_Off Terminate Return | |
| | | Klaus
Nombre de messages : 12274 Age : 74 Localisation : Ile de France Date d'inscription : 29/12/2009
| Sujet: Re: a l'aide klaus Ven 8 Déc 2017 - 1:07 | |
| Et voici le code complet, avec ma correction et mes commentaires explicatifs: - Code:
-
Dim Station$,url$,Frequence%,Q%,LeftD% ,res%,WB% Dim Volume%,GaucheVol%,DroitVol%,Min_Track5%,Max_Track5%,Hnd_Dll% Dim Winmm$,FonctionWinmm$ dim TotalVol%
Label Choix,Plus,Moin,Lecture,Etein Label NiveauSon
Color 0,0,0,0 Height 0,180 Width 0,530 Caption 0,"Radio FM" Font_Size 0,10 Font_Bold 0 Font_Color 0,0,255,0 On_Close 0,Etein
' resize off form 0 If File_exists("D:\Programmation\Projet Panoramic\poste radio\form.dll")=1 Dll_On "D:\Programmation\Projet Panoramic\poste radio\form.dll" res% = DLL_CALL2("SetSize",HANDLE(0),0) Width 0,531 Dll_Off End_if
' création browser Dll_On "D:\Programmation\Projet Panoramic\poste radio\kgf.dll" WB% = dll_call1("WB_Create",Handle(0)) res% = dll_call5("WB_Locate",WB%,10,50,0,0) Winmm$="Winmm.Dll" Hnd_Dll% = dll_call1("LoadDLL",adr(Winmm$))
Alpha 1 Left 1,200
' liste des stations List 2 Top 2,40 Left 2,260 Height 2,80 Color 2,0,0,0 Font_Color 2,0,255,0 File_Load 2,"D:\Programmation\Projet Panoramic\poste radio\stations.txt" On_Click 2,Choix Alpha 3 Left 3,260 : Top 3,20 Caption 3,"Stations:"
Track_Bar 5 Left 5,20: Top 5,85 Width 5,222: Height 5,26 Min 5,0 :Max 5,65535 On_Change 5,NiveauSon Progress_Bar 6 Left 6,20: Top 6,120 Width 6,222: Height 6,10
' Tableau FREQUENCE Container 10 Caption 10,"FREQUENCE" Left 10,20 :Top 10,20 Width 10,200 : Height 10,52 Hide 10
LeftD%=-10 For Q%=11 to 16 LeftD%=LeftD%+30 DIGIT1 Q% Parent Q%,10 Top Q%,15 Width Q%,20 Height Q%,34 Left Q%,LeftD% Color Q%,0,255,0 Caption Q%,"" Next Q% Show 10
Button 20 Left 20,221 : Top 20,28 Width 20,21 : Height 20,21 Font_Size 20,16 Font_Bold 20 Caption 20,"+" On_Click 20,Plus
Button 30 Left 30,221 : Top 30,52 Width 30,21 : Height 30,21 Font_Size 30,20 Font_Bold 30 Caption 30,"-" On_Click 30,Moin
Frequence%=0 End
' selection des fréquences + ou - Plus: Set_Focus 10 Frequence%=Frequence%+1 If Frequence%=>42 Then Frequence%=1 Item_Select 2,Frequence% Gosub Choix Return
Moin: Set_Focus 10 Frequence%=Frequence%-1 If Frequence%=<0 Then Frequence%=42 Item_Select 2,Frequence% Gosub Choix Return
' selection des stations Choix: Caption 11,"" : Caption 12,"" : Caption 13,"" : Caption 14,"" : Caption 15,"" : Caption 16,""
If Clicked(2)=1 Then Frequence%=Item_Index(2) Select Frequence% Case 1 : Station$="France-Inter" Caption 13,"8" : Caption 14,"7" : Caption 15,"-" : Caption 16,"8" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/france-inter/" Case 2 : Station$="Générations" Caption 13,"8" : Caption 14,"8" : Caption 15,"-" : Caption 16,"2" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/generations/" Case 3 : Station$="Nostalgie" Caption 13,"9" : Caption 14,"0" : Caption 15,"-" : Caption 16,"4" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/nostalgie/" Case 4 : Station$="Chante-France" Caption 13,"9" : Caption 14,"0" : Caption 15,"-" : Caption 16,"9" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/chante-france/" Case 5 : Station$="Contact-Fm" Caption 13,"9" : Caption 14,"1" : Caption 15,"-" : Caption 16,"4" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/contact-fm/" Case 6 : Station$="Cherie-Fm" Caption 12,"9" : Caption 13,"1." : Caption 14,"7" : Caption 15,"-" : Caption 16,"1" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/cherie/" Case 7 : Station$="France-Musique" Caption 12,"9" : Caption 13,"2." : Caption 14,"0" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/france-musique/" Case 8 : Station$="France-culture" Caption 12,"9" : Caption 13,"3." : Caption 14,"5" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/france-culture/" Case 9 : Station$="Orient-Fm" Caption 12,"9" : Caption 13,"4." : Caption 14,"3" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/orient/" Case 10 : Station$="Galaxie FM France" Caption 12,"9" : Caption 13,"5." : Caption 14,"3" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/galaxie/" Case 11 : Station$="Puls Radio" Caption 12,"9" : Caption 13,"5." : Caption 14,"4" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/puls/" Case 12 : Station$="Jazz" Caption 12,"9" : Caption 13,"5." : Caption 14,"7" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/jazz/" Case 13 : Station$="Skyrock" Caption 12,"9" : Caption 13,"6." : Caption 14,"0" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/skyrock/" Case 14 : Station$="Voltage" Caption 12,"9" : Caption 13,"6." : Caption 14,"9" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/voltage/" Case 15 : Station$="Rire et chanson" Caption 12,"9" : Caption 13,"7." : Caption 14,"4" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/rire-et-chanson/" Case 16 : Station$="Metropolys" Caption 12,"9" : Caption 13,"7." : Caption 14,"6" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/metropolys/" Case 17 : Station$="FG DJ Radio" Caption 12,"9" : Caption 13,"8." : Caption 14,"2" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/fg-dj/" Case 18 : Station$="Vibration FM" Caption 12,"9" : Caption 13,"8." : Caption 14,"7" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/vibration/" Case 19 : Station$="Latina" Caption 12,"9" : Caption 13,"9." : Caption 14,"0" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/latina/" Case 20 : Station$="France Maghreb 2 France" Caption 12,"9" : Caption 13,"9." : Caption 14,"5" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/maghreb-2/" Case 21 : Station$="NRJ" Caption 11,"1" : Caption 12,"0" : Caption 13,"0." : Caption 14,"3" : Caption 15,"-" : Caption 16,"1" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/nrj-france/" Case 22 : Station$="Alouette France" Caption 11,"1" : Caption 12,"0" : Caption 13,"0." : Caption 14,"3" : Caption 15,"-" : Caption 16,"2" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/alouette/" Case 23 : Station$="Fun Radio" Caption 11,"1" : Caption 12,"0" : Caption 13,"1." : Caption 14,"9" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/fun/" Case 24 : Station$="Oui FM" Caption 11,"1" : Caption 12,"0" : Caption 13,"2." : Caption 14,"3" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="" Case 25 : Station$="MFM Radio France" Caption 11,"1" : Caption 12,"0" : Caption 13,"2." : Caption 14,"7" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/mfm/" Case 26 : Station$="Gold FM" Caption 11,"1" : Caption 12,"0" : Caption 13,"3." : Caption 14,"3" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/gold-fm/" Case 27 : Station$="Virgin" Caption 11,"1" : Caption 12,"0" : Caption 13,"3." : Caption 14,"5" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/virgin/" Case 28 : Station$="RFM" Caption 11,"1" : Caption 12,"0" : Caption 13,"3." : Caption 14,"9" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/rfm/" Case 29 : Station$="Hit West France" Caption 11,"1" : Caption 12,"0" : Caption 13,"4." : Caption 14,"1" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/hit-west/" Case 30 : Station$="RTL" Caption 11,"1" : Caption 12,"0" : Caption 13,"4." : Caption 14,"3" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/rtl/" Case 31 : Station$="Europe 1" Caption 11,"1" : Caption 12,"0" : Caption 13,"4." : Caption 14,"7" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/europe/" Case 32 : Station$="Radio FIP" Caption 11,"1" : Caption 12,"0" : Caption 13,"5." : Caption 14,"1" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/fip/" Case 33 : Station$="France-Info" Caption 11,"1" : Caption 12,"0" : Caption 13,"5." : Caption 14,"5" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/france-info/" Case 34 : Station$="RTL2" Caption 11,"1" : Caption 12,"0" : Caption 13,"5." : Caption 14,"9" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/rtl2/" Case 35 : Station$="Beur FM France" Caption 11,"1" : Caption 12,"0" : Caption 13,"6." : Caption 14,"7" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/beur/" Case 36 : Station$="France-Bleu" Caption 11,"1" : Caption 12,"0" : Caption 13,"7." : Caption 14,"1" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/france-bleu/" Case 37 : Station$="RFI France" Caption 11,"1" : Caption 12,"0" : Caption 13,"7." : Caption 14,"9" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/rfi/" Case 38 : Station$="Radio Meuh France" Caption 12,"9" : Caption 13,"9" : Caption 14,"9." : Caption 15,"0" : Caption 16,"1" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/meuh/" Case 39 : Station$="Enjoy Radio" Caption 12,"9" : Caption 13,"9" : Caption 14,"9." : Caption 15,"0" : Caption 16,"2" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/enjoy/" Case 40 : Station$="La Grosse Radio France" Caption 12,"9" : Caption 13,"9" : Caption 14,"9." : Caption 15,"0" : Caption 16,"3" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/la-grosse/" Case 41 : Station$="Africa-1-France" Caption 12,"9" : Caption 13,"9" : Caption 14,"9." : Caption 15,"0" : Caption 16,"4" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/africa-1-france/" Case 42 : Station$="Swigg Radio" Caption 12,"9" : Caption 13,"9" : Caption 14,"9." : Caption 15,"0" : Caption 16,"5" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/ado/" End_Select gosub Lecture Return
Lecture: res% = dll_call2("WB_Url",WB%,adr(url$)) NiveauSon() Return
' / GESTIONS DU VOLUME / *********************************************************** NiveauSon: GaucheVol%=position(5) FonctionWinmm$="waveOutSetVolume," If GaucheVol%<0 Then GaucheVol%=0 If GaucheVol%>65535 Then GaucheVol%=65535
Res% = dll_call2("TargetDLL",hnd_dll%,adr(FonctionWinmm$)) Res% = dll_call2("CallDLL2",0,GaucheVol%) DroitVol%=position(5) If DroitVol%<0 Then DroitVol%=0 If DroitVol%>65535 Then DroitVol%=65535
' Il faut respecter le format de codage: ' RRRRLLLL en hexa, pas une simple addition ! TotalVol% = bin_or(GaucheVol%,DroitVol%*65536) ' la ligne suivante est unitile ici, car il s'agit le ma même fonction ! ' Res% = dll_call2("TargetDLL",hnd_dll%,adr(FonctionWinmm$)) ' il faut passer le second paramètre sous forme d'adresse, pas valeur ! Res% = dll_call2("CallDLL2",0,adr(TotalVol%)) Return
Sub NiveauSon() ' RECUPERE LE NIVEAU ACTUEL DU SON FonctionWinmm$="waveOutGetVolume Res% = dll_call2("TargetDLL",hnd_dll%,adr(FonctionWinmm$)) Res% = dll_call2("CallDLL2",0,adr(Volume%) : ' <--erreur de violation ici GaucheVol% = bin_and(volume%,hex("0000FFFF")) DroitVol% = bin_and(volume%,hex("FFFF0000"))/65536 End_Sub
************************************************************
Etein: res% = dll_call1("WB_Delete",WB%) res% = dll_call1("UnLoadDLL",Hnd_Dll%) Dll_Off Terminate Return | |
| | | pascal10000
Nombre de messages : 812 Localisation : Troyes Date d'inscription : 05/02/2011
| Sujet: Re: a l'aide klaus Ven 8 Déc 2017 - 1:13 | |
| je vien d'essayer ton code même erreur!!!!!!!!
| |
| | | Klaus
Nombre de messages : 12274 Age : 74 Localisation : Ile de France Date d'inscription : 29/12/2009
| Sujet: Re: a l'aide klaus Ven 8 Déc 2017 - 1:18 | |
| Et si, dans cette SUB, tu remplaçais - Code:
-
Res% = dll_call2("CallDLL2",0,adr(Volume%) : ' <--erreur de violation ici par - Code:
-
Res% = dll_call2("CallDLL2",0,adr(Volume%)) : ' <--erreur de violation ici Il manquait une parenthèse... | |
| | | pascal10000
Nombre de messages : 812 Localisation : Troyes Date d'inscription : 05/02/2011
| Sujet: Re: a l'aide klaus Ven 8 Déc 2017 - 1:19 | |
| | |
| | | Klaus
Nombre de messages : 12274 Age : 74 Localisation : Ile de France Date d'inscription : 29/12/2009
| Sujet: Re: a l'aide klaus Ven 8 Déc 2017 - 1:29 | |
| Et en remplaçant - Code:
-
FonctionWinmm$="waveOutGetVolume par - Code:
-
FonctionWinmm$="waveOutGetVolume" c'est mieux ? Il manquait le guillemet fermant... EDITSi tu fais ceci: - Code:
-
dim FonctionWinmm$ FonctionWinmm$="waveOutGetVolume print FonctionWinmm$
tu vois immédiatement pourquoi ça plante... EDITBon, maintenant Zzzzz.... | |
| | | Minibug
Nombre de messages : 4566 Age : 57 Localisation : Vienne (86) Date d'inscription : 09/02/2012
| Sujet: Re: a l'aide klaus Ven 8 Déc 2017 - 9:09 | |
| Bonjour à tous les 2 ! Je viens de tester ton code Pascal10000 avec les corrections de Klaus. Je n'ai pas de bugs ou d'erreurs dans le fonctionnement du programme ce qui est déjà une bonne chose ! Par contre le volume ne change pas. J'ai juste quelques grésillements dans le son lors du déplacement de la barre de volume. J'attends la suite avec impatience... Bon courage à tous les 2 ! | |
| | | pascal10000
Nombre de messages : 812 Localisation : Troyes Date d'inscription : 05/02/2011
| Sujet: Re: a l'aide klaus Ven 8 Déc 2017 - 9:54 | |
| bjr klaus tout fonctionne mais un nouveau probleme survient dès que je test le code avec panoramic j'ai 2 ouverture de son dans le mélangeur de volume de windows dès que j'agis sur le volume du poste seul le curseur rouge fonctionne mais rien ne se passe et en plus le curseur gauche du mixer chahute par contre pour baiser le son du poste je doit agir sur le curseur vert du mixer de windows comme tu peut le remarquer sur l'image le curseur entouré en vert , on remarque le niveau du vumetre qui est en action bjr minibug | |
| | | pascal10000
Nombre de messages : 812 Localisation : Troyes Date d'inscription : 05/02/2011
| Sujet: Re: a l'aide klaus Ven 8 Déc 2017 - 10:06 | |
| bjr klaus Ah il me vient une idée à l'instant la cause de ce phénomene c'est que a mon avis je dois agir directement du site ouvert par kgf? | |
| | | Klaus
Nombre de messages : 12274 Age : 74 Localisation : Ile de France Date d'inscription : 29/12/2009
| Sujet: Re: a l'aide klaus Ven 8 Déc 2017 - 10:08 | |
| J'ai du mal à tester chez moi, car je n'ai pas le fichier, et je n'ai pas le temps de le constituer manuellement. Par contre, j'ai remarqué que dans le sous-programme NiveauSon (pas la SUB, mais le sous-programme !), il y avait une incohérence: on appelle la fonction waveOutSetVolume deux fois, une fois pour le canal gauche, et une autre fois, initialement pour le canal droite, et après ma modification, pour les deux canaix simultanément. Or, le premier appel est inutile et met accessoirement le volume du canal droite à zéro. Donc, essayez cette version: - Code:
-
Dim Station$,url$,Frequence%,Q%,LeftD% ,res%,WB% Dim Volume%,GaucheVol%,DroitVol%,Min_Track5%,Max_Track5%,Hnd_Dll% Dim Winmm$,FonctionWinmm$
Label Choix,Plus,Moin,Lecture,Etein Label NiveauSon
Color 0,0,0,0 Height 0,180 Width 0,530 Caption 0,"Radio FM" Font_Size 0,10 Font_Bold 0 Font_Color 0,0,255,0 On_Close 0,Etein
' resize off form 0 If File_exists("D:\Programmation\Projet Panoramic\poste radio\form.dll")=1 Dll_On "D:\Programmation\Projet Panoramic\poste radio\form.dll" res% = DLL_CALL2("SetSize",HANDLE(0),0) Width 0,531 Dll_Off End_if
' création browser Dll_On "D:\Programmation\Projet Panoramic\poste radio\kgf.dll" WB% = dll_call1("WB_Create",Handle(0)) res% = dll_call5("WB_Locate",WB%,10,50,0,0) Winmm$="Winmm.Dll" Hnd_Dll% = dll_call1("LoadDLL",adr(Winmm$))
Alpha 1 Left 1,200
' liste des stations List 2 Top 2,40 Left 2,260 Height 2,80 Color 2,0,0,0 Font_Color 2,0,255,0 File_Load 2,"D:\Programmation\Projet Panoramic\poste radio\stations.txt" On_Click 2,Choix Alpha 3 Left 3,260 : Top 3,20 Caption 3,"Stations:"
Track_Bar 5 Left 5,20: Top 5,85 Width 5,222: Height 5,26 Min 5,0 :Max 5,65535 On_Change 5,NiveauSon Progress_Bar 6 Left 6,20: Top 6,120 Width 6,222: Height 6,10
' Tableau FREQUENCE Container 10 Caption 10,"FREQUENCE" Left 10,20 :Top 10,20 Width 10,200 : Height 10,52 Hide 10
LeftD%=-10 For Q%=11 to 16 LeftD%=LeftD%+30 DIGIT1 Q% Parent Q%,10 Top Q%,15 Width Q%,20 Height Q%,34 Left Q%,LeftD% Color Q%,0,255,0 Caption Q%,"" Next Q% Show 10
Button 20 Left 20,221 : Top 20,28 Width 20,21 : Height 20,21 Font_Size 20,16 Font_Bold 20 Caption 20,"+" On_Click 20,Plus
Button 30 Left 30,221 : Top 30,52 Width 30,21 : Height 30,21 Font_Size 30,20 Font_Bold 30 Caption 30,"-" On_Click 30,Moin
Frequence%=0 End
' selection des fréquences + ou - Plus: Set_Focus 10 Frequence%=Frequence%+1 If Frequence%=>42 Then Frequence%=1 Item_Select 2,Frequence% Gosub Choix Return
Moin: Set_Focus 10 Frequence%=Frequence%-1 If Frequence%=<0 Then Frequence%=42 Item_Select 2,Frequence% Gosub Choix Return
' selection des stations Choix: Caption 11,"" : Caption 12,"" : Caption 13,"" : Caption 14,"" : Caption 15,"" : Caption 16,""
If Clicked(2)=1 Then Frequence%=Item_Index(2) Select Frequence% Case 1 : Station$="France-Inter" Caption 13,"8" : Caption 14,"7" : Caption 15,"-" : Caption 16,"8" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/france-inter/" Case 2 : Station$="Générations" Caption 13,"8" : Caption 14,"8" : Caption 15,"-" : Caption 16,"2" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/generations/" Case 3 : Station$="Nostalgie" Caption 13,"9" : Caption 14,"0" : Caption 15,"-" : Caption 16,"4" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/nostalgie/" Case 4 : Station$="Chante-France" Caption 13,"9" : Caption 14,"0" : Caption 15,"-" : Caption 16,"9" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/chante-france/" Case 5 : Station$="Contact-Fm" Caption 13,"9" : Caption 14,"1" : Caption 15,"-" : Caption 16,"4" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/contact-fm/" Case 6 : Station$="Cherie-Fm" Caption 12,"9" : Caption 13,"1." : Caption 14,"7" : Caption 15,"-" : Caption 16,"1" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/cherie/" Case 7 : Station$="France-Musique" Caption 12,"9" : Caption 13,"2." : Caption 14,"0" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/france-musique/" Case 8 : Station$="France-culture" Caption 12,"9" : Caption 13,"3." : Caption 14,"5" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/france-culture/" Case 9 : Station$="Orient-Fm" Caption 12,"9" : Caption 13,"4." : Caption 14,"3" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/orient/" Case 10 : Station$="Galaxie FM France" Caption 12,"9" : Caption 13,"5." : Caption 14,"3" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/galaxie/" Case 11 : Station$="Puls Radio" Caption 12,"9" : Caption 13,"5." : Caption 14,"4" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/puls/" Case 12 : Station$="Jazz" Caption 12,"9" : Caption 13,"5." : Caption 14,"7" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/jazz/" Case 13 : Station$="Skyrock" Caption 12,"9" : Caption 13,"6." : Caption 14,"0" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/skyrock/" Case 14 : Station$="Voltage" Caption 12,"9" : Caption 13,"6." : Caption 14,"9" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/voltage/" Case 15 : Station$="Rire et chanson" Caption 12,"9" : Caption 13,"7." : Caption 14,"4" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/rire-et-chanson/" Case 16 : Station$="Metropolys" Caption 12,"9" : Caption 13,"7." : Caption 14,"6" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/metropolys/" Case 17 : Station$="FG DJ Radio" Caption 12,"9" : Caption 13,"8." : Caption 14,"2" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/fg-dj/" Case 18 : Station$="Vibration FM" Caption 12,"9" : Caption 13,"8." : Caption 14,"7" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/vibration/" Case 19 : Station$="Latina" Caption 12,"9" : Caption 13,"9." : Caption 14,"0" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/latina/" Case 20 : Station$="France Maghreb 2 France" Caption 12,"9" : Caption 13,"9." : Caption 14,"5" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/maghreb-2/" Case 21 : Station$="NRJ" Caption 11,"1" : Caption 12,"0" : Caption 13,"0." : Caption 14,"3" : Caption 15,"-" : Caption 16,"1" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/nrj-france/" Case 22 : Station$="Alouette France" Caption 11,"1" : Caption 12,"0" : Caption 13,"0." : Caption 14,"3" : Caption 15,"-" : Caption 16,"2" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/alouette/" Case 23 : Station$="Fun Radio" Caption 11,"1" : Caption 12,"0" : Caption 13,"1." : Caption 14,"9" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/fun/" Case 24 : Station$="Oui FM" Caption 11,"1" : Caption 12,"0" : Caption 13,"2." : Caption 14,"3" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="" Case 25 : Station$="MFM Radio France" Caption 11,"1" : Caption 12,"0" : Caption 13,"2." : Caption 14,"7" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/mfm/" Case 26 : Station$="Gold FM" Caption 11,"1" : Caption 12,"0" : Caption 13,"3." : Caption 14,"3" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/gold-fm/" Case 27 : Station$="Virgin" Caption 11,"1" : Caption 12,"0" : Caption 13,"3." : Caption 14,"5" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/virgin/" Case 28 : Station$="RFM" Caption 11,"1" : Caption 12,"0" : Caption 13,"3." : Caption 14,"9" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/rfm/" Case 29 : Station$="Hit West France" Caption 11,"1" : Caption 12,"0" : Caption 13,"4." : Caption 14,"1" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/hit-west/" Case 30 : Station$="RTL" Caption 11,"1" : Caption 12,"0" : Caption 13,"4." : Caption 14,"3" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/rtl/" Case 31 : Station$="Europe 1" Caption 11,"1" : Caption 12,"0" : Caption 13,"4." : Caption 14,"7" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/europe/" Case 32 : Station$="Radio FIP" Caption 11,"1" : Caption 12,"0" : Caption 13,"5." : Caption 14,"1" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/fip/" Case 33 : Station$="France-Info" Caption 11,"1" : Caption 12,"0" : Caption 13,"5." : Caption 14,"5" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/france-info/" Case 34 : Station$="RTL2" Caption 11,"1" : Caption 12,"0" : Caption 13,"5." : Caption 14,"9" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/rtl2/" Case 35 : Station$="Beur FM France" Caption 11,"1" : Caption 12,"0" : Caption 13,"6." : Caption 14,"7" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/beur/" Case 36 : Station$="France-Bleu" Caption 11,"1" : Caption 12,"0" : Caption 13,"7." : Caption 14,"1" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/france-bleu/" Case 37 : Station$="RFI France" Caption 11,"1" : Caption 12,"0" : Caption 13,"7." : Caption 14,"9" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/rfi/" Case 38 : Station$="Radio Meuh France" Caption 12,"9" : Caption 13,"9" : Caption 14,"9." : Caption 15,"0" : Caption 16,"1" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/meuh/" Case 39 : Station$="Enjoy Radio" Caption 12,"9" : Caption 13,"9" : Caption 14,"9." : Caption 15,"0" : Caption 16,"2" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/enjoy/" Case 40 : Station$="La Grosse Radio France" Caption 12,"9" : Caption 13,"9" : Caption 14,"9." : Caption 15,"0" : Caption 16,"3" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/la-grosse/" Case 41 : Station$="Africa-1-France" Caption 12,"9" : Caption 13,"9" : Caption 14,"9." : Caption 15,"0" : Caption 16,"4" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/africa-1-france/" Case 42 : Station$="Swigg Radio" Caption 12,"9" : Caption 13,"9" : Caption 14,"9." : Caption 15,"0" : Caption 16,"5" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/ado/" End_Select gosub Lecture Return
Lecture: res% = dll_call2("WB_Url",WB%,adr(url$)) NiveauSon() Return
' / GESTIONS DU VOLUME / *********************************************************** NiveauSon: FonctionWinmm$="waveOutSetVolume,"
GaucheVol%=position(5) If GaucheVol%<0 Then GaucheVol%=0 If GaucheVol%>65535 Then GaucheVol%=65535
DroitVol%=position(5) If DroitVol%<0 Then DroitVol%=0 If DroitVol%>65535 Then DroitVol%=65535
' Il faut respecter le format de codage: ' RRRRLLLL en hexa, pas une simple addition ! TotalVol% = bin_or(GaucheVol%,DroitVol%*65536)
' il faut passer le second paramètre sous forme d'adresse, pas valeur ! Res% = dll_call2("CallDLL2",0,adr(TotalVol%)) Return
Sub NiveauSon() ' RECUPERE LE NIVEAU ACTUEL DU SON FonctionWinmm$="waveOutGetVolume" Res% = dll_call2("TargetDLL",hnd_dll%,adr(FonctionWinmm$)) Res% = dll_call2("CallDLL2",0,adr(Volume%)) : ' <--erreur de violation ici GaucheVol% = bin_and(volume%,hex("0000FFFF")) DroitVol% = bin_and(volume%,hex("FFFF0000"))/65536 End_Sub
************************************************************
Etein: res% = dll_call1("WB_Delete",WB%) res% = dll_call1("UnLoadDLL",Hnd_Dll%) Dll_Off Terminate Return Peux-tu poster, dans un spoiker, le fichier stations.txt, pour que je puisse tester aussi ? | |
| | | Minibug
Nombre de messages : 4566 Age : 57 Localisation : Vienne (86) Date d'inscription : 09/02/2012
| Sujet: Re: a l'aide klaus Ven 8 Déc 2017 - 10:12 | |
| Chez moi il n'y a qu'un processus ! Et après quelques manipulations, cela fonctionne... Par contre j'ai l'impression que le volume est plus élevé d'un coté que de l'autre ?! | |
| | | Klaus
Nombre de messages : 12274 Age : 74 Localisation : Ile de France Date d'inscription : 29/12/2009
| Sujet: Re: a l'aide klaus Ven 8 Déc 2017 - 10:20 | |
| Je me suis rendu compte que la multiplication pose problème si le volume droite est au maximum (65525). J'ai donc remplacé la miltiplication par un shift à gauche de 16 bits (via KGF.dll). Voici ce que ça donne: - Code:
-
Dim Station$,url$,Frequence%,Q%,LeftD% ,res%,WB% Dim Volume%,GaucheVol%,DroitVol%,Min_Track5%,Max_Track5%,Hnd_Dll% Dim Winmm$,FonctionWinmm$ DIM TotalVol%
Label Choix,Plus,Moin,Lecture,Etein Label NiveauSon
Color 0,0,0,0 Height 0,180 Width 0,530 Caption 0,"Radio FM" Font_Size 0,10 Font_Bold 0 Font_Color 0,0,255,0 On_Close 0,Etein
' resize off form 0 If File_exists("D:\Programmation\Projet Panoramic\poste radio\form.dll")=1 Dll_On "D:\Programmation\Projet Panoramic\poste radio\form.dll" res% = DLL_CALL2("SetSize",HANDLE(0),0) Width 0,531 Dll_Off End_if
' création browser Dll_On "D:\Programmation\Projet Panoramic\poste radio\kgf.dll" WB% = dll_call1("WB_Create",Handle(0)) res% = dll_call5("WB_Locate",WB%,10,50,0,0) Winmm$="Winmm.Dll" Hnd_Dll% = dll_call1("LoadDLL",adr(Winmm$))
Alpha 1 Left 1,200
' liste des stations List 2 Top 2,40 Left 2,260 Height 2,80 Color 2,0,0,0 Font_Color 2,0,255,0 File_Load 2,"D:\Programmation\Projet Panoramic\poste radio\stations.txt" On_Click 2,Choix Alpha 3 Left 3,260 : Top 3,20 Caption 3,"Stations:"
Track_Bar 5 Left 5,20: Top 5,85 Width 5,222: Height 5,26 Min 5,0 :Max 5,65535 On_Change 5,NiveauSon Progress_Bar 6 Left 6,20: Top 6,120 Width 6,222: Height 6,10
' Tableau FREQUENCE Container 10 Caption 10,"FREQUENCE" Left 10,20 :Top 10,20 Width 10,200 : Height 10,52 Hide 10
LeftD%=-10 For Q%=11 to 16 LeftD%=LeftD%+30 DIGIT1 Q% Parent Q%,10 Top Q%,15 Width Q%,20 Height Q%,34 Left Q%,LeftD% Color Q%,0,255,0 Caption Q%,"" Next Q% Show 10
Button 20 Left 20,221 : Top 20,28 Width 20,21 : Height 20,21 Font_Size 20,16 Font_Bold 20 Caption 20,"+" On_Click 20,Plus
Button 30 Left 30,221 : Top 30,52 Width 30,21 : Height 30,21 Font_Size 30,20 Font_Bold 30 Caption 30,"-" On_Click 30,Moin
Frequence%=0 End
' selection des fréquences + ou - Plus: Set_Focus 10 Frequence%=Frequence%+1 If Frequence%=>42 Then Frequence%=1 Item_Select 2,Frequence% Gosub Choix Return
Moin: Set_Focus 10 Frequence%=Frequence%-1 If Frequence%=<0 Then Frequence%=42 Item_Select 2,Frequence% Gosub Choix Return
' selection des stations Choix: Caption 11,"" : Caption 12,"" : Caption 13,"" : Caption 14,"" : Caption 15,"" : Caption 16,""
If Clicked(2)=1 Then Frequence%=Item_Index(2) Select Frequence% Case 1 : Station$="France-Inter" Caption 13,"8" : Caption 14,"7" : Caption 15,"-" : Caption 16,"8" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/france-inter/" Case 2 : Station$="Générations" Caption 13,"8" : Caption 14,"8" : Caption 15,"-" : Caption 16,"2" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/generations/" Case 3 : Station$="Nostalgie" Caption 13,"9" : Caption 14,"0" : Caption 15,"-" : Caption 16,"4" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/nostalgie/" Case 4 : Station$="Chante-France" Caption 13,"9" : Caption 14,"0" : Caption 15,"-" : Caption 16,"9" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/chante-france/" Case 5 : Station$="Contact-Fm" Caption 13,"9" : Caption 14,"1" : Caption 15,"-" : Caption 16,"4" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/contact-fm/" Case 6 : Station$="Cherie-Fm" Caption 12,"9" : Caption 13,"1." : Caption 14,"7" : Caption 15,"-" : Caption 16,"1" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/cherie/" Case 7 : Station$="France-Musique" Caption 12,"9" : Caption 13,"2." : Caption 14,"0" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/france-musique/" Case 8 : Station$="France-culture" Caption 12,"9" : Caption 13,"3." : Caption 14,"5" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/france-culture/" Case 9 : Station$="Orient-Fm" Caption 12,"9" : Caption 13,"4." : Caption 14,"3" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/orient/" Case 10 : Station$="Galaxie FM France" Caption 12,"9" : Caption 13,"5." : Caption 14,"3" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/galaxie/" Case 11 : Station$="Puls Radio" Caption 12,"9" : Caption 13,"5." : Caption 14,"4" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/puls/" Case 12 : Station$="Jazz" Caption 12,"9" : Caption 13,"5." : Caption 14,"7" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/jazz/" Case 13 : Station$="Skyrock" Caption 12,"9" : Caption 13,"6." : Caption 14,"0" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/skyrock/" Case 14 : Station$="Voltage" Caption 12,"9" : Caption 13,"6." : Caption 14,"9" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/voltage/" Case 15 : Station$="Rire et chanson" Caption 12,"9" : Caption 13,"7." : Caption 14,"4" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/rire-et-chanson/" Case 16 : Station$="Metropolys" Caption 12,"9" : Caption 13,"7." : Caption 14,"6" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/metropolys/" Case 17 : Station$="FG DJ Radio" Caption 12,"9" : Caption 13,"8." : Caption 14,"2" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/fg-dj/" Case 18 : Station$="Vibration FM" Caption 12,"9" : Caption 13,"8." : Caption 14,"7" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/vibration/" Case 19 : Station$="Latina" Caption 12,"9" : Caption 13,"9." : Caption 14,"0" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/latina/" Case 20 : Station$="France Maghreb 2 France" Caption 12,"9" : Caption 13,"9." : Caption 14,"5" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/maghreb-2/" Case 21 : Station$="NRJ" Caption 11,"1" : Caption 12,"0" : Caption 13,"0." : Caption 14,"3" : Caption 15,"-" : Caption 16,"1" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/nrj-france/" Case 22 : Station$="Alouette France" Caption 11,"1" : Caption 12,"0" : Caption 13,"0." : Caption 14,"3" : Caption 15,"-" : Caption 16,"2" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/alouette/" Case 23 : Station$="Fun Radio" Caption 11,"1" : Caption 12,"0" : Caption 13,"1." : Caption 14,"9" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/fun/" Case 24 : Station$="Oui FM" Caption 11,"1" : Caption 12,"0" : Caption 13,"2." : Caption 14,"3" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="" Case 25 : Station$="MFM Radio France" Caption 11,"1" : Caption 12,"0" : Caption 13,"2." : Caption 14,"7" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/mfm/" Case 26 : Station$="Gold FM" Caption 11,"1" : Caption 12,"0" : Caption 13,"3." : Caption 14,"3" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/gold-fm/" Case 27 : Station$="Virgin" Caption 11,"1" : Caption 12,"0" : Caption 13,"3." : Caption 14,"5" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/virgin/" Case 28 : Station$="RFM" Caption 11,"1" : Caption 12,"0" : Caption 13,"3." : Caption 14,"9" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/rfm/" Case 29 : Station$="Hit West France" Caption 11,"1" : Caption 12,"0" : Caption 13,"4." : Caption 14,"1" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/hit-west/" Case 30 : Station$="RTL" Caption 11,"1" : Caption 12,"0" : Caption 13,"4." : Caption 14,"3" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/rtl/" Case 31 : Station$="Europe 1" Caption 11,"1" : Caption 12,"0" : Caption 13,"4." : Caption 14,"7" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/europe/" Case 32 : Station$="Radio FIP" Caption 11,"1" : Caption 12,"0" : Caption 13,"5." : Caption 14,"1" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/fip/" Case 33 : Station$="France-Info" Caption 11,"1" : Caption 12,"0" : Caption 13,"5." : Caption 14,"5" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/france-info/" Case 34 : Station$="RTL2" Caption 11,"1" : Caption 12,"0" : Caption 13,"5." : Caption 14,"9" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/rtl2/" Case 35 : Station$="Beur FM France" Caption 11,"1" : Caption 12,"0" : Caption 13,"6." : Caption 14,"7" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/beur/" Case 36 : Station$="France-Bleu" Caption 11,"1" : Caption 12,"0" : Caption 13,"7." : Caption 14,"1" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/france-bleu/" Case 37 : Station$="RFI France" Caption 11,"1" : Caption 12,"0" : Caption 13,"7." : Caption 14,"9" : Caption 15,"-" : Caption 16,"0" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/rfi/" Case 38 : Station$="Radio Meuh France" Caption 12,"9" : Caption 13,"9" : Caption 14,"9." : Caption 15,"0" : Caption 16,"1" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/meuh/" Case 39 : Station$="Enjoy Radio" Caption 12,"9" : Caption 13,"9" : Caption 14,"9." : Caption 15,"0" : Caption 16,"2" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/enjoy/" Case 40 : Station$="La Grosse Radio France" Caption 12,"9" : Caption 13,"9" : Caption 14,"9." : Caption 15,"0" : Caption 16,"3" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/la-grosse/" Case 41 : Station$="Africa-1-France" Caption 12,"9" : Caption 13,"9" : Caption 14,"9." : Caption 15,"0" : Caption 16,"4" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/africa-1-france/" Case 42 : Station$="Swigg Radio" Caption 12,"9" : Caption 13,"9" : Caption 14,"9." : Caption 15,"0" : Caption 16,"5" :Caption 1,Station$ url$="http://www.ecouterradioenligne.com/ado/" End_Select gosub Lecture Return
Lecture: res% = dll_call2("WB_Url",WB%,adr(url$)) NiveauSon() Return
' / GESTIONS DU VOLUME / *********************************************************** NiveauSon: FonctionWinmm$="waveOutSetVolume,"
GaucheVol%=position(5) If GaucheVol%<0 Then GaucheVol%=0 If GaucheVol%>65535 Then GaucheVol%=65535
DroitVol%=position(5) If DroitVol%<0 Then DroitVol%=0 If DroitVol%>65535 Then DroitVol%=65535
' Il faut respecter le format de codage: ' RRRRLLLL en hexa, pas une simple addition ! res% = dll_call2("bin_SHL",DroitVol%,16) TotalVol% = bin_or(GaucheVol%,DroitVol%)
' il faut passer le second paramètre sous forme d'adresse, pas valeur ! Res% = dll_call2("CallDLL2",0,adr(TotalVol%)) Return
Sub NiveauSon() ' RECUPERE LE NIVEAU ACTUEL DU SON FonctionWinmm$="waveOutGetVolume" Res% = dll_call2("TargetDLL",hnd_dll%,adr(FonctionWinmm$)) Res% = dll_call2("CallDLL2",0,adr(Volume%)) : ' <--erreur de violation ici GaucheVol% = bin_and(volume%,hex("0000FFFF")) DroitVol% = bin_and(volume%,hex("FFFF0000"))/65536 End_Sub
************************************************************
Etein: res% = dll_call1("WB_Delete",WB%) res% = dll_call1("UnLoadDLL",Hnd_Dll%) Dll_Off Terminate Return @Minibug: Peux-tu tester avec cette version, et me poster le fichier stations.txt, pour que je puisse tester de mon côté ?
Dernière édition par Klaus le Ven 8 Déc 2017 - 10:33, édité 1 fois | |
| | | Minibug
Nombre de messages : 4566 Age : 57 Localisation : Vienne (86) Date d'inscription : 09/02/2012
| Sujet: Re: a l'aide klaus Ven 8 Déc 2017 - 10:26 | |
| Salut Klaus ! Voici le fichier en question : - Spoiler:
- Code:
-
France-Inter Générations Nostalgie Chante-France Contact-Fm Cherie-Fm France-Musique france-culture Orient-Fm Galaxie FM France Puls Radio Jazz Skyrock Voltage Rire et chanson Metropolys FG DJ Radio Vibration FM Latina France Maghreb 2 France NRJ Alouette France Fun Radio Oui FM MFM Radio France Gold FM Virgin RFM Hit West France RTL Europe 1 Radio FIP France-Info RTL2 Beur FM France France-Bleu RFI France Radio Meuh France Enjoy Radio La Grosse Radio France Africa-1-France Swigg Radio
Je vais tester ton dernier code et je reviens... | |
| | | Klaus
Nombre de messages : 12274 Age : 74 Localisation : Ile de France Date d'inscription : 29/12/2009
| Sujet: Re: a l'aide klaus Ven 8 Déc 2017 - 10:34 | |
| Merci pour le fichier.
Il manquait ma nouvelle variable, en haut - je l'ai rajoutée dans le dernier post. | |
| | | Minibug
Nombre de messages : 4566 Age : 57 Localisation : Vienne (86) Date d'inscription : 09/02/2012
| Sujet: Re: a l'aide klaus Ven 8 Déc 2017 - 10:35 | |
| Désolé Klaus mais ton code ne fonctionne pas ! Je ne peux pas faire varier le volume. edit : pour la variable j'avais corrigé ! Le seul qui fonctionne c'est celui-ci : - Code:
-
' / GESTIONS DU VOLUME / *********************************************************** NiveauSon: GaucheVol%=position(5) FonctionWinmm$="waveOutSetVolume" If GaucheVol%<0 Then GaucheVol%=0 If GaucheVol%>65535 Then GaucheVol%=65535
Res% = dll_call2("TargetDLL",hnd_dll%,adr(FonctionWinmm$)) Res% = dll_call2("CallDLL2",0,GaucheVol%) DroitVol%=position(5) If DroitVol%<0 Then DroitVol%=0 If DroitVol%>65535 Then DroitVol%=65535
Res% = dll_call2("TargetDLL",hnd_dll%,adr(FonctionWinmm$)) Res% = dll_call2("CallDLL2",0,GaucheVol%+DroitVol%) Return
Sub NiveauSon() ' RECUPERE LE NIVEAU ACTUEL DU SON FonctionWinmm$="waveOutGetVolume" Res% = dll_call2("TargetDLL",hnd_dll%,adr(FonctionWinmm$)) Res% = dll_call2("CallDLL2",0,adr(Volume%)) : ' <--erreur de violation ici GaucheVol% = bin_and(volume%,hex("0000FFFF")) DroitVol% = bin_and(volume%,hex("FFFF0000"))/65536 End_Sub ************************************************************ Par contre j'ai le son plus fort d'un coté que de l'autre. Et lorsque je fais varier le volume depuis le trackbarre du programme il y a des crachotements dans le son.
Dernière édition par Minibug le Ven 8 Déc 2017 - 10:36, édité 1 fois | |
| | | Contenu sponsorisé
| Sujet: Re: a l'aide klaus | |
| |
| | | | a l'aide klaus | |
|
Sujets similaires | |
|
| Permission de ce forum: | Vous ne pouvez pas répondre aux sujets dans ce forum
| |
| |
| |