VERSION 5.00
Begin VB.Form ChooseURL 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "Choose from URL"
   ClientHeight    =   4950
   ClientLeft      =   6285
   ClientTop       =   5085
   ClientWidth     =   6585
   Icon            =   "ChooseURL.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   4950
   ScaleWidth      =   6585
   ShowInTaskbar   =   0   'False
   Begin VB.Timer Timer1 
      Interval        =   10
      Left            =   120
      Top             =   4320
   End
   Begin VB.CheckBox chkSubliminals 
      Caption         =   "Subliminals"
      Height          =   375
      Left            =   120
      TabIndex        =   22
      Top             =   3840
      Width           =   1215
   End
   Begin VB.CheckBox chkVideo 
      Caption         =   "Video"
      Height          =   375
      Left            =   120
      TabIndex        =   21
      Top             =   3360
      Width           =   1215
   End
   Begin VB.CheckBox chkAudio 
      Caption         =   "Audio"
      Height          =   375
      Left            =   120
      TabIndex        =   20
      Top             =   2880
      Width           =   1215
   End
   Begin VB.CheckBox chkWakener 
      Caption         =   "Wakener"
      Height          =   375
      Left            =   120
      TabIndex        =   19
      Top             =   2400
      Width           =   1215
   End
   Begin VB.CheckBox chkSuggestions 
      Caption         =   "Suggestions"
      Height          =   375
      Left            =   120
      TabIndex        =   18
      Top             =   1920
      Width           =   1215
   End
   Begin VB.CheckBox chkDeepener 
      Caption         =   "Deepener"
      Height          =   375
      Left            =   120
      TabIndex        =   17
      Top             =   1440
      Width           =   1215
   End
   Begin VB.CheckBox chkInduction 
      Caption         =   "Induction"
      Height          =   375
      Left            =   120
      TabIndex        =   16
      Top             =   960
      Width           =   1215
   End
   Begin VB.CommandButton cmdOK 
      Caption         =   "OK"
      Height          =   375
      Left            =   2760
      TabIndex        =   15
      Top             =   4440
      Width           =   1215
   End
   Begin VB.CommandButton prvSubliminals 
      Caption         =   "Preview"
      Height          =   375
      Left            =   5760
      TabIndex        =   14
      Top             =   3840
      Width           =   735
   End
   Begin VB.CommandButton prvVideo 
      Caption         =   "Preview"
      Height          =   375
      Left            =   5760
      TabIndex        =   13
      Top             =   3360
      Width           =   735
   End
   Begin VB.CommandButton prvAudio 
      Caption         =   "Preview"
      Height          =   375
      Left            =   5760
      TabIndex        =   12
      Top             =   2880
      Width           =   735
   End
   Begin VB.CommandButton prvWakener 
      Caption         =   "Preview"
      Height          =   375
      Left            =   5760
      TabIndex        =   11
      Top             =   2400
      Width           =   735
   End
   Begin VB.CommandButton prvSuggestions 
      Caption         =   "Preview"
      Height          =   375
      Left            =   5760
      TabIndex        =   10
      Top             =   1920
      Width           =   735
   End
   Begin VB.CommandButton prvDeepener 
      Caption         =   "Preview"
      Height          =   375
      Left            =   5760
      TabIndex        =   9
      Top             =   1440
      Width           =   735
   End
   Begin VB.CommandButton prvInduction 
      Caption         =   "Preview"
      Height          =   375
      Left            =   5760
      TabIndex        =   8
      Top             =   960
      Width           =   735
   End
   Begin VB.TextBox SubliminalsURL 
      Height          =   375
      Left            =   1440
      TabIndex        =   7
      Top             =   3840
      Width           =   4215
   End
   Begin VB.TextBox VideoURL 
      Height          =   375
      Left            =   1440
      TabIndex        =   6
      Top             =   3360
      Width           =   4215
   End
   Begin VB.TextBox AudioURL 
      Height          =   375
      Left            =   1440
      TabIndex        =   5
      Top             =   2880
      Width           =   4215
   End
   Begin VB.TextBox WakenerURL 
      Height          =   375
      Left            =   1440
      TabIndex        =   4
      Top             =   2400
      Width           =   4215
   End
   Begin VB.TextBox SuggestionsURL 
      Height          =   375
      Left            =   1440
      TabIndex        =   3
      Top             =   1920
      Width           =   4215
   End
   Begin VB.TextBox DeepenerURL 
      Height          =   375
      Left            =   1440
      TabIndex        =   2
      Top             =   1440
      Width           =   4215
   End
   Begin VB.TextBox InductionURL 
      Height          =   375
      Left            =   1440
      TabIndex        =   1
      Top             =   960
      Width           =   4215
   End
   Begin VB.Line Line1 
      X1              =   0
      X2              =   6480
      Y1              =   720
      Y2              =   720
   End
   Begin VB.Label Label1 
      Alignment       =   2  'Center
      Caption         =   $"ChooseURL.frx":08CA
      Height          =   495
      Left            =   480
      TabIndex        =   0
      Top             =   120
      Width           =   5535
   End
End
Attribute VB_Name = "ChooseURL"
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

Private Sub cmdOK_Click()
If chkInduction.Value = 1 Then InductionFile = InductionURL.Text: frmSession.fileInduction.Enabled = False
If chkDeepener.Value = 1 Then DeepenerFile = DeepenerURL.Text: frmSession.fileDeepener.Enabled = False
If chkSuggestions.Value = 1 Then SuggestionsFile = SuggestionsURL.Text: frmSession.fileSubliminals.Enabled = False
If chkWakener.Value = 1 Then WakenerFile = WakenerURL.Text: frmSession.fileWakener.Enabled = False
If chkAudio.Value = 1 Then AudioFile = AudioURL.Text: frmSession.fileAudio.Enabled = False
If chkVideo.Value = 1 Then VideoFile = VideoURL.Text: frmSession.fileVideo.Enabled = False
If chkSubliminals.Value = 1 Then SubliminalsFile = SubliminalsURL.Text: frmSession.fileSubliminals.Enabled = False
Me.Hide
End Sub

Private Sub Form_Load()
Me.Left = (ScreenX / 2) - (Me.Width / 2)
Me.Top = (ScreenY / 2) - (Me.Height / 2)
If InStr(InductionFile, "://") > 0 Then
    chkInduction.Value = 1
    InductionURL.Text = InductionFile
End If
If InStr(DeepenerFile, "://") > 0 Then
    chkDeepener.Value = 1
    DeepenerURL.Text = DeepenerFile
End If
If InStr(SuggestionsFile, "://") > 0 Then
    chkSuggestions.Value = 1
    SuggestionsURL.Text = SuggestionsFile
End If
If InStr(WakenerFile, "://") > 0 Then
    chkWakener.Value = 1
    WakenerURL.Text = WakenerFile
End If
If InStr(AudioFile, "://") > 0 Then
    chkAudio.Value = 1
    AudioURL.Text = AudioFile
End If
If InStr(VideoFile, "://") > 0 Then
    chkVideo.Value = 1
    VideoURL.Text = VideoFile
End If
If InStr(SubliminalsFile, "://") > 0 Then
    chkSubliminals.Value = 1
    SubliminalsURL.Text = SubliminalsFile
End If
End Sub

Private Sub prvAudio_Click()
Call frmPreview.PlayPreview(AudioURL.Text, False)
End Sub

Private Sub prvDeepener_Click()
LoadTextFile DeepenerURL.Text
End Sub

Private Sub prvInduction_Click()
LoadTextFile InductionURL.Text
End Sub

Private Sub LoadTextFile(FileURL As String)

If Downloader.DownloadFile(FileURL, GetTempDir + "vh_script.dat") = True Then
    If IsEncrypted(GetTempDir + "vh_script.dat") = True Then
        MsgBox "Cannot preview encrypted files", vbCritical, "Virtual Hypnotist"
        Kill GetTempDir + "vh_script.dat"
        Exit Sub
    End If
    If ExceptionHandlers = True Then On Error GoTo ErrorHandler
    Dim TempString As String
    Dim TempString2 As String
    'load file
    Open GetTempDir + "vh_script.dat" For Input As #1
        TempString = ""
        TempString2 = ""
        Do While Not EOF(1)
            DoEvents
            Line Input #1, TempString
            TempString2 = TempString2 + TempString + vbCrLf
        Loop
    Close #1
    Kill GetTempDir + "vh_script.dat"
    Call frmViewer.View(1, "Changelog", 0, TempString2)
    Exit Sub
End If

ErrorHandler:
err.Source = "ChooseURL"
   Call ErrorReport("An error occurred while loading the text file.", vbExclamation)
End Sub

Private Sub prvSubliminals_Click()
LoadTextFile SubliminalsURL.Text
End Sub

Private Sub prvSuggestions_Click()
LoadTextFile SuggestionsURL.Text
End Sub

Private Sub prvVideo_Click()
Call frmPreview.PlayPreview(VideoURL.Text, True)
End Sub

Private Sub prvWakener_Click()
LoadTextFile WakenerURL.Text
End Sub

Private Sub Timer1_Timer()
If InductionURL.Text = "" Then
    prvInduction.Enabled = False
Else
    prvInduction.Enabled = True
End If

If DeepenerURL.Text = "" Then
    prvDeepener.Enabled = False
Else
    prvDeepener.Enabled = True
End If

If SuggestionsURL.Text = "" Then
    prvSuggestions.Enabled = False
Else
    prvSuggestions.Enabled = True
End If

If WakenerURL.Text = "" Then
    prvWakener.Enabled = False
Else
    prvWakener.Enabled = True
End If

If AudioURL.Text = "" Then
    prvAudio.Enabled = False
Else
    prvAudio.Enabled = True
End If

If VideoURL.Text = "" Then
    prvVideo.Enabled = False
Else
    prvVideo.Enabled = True
End If

If SubliminalsURL.Text = "" Then
    prvSubliminals.Enabled = False
Else
    prvSubliminals.Enabled = True
End If

End Sub
