Página 1 de 1
Progress
Publicado: 20 May 2013 21:35
por nolram
Buenas Specialist
Necesito ayuda con una Progress bar la quiero utilizar como slider para saber el progreso de las canciones...
Pero no se como hacerlo........
alguien sabe como.....
GRacias....
Publicado: 20 May 2013 21:45
por carsonzillo
no es por ser desagradable pero has usado el buscador primero creo que hay un ejemplo en el foro y si no busca el amsspecialist pack de ceone que esta puesto como post fijo en el foro
Publicado: 20 May 2013 22:51
por rafaxplayer
que poquitos datos no? bueno aqui te paso un ejemplo cargando un audio con las acciones de Audio y una barra de progreso
- HIDE: ON
- Hidebb Message Hidden Description
Publicado: 20 May 2013 23:10
por abood1987
Gracias.... rafa
Re: Progress
Publicado: 20 May 2013 23:29
por nolram
Muchas Gracias Rafax... esto esta excelente
Me podrias hacer otro favor como hago para buscar una posición en el audio con la progress.......
como si fuera la de windows media player, que donde yo le de click, ahi llegue la barra
Espero me entiendas y gracias
Publicado: 21 May 2013 00:03
por rafaxplayer
eso es mas xungo....
Publicado: 21 May 2013 09:58
por Ceone
Bueno... según el objeto que uses pero mas o menos seria así:
Funciones necesarias...
function ObjectFunctionPrefix(sObjectType)
local nObjType = Page.GetObjectType(sObjectType)
if nObjType == OBJECT_BUTTON then
return Button
elseif nObjType == OBJECT_LABEL then
return Label
elseif nObjType == OBJECT_PARAGRAPH then
return Paragraph
elseif nObjType == OBJECT_IMAGE then
return Image
elseif nObjType == OBJECT_FLASH then
return Flash
elseif nObjType == OBJECT_VIDEO then
return Video
elseif nObjType == OBJECT_WEB then
return Web
elseif nObjType == OBJECT_INPUT then
return Input
elseif nObjType == OBJECT_HOTSPOT then
return Hotspot
elseif nObjType == OBJECT_LISTBOX then
return Listbox
elseif nObjType == OBJECT_COMBOBOX then
return Combobox
elseif nObjType == OBJECT_PROGRESS then
return Progress
elseif nObjType == OBJECT_TREE then
return Tree
elseif nObjType == OBJECT_RADIOBUTTON then
return RadioButton
elseif nObjType == OBJECT_RICHTEXT then
return RichText
elseif nObjType == OBJECT_CHECKBOX then
return CheckBox
elseif nObjType == OBJECT_SLIDESHOW then
return Slideshow
elseif nObjType == OBJECT_GRID then
return Grid
elseif nObjType == OBJECT_PDF then
return PDF
elseif nObjType == OBJECT_QUICKTIME then
return QuickTime
elseif nObjType == OBJECT_XBUTTON then
return xButton
elseif nObjType == OBJECT_PLUGIN then
return Plugin
else
return nil
end
end
function IsInRect(strObject)
local bReturn = false;
local tObj= ObjectFunctionPrefix(strObject)
if tObj then
local tPos = tObj.GetPos(strObject)
local tSize = tObj.GetSize(strObject)
local tMouse=System.GetMousePosition(true);
local nX=tMouse.X
local nY=tMouse.Y
if (nX >= tPos.X) and (nX <= tPos.X + tSize.Width) then
if (nY >= tPos.Y) and (nY <=tPos.Y + tSize.Height) then
bReturn = true;
end
end
end
return bReturn;
end
On PosChange de Slider:
if IsInRect(this) and System.IsKeyDown(1) then
Audio.Seek(CHANNEL_BACKGROUND, SEEK_SPECIFIC, e_Pos);
end
Aquí te dejo un ejemplo espero que lo entiendas...
- HIDE: ON
- Hidebb Message Hidden Description
Un Saludo...
Publicado: 22 May 2013 15:06
por nolram
Gracias Ceone realmente aprecio tu ayuda...
ese ejemplo me sirvió para otro proyecto.......
Pero

si puedes lograr la otra parte de la progress te agradeceria mucho
.....
Gracias.....
Publicado: 23 May 2013 08:07
por Ceone
Publicado: 23 May 2013 15:09
por nolram
Ceone no se si conozcas el reproductor de Lucsled que esta qui mismo en este foro...
http://amsspecialist.com//viewtopic.php ... ilit=xplay
bueno si ya lo has visto mi idea es que la progress quede como la de ese reproductor.......
asi que pues agradezco tu ayuda si me puedes decir como hacerlo
y pues por eso lo de la otra parte por que.....bueno rafaxplayer y tu ya me dieron el script para que la progress corra con la cancion solo falta hacer click sobre ella para que la cancion retroceda o adelante::::
ESpero me entiendan
GRACIAS::::
Publicado: 23 May 2013 17:41
por Ceone
Funciones necesarias....
function ObjectFunctionPrefix(sObjectType)
local nObjType = Page.GetObjectType(sObjectType)
if nObjType == OBJECT_BUTTON then
return Button
elseif nObjType == OBJECT_LABEL then
return Label
elseif nObjType == OBJECT_PARAGRAPH then
return Paragraph
elseif nObjType == OBJECT_IMAGE then
return Image
elseif nObjType == OBJECT_FLASH then
return Flash
elseif nObjType == OBJECT_VIDEO then
return Video
elseif nObjType == OBJECT_WEB then
return Web
elseif nObjType == OBJECT_INPUT then
return Input
elseif nObjType == OBJECT_HOTSPOT then
return Hotspot
elseif nObjType == OBJECT_LISTBOX then
return Listbox
elseif nObjType == OBJECT_COMBOBOX then
return Combobox
elseif nObjType == OBJECT_PROGRESS then
return Progress
elseif nObjType == OBJECT_TREE then
return Tree
elseif nObjType == OBJECT_RADIOBUTTON then
return RadioButton
elseif nObjType == OBJECT_RICHTEXT then
return RichText
elseif nObjType == OBJECT_CHECKBOX then
return CheckBox
elseif nObjType == OBJECT_SLIDESHOW then
return Slideshow
elseif nObjType == OBJECT_GRID then
return Grid
elseif nObjType == OBJECT_PDF then
return PDF
elseif nObjType == OBJECT_QUICKTIME then
return QuickTime
elseif nObjType == OBJECT_XBUTTON then
return xButton
elseif nObjType == OBJECT_PLUGIN then
return Plugin
else
return nil
end
end
function GetSec(strObject, strBackgroundChannel)
local Sec = nil;
local tObj = ObjectFunctionPrefix(strObject);
if tObj then
if Audio.GetLength(strBackgroundChannel) ~= -1 then
local tPos = tObj.GetPos(strObject);
local tSize = tObj.GetSize(strObject);
local tMouse = System.GetMousePosition(true);
local tAudio = Audio.GetLength(strBackgroundChannel);
Sec = (tMouse.X-tPos.X)*(tAudio/tSize.Width);
end
end
return Sec;
end
Y en el objeto que desees lo siguiente:
(ON CLICK)
e_Pos = GetSec(this, CHANNEL_BACKGROUND);
if e_Pos ~= nil then
Audio.Seek(CHANNEL_BACKGROUND, SEEK_SPECIFIC, e_Pos);
end
He tenido que modificar un poco por que Slider esta realmente echo para esta función y Progress tiene muchas limitaciones pero bueno... tu quieres un progress pues tirale...
La función GetSec lo que hace es decir el segundo donde se tiene que enviar y eso se consigue haciendo unas matemáticas realmente simples en la que intervienen la posición del objeto, la medida del objeto y por ultimo la posición del mouse... algo realmente muy simple en el que sabiendo estos datos se puede saber la posición de la canción donde la quieres enviar... No he redondeado el numero, pero bueno eso ya es cosa tuya...
- HIDE: ON
- Hidebb Message Hidden Description
Publicado: 23 May 2013 22:28
por abood1987
Gracias.... Ceone
very good

Publicado: 24 May 2013 01:52
por Kevin
gracias..
Publicado: 29 May 2013 00:37
por nolram
Publicado: 29 May 2013 18:53
por tam
GRACIAS::::