• Tidak ada hasil yang ditemukan

Hasil Uji Program Tugas Akhir

Yang bertanda tangan dibawah ini, menerangkan bahwa Mahasiswa Tugas Akhir Program Diploma III Teknik Informatika/Statistika :

Nama : FRANSLONDO OMPUSUNGGU NIM : 082406148

Prog. Studi : D-III Teknik Informatika

Judul TA : Perancangan Program Aplikasi Perangkat Lunak Multimedia Player Menggunakan Microsoft Visual Basic 6.0.

Telah melaksanakan test program Tugas Akhir Mahasiswa tersebut di atas pada tanggal……….

Dengan Hasil : Sukses / Gagal

Demikian diterangkan untuk digunakan melengkapi syarat pendaftaran Ujian Meja Hijau Tugas Akhir Mahasiswa bersangkutan di Departemen Matematika FMIPA USU Medan.

Medan, Mei 2011 Dosen Pembimbing

Program Studi D3 Teknik Informatika

Drs. Marihat situmorang, M.Kom NIP. 196312141989031001

LISTING PROGRAM MULTIMEDIA PLAYER

Public db As New ADODB.Connection Public rs As New ADODB.Recordset Public rs1 As New ADODB.Recordset Dim temp As String

Dim op As Integer Dim op1 As Integer Dim str As String

Dim Red, Green, Blue As Integer Dim Paused

Const NormalWidth = 5280 Dim temp1 As Variant

Private Sub List_Click() rs.MoveFirst

Dim t As String t = List.Text While Not rs.EOF

If t = rs.Fields(0) Then TxtPath = rs.Fields(1) rs.MoveNext

Else

rs.MoveNext End If

Wend End Sub

Private Sub List1_Click() rs1.MoveFirst

Dim t As String t = List1.Text While Not rs1.EOF

If t = rs1.Fields(0) Then TxtPath = rs1.Fields(1) rs1.MoveNext

Else

rs1.MoveNext End If

Wend

Flash1.Visible = App.path & "\movie4.swf"

Flash1.Visible = True Flash1.Enabled = True End Sub

Private Sub cmdUlang_Click() Call ulang

End Sub

Private Sub Command1_Click()

File1.ListIndex = File1.ListIndex - 1 On Error GoTo er

With mp

.FileName = p .AutoStart = True End With

er:

If Err.Number = 381 Then File1.ListIndex = 0 End Sub

Private Sub Command2_Click() On Error GoTo er

File1.ListIndex = File1.ListIndex + 1 With mp

.FileName = p .AutoStart = True End With

er: On Error Resume Next

If Err.Number = 381 Then File1.ListIndex = 0 End Sub

Sub ulang()

File1.ListIndex = 0

Do While File1.ListIndex = File1.ListIndex + 1 On Error GoTo er

With mp

.FileName = p .AutoStart = True End With

er:

If Err.Number = 381 Then File1.ListIndex = 0 Loop

End Sub

Private Sub Dir1_Change() File1.FileName = Dir1.path End Sub

Private Sub Drive1_Change() On Error GoTo error

Dir1.path = Drive1.Drive Exit Sub

error:

MsgBox ("Drive not available") Drive1.Drive = Dir1.path

End Sub

Private Sub File1_Click()

ext = Right$(File1.FileName, 3)

If Not (ext = "mp3" Or ext = "MP3" Or ext = "mpeg" Or ext

= "MPEG" Or ext = "avi" Or ext = "AVI" Or ext = "flv" Or ext = "FLV" Or ext = "mp4" Or ext = "MP4" Or ext = "3gp"

Or ext = "3GP") Then

MsgBox ("Please select mp3,mpeg,avi,flv,mp4 and 3gp files from the list")

ElseIf Right$(Dir1.path, 1) = "\" Then s = ""

Else s = "\"

p = Dir1.path + s + File1.FileName Flash1.Visible = False

Flash1.Visible = False temp = cmd.FileTitle TxtPath.Text = p

TxtNama.Text = File1.FileName Flash1.Visible = False

Flash1.Visible = False If Paused Then

ActiveMovieControl.PlayActiveMovie Else

ActiveMovieControl.RunVideoContent TxtPath.Text, _

MaintainRatio, RunFullScreen End If

End If End Sub

Private Sub mnback_Click()

File1.ListIndex = File1.ListIndex - 1 On Error GoTo er

With mp

.FileName = p .AutoStart = True End With

er:

If Err.Number = 381 Then File1.ListIndex = 0

End Sub

Private Sub mnbantuan_Click() Load Form1

Form1.Visible = True End Sub

Private Sub mnDir1_Click() File1.FileName = Dir1.path End Sub

Private Sub mnexit_Click() Unload Me

End Sub

Private Sub mnfile1_Click() ext = Right$(File1.FileName, 3)

If Not (ext = "mp3" Or ext = "MP3" Or ext = "mpeg" Or ext

= "MPEG" Or ext = "avi" Or ext = "AVI" Or ext = "flv" Or ext = "FLV" Or ext = "mp4" Or ext = "MP4" Or ext = "3gp"

Or ext = "3GP") Then

MsgBox ("Please select mp3,mpeg,avi,flv,mp4 and 3gp files from the list")

ElseIf Right$(Dir1.path, 1) = "\" Then s = ""

Else s = "\"

p = Dir1.path + s + File1.FileName Flash1.Visible = False

Flash1.Visible = False temp = cmd.FileTitle TxtPath.Text = p

TxtNama.Text = File1.FileName Flash1.Visible = False

Flash1.Visible = False If Paused Then

ActiveMovieControl.PlayActiveMovie Else

ActiveMovieControl.RunVideoContent TxtPath.Text, _

MaintainRatio, RunFullScreen End If

End If End Sub

Private Sub mnmain_Click(Index As Integer) If Paused Then

ActiveMovieControl.PlayActiveMovie Else

ActiveMovieControl.RunVideoContent TxtPath.Text, _

MaintainRatio, RunFullScreen End If

End Sub

Private Sub mnnext_Click() On Error GoTo er

File1.ListIndex = File1.ListIndex + 1 With mp

.FileName = p .AutoStart = True End With

er: On Error Resume Next

If Err.Number = 381 Then File1.ListIndex = 0 End Sub

Private Sub mnopen_Click() Flash1.Visible = False Flash1.Visible = False cmd.ShowOpen

temp = cmd.FileName TxtPath.Text = temp

TxtNama.Text = cmd.FileTitle Flash1.Visible = False

Flash1.Visible = False End Sub

Private Sub mnpause_Click() Paused = True

ActiveMovieControl.PauseActiveMovie End Sub

Private Sub mnstop_Click() Paused = False

ActiveMovieControl.StopActiveMovie End Sub

Private Sub mntentang_Click() Load Form2

Form2.Visible = True End Sub

Private Sub mnulang_Click() Call ulang

End Sub

Private Sub TbOpen_Click() Flash1.Visible = False Flash1.Visible = False cmd.ShowOpen

temp = cmd.FileName TxtPath.Text = temp

TxtNama.Text = cmd.FileTitle Flash1.Visible = False

Flash1.Visible = False End Sub

Private Sub TbPlay_Click() If Paused Then

ActiveMovieControl.PlayActiveMovie Else

ActiveMovieControl.RunVideoContent TxtPath.Text, _

MaintainRatio, RunFullScreen

End If End Sub

Private Sub TbStop_Click() Paused = False

ActiveMovieControl.StopActiveMovie End Sub

Private Sub TbPause_Click() Paused = True

ActiveMovieControl.PauseActiveMovie End Sub

Private Sub TbExit_Click() Unload Me

End Sub

Private Sub Timer1_Timer() Label5.Left = Label5.Left - 1

If Label5.Left <= -Label5.Left Then Label5.Left = FmVideo.Width End If

End Sub

Private Sub Timer2_Timer() If Blue <= 255 Then

Blue = Blue + 50 Else

Blue = 0

Green = Green + 50 End If

If Green >= 255 Then Green = 0

Red = Red + 50 End If

If Red >= 255 Then Red = 0

End If

Label6.ForeColor = Int(RGB(Red, Green, Blue)) Label6.Refresh

End Sub

Private Sub Timer3_Timer()

Me.Caption = "Multimedia Player - " & Time If detik = batas And detik > 0 Then

MM.Command = "Close"

Timer2.Enabled = False End If

End Sub

Private Sub Volume_s_Click()

ActiveMovieControl.SetActiveMovieVolume _ Volume_s.Value

End Sub

Private Sub Balance_s_Click()

ActiveMovieControl.SetActiveMovieBalance _ Balance_s.Value

End Sub

Private Sub RefreshTimer_Timer()

If ActiveMovieControl.VideoRunning Then LblPjg.Caption = "Panjang: " _

& ActiveMovieControl.GetVideoLength LblPutar.Caption = "Sedang Putar: " _ & ActiveMovieControl.GetVideoPos End If

End Sub

Private Sub StateTimer_Timer()

ActiveMovieControl.ActiveMovieTimerEvent End Sub

Public Sub VideoFinishedEvent() LblPutar.Caption = "Gets End!"

End Sub

LISTING PROGRAM FRM HELP Private Sub Command1_Click() Unload Form1

End Sub

LISTING PROGRAM FRM ABOUT Private Sub Command1_Click() Unload Form2

End Sub

Private Sub Timer1_Timer() Label1.Left = Label1.Left - 10

If Label1.Left <= -Label1.Left Then Label1.Left = Form2.Width

End If End Sub

LISTING PROGRAM MODULE 1 (ActiveMovieControl) Option Explicit

Option Base 0

Option Compare Text

Private m_dblRate As Double

Private m_bstrFileName As String Private m_dblRunLength As Double Private m_dblStartPosition As Double Public m_boolVideoRunning As Boolean Private dblPosition As Double

Private m_objBasicAudio As IBasicAudio Private m_objBasicVideo As IBasicVideo

Private m_objMediaEvent As IMediaEvent Private m_objVideoWindow As IVideoWindow Private m_objMediaControl As IMediaControl Private m_objMediaPosition As IMediaPosition

Sub RunVideoContent(ByVal path As String, _

Optional ByVal DontMaintainRatio As Boolean, _ Optional ByVal FullScreen As Boolean)

Dim Red, Green, Blue As Integer Dim nCount As Long

Dim sScale As Double Dim topMod As Long

On Local Error GoTo ErrLine UnloadActiveMovieControl m_bstrFileName = path

Set m_objMediaControl = New FilgraphManager

Call m_objMediaControl.RenderFile(m_bstrFileName) Set m_objBasicAudio = m_objMediaControl

m_objBasicAudio.Volume = 0 m_objBasicAudio.Balance = 0

Set m_objVideoWindow = m_objMediaControl

m_objVideoWindow.WindowStyle = CLng(&H6000000) m_objVideoWindow.Left = 0

sScale = m_objVideoWindow.Height / _ m_objVideoWindow.Width

m_objVideoWindow.Width = FmVideo.Video.Width

If Not (DontMaintainRatio) Then m_objVideoWindow.Height = _

FmVideo.Video.Width * sScale topMod = (FmVideo.Video.Height - _ m_objVideoWindow.Height) / 2 Else

m_objVideoWindow.Height = FmVideo.Video.Height End If

m_objVideoWindow.Top = topMod

m_objVideoWindow.FullScreenMode = FullScreen m_objVideoWindow.Owner = FmVideo.Video.hWnd Set m_objMediaEvent = m_objMediaControl Set m_objMediaPosition = m_objMediaControl m_objMediaPosition.Rate = 1

m_dblRate = m_objMediaPosition.Rate

m_dblRunLength = Round(m_objMediaPosition.Duration, 2)

m_dblStartPosition = 0 PlayActiveMovie

Exit Sub

ErrLine:

Err.Clear Resume Next End Sub

Sub UnloadActiveMovieControl() On Local Error GoTo ErrLine

m_boolVideoRunning = False DoEvents

If Not m_objMediaControl Is Nothing Then m_objMediaControl.Stop

End If

If Not m_objVideoWindow Is Nothing Then

m_objVideoWindow.Left = Screen.Width * 8 m_objVideoWindow.Height = Screen.Height * 8 m_objVideoWindow.Owner = 0

End If

If Not m_objBasicAudio Is Nothing _ Then Set m_objBasicAudio = Nothing If Not m_objBasicVideo Is Nothing _ Then Set m_objBasicVideo = Nothing If Not m_objMediaControl Is Nothing _ Then Set m_objMediaControl = Nothing If Not m_objVideoWindow Is Nothing _ Then Set m_objVideoWindow = Nothing If Not m_objMediaPosition Is Nothing _ Then Set m_objMediaPosition = Nothing Exit Sub

ErrLine:

Err.Clear End Sub

Sub PlayActiveMovie()

On Local Error GoTo errHandle

If CLng(m_objMediaPosition.CurrentPosition) _ < CLng(m_dblStartPosition) Then

m_objMediaPosition.CurrentPosition _ = m_dblStartPosition

ElseIf CLng(m_objMediaPosition.CurrentPosition) _ = CLng(m_dblRunLength) Then

m_objMediaPosition.CurrentPosition _ = m_dblStartPosition

End If

m_boolVideoRunning = True Call m_objMediaControl.Run

Exit Sub errHandle:

Err.Clear Resume Next End Sub

Sub PauseActiveMovie()

On Local Error GoTo errHandle

If Not (m_boolVideoRunning) Then Exit Sub Call m_objMediaControl.Pause

m_boolVideoRunning = False

Exit Sub errHandle:

Err.Clear End Sub

Sub StopActiveMovie()

On Local Error GoTo errHandle

If Not (m_boolVideoRunning) Then Exit Sub Call m_objMediaControl.Stop

m_boolVideoRunning = False

m_objMediaPosition.CurrentPosition = 0

Exit Sub errHandle:

Err.Clear End Sub

Sub SetActiveMovieBalance(ByVal Value As Long) On Local Error GoTo ErrLine

If Not m_objMediaControl Is Nothing Then _ m_objBasicAudio.Balance = Value

Exit Sub ErrLine:

Err.Clear End Sub

Sub SetActiveMovieVolume(ByVal Value As Long) On Local Error GoTo ErrLine

If Not m_objMediaControl Is Nothing Then _ m_objBasicAudio.Volume = Value

Exit Sub ErrLine:

Err.Clear End Sub

Function GetVideoLength() As Double

Dokumen terkait