PLAYER FILE Help

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
User avatar
mustafa
Posts: 1177
Joined: Fri Mar 20, 2009 11:38 am
DBs Used: DBF
Location: Alicante - Spain
Contact:

PLAYER FILE Help

Post by mustafa »

Hello friends
I need help with Player
I want through the Search button is chosen
mp3 file that will be heard.
the variable for mp3 file name is "cContenido"
occurs error.log
Play.prg (81) Error e0030 Syntax error "syntax error at '.'"
by putting "Form_1.Player_1.File: = cContenido" and if you
I put "Form_1.Player_1.Value: = cContenido"
Does no effect on that beach has no Value
but has FILE
not like going to the File Selection Control PLAYER
Player to later when the button Form_1.Player_1.Play ()
begin to hear the melody.
I put the example file that does not work and error.Log

Thanks in advance
*--------------------------------------*
Hola amigos
Necesito ayuda con Player
Quiero que mediante el Boton Search se elija el
fichero mp3 que se escuchará.
la variable para nombre del Fichero mp3 es "cContenido"
se produce error.log
Play.prg(81) Error E0030 Syntax error "syntax error at '.'"
por poner "Form_1.Player_1.File := cContenido" y si le
pongo "Form_1.Player_1.Value := cContenido "
No hace ningun efecto por que PLAYER no tiene Value
pero tiene FILE
no se como pasar la selección del Fichero al Control PLAYER
Player para que luego al pulsar el Boton Form_1.Player_1.Play()
empiece a escucharse la melodia.
Dejo el fichero ejemplo que no funciona y el error.log

Gracia de Antemano

Mustafa :oops:
Attachments
Player.zip
(1.28 KiB) Downloaded 198 times
User avatar
Roberto Lopez
HMG Founder
Posts: 4023
Joined: Wed Jul 30, 2008 6:43 pm

Re: PLAYER FILE Help

Post by Roberto Lopez »

mustafa wrote:Hello friends
I need help with Player
I want through the Search button is chosen
mp3 file that will be heard.
the variable for mp3 file name is "cContenido"
occurs error.log
Play.prg (81) Error e0030 Syntax error "syntax error at '.'"
by putting "Form_1.Player_1.File: = cContenido" and if you
I put "Form_1.Player_1.Value: = cContenido"
Does no effect on that beach has no Value
but has FILE
not like going to the File Selection Control PLAYER
Player to later when the button Form_1.Player_1.Play ()
begin to hear the melody.
I put the example file that does not work and error.Log

Thanks in advance
*--------------------------------------*
Hola amigos
Necesito ayuda con Player
Quiero que mediante el Boton Search se elija el
fichero mp3 que se escuchará.
la variable para nombre del Fichero mp3 es "cContenido"
se produce error.log
Play.prg(81) Error E0030 Syntax error "syntax error at '.'"
por poner "Form_1.Player_1.File := cContenido" y si le
pongo "Form_1.Player_1.Value := cContenido "
No hace ningun efecto por que PLAYER no tiene Value
pero tiene FILE
no se como pasar la selección del Fichero al Control PLAYER
Player para que luego al pulsar el Boton Form_1.Player_1.Play()
empiece a escucharse la melodia.
Dejo el fichero ejemplo que no funciona y el error.log

Gracia de Antemano

Mustafa :oops:

Player has not a 'value' property.

The 'file' property can be set at control definition only.

The right way to go is to use the 'open' method.

Code: Select all

/*

	Player control demo.

	Mustafá & Roberto Lopez

*/
 
#include "hmg.ch"

Function main()

	DEFINE WINDOW Form_1 AT 115,143 WIDTH 575 HEIGHT 425 MAIN TITLE "Form_1" 

		DEFINE PLAYER Player_1
			ROW    0
			COL    0
			WIDTH  0
			HEIGHT 0
			FILE ''
			HELPID Nil
			NOAUTOSIZEWINDOW .F.            
			NOAUTOSIZEMOVIE .F.              
			NOERRORDLG .F.
			NOMENU .F.
			NOOPEN .F.
			NOPLAYBAR .T.
			SHOWALL .F.
			SHOWMODE .F.
			SHOWNAME .F.                  
			SHOWPOSITION .F.
		END PLAYER
           
		@ 130,020 BUTTON Button_D1 ;
			CAPTION "Play MP3" ;
			ACTION Form_1.Player_1.Play() 

		@ 130,120 BUTTON Button_D2 ;
			CAPTION "Pause MP3" ;
			ACTION Form_1.Player_1.Pause()
                                 
		@ 130,220 BUTTON Button_D3 ;
			CAPTION "Resume MP3" ;
			ACTION Form_1.Player_1.Resume()

		@ 130,320 BUTTON Button_D4 ;
			CAPTION "End MP3" ;
			ACTION Form_1.Player_1.Position := 1

		@ 130,450 BUTTON Button_D5 ;
			CAPTION "Search" ;
			ACTION Busca_Music()

	END WINDOW

	Form_1.Center
	Form_1.Activate

Return Nil


*-------------------------------------------*
Procedure Busca_Music()
*-------------------------------------------*

	form_1.Player_1.Open ( GetFile( { { '' , '*.mp3'} } , '' , '' , .f. , .f. ) )

RETURN NIL
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
User avatar
mustafa
Posts: 1177
Joined: Fri Mar 20, 2009 11:38 am
DBs Used: DBF
Location: Alicante - Spain
Contact:

Re: PLAYER FILE Help

Post by mustafa »

Thanks Roberto
Works great
Greetings
Mustafa :lol:
Post Reply