Sunteți pe pagina 1din 6

Reproductor de Música/Video

Lo voy a explicar primero como hacer una máscara para poder aplicarla en el reproductor en este caso vamos a tener
que utilizar el Photoshop(cualquier versión) abrimos un nuevo documento en mi caso voy a utilizar 822px X 490px y
solamente va a contener 2 colores blanco y negro.... y le daremos la forma que querramos hacer como en la imágen, El
formato para guardar pueder ser PNG, BMP, JPG, GIF(sin efecto).
Ahora una vez guardado vamos a crear la capa/base del reproductor de la misma forma que el anterior pero solamente
utilizando la parte blanca y no el negro porque en el programa que utilizaremos el negro va a ser invisible, por lo tanto
el blanco visible. asi como se muestra en la imágen.

Abrimos el programa y nos va a aparecer así

Vamos a darle el tamaño que hemos elegido en las imágenes


Vamos a aplicar la máscara

Si le quieren poner un ICONO el cual les recomiendo hagan esto

Si le quieren poner quien lo hizo, su página, el año, o algo tienen que ir a la pestaña "Versión" y tildan la única opción que
hay
Le dan aceptar y nos quedaría algo así.Ahora damos doble clic en la parte blanca y nos saldrá este cuadro para aplicar la
2°máscara.

Ahora agregaremos plugin(reproductor), listbox(lista para seleccionar) -->Menú object y seleccionamos estas 2 opciones
crear.Una vez que hayan puesto el plugin del Reproductor directamente pongan Aceptar y lo acomodan al igual que la
lista. Ahora vamos a colocar 4 botones el programa tiene botones ya predeterminado o pueden buscar y descargar.

1°) Botón Cerrar


2°) Botón Minimizar
3°) Botón Cargar Música
4°) Botón Cargar Videos

Seleccionamos las que mas nos gusten tendríamos este resultado

Ahora lo que tenemos que hacer es ponerle los códigos para que esto pueda funcionar .

El primer código
Seleccionamos el "plugin" del reproductor y damos "CTRL + ENTER" para entrar en las propiedades y nos saldrá este
cuadro

Escribiremos esto

nCount ="";
nNext ="";
sFile ="";
nCount = ListBox.GetCount("ListBox1");
tSelected = ListBox.GetSelected("ListBox1");
if tSelected then
nSelected = tSelected[1];
nNext = nSelected;
if nNext < nCount then
nNext = nNext+1;
ListBox.SelectItem("ListBox1", nNext);
sFile = ListBox.GetItemData("ListBox1", nNext);
MediaPlayer.Load("Plugin1", sFile);
MediaPlayer.Play("Plugin1");
elseif nNext == nCount then
ListBox.SelectItem("ListBox1", 1);
sFile = ListBox.GetItemData("ListBox1", 1);
MediaPlayer.Load("Plugin1r", sFile);
MediaPlayer.Play("Plugin1");
end
end

Le damos Aceptar

El segundo código

Vamos a la lista el mismo paso anterior

Escribiremos esto

tSelected = ListBox.GetSelected("ListBox1");
if tSelected then
sFile = ListBox.GetItemData("ListBox1", tSelected[1]);
MediaPlayer.Load("Plugin1",sFile);
MediaPlayer.Play("Plugin1");
end
Ahora para los botones lo mismo

Este para el botón de Cargar Música

-- Pick a default folder to start the browsing


myfolder = Shell.GetFolder(SHF_MYDOCUMENTS);
LB = "ListBox1";
--Disable listbox Updating
ListBox.SetUpdate(LB, false);
-- Show the file browse dialog
folder = Dialog.FolderBrowse("Open Folder", myfolder);
if folder ~= "CANCEL" then
ListBox.SetEnabled(LB, true);
ListBox.DeleteItem(LB, -1);
-- tbSearchFiles = {"*.doc", "*.ppt", "*.odt", "*.exe"}; set your own file types here
tbSearchFiles = {"*.mp3","*.wav","*.wma","*.mid"};
for index,type in tbSearchFiles do
file = File.Find(folder, type, false, false, nil);
if file ~= nil and file ~="CANCEL" then
--do the following for each file:
for j,file_path in file do
--add the item to the listbox, with the name visible and path as data
tbFilePath = String.SplitPath(file_path);
sFile = tbFilePath.Filename..tbFilePath.Extension;
ListBox.AddItem(LB, sFile, file_path);
end
end
end
end
--Allow the listbox to display the updated content
ListBox.SetUpdate(LB, true);

Lo mismo para el botón Cargar Videos

-- Pick a default folder to start the browsing


myfolder = Shell.GetFolder(SHF_MYDOCUMENTS);
LB = "ListBox1";
--Disable listbox Updating
ListBox.SetUpdate(LB, false);
-- Show the file browse dialog
folder = Dialog.FolderBrowse("Open Folder", myfolder);
if folder ~= "CANCEL" then
ListBox.SetEnabled(LB, true);
ListBox.DeleteItem(LB, -1);
-- tbSearchFiles = {"*.doc", "*.ppt", "*.odt", "*.exe"}; set your own file types here
tbSearchFiles = {"*.dat","*.avi","*.mpg","*.wmv","*.asf","*.mp4"};
for index,type in tbSearchFiles do
file = File.Find(folder, type, false, false, nil);
if file ~= nil and file ~="CANCEL" then
--do the following for each file:
for j,file_path in file do
--add the item to the listbox, with the name visible and path as data
tbFilePath = String.SplitPath(file_path);
sFile = tbFilePath.Filename..tbFilePath.Extension;
ListBox.AddItem(LB, sFile, file_path);
end
end
end
end
--Allow the listbox to display the updated content
ListBox.SetUpdate(LB, true);

En el boton para cerrar hacemos esto


En boton para Minimizar poner el comando Minimizar

Por último haremos esto.Pueden precionar "F7"-->es igual al CD Dorado de la imagen

S-ar putea să vă placă și