VERSION 5.00
Object = "{22D6F304-B0F6-11D0-94AB-0080C74C7E95}#1.0#0"; "MSDXM.ocx"
Object = "{D27CDB6B-AE6D-11CF-96B8-444553540000}#1.0#0"; "Flash9e.ocx"
Begin VB.Form frmPreview 
   BackColor       =   &H00C0C0C0&
   Caption         =   "Preview Media"
   ClientHeight    =   4110
   ClientLeft      =   5160
   ClientTop       =   3660
   ClientWidth     =   4455
   ForeColor       =   &H00000000&
   Icon            =   "frmPreview.frx":0000
   LinkTopic       =   "Form1"
   MinButton       =   0   'False
   ScaleHeight     =   4110
   ScaleWidth      =   4455
   Begin ShockwaveFlashObjectsCtl.ShockwaveFlash ShockwaveFlash1 
      Height          =   4095
      Left            =   0
      TabIndex        =   1
      Top             =   0
      Visible         =   0   'False
      Width           =   4455
      _cx             =   7858
      _cy             =   7223
      FlashVars       =   ""
      Movie           =   ""
      Src             =   ""
      WMode           =   "Window"
      Play            =   -1  'True
      Loop            =   -1  'True
      Quality         =   "High"
      SAlign          =   ""
      Menu            =   -1  'True
      Base            =   ""
      AllowScriptAccess=   "always"
      Scale           =   "ShowAll"
      DeviceFont      =   0   'False
      EmbedMovie      =   0   'False
      BGColor         =   ""
      SWRemote        =   ""
      MovieData       =   ""
      SeamlessTabbing =   -1  'True
      Profile         =   0   'False
      ProfileAddress  =   ""
      ProfilePort     =   0
      AllowNetworking =   "all"
      AllowFullScreen =   "false"
   End
   Begin MediaPlayerCtl.MediaPlayer MediaPlayer1 
      Height          =   3375
      Left            =   0
      TabIndex        =   0
      Top             =   0
      Visible         =   0   'False
      Width           =   4290
      AudioStream     =   -1
      AutoSize        =   -1  'True
      AutoStart       =   -1  'True
      AnimationAtStart=   -1  'True
      AllowScan       =   -1  'True
      AllowChangeDisplaySize=   -1  'True
      AutoRewind      =   0   'False
      Balance         =   0
      BaseURL         =   ""
      BufferingTime   =   5
      CaptioningID    =   ""
      ClickToPlay     =   -1  'True
      CursorType      =   0
      CurrentPosition =   -1
      CurrentMarker   =   0
      DefaultFrame    =   ""
      DisplayBackColor=   0
      DisplayForeColor=   16777215
      DisplayMode     =   0
      DisplaySize     =   4
      Enabled         =   -1  'True
      EnableContextMenu=   -1  'True
      EnablePositionControls=   -1  'True
      EnableFullScreenControls=   0   'False
      EnableTracker   =   -1  'True
      Filename        =   ""
      InvokeURLs      =   -1  'True
      Language        =   -1
      Mute            =   0   'False
      PlayCount       =   1
      PreviewMode     =   0   'False
      Rate            =   1
      SAMILang        =   ""
      SAMIStyle       =   ""
      SAMIFileName    =   ""
      SelectionStart  =   -1
      SelectionEnd    =   -1
      SendOpenStateChangeEvents=   -1  'True
      SendWarningEvents=   -1  'True
      SendErrorEvents =   -1  'True
      SendKeyboardEvents=   0   'False
      SendMouseClickEvents=   0   'False
      SendMouseMoveEvents=   0   'False
      SendPlayStateChangeEvents=   -1  'True
      ShowCaptioning  =   0   'False
      ShowControls    =   -1  'True
      ShowAudioControls=   -1  'True
      ShowDisplay     =   0   'False
      ShowGotoBar     =   0   'False
      ShowPositionControls=   -1  'True
      ShowStatusBar   =   0   'False
      ShowTracker     =   -1  'True
      TransparentAtStart=   0   'False
      VideoBorderWidth=   0
      VideoBorderColor=   0
      VideoBorder3D   =   0   'False
      Volume          =   -600
      WindowlessVideo =   0   'False
   End
End
Attribute VB_Name = "frmPreview"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'Virtual Hypnotist
'©2003-2008 FollowTheWatch Software
'http://vhypno.sourceforge.net
'http://sourceforge.net/projects/vhypno
'Contact - followthewatch55@yahoo.com

'This program is free software; you can redistribute it and/or
'modify it under the terms of the GNU General Public License
'as published by the Free Software Foundation; either version 2
'of the License, or (at your option) any later version.

'This program is distributed in the hope that it will be useful,
'but WITHOUT ANY WARRANTY; without even the implied warranty of
'MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
'GNU General Public License for more details.

'You should have received a copy of the GNU General Public License
'along with this program; if not, write to the Free Software
'Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

Option Explicit

Public Sub PlayPreview(File As String, IsVideo As Boolean)
If ExceptionHandlers = True Then On Error GoTo ErrorHandler

Me.Show

If IsVideo = True Then

If LCase$(Right$(File, 4)) = ".swf" Then
    ShockwaveFlash1.Visible = True
    If frmSession.optFlashLow.Value = True Then ShockwaveFlash1.Quality = 0
    If frmSession.optFlashAutoLow.Value = True Then ShockwaveFlash1.Quality = 2
    If frmSession.optFlashHigh.Value = True Then ShockwaveFlash1.Quality = 1
    If frmSession.optFlashAutoHigh.Value = True Then ShockwaveFlash1.Quality = 3
    MediaPlayer1.Visible = False
    If InStr(File, "://") = 0 Then
        ShockwaveFlash1.Movie = App.path + "\videos\" + File
    Else
        ShockwaveFlash1.Movie = File
    End If
    ShockwaveFlash1.Loop = True
    ShockwaveFlash1.Play
Else
    ShockwaveFlash1.Visible = False
    MediaPlayer1.Visible = True
    If InStr(File, "://") = 0 Then
        MediaPlayer1.FileName = App.path + "\videos\" + File
    Else
        MediaPlayer1.FileName = File
    End If
    MediaPlayer1.PlayCount = 0
    MediaPlayer1.Rate = frmSession.VidSpeedSlider.Value / 100
    MediaPlayer1.AutoSize = True
    MediaPlayer1.AutoRewind = True
    MediaPlayer1.ShowDisplay = False
    Me.Width = MediaPlayer1.Width + 100
    Me.Height = MediaPlayer1.Height + 450
    Me.Left = (ScreenX / 2) - (Me.Width / 2)
    Me.Top = (ScreenY / 2) - (Me.Height / 2)
    MediaPlayer1.Play
End If
End If

If IsVideo = False Then
    ShockwaveFlash1.Visible = False
    MediaPlayer1.Visible = True
    If InStr(File, "://") = 0 Then
        MediaPlayer1.FileName = App.path + "\audio\" + File
    Else
        MediaPlayer1.FileName = File
    End If
    MediaPlayer1.PlayCount = 0
    MediaPlayer1.Rate = frmSession.AudioSpeedSlider.Value / 100
    MediaPlayer1.AutoRewind = True
    MediaPlayer1.ShowDisplay = False
    Me.Width = MediaPlayer1.Width + 100
    Me.Height = MediaPlayer1.Height + 450
    MediaPlayer1.Play
End If

Exit Sub
ErrorHandler:
err.Source = "Preview System"
Call ErrorReport("An error occurred while loading the media file.", vbCritical)
Me.Hide
End Sub
Private Sub Form_Load()
Me.Left = (ScreenX / 2) - (Me.Width / 2)
Me.Top = (ScreenY / 2) - (Me.Height / 2)
End Sub

Private Sub Form_Resize()
MediaPlayer1.Width = Me.Width - 100
MediaPlayer1.Height = Me.Height - 450
ShockwaveFlash1.Width = Me.Width
ShockwaveFlash1.Height = Me.Height
End Sub
