Questo sito utilizza cookies, anche di terze parti, per mostrare pubblicità e servizi in linea con il tuo account. Leggi l'informativa sui cookies.
Username: Password: oppure
GodPlayer - Godplayer2Main.frm

Godplayer2Main.frm

Caricato da: Natamas
Scarica il programma completo

  1. Option Explicit
  2.  
  3. Dim Looper1 As Boolean
  4. Dim Looper2 As Boolean
  5. Dim Filename As String
  6. Dim HasTag As Boolean
  7. Dim Tagg As String * 3
  8. Dim Songname As String * 30
  9. Dim Artist As String * 30
  10. Dim Album As String * 30
  11. Dim Year As String * 4
  12. Dim Comment As String * 30
  13. Dim Genre As String * 1
  14. Dim a As String, b As String
  15.  
  16. Private Sub GetTag(Filename)
  17. Open Filename For Binary As #1
  18. Get #1, FileLen(Filename) - 127, Tagg
  19. If Not Tagg = "TAG" Then
  20. Close #1
  21. HasTag = False
  22. Songname = "No Tag Found"
  23. Artist = "No Tag Found"
  24. Album = "No Tag Found"
  25. Year = "None"
  26. Comment = "No Tag Found"
  27. Genre = "0"
  28. Exit Sub
  29. Else
  30. HasTag = True
  31. Get #1, , Songname
  32. Get #1, , Artist
  33. Get #1, , Album
  34. Get #1, , Year
  35. Get #1, , Comment
  36. Get #1, , Genre
  37. Close #1
  38. End If
  39. End Sub
  40.  
  41. Private Sub Dir1_Change()
  42. File1.Path = Dir1.Path
  43. End Sub
  44.  
  45. Private Sub Dir2_Change()
  46. File2.Path = Dir2.Path
  47. End Sub
  48.  
  49. Private Sub Drive1_Change()
  50. On Error Resume Next
  51. Dir1.Path = Drive1.Drive
  52. End Sub
  53.  
  54. Private Sub Drive2_Change()
  55. On Error Resume Next
  56. Dir2.Path = Drive2.Drive
  57. End Sub
  58.  
  59. Private Sub File1_Click()
  60. a = Dir1.Path + "\" + File1.Filename
  61. File1.ToolTipText = File1.Filename
  62. Call GetTag(a)
  63. Artist1.Text = Artist & vbNullChar
  64. Title1.Text = Songname & vbNullChar
  65. Album1.Text = Album & vbNullChar
  66. Year1.Text = Year & vbNullChar
  67. Comment1.Text = Comment & vbNullChar
  68. Artist1.ToolTipText = Artist1.Text
  69. Title1.ToolTipText = Title1.Text
  70. Album1.ToolTipText = Album1.Text
  71. Year1.ToolTipText = Year1.Text
  72. Comment1.ToolTipText = Comment1.Text
  73. End Sub
  74.  
  75. Private Sub File1_dblClick()
  76. Line1Play.Enabled = True
  77. PosLine1.Enabled = True
  78. Timer8.Enabled = False
  79. tw1.Value = 1
  80. tw2.Value = 1
  81. tw3.Value = 1
  82. tw4.Value = 1
  83. tw5.Value = 1
  84. tw6.Value = 1
  85. tw7.Value = 1
  86. tw8.Value = 1
  87. WMPOCX1.URL = a
  88. Call file("1")
  89. Call Line1Stop_Click
  90. End Sub
  91.  
  92. Private Sub File2_Click()
  93. b = Dir2.Path + "\" + File2.Filename
  94. File2.ToolTipText = File2.Filename
  95. Call GetTag(b)
  96. Artist2.Text = Artist & vbNullChar
  97. Title2.Text = Songname & vbNullChar
  98. Album2.Text = Album & vbNullChar
  99. Year2.Text = Year & vbNullChar
  100. Comment2.Text = Comment & vbNullChar
  101. Artist2.ToolTipText = Artist2.Text
  102. Title2.ToolTipText = Title2.Text
  103. Album2.ToolTipText = Album2.Text
  104. Year2.ToolTipText = Year2.Text
  105. Comment2.ToolTipText = Comment2.Text
  106. End Sub
  107.  
  108. Private Sub File2_dblClick()
  109. Line2Play.Enabled = True
  110. PosLine2.Enabled = True
  111. Timer9.Enabled = False
  112. tw1_2.Value = 1
  113. tw2_2.Value = 1
  114. tw3_2.Value = 1
  115. tw4_2.Value = 1
  116. tw5_2.Value = 1
  117. tw6_2.Value = 1
  118. tw7_2.Value = 1
  119. tw8_2.Value = 1
  120. WMPOCX2.URL = b
  121. Call file("2")
  122. Call Line2Stop_Click
  123. End Sub
  124.  
  125. Private Sub Form_Load()
  126. Me.Caption = App.Title & " vers. " & App.Major & "." & App.Minor & "." & App.Revision & "   -   By Natamas"
  127. Randomize
  128. Looper1 = True
  129. Looper2 = True
  130. WMPOCX1.settings.autoStart = False
  131. WMPOCX2.settings.autoStart = False
  132. Line1Play.Enabled = False
  133. Line1Stop.Enabled = False
  134. Line2Play.Enabled = False
  135. Line2Stop.Enabled = False
  136. Line1Pause.Enabled = False
  137. Line2Pause.Enabled = False
  138. PosLine1.Enabled = False
  139. PosLine2.Enabled = False
  140. WMPOCX1.settings.volume = -VolumeLine1.Value
  141. WMPOCX2.settings.volume = -VolumeLine2.Value
  142. Positioner1.Text = WMPOCX1.settings.volume
  143. Positioner2.Text = WMPOCX2.settings.volume
  144. End Sub
  145.  
  146. Private Sub Form_Unload(Cancel As Integer)
  147. WMPOCX1.Controls.stop
  148. WMPOCX2.Controls.stop
  149. Unload Avvio
  150. Unload Me
  151. End
  152. End Sub
  153.  
  154. Private Sub Label13_Click()
  155. Timer5.Enabled = False
  156. Timer6.Enabled = False
  157. Timer7.Enabled = True
  158. End Sub
  159.  
  160. Private Sub Label13_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  161. Label13.ForeColor = &HFF&
  162. Timer4.Enabled = True
  163. End Sub
  164.  
  165. Private Sub Label30_Click()
  166. Timer5.Enabled = False
  167. Timer7.Enabled = False
  168. Timer6.Enabled = True
  169. End Sub
  170.  
  171. Private Sub Label30_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  172. Label30.ForeColor = &HFF&
  173. Timer4.Enabled = True
  174. End Sub
  175.  
  176. Private Sub Label31_Click()
  177. Timer6.Enabled = False
  178. Timer7.Enabled = False
  179. Timer5.Enabled = True
  180. End Sub
  181.  
  182. Private Sub Label31_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  183. Label31.ForeColor = &HFF&
  184. Timer4.Enabled = True
  185. End Sub
  186.  
  187. Private Sub LabelDownWithCopyright_Click()
  188. Avvio.Label3.Visible = False
  189. Avvio.Show 1
  190. End Sub
  191.  
  192. Private Sub LabelDownWithCopyright_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  193. LabelDownWithCopyright.ForeColor = &HFF&
  194. Timer4.Enabled = True
  195. End Sub
  196.  
  197. Private Sub Line1Pause_Click()
  198. Timer1.Enabled = False
  199. Timer8.Enabled = False
  200. Line1Stop.Enabled = True
  201. Line1Play.Enabled = True
  202. Line1Pause.Enabled = False
  203. WMPOCX1.Controls.pause
  204. End Sub
  205.  
  206. Private Sub Line2Pause_Click()
  207. Timer2.Enabled = False
  208. Timer9.Enabled = False
  209. Line2Stop.Enabled = True
  210. Line2Play.Enabled = True
  211. Line2Pause.Enabled = False
  212. WMPOCX2.Controls.pause
  213. End Sub
  214.  
  215. Private Sub Line1Play_Click()
  216. Timer1.Enabled = True
  217. WMPOCX1.Controls.play
  218. 'Line1Stop.Enabled = True
  219. 'Line1Play.Enabled = False
  220. 'Line1Pause.Enabled = True
  221. End Sub
  222.  
  223. Private Sub Line1Stop_Click()
  224. Timer1.Enabled = False
  225. Timer8.Enabled = False
  226. tw1.Value = 1
  227. tw2.Value = 1
  228. tw3.Value = 1
  229. tw4.Value = 1
  230. tw5.Value = 1
  231. tw6.Value = 1
  232. tw7.Value = 1
  233. tw8.Value = 1
  234. WMPOCX1.Controls.stop
  235. Line1Stop.Enabled = False
  236. Line1Play.Enabled = True
  237. Line1Pause.Enabled = False
  238. Bar1.Value = "0,0001"
  239. PosLine1.Value = 0
  240. Pos1.Text = ""
  241. Left1.Text = ""
  242. Total1.Text = ""
  243. End Sub
  244.  
  245. Private Sub Line2Play_Click()
  246. Timer2.Enabled = True
  247. WMPOCX2.Controls.play
  248. 'Line2Stop.Enabled = True
  249. 'Line2Play.Enabled = False
  250. 'Line2Pause.Enabled = True
  251. End Sub
  252.  
  253. Private Sub Line2Stop_Click()
  254. Timer2.Enabled = False
  255. Timer9.Enabled = False
  256. tw1_2.Value = 1
  257. tw2_2.Value = 1
  258. tw3_2.Value = 1
  259. tw4_2.Value = 1
  260. tw5_2.Value = 1
  261. tw6_2.Value = 1
  262. tw7_2.Value = 1
  263. tw8_2.Value = 1
  264. WMPOCX2.Controls.stop
  265. Line2Stop.Enabled = False
  266. Line2Play.Enabled = True
  267. Line2Pause.Enabled = False
  268. Bar2.Value = "0,0001"
  269. PosLine2.Value = 0
  270. Pos2.Text = ""
  271. Left2.Text = ""
  272. Total2.Text = ""
  273. End Sub
  274.  
  275. Private Sub PosLine1_Change()
  276. Looper1 = True
  277. End Sub
  278. Private Sub PosLine2_Change()
  279. Looper2 = True
  280. End Sub
  281.  
  282. Private Sub PosLine1_scroll()
  283. WMPOCX1.Controls.currentPosition = PosLine1.Value
  284. Looper1 = False
  285. Timer1.Enabled = True
  286. WMPOCX1.Controls.play
  287. End Sub
  288.  
  289. Private Sub PosLine2_scroll()
  290. WMPOCX2.Controls.currentPosition = PosLine2.Value
  291. Looper2 = False
  292. Timer2.Enabled = True
  293. WMPOCX2.Controls.play
  294. End Sub
  295.  
  296. Private Sub Slider1_scroll()
  297. Call slid
  298. End Sub
  299.  
  300. Private Sub Timer1_Timer()
  301. Bar1.Max = Format(WMPOCX1.currentMedia.duration + 1, "########.")
  302. PosLine1.Max = Format(WMPOCX1.currentMedia.duration + 1, "########.")
  303. Total1.Text = Format(WMPOCX1.currentMedia.duration + 1, "#######0.0")
  304. If WMPOCX1.currentMedia.duration <> 0 Then
  305.   If WMPOCX1.Controls.currentPosition = 0 Then
  306.       Bar1.Value = "0,0001"
  307.       Line1Stop.Enabled = False
  308.       Line1Pause.Enabled = False
  309.       Line1Play.Enabled = True
  310.       Timer8.Enabled = False
  311.       tw1.Value = 1
  312.       tw2.Value = 1
  313.       tw3.Value = 1
  314.       tw4.Value = 1
  315.       tw5.Value = 1
  316.       tw6.Value = 1
  317.       tw7.Value = 1
  318.       tw8.Value = 1
  319.   Else
  320.       Bar1.Value = WMPOCX1.Controls.currentPosition
  321.       Line1Stop.Enabled = True
  322.       Line1Play.Enabled = False
  323.       Line1Pause.Enabled = True
  324.       Timer8.Enabled = True
  325.   End If
  326.     If Looper1 Then
  327.         PosLine1.Value = WMPOCX1.Controls.currentPosition
  328.     End If
  329.     Pos1.Text = Format(WMPOCX1.Controls.currentPosition, "#######0.0")
  330.     Left1.Text = Format((WMPOCX1.currentMedia.duration + 1) - WMPOCX1.Controls.currentPosition, "#######0.0")
  331. End If
  332. End Sub
  333.  
  334. Private Sub Timer2_Timer()
  335. Bar2.Max = Format(WMPOCX2.currentMedia.duration + 1, "########.")
  336. PosLine2.Max = Format(WMPOCX2.currentMedia.duration + 1, "########.")
  337. Total2.Text = Format(WMPOCX2.currentMedia.duration + 1, "########0.0")
  338. If WMPOCX2.currentMedia.duration <> 0 Then
  339.       If WMPOCX2.Controls.currentPosition = 0 Then
  340.       Bar2.Value = "0,0001"
  341.       Line2Stop.Enabled = False
  342.       Line2Pause.Enabled = False
  343.       Line2Play.Enabled = True
  344.       Timer9.Enabled = False
  345.       tw1_2.Value = 1
  346.       tw2_2.Value = 1
  347.       tw3_2.Value = 1
  348.       tw4_2.Value = 1
  349.       tw5_2.Value = 1
  350.       tw6_2.Value = 1
  351.       tw7_2.Value = 1
  352.       tw8_2.Value = 1
  353.   Else
  354.       Bar2.Value = WMPOCX2.Controls.currentPosition
  355.       Line2Stop.Enabled = True
  356.       Line2Play.Enabled = False
  357.       Line2Pause.Enabled = True
  358.       Timer9.Enabled = True
  359.   End If
  360.     If Looper2 Then
  361.         PosLine2.Value = WMPOCX2.Controls.currentPosition
  362.     End If
  363.     Pos2.Text = Format(WMPOCX2.Controls.currentPosition, "#######0.0")
  364.     Left2.Text = Format((WMPOCX2.currentMedia.duration + 1) - WMPOCX2.Controls.currentPosition, "#######0.0")
  365. End If
  366. End Sub
  367.  
  368. Private Sub Timer3_Timer()
  369. Dim v1 As String, v2 As String
  370. v1 = (VolumeLine1.Value / -1000) * 100
  371. v2 = (VolumeLine2.Value / -1000) * 100
  372. VolumeLine1.ToolTipText = " " & Int(v1) & "% "
  373. VolumeLine2.ToolTipText = " " & Int(v2) & "% "
  374. Slider1.ToolTipText = " " & Int(v1) & "% , " & Int(v2) & "% "
  375. If Slider1.Value > 500 Then
  376.     VolumeLine1.Enabled = False
  377. ElseIf Slider1.Value < 500 Then
  378.     VolumeLine2.Enabled = False
  379. 'Else
  380. '    VolumeLine1.Enabled = True
  381. '    VolumeLine2.Enabled = True
  382. End If
  383. End Sub
  384.  
  385. Private Sub Timer4_Timer()
  386. Label13.ForeColor = &H808000
  387. Label30.ForeColor = &H808000
  388. Label31.ForeColor = &H808000
  389. LabelDownWithCopyright.ForeColor = &H808080
  390. Timer4.Enabled = False
  391. End Sub
  392.  
  393. Private Sub Timer5_Timer()
  394. Slider1.Value = Slider1.Value + 10
  395. Call slid
  396. If Slider1.Value = 1000 Then Timer5.Enabled = False
  397. End Sub
  398.  
  399. Private Sub Timer6_Timer()
  400. Slider1.Value = Slider1.Value - 10
  401. Call slid
  402. If Slider1.Value = 0 Then Timer6.Enabled = False
  403. End Sub
  404.  
  405. Private Sub Timer7_Timer()
  406. If Slider1.Value = 500 Then
  407.     VolumeLine1.Value = -1000
  408.     VolumeLine2.Value = -1000
  409.     VolumeLine1.Enabled = True
  410.     VolumeLine2.Enabled = True
  411.     Timer7.Enabled = False
  412. ElseIf Slider1.Value < 500 Then
  413.     Slider1.Value = Slider1.Value + 10
  414.     VolumeLine1.Value = -1000
  415.     VolumeLine2.Value = -2 * Slider1.Value
  416.     VolumeLine1.Enabled = True
  417.     If Slider1.Value > 500 Then
  418.     Timer7.Enabled = False
  419.     Slider1.Value = 500
  420.     VolumeLine1.Value = -1000
  421.     VolumeLine2.Value = -2 * Slider1.Value
  422.     End If
  423. ElseIf Slider1.Value > 500 Then
  424.     Slider1.Value = Slider1.Value - 10
  425.     VolumeLine1.Value = -1000 + (2 * (Slider1.Value - 500))
  426.     VolumeLine2.Value = -1000
  427.     VolumeLine2.Enabled = True
  428.     If Slider1.Value < 500 Then
  429.     Timer7.Enabled = False
  430.     Slider1.Value = 500
  431.     VolumeLine1.Value = -1000 + (2 * (Slider1.Value - 500))
  432.     VolumeLine2.Value = -1000
  433.     End If
  434. End If
  435. WMPOCX1.settings.volume = -VolumeLine1.Value / 10
  436. WMPOCX2.settings.volume = -VolumeLine2.Value / 10
  437. Positioner1.Text = WMPOCX1.settings.volume
  438. Positioner2.Text = WMPOCX2.settings.volume
  439. End Sub
  440.  
  441. Private Sub Timer8_Timer()
  442. Dim twr1 As Long, twr2 As Long, twr3 As Long, twr4 As Long, twr5 As Long, twr6 As Long, twr7 As Long, twr8 As Long
  443. twr1 = Int(999 * Rnd)
  444. twr2 = Int(999 * Rnd)
  445. twr3 = Int(999 * Rnd)
  446. twr4 = Int(999 * Rnd)
  447. twr5 = Int(999 * Rnd)
  448. twr6 = Int(999 * Rnd)
  449. twr7 = Int(999 * Rnd)
  450. twr8 = Int(999 * Rnd)
  451. If twr1 = 0 Then twr1 = 1
  452. If twr2 = 0 Then twr2 = 1
  453. If twr3 = 0 Then twr3 = 1
  454. If twr4 = 0 Then twr4 = 1
  455. If twr5 = 0 Then twr5 = 1
  456. If twr6 = 0 Then twr6 = 1
  457. If twr7 = 0 Then twr7 = 1
  458. If twr8 = 0 Then twr8 = 1
  459. tw1.Value = twr1
  460. tw2.Value = twr2
  461. tw3.Value = twr3
  462. tw4.Value = twr4
  463. tw5.Value = twr5
  464. tw6.Value = twr6
  465. tw7.Value = twr7
  466. tw8.Value = twr8
  467. End Sub
  468.  
  469. Private Sub Timer9_Timer()
  470. Dim twr1_2 As Long, twr2_2 As Long, twr3_2 As Long, twr4_2 As Long, twr5_2 As Long, twr6_2 As Long, twr7_2 As Long, twr8_2 As Long
  471. twr1_2 = Int(999 * Rnd)
  472. twr2_2 = Int(999 * Rnd)
  473. twr3_2 = Int(999 * Rnd)
  474. twr4_2 = Int(999 * Rnd)
  475. twr5_2 = Int(999 * Rnd)
  476. twr6_2 = Int(999 * Rnd)
  477. twr7_2 = Int(999 * Rnd)
  478. twr8_2 = Int(999 * Rnd)
  479. If twr1_2 = 0 Then twr1_2 = 1
  480. If twr2_2 = 0 Then twr2_2 = 1
  481. If twr3_2 = 0 Then twr3_2 = 1
  482. If twr4_2 = 0 Then twr4_2 = 1
  483. If twr5_2 = 0 Then twr5_2 = 1
  484. If twr6_2 = 0 Then twr6_2 = 1
  485. If twr7_2 = 0 Then twr7_2 = 1
  486. If twr8_2 = 0 Then twr8_2 = 1
  487. tw1_2.Value = twr1_2
  488. tw2_2.Value = twr2_2
  489. tw3_2.Value = twr3_2
  490. tw4_2.Value = twr4_2
  491. tw5_2.Value = twr5_2
  492. tw6_2.Value = twr6_2
  493. tw7_2.Value = twr7_2
  494. tw8_2.Value = twr8_2
  495. End Sub
  496.  
  497. Private Sub VolumeLine1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  498. If Slider1.Value > 500 Then
  499.     VolumeLine1.Enabled = False
  500. Else
  501.     VolumeLine1.Enabled = True
  502. End If
  503. End Sub
  504.  
  505. Private Sub VolumeLine1_scroll()
  506. WMPOCX1.settings.volume = -VolumeLine1.Value / 10
  507. Positioner1.Text = WMPOCX1.settings.volume
  508. End Sub
  509.  
  510. Private Sub VolumeLine2_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  511. If Slider1.Value < 500 Then
  512.     VolumeLine2.Enabled = False
  513. Else
  514.     VolumeLine2.Enabled = True
  515. End If
  516. End Sub
  517.  
  518. Private Sub VolumeLine2_scroll()
  519. WMPOCX2.settings.volume = -VolumeLine2.Value / 10
  520. Positioner2.Text = WMPOCX2.settings.volume
  521. End Sub
  522.  
  523. Sub slid()
  524. If Slider1.Value = 500 Then
  525.     VolumeLine1.Value = -1000
  526.     VolumeLine2.Value = -1000
  527.     VolumeLine1.Enabled = True
  528.     VolumeLine2.Enabled = True
  529. ElseIf Slider1.Value < 500 Then
  530.     VolumeLine1.Value = -1000
  531.     VolumeLine2.Value = -2 * Slider1.Value
  532.     VolumeLine1.Enabled = True
  533. ElseIf Slider1.Value > 500 Then
  534.     VolumeLine1.Value = -1000 + (2 * (Slider1.Value - 500))
  535.     VolumeLine2.Value = -1000
  536.     VolumeLine2.Enabled = True
  537. End If
  538. WMPOCX1.settings.volume = -VolumeLine1.Value / 10
  539. WMPOCX2.settings.volume = -VolumeLine2.Value / 10
  540. Positioner1.Text = WMPOCX1.settings.volume
  541. Positioner2.Text = WMPOCX2.settings.volume
  542. End Sub
  543.  
  544. Sub file(parte)
  545. If parte = 1 Then
  546. file1_sel.Text = File1.Filename
  547. file1_sel.ToolTipText = file1_sel.Text
  548. ElseIf parte = 2 Then
  549. file2_sel.Text = File2.Filename
  550. file2_sel.ToolTipText = file2_sel.Text
  551. End If
  552. Exit Sub
  553. End Sub