General :  K-Meleon Web Browser Forum
General discussion about K-Meleon 
exec (command line) / exec(ligne de commande)
Posted by: Mec94
Date: September 16, 2008 08:50AM

Bonjour, Hi,

J'utilise cette commande / I use this comand :

exec("\"".getfolder(MacroFolder)."\\PgLdSound\\Sounder.exe\" ".$_PgLdSound_Choice." >Nul") : 0;

ou / Where :

$_PgLdSound_Choice_Path = promptforfile( $_PgLdSound_Path, "Sound Files", "*.wav" );
$_PLS_Length = length($_PgLdSound_Path );
setpref( STRING, "k-meleon_pgldsound_choice", substr($_PgLdSound_Choice_Path, $_PLS_Length + 1 ));

Je voudrais savoir comment ecrire la commande exec pour que : / I would like Know how can I write the exec command for :

$_PgLdSound_Choice

peut etre autre part que le répertoire du lecteur se trouvant dans le repertoire de K-meleon / can be in other folder than the folder of the program which read the file and witch is in the folder of K-meleon.

Merci pour votre aide/Thanks for your help.

Options: ReplyQuote
Re: exec (command line) / exec(ligne de commande)
Posted by: desga2
Date: September 16, 2008 12:34PM

I'm sorry but i don't understand you like do, can you explain it?

You can use the path you like to Sounder.exe and *.wav file.

K-Meleon in Spanish

Options: ReplyQuote
Re: exec (command line) / exec(ligne de commande)
Posted by: JamesD
Date: September 16, 2008 02:09PM

@ Mec94

Sounder.exe does not like using a path. It expects the wave file to be in the same folder in which it resides.
sounder.exe c:\windows\media\tada.wav   This will not work.
sounder.exe tada.wav                    this will work.



Options: ReplyQuote
Re: exec (command line) / exec(ligne de commande)
Posted by: Mec94
Date: September 16, 2008 02:26PM

Hello,

I want to know how the exec command could be write with $_PgLdSound_Choice. Actually with that only folder in k-meleon are knows (here x:\.....). My sound file are on d:\.......

Like I said before $_PgLdSound_Choice is in the k-meleon folder.

Options: ReplyQuote
Re: exec (command line) / exec(ligne de commande)
Posted by: desga2
Date: September 17, 2008 06:20PM

@ Mec94:

You are using $_PgLdSound_Choice already in your exec:
exec("\"".getfolder(MacroFolder)."\\PgLdSound\\Sounder.exe\" ".$_PgLdSound_Choice." >Nul") : 0;


I think that you like use this exec in conditional statement:

$_PgLdSound_Choice != "" ? exec("\"".getfolder(MacroFolder)."\\PgLdSound\\Sounder.exe\" ".$_PgLdSound_Choice) : 0;


You can obtain $_PgLdSound_Choice=WAV file path from pref or from prompt:
# To setting data:
$_PgLdSound_Choice = promptforfile( $_PgLdSound_Path, "Sound Files", "*.wav" );
setpref(STRING, "k-meleon.pgldsound.choice", $_PgLdSound_Choice);
# To get data:
$_PgLdSound_Choice = getpref(STRING, "k-meleon.pgldsound.choice");

K-Meleon in Spanish



Edited 1 time(s). Last edit at 09/17/2008 06:27PM by desga2.

Options: ReplyQuote
Re: exec (command line) / exec(ligne de commande)
Posted by: Mec94
Date: September 18, 2008 09:19AM

Hi,


I just want write a exec(command line) with the path of the player in the first part, and the path of the file sound in a second part.

The file sound could be on an other drive or the same drive but not the same folder of player.

Actually the exec take the player and the sound file in the same folder.

a+

Options: ReplyQuote
Re: exec (command line) / exec(ligne de commande)
Posted by: JamesD
Date: September 18, 2008 12:17PM

@ Mec94

I don't think that will work.

Quote
JamesD
Sounder.exe does not like using a path. It expects the wave file to be in the same folder in which it resides.

sounder.exe c:\windows\media\tada.wav This will not work.
sounder.exe tada.wav this will work.

I did a test using the command prompt. I put a copy of sounder.exe in the folder where the command prompt starts. I tried the code listed above. I got a failure noise pointing to c:\windows\media\tada.wav so I then put a copy of tada.wav in the same folder. The wave file played there.

Options: ReplyQuote
Re: exec (command line) / exec(ligne de commande)
Posted by: Mec94
Date: September 18, 2008 01:50PM

Hi,


not only sounder.exe, any player.

a+

Options: ReplyQuote
Re: exec (command line) / exec(ligne de commande)
Posted by: JamesD
Date: September 18, 2008 03:01PM

To start my audio player which is dB PowerAmp http://en.wikipedia.org/wiki/DBpoweramp, I can use this exec statement.
exec("C:\\Program Files\\Illustrate\\dBpowerAMP\\Amp.exe") ;


Options: ReplyQuote
Re: exec (command line) / exec(ligne de commande)
Posted by: Mec94
Date: September 18, 2008 03:48PM

Hi,

thank's I know how to start a player but I want to start also with the player a playlist or a file soung.

Options: ReplyQuote
Re: exec (command line) / exec(ligne de commande)
Posted by: JujuLand
Date: September 18, 2008 04:35PM

Je pense que, si comme le dis JamesD, il n'est pas possible de spécifier un chemin pour le fichier à lire, il faut passer par un fichier bat/cmd :

-se déplacer dans le dossier du fichier ou de la liste à lire
-executer le player avec le chemin complet et, comme paramètre, le nom du fichier sans chemin.

Mais tu peux essayer aussi çà:

exec("\"".getfolder(MacroFolder)."\\PgLdSound\\Sounder.exe\" \"".$_PgLdSound_Choice."\" >Nul") : 0;

si évidemment $_PgLdSound_Choice contient le nom avec le chemin.

A essayer ... car pour moi, il manquait les quotes autour du nom du fichier à lire (avec le chemin).

A+



Mozilla/5.0 (x11; U; Linux x86_64; fr-FR; rv:38.0) Gecko/20100101 Ubuntu/12.04 K-Meleon/76.0


Web: http://jujuland.pagesperso-orange.fr/
Mail : alain [dot] aupeix [at] wanadoo [dot] fr



Ubuntu 12.04 - Gramps 3.4.9 - Harbour 3.2.0 - Hwgui 2.20-3 - K-Meleon 76.0 rc



Options: ReplyQuote
Re: exec (command line) / exec(ligne de commande)
Posted by: desga2
Date: September 18, 2008 07:21PM

@ Mec94:
Quote
Mec94
I know how to start a player but I want to start also with the player a playlist or a file soung.

Are you tried with 1by1?

Quote
1by1 Help File
Command line options

Usage: 1by1.exe <audio file / folder / Cue sheet / playlist> <options>

Auto Resume options:
/r Resume the last track and position
/rt Play the last track from the beginning
/rd Play the last directory from the beginning (depending on how it is sorted)

Other options:
/close Close the program after playing one track
/hide Hide the window and enable the Systray icon
/enqueue Enqueue the given file to the playlist view
/newinst Starts a new instance ignoring the 'Only one instance' setting
/localini Never try to use Appdata folder for ini file storage

K-Meleon in Spanish



Edited 1 time(s). Last edit at 09/18/2008 07:25PM by desga2.

Options: ReplyQuote
Re: exec (command line) / exec(ligne de commande)
Posted by: Mec94
Date: September 19, 2008 08:11AM

Bonjour,

Merci Juju, effectivment il y a du mieux avec l'ecriture de ta commande.

Je vois bien le path du fichier mais il me manque la lettre du disque sur lequel il se trouve. ???????

a +

Options: ReplyQuote
Re: exec (command line) / exec(ligne de commande)
Posted by: JujuLand
Date: September 19, 2008 09:26AM

Je suppose que la ligne que tu as donné est incomplète, sinon, il y a une erreur de syntaxe qui devrait générer une erreur au lancement de K-Meleon.

Essaye ça pour voir quelle commande est générée

alert("\"".getfolder(MacroFolder)."\\PgLdSound\\Sounder.exe\" \"".$_PgLdSound_Choice."\" >Nul","");

Il est probable que tu as une erreur dans le contenu de $_PgLdSound_Choice

L'erreur la plus probable, est que tu as saisi la valeur à la main, et que tu as saisi un truc du style:

E:\mon_rep au lieu de E:\\mon_rep

A+



Mozilla/5.0 (x11; U; Linux x86_64; fr-FR; rv:38.0) Gecko/20100101 Ubuntu/12.04 K-Meleon/76.0


Web: http://jujuland.pagesperso-orange.fr/
Mail : alain [dot] aupeix [at] wanadoo [dot] fr



Ubuntu 12.04 - Gramps 3.4.9 - Harbour 3.2.0 - Hwgui 2.20-3 - K-Meleon 76.0 rc



Options: ReplyQuote
Re: exec (command line) / exec(ligne de commande)
Posted by: Mec94
Date: September 19, 2008 10:19AM

oui c'est bien ca j'ai le path du fichier sans la lettre du disque dur. Mais je ne saisie rien cela viens d'une boite de dialogue ou je click sur le fichier et que je récupère ainsi :

$_PgLdSound_Choice_Path = promptforfile( $_PgLdSound_Path, "Sound Files", "*.wav" );
$_PLS_Length = length($_PgLdSound_Path );
setpref( STRING, "k-meleon_pgldsound_choice", substr($_PgLdSound_Choice_Path, $_PLS_Length + 1 ));

puis par

$_PgLdSound_Use = getpref( BOOL , "k-meleon_pgldsound_use" );
$_PgLdSound_Choice = getpref( STRING , "k-meleon_pgldsound_choice" );
exec("\"".getfolder(MacroFolder)."\\PgLdSound\\Sounder.exe\" \"".$_PgLdSound_Choice."\" >Nul");

Options: ReplyQuote
Re: exec (command line) / exec(ligne de commande)
Posted by: JujuLand
Date: September 19, 2008 11:12AM

Essaye çà:

$_PgLdSound_Choice_Path = promptforfile( $_PgLdSound_Path, "Sound Files", "*.wav" );
alert($_PgLdSound_Path,"")
$_PLS_Length = length($_PgLdSound_Path );
setpref( STRING, "k-meleon_pgldsound_choice", substr($_PgLdSound_Choice_Path, $_PLS_Length + 1 ));
getpref(string,"k-meleon_pgldsound_choice");
alert($_PgLdSound_Path,"")

Et vois s'il y a une différence entre les deux affichages

A+



Mozilla/5.0 (x11; U; Linux x86_64; fr-FR; rv:38.0) Gecko/20100101 Ubuntu/12.04 K-Meleon/76.0


Web: http://jujuland.pagesperso-orange.fr/
Mail : alain [dot] aupeix [at] wanadoo [dot] fr



Ubuntu 12.04 - Gramps 3.4.9 - Harbour 3.2.0 - Hwgui 2.20-3 - K-Meleon 76.0 rc



Options: ReplyQuote
Re: exec (command line) / exec(ligne de commande)
Posted by: Mec94
Date: September 19, 2008 12:41PM

Merci Juju pour m'avoir permis de résoudre ce problème.

J'ai pu trouver les erreurs.

Pour résumer :

- Comme il est dit plus haut Sounder.exe n'accepte pas les sons qui sont situés autre part que le répertoire Macro/Pglsound de K-Meleon.

- le substr dans le setpref n'est pas bon.

deux codes un pour le sounder.exe pour lancer un son a la fin du chargement de page et le second pour lancer un player. Les deux players sont dans leur propre repertoire dans le dossier macro de k-meleon.

la difference entre les deux c'est que Sounder.exe lui n'apparait pas lors de son lancement, ce qui n'est pas le cas du player de la playlist.

Code :
## ------------------------------------------------------------------------------------------------------------------
# Chargement d'une Playlist ou d'un fichier son
## ------------------------------------------------------------------------------------------------------------------
_Playlist_Sound_On{
# checkmark value for the on menu;
menuchecked=getpref( BOOL , "k-meleon_Playlist_use" )==true;
# set the userpref k-meleon_Playlist_use to true;
setpref( BOOL , "k-meleon_Playlist_use", true );
# set the userpref k-meleon_pgldsound_use to false;
setpref( BOOL , "k-meleon_pgldsound_use", false );
}
#
_Playlist_Sound_Off{
# checkmark value for the off menu;
menuchecked=getpref( BOOL , "k-meleon_Playlist_use" )==false;
# set the userpref k-meleon Playlist_use to false;
setpref( BOOL , "k-meleon_Playlist_use", false );
}
#
_Playlist_Configure{
#Prompts the user for a file, displaying only the files matching the pattern.
$_Playlist_Choice_Path = promptforfile( $_Playlist_Path, "Sound Files", "" );
$_PLS_Length = length($_Playlist_Choice_Path );
setpref( STRING, "k-meleon_Playlist_choice", $_Playlist_Choice_Path);
}
## ------------------------------------------------------------------------------------------------------------------
# Jouer du son lors du chargment de la page
## ------------------------------------------------------------------------------------------------------------------
_PgLdSound_Sound_On{
# checkmark value for the on menu;
menuchecked=getpref( BOOL , "k-meleon_pgldsound_use" )==true;
# set the userpref k-meleon_pgldsound_use to true;
setpref( BOOL , "k-meleon_pgldsound_use", true );
# set the userpref k-meleon_Playlist_use to false;
setpref( BOOL , "k-meleon_Playlist_use", false);
}
#
_PgLdSound_Sound_Off{
# checkmark value for the off menu;
menuchecked=getpref( BOOL , "k-meleon_pgldsound_use" )==false;
# set the userpref k-meleon pgldsound_use to false;
setpref( BOOL , "k-meleon_pgldsound_use", false );
}
#
_PgLdSound_Configure{
#Prompts the user for a file, displaying only the files matching the pattern.
$_PgLdSound_Choice_Path = promptforfile( $_PgLdSound_Path, "Sound Files", "*.wav");
$_PLS_Length = length($_PgLdSound_Choice_Path);
setpref(STRING, "k-meleon_pgldsound_choice", $_PgLdSound_Choice_Path);
}

Dans le build du menu :

setmenu("Chargement de Page en Musique",macro,"ON" . " (" .getpref( STRING , "k-meleon_pgldsound_choice" ) ." )",_PgLdSound_Sound_On,0);
setmenu("Chargement de Page en Musique",macro,"OFF",_PgLdSound_Sound_Off,1);
setmenu("Chargement de Page en Musique",separator,2);
setmenu("Chargement de Page en Musique",macro,"Configure ...",_PgLdSound_Configure,3);
setmenu("&Parametrages Personnel",popup,"Chargement d'une Playlist",Misc);
setmenu("Chargement d'une Playlist",macro,"ON" . " (" .getpref( STRING , "k-meleon_Playlist_choice" ) ." )",_Playlist_Sound_On,0);
setmenu("Chargement d'une Playlist",macro,"OFF",_Playlist_Sound_Off,1);
setmenu("Chargement d'une Playlist",separator,2);
setmenu("Chargement d'une Playlist",macro,"Configure ...",_Playlist_Configure,3);

#
_Play_Get_Path{
getpref(BOOL,"k-meleon_pgldsound_use")==true?$_PgLdSound_Path=getfolder(MacroFolder)."\\PgLdSound":$_Playlist_Path=getfolder(MacroFolder)."\\Playlist";
}
#
_Play_Sound{
getpref(BOOL,"k-meleon_pgldsound_use")==true?&_Play_Sounder:0;
getpref(BOOL,"k-meleon_Playlist_use")==true?&_Play_MPC:0;
}
#
_Play_Sounder{
$_PgLdSound_Use = getpref( BOOL , "k-meleon_pgldsound_use" );
$_PgLdSound_Choice = getpref( STRING , "k-meleon_pgldsound_choice" );
#alert("\"".getfolder(MacroFolder)."\\PgLdSound\\Sounder.exe\" \"".$_PgLdSound_Choice."\" >Nul","");
exec("\"".getfolder(MacroFolder)."\\PgLdSound\\Sounder.exe\" \"".$_PgLdSound_Choice."\"");
}
#
_Play_MPC{
$_Playlist_Use = getpref( BOOL , "k-meleon_Playlist_use" );
$_Playlist_Choice = getpref( STRING , "k-meleon_Playlist_choice" );
#exec("\"".getfolder(MacroFolder)."\\Playlist\\mplayerc.exe\" ".$_Playlist_Choice." >Nul");
exec("\"".getfolder(MacroFolder)."\\Playlist\\mplayerc.exe\" \"".$_Playlist_Choice."\"");
}
#
$OnStartup=$OnStartup."_Play_Get_Path;";
$OnLoad=$OnLoad."_Play_Sound;";

Merci pour votre aide.

a+

Options: ReplyQuote
Re: exec (command line) / exec(ligne de commande)
Posted by: JujuLand
Date: September 19, 2008 01:43PM

Les deux players sont dans leur propre repertoire dans le dossier macro de k-meleon.
Bof, pas top ... je verrais plutot un sous répertoire de C:\program Files\K-Meleon\Tools

A+



Mozilla/5.0 (x11; U; Linux x86_64; fr-FR; rv:38.0) Gecko/20100101 Ubuntu/12.04 K-Meleon/76.0


Web: http://jujuland.pagesperso-orange.fr/
Mail : alain [dot] aupeix [at] wanadoo [dot] fr



Ubuntu 12.04 - Gramps 3.4.9 - Harbour 3.2.0 - Hwgui 2.20-3 - K-Meleon 76.0 rc



Options: ReplyQuote
Re: exec (command line) / exec(ligne de commande)
Posted by: Mec94
Date: September 19, 2008 01:47PM

Oui on peut le faire.

Options: ReplyQuote


K-Meleon forum is powered by Phorum.