FORUM DE DISCUSSION SUR LE LANGAGE PANORAMIC
Vous souhaitez réagir à ce message ? Créez un compte en quelques clics ou connectez-vous pour continuer.
FORUM DE DISCUSSION SUR LE LANGAGE PANORAMIC

Développement d'applications avec le langage Panoramic
 
AccueilAccueil  RechercherRechercher  Dernières imagesDernières images  S'enregistrerS'enregistrer  MembresMembres  Connexion  
Derniers sujets
» 2D_fill_color
a l'aide klaus Emptypar leclode Aujourd'hui à 10:34

» Consommation gaz électricité
a l'aide klaus Emptypar leclode Mer 17 Avr 2024 - 11:07

» trop de fichiers en cours
a l'aide klaus Emptypar lepetitmarocain Mer 17 Avr 2024 - 10:19

» on_key_down (résolu)
a l'aide klaus Emptypar leclode Mar 16 Avr 2024 - 11:01

» Sous-programme(résolu)
a l'aide klaus Emptypar jjn4 Jeu 4 Avr 2024 - 14:42

» Bataille-navale
a l'aide klaus Emptypar jjn4 Mer 3 Avr 2024 - 14:08

» Minimiser une fenêtre Panoramic.
a l'aide klaus Emptypar Pedro Mar 2 Avr 2024 - 13:50

» Récapitulatif ludothèque panoramic jjn4
a l'aide klaus Emptypar jjn4 Lun 1 Avr 2024 - 18:04

» demande explication KGF pour imprimer en mm
a l'aide klaus Emptypar JL35 Jeu 28 Mar 2024 - 17:28

» Petit passage furtif
a l'aide klaus Emptypar Froggy One Mer 27 Mar 2024 - 14:26

» SPIN et aide langage (résolu)
a l'aide klaus Emptypar leclode Sam 23 Mar 2024 - 15:20

» Aide-mémoire des mots-clés Panoramic
a l'aide klaus Emptypar papydall Mer 20 Mar 2024 - 21:23

» Je ne comprend pas pourquoi la largeur de la scene 3d change
a l'aide klaus Emptypar Marc Mar 12 Mar 2024 - 20:06

» Comment télécharger panoramic?
a l'aide klaus Emptypar lepetitmarocain Sam 9 Mar 2024 - 13:31

» @lepetitmarocain <==> KGFGrid
a l'aide klaus Emptypar Klaus Dim 3 Mar 2024 - 9:59

Navigation
 Portail
 Index
 Membres
 Profil
 FAQ
 Rechercher
Rechercher
 
 

Résultats par :
 
Rechercher Recherche avancée
Avril 2024
LunMarMerJeuVenSamDim
1234567
891011121314
15161718192021
22232425262728
2930     
CalendrierCalendrier
Le deal à ne pas rater :
Funko POP! Jumbo One Piece Kaido Dragon Form : où l’acheter ?
Voir le deal

 

 a l'aide klaus

Aller en bas 
3 participants
Aller à la page : 1, 2  Suivant
AuteurMessage
pascal10000

pascal10000


Nombre de messages : 812
Localisation : Troyes
Date d'inscription : 05/02/2011

a l'aide klaus Empty
MessageSujet: a l'aide klaus   a l'aide klaus EmptyJeu 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é?
Revenir en haut Aller en bas
Klaus

Klaus


Nombre de messages : 12274
Age : 74
Localisation : Ile de France
Date d'inscription : 29/12/2009

a l'aide klaus Empty
MessageSujet: Re: a l'aide klaus   a l'aide klaus EmptyJeu 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...
Revenir en haut Aller en bas
http://klauspanoramic.comxa.com/index.html
pascal10000

pascal10000


Nombre de messages : 812
Localisation : Troyes
Date d'inscription : 05/02/2011

a l'aide klaus Empty
MessageSujet: Re: a l'aide klaus   a l'aide klaus EmptyJeu 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..
Revenir en haut Aller en bas
Klaus

Klaus


Nombre de messages : 12274
Age : 74
Localisation : Ile de France
Date d'inscription : 29/12/2009

a l'aide klaus Empty
MessageSujet: Re: a l'aide klaus   a l'aide klaus EmptyJeu 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 !
Revenir en haut Aller en bas
http://klauspanoramic.comxa.com/index.html
pascal10000

pascal10000


Nombre de messages : 812
Localisation : Troyes
Date d'inscription : 05/02/2011

a l'aide klaus Empty
MessageSujet: Re: a l'aide klaus   a l'aide klaus EmptyJeu 7 Déc 2017 - 23:19

ben je ne me suis pas trompé
mon raisonnement était bon!!
Revenir en haut Aller en bas
Klaus

Klaus


Nombre de messages : 12274
Age : 74
Localisation : Ile de France
Date d'inscription : 29/12/2009

a l'aide klaus Empty
MessageSujet: Re: a l'aide klaus   a l'aide klaus EmptyJeu 7 Déc 2017 - 23:37

Oui, sauf pour le passage des paramètres...
Revenir en haut Aller en bas
http://klauspanoramic.comxa.com/index.html
pascal10000

pascal10000


Nombre de messages : 812
Localisation : Troyes
Date d'inscription : 05/02/2011

a l'aide klaus Empty
MessageSujet: Re: a l'aide klaus   a l'aide klaus EmptyVen 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#67469

a l'exemple de papydall seul le cote gauche fonctionnait
Revenir en haut Aller en bas
Klaus

Klaus


Nombre de messages : 12274
Age : 74
Localisation : Ile de France
Date d'inscription : 29/12/2009

a l'aide klaus Empty
MessageSujet: Re: a l'aide klaus   a l'aide klaus EmptyVen 8 Déc 2017 - 0:39

J'ai apporté la solution ici:
https://panoramic.1fr1.net/t5540-carte-son#67479
en me trompant de fil de discussion...
Revenir en haut Aller en bas
http://klauspanoramic.comxa.com/index.html
pascal10000

pascal10000


Nombre de messages : 812
Localisation : Troyes
Date d'inscription : 05/02/2011

a l'aide klaus Empty
MessageSujet: Re: a l'aide klaus   a l'aide klaus EmptyVen 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
Revenir en haut Aller en bas
Klaus

Klaus


Nombre de messages : 12274
Age : 74
Localisation : Ile de France
Date d'inscription : 29/12/2009

a l'aide klaus Empty
MessageSujet: Re: a l'aide klaus   a l'aide klaus EmptyVen 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.
Revenir en haut Aller en bas
http://klauspanoramic.comxa.com/index.html
pascal10000

pascal10000


Nombre de messages : 812
Localisation : Troyes
Date d'inscription : 05/02/2011

a l'aide klaus Empty
MessageSujet: Re: a l'aide klaus   a l'aide klaus EmptyVen 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
Revenir en haut Aller en bas
Klaus

Klaus


Nombre de messages : 12274
Age : 74
Localisation : Ile de France
Date d'inscription : 29/12/2009

a l'aide klaus Empty
MessageSujet: Re: a l'aide klaus   a l'aide klaus EmptyVen 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
Revenir en haut Aller en bas
http://klauspanoramic.comxa.com/index.html
pascal10000

pascal10000


Nombre de messages : 812
Localisation : Troyes
Date d'inscription : 05/02/2011

a l'aide klaus Empty
MessageSujet: Re: a l'aide klaus   a l'aide klaus EmptyVen 8 Déc 2017 - 1:13

je vien d'essayer ton code
même erreur!!!!!!!!
Revenir en haut Aller en bas
Klaus

Klaus


Nombre de messages : 12274
Age : 74
Localisation : Ile de France
Date d'inscription : 29/12/2009

a l'aide klaus Empty
MessageSujet: Re: a l'aide klaus   a l'aide klaus EmptyVen 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...
Revenir en haut Aller en bas
http://klauspanoramic.comxa.com/index.html
pascal10000

pascal10000


Nombre de messages : 812
Localisation : Troyes
Date d'inscription : 05/02/2011

a l'aide klaus Empty
MessageSujet: Re: a l'aide klaus   a l'aide klaus EmptyVen 8 Déc 2017 - 1:19

cest pareil meme erreur
bon je vais Sleep Sleep Sleep Sleep Sleep Sleep Sleep
bonne nuit
Revenir en haut Aller en bas
Klaus

Klaus


Nombre de messages : 12274
Age : 74
Localisation : Ile de France
Date d'inscription : 29/12/2009

a l'aide klaus Empty
MessageSujet: Re: a l'aide klaus   a l'aide klaus EmptyVen 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...

EDIT

Si tu fais ceci:
Code:
dim FonctionWinmm$
FonctionWinmm$="waveOutGetVolume
print FonctionWinmm$
tu vois immédiatement pourquoi ça plante...

EDIT

Bon, maintenant Zzzzz....
Revenir en haut Aller en bas
http://klauspanoramic.comxa.com/index.html
Minibug

Minibug


Nombre de messages : 4566
Age : 57
Localisation : Vienne (86)
Date d'inscription : 09/02/2012

a l'aide klaus Empty
MessageSujet: Re: a l'aide klaus   a l'aide klaus EmptyVen 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 ! Wink
Revenir en haut Aller en bas
http://gpp.panoramic.free.fr
pascal10000

pascal10000


Nombre de messages : 812
Localisation : Troyes
Date d'inscription : 05/02/2011

a l'aide klaus Empty
MessageSujet: Re: a l'aide klaus   a l'aide klaus EmptyVen 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

a l'aide klaus Captur10

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
Revenir en haut Aller en bas
pascal10000

pascal10000


Nombre de messages : 812
Localisation : Troyes
Date d'inscription : 05/02/2011

a l'aide klaus Empty
MessageSujet: Re: a l'aide klaus   a l'aide klaus EmptyVen 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?
Revenir en haut Aller en bas
Klaus

Klaus


Nombre de messages : 12274
Age : 74
Localisation : Ile de France
Date d'inscription : 29/12/2009

a l'aide klaus Empty
MessageSujet: Re: a l'aide klaus   a l'aide klaus EmptyVen 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 ?
Revenir en haut Aller en bas
http://klauspanoramic.comxa.com/index.html
Minibug

Minibug


Nombre de messages : 4566
Age : 57
Localisation : Vienne (86)
Date d'inscription : 09/02/2012

a l'aide klaus Empty
MessageSujet: Re: a l'aide klaus   a l'aide klaus EmptyVen 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 ?!

a l'aide klaus Sans_t12
Revenir en haut Aller en bas
http://gpp.panoramic.free.fr
Klaus

Klaus


Nombre de messages : 12274
Age : 74
Localisation : Ile de France
Date d'inscription : 29/12/2009

a l'aide klaus Empty
MessageSujet: Re: a l'aide klaus   a l'aide klaus EmptyVen 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
Revenir en haut Aller en bas
http://klauspanoramic.comxa.com/index.html
Minibug

Minibug


Nombre de messages : 4566
Age : 57
Localisation : Vienne (86)
Date d'inscription : 09/02/2012

a l'aide klaus Empty
MessageSujet: Re: a l'aide klaus   a l'aide klaus EmptyVen 8 Déc 2017 - 10:26

Salut Klaus !

Voici le fichier en question :

Spoiler:

Je vais tester ton dernier code et je reviens... Wink
Revenir en haut Aller en bas
http://gpp.panoramic.free.fr
Klaus

Klaus


Nombre de messages : 12274
Age : 74
Localisation : Ile de France
Date d'inscription : 29/12/2009

a l'aide klaus Empty
MessageSujet: Re: a l'aide klaus   a l'aide klaus EmptyVen 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.
Revenir en haut Aller en bas
http://klauspanoramic.comxa.com/index.html
Minibug

Minibug


Nombre de messages : 4566
Age : 57
Localisation : Vienne (86)
Date d'inscription : 09/02/2012

a l'aide klaus Empty
MessageSujet: Re: a l'aide klaus   a l'aide klaus EmptyVen 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é ! Laughing

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
Revenir en haut Aller en bas
http://gpp.panoramic.free.fr
Contenu sponsorisé





a l'aide klaus Empty
MessageSujet: Re: a l'aide klaus   a l'aide klaus Empty

Revenir en haut Aller en bas
 
a l'aide klaus
Revenir en haut 
Page 1 sur 2Aller à la page : 1, 2  Suivant
 Sujets similaires
-
» a laide pour codé
» Klaus ?
» Klaus ?
» Utilitaire Designer: générer une structure Panoramic valide
» @ Klaus

Permission de ce forum:Vous ne pouvez pas répondre aux sujets dans ce forum
FORUM DE DISCUSSION SUR LE LANGAGE PANORAMIC :: PANORAMIC :: A l'aide!-
Sauter vers: