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
» Gestion d'un système client-serveur.
a l'aide klaus - Page 2 Emptypar Klaus Aujourd'hui à 9:32

» item_index(résolu)
a l'aide klaus - Page 2 Emptypar jjn4 Mar 14 Mai 2024 - 19:38

» Bataille terrestre
a l'aide klaus - Page 2 Emptypar jjn4 Lun 13 Mai 2024 - 15:01

» SineCube
a l'aide klaus - Page 2 Emptypar Marc Sam 11 Mai 2024 - 12:38

» Editeur EliP 6 : Le Tiny éditeur avec 25 onglets de travail
a l'aide klaus - Page 2 Emptypar Marc Sam 11 Mai 2024 - 12:22

» Philharmusique
a l'aide klaus - Page 2 Emptypar jjn4 Ven 10 Mai 2024 - 13:58

» PANORAMIC V 1
a l'aide klaus - Page 2 Emptypar papydall Jeu 9 Mai 2024 - 3:22

» select intégrés [résolu]
a l'aide klaus - Page 2 Emptypar jjn4 Mer 8 Mai 2024 - 17:00

» number_mouse_up
a l'aide klaus - Page 2 Emptypar jjn4 Mer 8 Mai 2024 - 11:59

» Aide de PANORAMIC
a l'aide klaus - Page 2 Emptypar jjn4 Mer 8 Mai 2024 - 11:16

» trop de fichiers en cours
a l'aide klaus - Page 2 Emptypar lepetitmarocain Mer 8 Mai 2024 - 10:43

» Je teste PANORAMIC V 1 beta 1
a l'aide klaus - Page 2 Emptypar papydall Mer 8 Mai 2024 - 4:17

» bouton dans autre form que 0(résolu)
a l'aide klaus - Page 2 Emptypar leclode Lun 6 Mai 2024 - 13:59

» KGF_dll - nouvelles versions
a l'aide klaus - Page 2 Emptypar Klaus Lun 6 Mai 2024 - 11:41

» @Jack
a l'aide klaus - Page 2 Emptypar Jack Mar 30 Avr 2024 - 20:40

Navigation
 Portail
 Index
 Membres
 Profil
 FAQ
 Rechercher
Rechercher
 
 

Résultats par :
 
Rechercher Recherche avancée
Mai 2024
LunMarMerJeuVenSamDim
  12345
6789101112
13141516171819
20212223242526
2728293031  
CalendrierCalendrier
Le Deal du moment : -21%
LEGO® Icons 10329 Les Plantes Miniatures, ...
Voir le deal
39.59 €

 

 a l'aide klaus

Aller en bas 
3 participants
Aller à la page : Précédent  1, 2
AuteurMessage
Klaus

Klaus


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

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

Ok, j'ai également la violation d'accès. Je vais pouvoir traquer cela, maintenant.
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 - Page 2 Empty
MessageSujet: Re: a l'aide klaus   a l'aide klaus - Page 2 EmptyVen 8 Déc 2017 - 10:39

Bizarre !

Moi avec le code que je t'ai indiqué, je n'ai pas de violation d'accès.
Je suis sur seven 32 peut être que cela a une incidence ?
Revenir en haut Aller en bas
http://gpp.panoramic.free.fr
Klaus

Klaus


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

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

Ce n'est sûrement pas une coïncidence. Je vais pister cela.
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 - Page 2 Empty
MessageSujet: Re: a l'aide klaus   a l'aide klaus - Page 2 EmptyVen 8 Déc 2017 - 11:05


c'est quand même bizarre
avec le code de minibug j'ai tjr le même
probleme citer plus haut!!!!
je ne comprend que d'al
Revenir en haut Aller en bas
Klaus

Klaus


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

a l'aide klaus - Page 2 Empty
MessageSujet: Re: a l'aide klaus   a l'aide klaus - Page 2 EmptyVen 8 Déc 2017 - 11:12

Deux autres anomalies dans le code:
1. dans le sous-programme "NiveauSon:", la variable FonctionWinmm$ est chargé avec le nom de la fonction à appeler, mais il y a une virgule à la fin, ce qui est une erreur
2. contrairement à la fonction waveOutGetVolume dont le second paramètre est l'adresse d'une variable de type integer, ma fonction waveOutSetVolume prend la valeur directement comme second paramètre.

Donc, voici une version qui corrige ces deux problèmes:
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"
Dll_On "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"
File_Load 2,"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"
    Res% = dll_call2("TargetDLL",hnd_dll%,adr(FonctionWinmm$))

    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 de valeur !
    Res% = dll_call2("CallDLL2",0,TotalVol%)
Return

Sub NiveauSon()
' RECUPERE LE NIVEAU ACTUEL DU SON
    FonctionWinmm$="waveOutGetVolume"
    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(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

Ceci dit, cela ne résoud pas le problème de la violation d'accès, et je continue.


Dernière édition par Klaus le Ven 8 Déc 2017 - 11:22, é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 - Page 2 Empty
MessageSujet: Re: a l'aide klaus   a l'aide klaus - Page 2 EmptyVen 8 Déc 2017 - 11:14

@Pascal10000 :

Je t'invite à reprendre le code que j'ai posté car lors de ma première utilisation j'y ai relevé une erreur
en plus de celles que Klaus a mentionné.

Il y a une ligne ou tu as indiqué :

FonctionWinmm$="waveOutSetVolume."

au lieu de :

FonctionWinmm$="waveOutSetVolume"

Peut-être que tu ne l'a pas corrigé ?
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 - Page 2 Empty
MessageSujet: Re: a l'aide klaus   a l'aide klaus - Page 2 EmptyVen 8 Déc 2017 - 11:16

Enfin j'ai testé ton klaus
je n'ai pas d'acces de violation

sur le mixer de windows
j'ai le même problême 2 source de volume mais par contre
plus rien ne fonctionne et ce coup cest le 1er canal qui est en activation
celle que j'ai entouré en rouge

petit précision je suis sur windows 10 et ma carte de son est Realtek
Revenir en haut Aller en bas
pascal10000

pascal10000


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

a l'aide klaus - Page 2 Empty
MessageSujet: Re: a l'aide klaus   a l'aide klaus - Page 2 EmptyVen 8 Déc 2017 - 11:18

minibug

oui j'ai vue je l'ai corrigé
Revenir en haut Aller en bas
pascal10000

pascal10000


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

a l'aide klaus - Page 2 Empty
MessageSujet: Re: a l'aide klaus   a l'aide klaus - Page 2 EmptyVen 8 Déc 2017 - 11:24

j'ai testé ton dernier code

erreur de violation

a l'aide klaus - Page 2 Captur11
Revenir en haut Aller en bas
Klaus

Klaus


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

a l'aide klaus - Page 2 Empty
MessageSujet: Re: a l'aide klaus   a l'aide klaus - Page 2 EmptyVen 8 Déc 2017 - 11:25

Dans le sous-programme de changement de volume, il manquait une ligne. Voici qui est corrigé:
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"
Dll_On "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"
File_Load 2,"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"
    Res% = dll_call2("TargetDLL",hnd_dll%,adr(FonctionWinmm$))

    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 de valeur !
    Res% = dll_call2("CallDLL2",0,TotalVol%)
Return

Sub NiveauSon()
' RECUPERE LE NIVEAU ACTUEL DU SON
    FonctionWinmm$="waveOutGetVolume"
    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(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
Plus de violation d'accès, mais pas d'action non plus suir le volume. D'ailleurs, au lancement du programme, la lecture du volume actuel n'est pas reporté sur la tracbar. Je vais pister cela.
Revenir en haut Aller en bas
http://klauspanoramic.comxa.com/index.html
Klaus

Klaus


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

a l'aide klaus - Page 2 Empty
MessageSujet: Re: a l'aide klaus   a l'aide klaus - Page 2 EmptyVen 8 Déc 2017 - 11:38

Pour récupérer le niveau du volume au lancement d'une chaîne, il suffit de modifier la sub de la manière suivante:
Code:
Sub NiveauSon()
' RECUPERE LE NIVEAU ACTUEL DU SON
    FonctionWinmm$="waveOutGetVolume"
    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(Volume%)) : ' <--erreur de violation ici
    GaucheVol% = bin_and(volume%,hex("0000FFFF"))
    DroitVol% = dll_call2("bin_SHR",volume%,16)
    position 5,GaucheVol%  : ' <=========== ici, on récupère le volume
    End_Sub

Chez moi, le canal de droite est ignoré (volume toujours à zéro, quelque soit le réglage dans le gestionaire du mixeur), car le driver du haut-parleur de mon portable est en MONO. Si vous avez des enceintes STEREO, cela peut avoir un sens. Mais il faut alors prévoir deux scroll_bars et non pas une seule comme dans ce code: une pour le volume de gauche, l'autre pour le volume de droite. actuellement, bien qu'il y ait deux variables, tout est reporté sur le volume de gauche.

Bon, pour la lecture du volume, ça marche maintenant. Je continue pour la modification du volume...
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 - Page 2 Empty
MessageSujet: Re: a l'aide klaus   a l'aide klaus - Page 2 EmptyVen 8 Déc 2017 - 11:47

je vous fourni le code de démo de papydall
avec un track_bar à la place des bouttons

Code:
rem ============================================================================
rem            Augmenter / diminuer le volume son
rem ============================================================================
rem Cliquer sur les boutons pour augmenter / diminuer le volume du côté gauche
rem ou du côté droit (Utilisation d'un track_bar à la place
rem ============================================================================
Label Clic
Init()
Form_Load()

end
rem ============================================================================
SUB Init()
' Déclaration des constantes
' Variable globale du volume
    dim Vol%
    dim volume%
' Variable globale bidon pour les retour d'API
    dim ret%
' Les boutons
    track_bar 1
    min 1,0:max 1,65535
    On_Change 1,Clic
' Jouer un fichier .mp3
    sound 99 : file_load 99,"D:\Disque Album\Divers\Coldplay - Adventure Of A Lifetime .mp3"  : ' <--- Adapter le chemin
    play 99
    dll_on "winmm"
END_SUB
rem ============================================================================
Clic:
    Vol%=position(1)
    If Vol%<0 Then Vol%=0 : If Vol%>65535 Then Vol%=65535
    ret% =  dll_call2("waveOutSetVolume",0,Vol%)
return
rem ============================================================================
SUB Form_Load()
  ' Récupération du volume courant
    ret%  = dll_call2("waveOutGetVolume",0, volume%)
    Vol% = bin_and(volume%, hex("FFFF"))
    Position 1,volume%
END_SUB

mais l'inconvéniant c'est que il n'y a que le coté gauche qui fonctionne
et je voulais m'en servir pour mon poste mais refflection
panoramic n’e gère qu' une seule librairie à la fois et c'est là je j'interviens avec kgf
voilà toute l'histoire
Revenir en haut Aller en bas
pascal10000

pascal10000


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

a l'aide klaus - Page 2 Empty
MessageSujet: Re: a l'aide klaus   a l'aide klaus - Page 2 EmptyVen 8 Déc 2017 - 11:51

on c croisé klaus
pourquoi ne pas y avoir pensé aux "2 track_bar" cheers
Revenir en haut Aller en bas
Minibug

Minibug


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

a l'aide klaus - Page 2 Empty
MessageSujet: Re: a l'aide klaus   a l'aide klaus - Page 2 EmptyVen 8 Déc 2017 - 12:01

Quel intérêt de mettre 2 trackbar ?

Le plus simple serait de régler le volume du coté gauche sur le coté droit , ou inversement non ?
Je dis peut être une bêtise car cela ne semble pas aussi simple... drunken
Revenir en haut Aller en bas
http://gpp.panoramic.free.fr
Klaus

Klaus


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

a l'aide klaus - Page 2 Empty
MessageSujet: Re: a l'aide klaus   a l'aide klaus - Page 2 EmptyVen 8 Déc 2017 - 12:04

Chez moi, ça n'aurait aucun sens, car mon hardware est en MONO. La preuve: GaucheVol% reflète bien la bonne valeur, après avoir cliqué sur une station, mais DroitVol% est systématiquement égal à zéro.
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 - Page 2 Empty
MessageSujet: Re: a l'aide klaus   a l'aide klaus - Page 2 EmptyVen 8 Déc 2017 - 12:29

Chez moi, c'est pourtant du stéréo mais je n'ai le son que d'un coté et l'autre variable reste désespérément à 0 !

Juste une chose. On parle parfois de balance gauche-droite avec justement un trackbar présenté horizontalement pour passé de tout à gauche vers tout à droite.

Est ce que ce n'est pas cette variable qu'il faudrait faire varier...

a l'aide klaus - Page 2 Sans_t13
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 - Page 2 Empty
MessageSujet: Re: a l'aide klaus   a l'aide klaus - Page 2 EmptyVen 8 Déc 2017 - 12:33

klaus chez moi recuperer le son ça fonctionne
vois le niveau du vumetre en haut de l'image

mon probleme c'est ce qui est en bas de  l'image
je me retrouve avec plusieurs de source ouverte
dès que manipule le curseur l'inverse  qui agis celui qui ne reçois
les db

a l'aide klaus - Page 2 Captur12

controle si c'est le meme cas chez vous
Revenir en haut Aller en bas
Klaus

Klaus


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

a l'aide klaus - Page 2 Empty
MessageSujet: Re: a l'aide klaus   a l'aide klaus - Page 2 EmptyVen 8 Déc 2017 - 12:42

Ton affichage me semble normal, pourtant. J'ai quelque chose de similaire.

Le problème est ailleurs. En passant 0 comme premier paramètre, tu choisis le "Master Volume". Or, chez moi (et apparemment chez toi, vu ce que montrent les VuMètres), la valeur est constante et retournée comme étant la dernière valeur imposée au master volume, quelque soient les réglages dans le panneau de contrôle du mixeur. Et d'ailleurs sans aucune influence sur le volume de la sortie du haut-parleur.

Chez moi, initialement, le master volume était au-dessus des 50000, comme visiblement chez toi. Après avoir forcé le master volume à 2000, il reste à cette valeur, quelque soient les réglages des curseurs du mixeur.

Il faut donc que je comprennd d'abord le lien entre le master volume et le mixeur et de là vers la sortie haut-parleur, avant de pouvoir aller plus loin.
Revenir en haut Aller en bas
http://klauspanoramic.comxa.com/index.html
Klaus

Klaus


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

a l'aide klaus - Page 2 Empty
MessageSujet: Re: a l'aide klaus   a l'aide klaus - Page 2 EmptyVen 8 Déc 2017 - 14:05

Je viens de mettre une nouvelle version de KGF.dll en ligne, avec deux nouvelles fonctions:
Code:
volume% = dll_call0("GetMasterVolume") : ' retourne une valeur entre 0 et 65535
res% = dll_call1("SetMasterVolume",volume%) : impose cette valeur comme volume principal

A l'aide de ces deux fonctions, j'ai recodé le programme, en éliminant le besoin d'une DLL extérieure:
Code:
Dim Station$,url$,Frequence%,Q%,LeftD% ,res%,WB%
Dim Volume%,GaucheVol%,DroitVol%,Min_Track5%,Max_Track5%,Hnd_Dll%
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"
Dll_On "kgf.dll"
WB% = dll_call1("WB_Create",Handle(0))
res% = dll_call5("WB_Locate",WB%,10,50,0,0)

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"
File_Load 2,"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)
    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 !   
    DroitVol% = dll_call2("bin_SHL",DroitVol%,16)
    TotalVol% = bin_or(GaucheVol%,DroitVol%)      : ' <==== ne sera pas utilisé ici !
    res% = dll_call1("SetMasterVolume",GaucheVol%)
Return

Sub NiveauSon()
' RECUPERE LE NIVEAU ACTUEL DU SON
    Volume% = dll_call0("GetMasterVolume")
    GaucheVol% = bin_and(volume%,hex("0000FFFF"))
    DroitVol% = dll_call2("bin_SHR",volume%,16)
    position 5,GaucheVol% 
    End_Sub


************************************************************

Etein:
res% = dll_call1("WB_Delete",WB%)
Dll_Off
Terminate
Return

Le problème venait en fait de la confusion entre la notion de MasterVolume et WaveOut. Ces deux termes ne s'adressent pas du tout au même élément dans Windows. C'est pour cette raison qu'aussi bien la lecture que la modification du volume posait problème.
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 - Page 2 Empty
MessageSujet: Re: a l'aide klaus   a l'aide klaus - Page 2 EmptyVen 8 Déc 2017 - 15:37

cool cool plus que le vu metre cheers
si j'en etait capable de faire ça y a longtemps que je m'y serai consacré
mais c vrais que pour connaitre tout les apis et les secrets de windows
c une bible 3 fois plus gros que le dictionnaire.
Revenir en haut Aller en bas
Klaus

Klaus


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

a l'aide klaus - Page 2 Empty
MessageSujet: Re: a l'aide klaus   a l'aide klaus - Page 2 EmptySam 9 Déc 2017 - 12:51

J'ai modifié ma version (ancienne) de la Radio FM, en tenant compte de la nouvelle version de KGF.dll. Il y a un peu de changement dans l'organisation générale (voir texte de mn post concernant la nouvelle version).

Maintenant, la trackbar du volume agit sur les réglages du mixeur, mais la modification de la barre de volue du mixeur modifie également celle de la radio ! C'est snchronisé !

En plus, il y a une petite case à cocher à gauche de la trackbar du volume. Elle indique l'état actit/muet du haut-parleur, et elle est synchronisée aussi !

Voici cette version:
Code:
Dim Station$,url$,Frequence%,Q%,LeftD% ,res%,WB%
Dim Volume%,GaucheVol%,DroitVol%,Min_Track5%,Max_Track5%,Hnd_Dll%
DIM TotalVol%

Label Choix,Plus,Moin,Lecture,Etein
Label NiveauSon
label ChangeVolume, ChangeMute

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"
Dll_On "kgf.dll"
WB% = dll_call1("WB_Create",Handle(0))
res% = dll_call5("WB_Locate",WB%,10,50,0,0)

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"
File_Load 2,"stations.txt"
On_Click 2,Choix
Alpha 3
Left 3,260 : Top 3,20
Caption 3,"Stations:"

Check 7 : top 7,87
left 7,5
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 

On_User_Event ChangeVolume
res% = dll_call0("CreateMasterVolume")
TotalVol% = dll_call0("GetMasterVolume")
position 5,TotalVol%
res% = dll_call0("GetMasterMute")
if res%=0 then mark_on 7
on_click 7,ChangeMute

End

' changement du volume dans le panneau du mixeur Windows
ChangeVolume:
  if User_Event_WParam=hex("06020000") then position 5,User_Event_LParam
  if User_Event_WParam=hex("06010000")
    if User_Event_LParam=0
      Mark_On 7
    else
      Mark_Off 7
    end_if
  end_if
  return
 
' changement de l'état actif/muet du haut-parleur
ChangeMute:
  if checked(7)=1
    res% = dll_call1("SetMasterMute",0)
  else
    res% = dll_call1("SetMasterMute",1)
  end_if
  return

' 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:
    TotalVol%=position(5)
    If TotalVol%<0 Then TotalVol%=0
    If TotalVol%>65535 Then TotalVol%=65535
    res% = dll_call1("SetMasterVolume",TotalVol%)
Return

Sub NiveauSon()
' RECUPERE LE NIVEAU ACTUEL DU SON
    TotalVol% = dll_call0("GetMasterVolume")
    position 5,TotalVol% 
    End_Sub


************************************************************

Etein:
res% = dll_call0("DeleteMasterVolume")
res% = dll_call1("WB_Delete",WB%)
Dll_Off
Terminate
Return

J'espère que cette technique de contrôle synchronisé vous plaira !
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 - Page 2 Empty
MessageSujet: Re: a l'aide klaus   a l'aide klaus - Page 2 EmptyLun 11 Déc 2017 - 8:27

Bon et bien je vais remettre à jour ma radio alors ! drunken

Dommage c'était bien avant. Il y avait moins de lignes de codes.
C'était plus simple à mon goût. Mais bon, si c'est mieux pour toi... Wink
Revenir en haut Aller en bas
http://gpp.panoramic.free.fr
Klaus

Klaus


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

a l'aide klaus - Page 2 Empty
MessageSujet: Re: a l'aide klaus   a l'aide klaus - Page 2 EmptyLun 11 Déc 2017 - 9:18

Euh... regarde la partie significativen en fin de programme:
Code:
' / GESTIONS DU VOLUME         /
***********************************************************
NiveauSon:
    TotalVol%=position(5)
    If TotalVol%<0 Then TotalVol%=0
    If TotalVol%>65535 Then TotalVol%=65535
    res% = dll_call1("SetMasterVolume",TotalVol%)
Return

Sub NiveauSon()
' RECUPERE LE NIVEAU ACTUEL DU SON
    TotalVol% = dll_call0("GetMasterVolume")
    position 5,TotalVol%  
    End_Sub


************************************************************

Etein:
res% = dll_call0("DeleteMasterVolume")
res% = dll_call1("WB_Delete",WB%)
Dll_Off
Terminate
Return

Le sous-programme NiveauSon aussi bien que la SUB NiveauSon sont nettement plus courts... Seul le sous-programme Etein contient une ligne de plus... La fin du programme principal (juste avant END), également:
Code:
On_User_Event ChangeVolume
res% = dll_call0("CreateMasterVolume")
TotalVol% = dll_call0("GetMasterVolume")
position 5,TotalVol%
res% = dll_call0("GetMasterMute")
if res%=0 then mark_on 7
on_click 7,ChangeMute

End
Il y a une variable en plus (TotalVol%) et deux variables qui ne sont plus utilisées (volume gauche et droit)... En regardant de près, c'est plus simple ! Le seul vrai ajout, c'est la gestiondu USER_EVENT pour obtenir l'effet bi-directionnel des commandes de volume:
Code:
' changement du volume dans le panneau du mixeur Windows
ChangeVolume:
  if User_Event_WParam=hex("06020000") then position 5,User_Event_LParam
  if User_Event_WParam=hex("06010000")
    if User_Event_LParam=0
      Mark_On 7
    else
      Mark_Off 7
    end_if
  end_if
  return
 
ainsi que la définition de la case à cocher pour rendre le haut-parleur muet ou non:
Code:
Check 7 : top 7,87
left 7,5
Pas vraiment la mer à boire, non ?
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 - Page 2 Empty
MessageSujet: Re: a l'aide klaus   a l'aide klaus - Page 2 EmptyLun 11 Déc 2017 - 9:42

C'est vrai ! Pas vraiment la mer à boire. Tu as raison ! Laughing

Je vais mettre tout ça à jour ce soir. Car là il faut que j'y ailles...
Bonne journée Exclamation
Revenir en haut Aller en bas
http://gpp.panoramic.free.fr
Contenu sponsorisé





a l'aide klaus - Page 2 Empty
MessageSujet: Re: a l'aide klaus   a l'aide klaus - Page 2 Empty

Revenir en haut Aller en bas
 
a l'aide klaus
Revenir en haut 
Page 2 sur 2Aller à la page : Précédent  1, 2
 Sujets similaires
-
» a laide pour codé
» Klaus ?
» Utilitaire Designer: générer une structure Panoramic valide
» @ Klaus
» @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: