home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 1_2002.ISO / Data / Zips / CODE_UPLOAD3312292000.psc / Repro.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  2000-01-17  |  13.2 KB  |  422 lines

  1. VERSION 5.00
  2. Object = "{27395F88-0C0C-101B-A3C9-08002B2F49FB}#1.1#0"; "PICCLP32.OCX"
  3. Object = "{C7978AF1-C807-11D3-8138-C648DCBB7330}#9.0#0"; "DsReproductor.ocx"
  4. Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
  5. Begin VB.Form frmPlayer 
  6.    BackColor       =   &H80000012&
  7.    BorderStyle     =   1  'Fixed Single
  8.    Caption         =   "Ds Mp3"
  9.    ClientHeight    =   4065
  10.    ClientLeft      =   45
  11.    ClientTop       =   330
  12.    ClientWidth     =   4140
  13.    Icon            =   "Repro.frx":0000
  14.    LinkTopic       =   "Form1"
  15.    MaxButton       =   0   'False
  16.    MinButton       =   0   'False
  17.    Picture         =   "Repro.frx":0442
  18.    ScaleHeight     =   4065
  19.    ScaleWidth      =   4140
  20.    StartUpPosition =   3  'Windows Default
  21.    Begin MSComDlg.CommonDialog Dialog1 
  22.       Left            =   1635
  23.       Top             =   2325
  24.       _ExtentX        =   847
  25.       _ExtentY        =   847
  26.       _Version        =   393216
  27.    End
  28.    Begin VB.CommandButton Command5 
  29.       Caption         =   "Abrir Archivo"
  30.       Height          =   315
  31.       Left            =   1425
  32.       TabIndex        =   8
  33.       Top             =   3630
  34.       Width           =   1260
  35.    End
  36.    Begin VB.CommandButton Command4 
  37.       Caption         =   "Limpiar Lista"
  38.       Height          =   315
  39.       Left            =   75
  40.       TabIndex        =   7
  41.       Top             =   3630
  42.       Width           =   1260
  43.    End
  44.    Begin VB.CommandButton Command3 
  45.       Caption         =   "Borrar Tema"
  46.       Height          =   315
  47.       Left            =   1425
  48.       TabIndex        =   5
  49.       Top             =   3255
  50.       Width           =   1260
  51.    End
  52.    Begin VB.CommandButton Command2 
  53.       Caption         =   "Grabar lista"
  54.       Height          =   315
  55.       Left            =   60
  56.       TabIndex        =   4
  57.       Top             =   3255
  58.       Width           =   1260
  59.    End
  60.    Begin VB.CommandButton Command1 
  61.       Caption         =   "Cerrar"
  62.       Height          =   345
  63.       Left            =   3120
  64.       TabIndex        =   3
  65.       Top             =   3255
  66.       Width           =   930
  67.    End
  68.    Begin VB.Timer Timer2 
  69.       Enabled         =   0   'False
  70.       Interval        =   500
  71.       Left            =   975
  72.       Top             =   2565
  73.    End
  74.    Begin VB.Timer Timer1 
  75.       Enabled         =   0   'False
  76.       Interval        =   500
  77.       Left            =   525
  78.       Top             =   2610
  79.    End
  80.    Begin VB.ListBox List1 
  81.       Height          =   1425
  82.       Left            =   45
  83.       TabIndex        =   2
  84.       Top             =   1755
  85.       Width           =   4005
  86.    End
  87.    Begin PicClip.PictureClip PicClip1 
  88.       Left            =   660
  89.       Top             =   1875
  90.       _ExtentX        =   3598
  91.       _ExtentY        =   953
  92.       _Version        =   393216
  93.       Rows            =   2
  94.       Cols            =   6
  95.       Picture         =   "Repro.frx":17BB6
  96.    End
  97.    Begin DsReproductor.DsRepro DsRepro1 
  98.       Left            =   600
  99.       Top             =   2340
  100.       _ExtentX        =   847
  101.       _ExtentY        =   847
  102.    End
  103.    Begin VB.Label Label2 
  104.       BackColor       =   &H00000000&
  105.       BorderStyle     =   1  'Fixed Single
  106.       ForeColor       =   &H00FFFFFF&
  107.       Height          =   240
  108.       Left            =   165
  109.       TabIndex        =   6
  110.       Top             =   975
  111.       Width           =   3780
  112.    End
  113.    Begin VB.Label Label1 
  114.       BackColor       =   &H80000008&
  115.       Caption         =   "1999.-Carlos D'Agostino. - Todos los Derechos. "
  116.       ForeColor       =   &H000000FF&
  117.       Height          =   375
  118.       Left            =   180
  119.       TabIndex        =   1
  120.       Top             =   1800
  121.       Width           =   3855
  122.    End
  123.    Begin VB.Label LCD 
  124.       Alignment       =   2  'Center
  125.       BackColor       =   &H00004000&
  126.       BorderStyle     =   1  'Fixed Single
  127.       Caption         =   "00:00"
  128.       BeginProperty Font 
  129.          Name            =   "Arial"
  130.          Size            =   20.25
  131.          Charset         =   0
  132.          Weight          =   700
  133.          Underline       =   0   'False
  134.          Italic          =   -1  'True
  135.          Strikethrough   =   0   'False
  136.       EndProperty
  137.       ForeColor       =   &H0000FF00&
  138.       Height          =   555
  139.       Left            =   240
  140.       TabIndex        =   0
  141.       Top             =   360
  142.       Width           =   1290
  143.    End
  144.    Begin VB.Image Image1 
  145.       Height          =   285
  146.       Index           =   5
  147.       Left            =   2070
  148.       Top             =   1335
  149.       Width           =   330
  150.    End
  151.    Begin VB.Image Image1 
  152.       Height          =   285
  153.       Index           =   4
  154.       Left            =   1605
  155.       Top             =   1320
  156.       Width           =   360
  157.    End
  158.    Begin VB.Image Image1 
  159.       Height          =   285
  160.       Index           =   3
  161.       Left            =   1260
  162.       Top             =   1320
  163.       Width           =   375
  164.    End
  165.    Begin VB.Image Image1 
  166.       Height          =   285
  167.       Index           =   2
  168.       Left            =   915
  169.       Top             =   1320
  170.       Width           =   375
  171.    End
  172.    Begin VB.Image Image1 
  173.       Height          =   270
  174.       Index           =   1
  175.       Left            =   570
  176.       Top             =   1320
  177.       Width           =   360
  178.    End
  179.    Begin VB.Image Image1 
  180.       Height          =   255
  181.       Index           =   0
  182.       Left            =   240
  183.       Top             =   1320
  184.       Width           =   360
  185.    End
  186. Attribute VB_Name = "frmPlayer"
  187. Attribute VB_GlobalNameSpace = False
  188. Attribute VB_Creatable = False
  189. Attribute VB_PredeclaredId = True
  190. Attribute VB_Exposed = False
  191. Option Explicit
  192. Dim Playing As Boolean, PlayIndex As Integer, stoping As Boolean
  193. Dim a As String, bTime As Boolean
  194. Const conHwndTopmost = -1
  195. Const conHwndNoTopmost = -2
  196. Const conSwpNoActivate = &H10
  197. Const conSwpShowWindow = &H40
  198. Private Sub Command1_Click()
  199.     frmPlayer.Height = 2115
  200.     If List1.ListCount > 0 Then
  201.        SetControls True, True, True, True, True, True
  202.     Else
  203.        SetControls False, False, False, False, False, True
  204.     End If
  205. End Sub
  206. Private Sub Command2_Click()
  207.   Dim archi As String, i As Integer
  208.   Static LastFilter
  209.   If LastFilter = 0 Then LastFilter = 1
  210.   On Error GoTo ErrHandler
  211.   Dialog1.CancelError = True
  212.   Dialog1.InitDir = App.Path
  213.   Dialog1.DialogTitle = "Grabar Listas de Sonidos"
  214.   Dialog1.Flags = cdlOFNHideReadOnly
  215.   Dialog1.Filter = "Playlists *.m3u|*.M3U;"
  216.   Dialog1.FilterIndex = LastFilter
  217.   Dialog1.FileName = ""
  218.   Dialog1.ShowSave
  219.         
  220.   archi = Dialog1.FileName
  221.   Open archi For Output As #1
  222.   List1.ListIndex = 0
  223.   For i = 1 To List1.ListCount
  224.       Print #1, List1.Text
  225.       List1.ListIndex = List1.ListIndex + 1
  226.   Next i
  227.   Close #1
  228. ErrHandler:
  229.     Exit Sub
  230. End Sub
  231. Private Sub Command3_Click()
  232.   If List1.ListCount > 0 Then
  233.      List1.RemoveItem List1.ListIndex
  234.   End If
  235. End Sub
  236. Private Sub Command4_Click()
  237.   List1.Clear
  238. End Sub
  239. Private Sub Command5_Click()
  240.   a = DsRepro1.AbrirSonido
  241.   Dim b As String
  242.   If Right(a, 3) <> "M3U" And Right(a, 3) <> "m3u" Then
  243.      List1.AddItem a
  244.   Else
  245.      Close #1
  246.      Open a For Input As #1
  247.      Do While Not EOF(1)
  248.         Input #1, b
  249.         List1.AddItem b
  250.      Loop
  251.      Close #1
  252.  End If
  253.  SetControls True, True, True, True, True, False
  254. End Sub
  255. Private Sub DsRepro1_Reproduciendo(tiempo As String)
  256.   LCD.Caption = tiempo
  257. End Sub
  258. Private Sub DsRepro1_Termine()
  259.   On Error GoTo errores
  260.   If Playing = True Then
  261.      List1.ListIndex = List1.ListIndex + 1
  262.      If List1.ListIndex < List1.ListCount Then
  263.         DsRepro1.Reproducir (List1.Text)
  264.         Label2.Caption = List1.Text
  265.      End If
  266.   End If
  267.     Exit Sub
  268. errores:
  269. End Sub
  270. Private Sub Form_Load()
  271.   SetControls False, False, False, False, False, True
  272.   frmPlayer.Height = 2115
  273.   SetWindowPos hWnd, conHwndTopmost, 0, 0, 280, 135, conSwpNoActivate Or conSwpShowWindow
  274. End Sub
  275. Private Sub Image1_MouseDown(Index As Integer, Button As Integer, Shift As Integer, x As Single, y As Single)
  276.   Select Case Index
  277.          Case 0
  278.               bTime = False
  279.               PicClip1.ClipX = 0
  280.               PicClip1.ClipY = 18
  281.               PicClip1.ClipWidth = 23
  282.               PicClip1.ClipHeight = 15
  283.               Image1(Index).Picture = PicClip1.Clip
  284.               Timer2.Enabled = True
  285.          Case 1
  286.               PicClip1.ClipX = 23
  287.               PicClip1.ClipY = 18
  288.               PicClip1.ClipWidth = 24
  289.               PicClip1.ClipHeight = 15
  290.               Image1(Index).Picture = PicClip1.Clip
  291.               Playing = True
  292.               PlayIndex = 0
  293.               stoping = False
  294.               If List1.Text = "" Then
  295.                  If List1.ListIndex <> -1 Then
  296.                     List1.ListIndex = 0
  297.                  End If
  298.               End If
  299.               DsRepro1.Reproducir (List1.Text)
  300.               Label2.Caption = List1.Text
  301.          Case 2
  302.               PicClip1.ClipX = 46
  303.               PicClip1.ClipY = 18
  304.               PicClip1.ClipWidth = 24
  305.               PicClip1.ClipHeight = 15
  306.               Image1(Index).Picture = PicClip1.Clip
  307.          Case 3
  308.               PicClip1.ClipX = 69
  309.               PicClip1.ClipY = 18
  310.               PicClip1.ClipWidth = 24
  311.               PicClip1.ClipHeight = 15
  312.               Image1(Index).Picture = PicClip1.Clip
  313.               stoping = True
  314.          Case 4
  315.               bTime = False
  316.               PicClip1.ClipX = 92
  317.               PicClip1.ClipY = 18
  318.               PicClip1.ClipWidth = 23
  319.               PicClip1.ClipHeight = 15
  320.               Image1(Index).Picture = PicClip1.Clip
  321.               Timer1.Enabled = True
  322.          Case 5
  323.               PicClip1.ClipX = 114
  324.               PicClip1.ClipY = 16
  325.               PicClip1.ClipWidth = 20
  326.               PicClip1.ClipHeight = 15
  327.               Image1(Index).Picture = PicClip1.Clip
  328.   End Select
  329. End Sub
  330. Private Sub Image1_MouseUp(Index As Integer, Button As Integer, Shift As Integer, x As Single, y As Single)
  331.   Dim i As Integer
  332.   Select Case Index
  333.          Case 0
  334.               PicClip1.ClipX = 0
  335.               PicClip1.ClipY = 0
  336.               PicClip1.ClipWidth = 24
  337.               PicClip1.ClipHeight = 15
  338.               Image1(Index).Picture = PicClip1.Clip
  339.               stoping = True
  340.               PlayIndex = PlayIndex - 2
  341.               If PlayIndex < 0 Then PlayIndex = 0
  342.               PlayIndex = PlayIndex + 1
  343.               Timer2.Enabled = False
  344.               If bTime = False Then
  345.                  If List1.ListIndex <> 0 Then
  346.                     If List1.ListIndex <> -1 Then
  347.                        List1.ListIndex = List1.ListIndex - 2
  348.                     End If
  349.                  Else
  350.                     List1.ListIndex = 0
  351.                  End If
  352.                  Label2.Caption = List1.Text
  353.                  DsRepro1_Termine
  354.               End If
  355.          Case 1
  356.               PicClip1.ClipX = 22
  357.               PicClip1.ClipY = 0
  358.               PicClip1.ClipWidth = 22
  359.               PicClip1.ClipHeight = 10
  360.               Image1(1).Picture = PicClip1.Clip
  361.               PlayIndex = PlayIndex + 1
  362.               SetControls True, True, True, True, True, True
  363.          Case 2
  364.               PicClip1.ClipX = 45
  365.               PicClip1.ClipY = 0
  366.               PicClip1.ClipWidth = 24
  367.               PicClip1.ClipHeight = 15
  368.               Image1(Index).Picture = PicClip1.Clip
  369.               DsRepro1.Pausa
  370.          Case 3
  371.               PicClip1.ClipX = 68
  372.               PicClip1.ClipY = 0
  373.               PicClip1.ClipWidth = 23
  374.               PicClip1.ClipHeight = 15
  375.               Image1(Index).Picture = PicClip1.Clip
  376.               PicClip1.ClipX = 22
  377.               PicClip1.ClipY = 0
  378.               PicClip1.ClipWidth = 22
  379.               PicClip1.ClipHeight = 10
  380.               Image1(1).Picture = PicClip1.Clip
  381.               Playing = False
  382.               DsRepro1.Parar
  383.               SetControls True, True, False, False, True, True
  384.          Case 4
  385.               PicClip1.ClipX = 91
  386.               PicClip1.ClipY = 0
  387.               PicClip1.ClipWidth = 23
  388.               PicClip1.ClipHeight = 15
  389.               Image1(Index).Picture = PicClip1.Clip
  390.               stoping = True
  391.               PlayIndex = PlayIndex + 1
  392.               Timer1.Enabled = False
  393.               If bTime = False Then
  394.                  DsRepro1_Termine
  395.               End If
  396.          Case 5
  397.               PicClip1.ClipX = 115
  398.               PicClip1.ClipY = 0.5
  399.               PicClip1.ClipWidth = 20
  400.               PicClip1.ClipHeight = 15
  401.               Image1(Index).Picture = PicClip1.Clip
  402.               frmPlayer.Height = 4440
  403.      End Select
  404. End Sub
  405. Private Sub SetControls(ByVal bRev As Boolean, ByVal bPlay As Boolean, _
  406.     ByVal bPause As Boolean, ByVal bStop As Boolean, ByVal bForw As Boolean, ByVal bEject As Boolean)
  407.   Image1(0).Enabled = bRev
  408.   Image1(1).Enabled = bPlay
  409.   Image1(2).Enabled = bPause
  410.   Image1(3).Enabled = bStop
  411.   Image1(4).Enabled = bForw
  412.   Image1(5).Enabled = bEject
  413. End Sub
  414. Private Sub Timer1_Timer()
  415.     DsRepro1.Adelantar
  416.     bTime = True
  417. End Sub
  418. Private Sub Timer2_Timer()
  419.     DsRepro1.Atrasar
  420.     bTime = True
  421. End Sub
  422.