Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Region ;**** Directives created by AutoIt3Wrapper_GUI ****
- #AutoIt3Wrapper_Icon=E:\Portfolio\Project COS3110\for Adobe\clock.ico
- #AutoIt3Wrapper_Outfile=E:\Portfolio\Project COS3110\for Adobe\Adobe Automatic Schedule x86.exe
- #AutoIt3Wrapper_UseX64=n
- #AutoIt3Wrapper_Res_Description=ตารางเวลา Encoder
- #AutoIt3Wrapper_Res_Fileversion=1.0.0.0
- #AutoIt3Wrapper_Res_Fileversion_AutoIncrement=y
- #AutoIt3Wrapper_Res_ProductVersion=2.0
- #AutoIt3Wrapper_Res_LegalCopyright=
- #AutoIt3Wrapper_Res_Language=1054
- #AutoIt3Wrapper_Res_Field=ProductName|
- #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
- #include <GUIConstantsEx.au3>
- #include <ComboConstants.au3>
- #include <StaticConstants.au3>
- #include <DateTimeConstants.au3>
- #include <MsgBoxConstants.au3>
- #include <ColorConstants.au3>
- #include <Date.au3>
- $title = "Windows Media Encoder"
- $title= "Untitled - Windows Media Encoder"
- #Region ### START Koda GUI section ###
- $MainForm = GUICreate("WME Automatic Schedule", 800, 650, -1, -1)
- ; Create the controls
- GUICtrlCreateGroup("เลือกวัน", 70, 140, 165, 270)
- GUIStartGroup()
- $Radio2 = GUICtrlCreateRadio("จันทร์", 100, 180, 70, 20)
- $Radio3 = GUICtrlCreateRadio("อังคาร", 100, 210, 60, 20)
- $Radio4 = GUICtrlCreateRadio("พุธ", 100, 240, 60, 20)
- $Radio5 = GUICtrlCreateRadio("พฤหัสบดี", 100, 270, 70, 20)
- $Radio6 = GUICtrlCreateRadio("ศุกร์", 100, 300, 60, 20)
- $Radio7 = GUICtrlCreateRadio("เสาร์", 100, 330, 60, 20)
- $Radio1 = GUICtrlCreateRadio("อาทิตย์", 100, 360, 70, 20)
- $lecture1 = GUICtrlCreateCheckbox("", 280, 140, 18, 18)
- $lecture2 = GUICtrlCreateCheckbox("", 280, 180, 18, 18)
- $lecture3 = GUICtrlCreateCheckbox("", 280, 220, 18, 18)
- $lecture4 = GUICtrlCreateCheckbox("", 280, 260, 18, 18)
- $lecture5 = GUICtrlCreateCheckbox("", 280, 300, 18, 18)
- $lecture6 = GUICtrlCreateCheckbox("", 280, 340, 18, 18)
- $lecture7 = GUICtrlCreateCheckbox("", 280, 380, 18, 18)
- $lecture8 = GUICtrlCreateCheckbox("", 280, 420, 18, 18)
- $lecture9 = GUICtrlCreateCheckbox("", 280, 460, 18, 18)
- $lecture10 = GUICtrlCreateCheckbox("", 280, 500, 18, 18)
- $startBefore = GUICtrlCreateCombo("", 50, 535, 65, 30, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL))
- $endAfter = GUICtrlCreateCombo("", 150, 535, 65, 30, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL))
- GUIStartGroup()
- $extensionRadio1 = GUICtrlCreateRadio(".flv", 125, 575, 50, 30)
- $extensionRadio2 = GUICtrlCreateRadio(".f4v", 180, 575, 50, 30)
- $startH1 = GUICtrlCreateCombo("", 320, 140, 80, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL))
- $startH2 = GUICtrlCreateCombo("", 320, 180, 80, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL))
- $startH3 = GUICtrlCreateCombo("", 320, 220, 80, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL))
- $startH4 = GUICtrlCreateCombo("", 320, 260, 80, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL))
- $startH5 = GUICtrlCreateCombo("", 320, 300, 80, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL))
- $startH6 = GUICtrlCreateCombo("", 320, 340, 80, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL))
- $startH7 = GUICtrlCreateCombo("", 320, 380, 80, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL))
- $startH8 = GUICtrlCreateCombo("", 320, 420, 80, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL))
- $startH9 = GUICtrlCreateCombo("", 320, 460, 80, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL))
- $startH10 = GUICtrlCreateCombo("", 320, 500, 80, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL))
- $startM1 = GUICtrlCreateCombo("", 420, 140, 70, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL))
- $startM2 = GUICtrlCreateCombo("", 420, 180, 70, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL))
- $startM3 = GUICtrlCreateCombo("", 420, 220, 70, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL))
- $startM4 = GUICtrlCreateCombo("", 420, 260, 70, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL))
- $startM5 = GUICtrlCreateCombo("", 420, 300, 70, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL))
- $startM6 = GUICtrlCreateCombo("", 420, 340, 70, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL))
- $startM7 = GUICtrlCreateCombo("", 420, 380, 70, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL))
- $startM8 = GUICtrlCreateCombo("", 420, 420, 70, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL))
- $startM9 = GUICtrlCreateCombo("", 420, 460, 70, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL))
- $startM10 = GUICtrlCreateCombo("", 420, 500, 70, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL))
- $endH1 = GUICtrlCreateCombo("", 560, 140, 80, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL))
- $endH2 = GUICtrlCreateCombo("", 560, 180, 80, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL))
- $endH3 = GUICtrlCreateCombo("", 560, 220, 80, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL))
- $endH4 = GUICtrlCreateCombo("", 560, 260, 80, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL))
- $endH5 = GUICtrlCreateCombo("", 560, 300, 80, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL))
- $endH6 = GUICtrlCreateCombo("", 560, 340, 80, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL))
- $endH7 = GUICtrlCreateCombo("", 560, 380, 80, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL))
- $endH8 = GUICtrlCreateCombo("", 560, 420, 80, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL))
- $endH9 = GUICtrlCreateCombo("", 560, 460, 80, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL))
- $endH10 = GUICtrlCreateCombo("", 560, 500, 80, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL))
- $endM1 = GUICtrlCreateCombo("", 660, 140, 70, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL))
- $endM2 = GUICtrlCreateCombo("", 660, 180, 70, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL))
- $endM3 = GUICtrlCreateCombo("", 660, 220, 70, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL))
- $endM4 = GUICtrlCreateCombo("", 660, 260, 70, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL))
- $endM5 = GUICtrlCreateCombo("", 660, 300, 70, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL))
- $endM6 = GUICtrlCreateCombo("", 660, 340, 70, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL))
- $endM7 = GUICtrlCreateCombo("", 660, 380, 70, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL))
- $endM8 = GUICtrlCreateCombo("", 660, 420, 70, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL))
- $endM9 = GUICtrlCreateCombo("", 660, 460, 70, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL))
- $endM10 = GUICtrlCreateCombo("", 660, 500, 70, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL))
- $shutdownH = GUICtrlCreateCombo("", 615, 58, 55, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL))
- $shutdownM = GUICtrlCreateCombo("", 685, 58, 55, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL))
- $copytoDay = GUICtrlCreateCombo("", 630, 100, 100, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL))
- ; Add additional items to the combobox.
- GUICtrlSetData($startBefore, "0|1|2|3|4|5", "0")
- GUICtrlSetData($endAfter, "0|1|2|3|4|5", "0")
- GUICtrlSetData($shutdownH, "00|01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19|20|21|22|23|none", "none")
- GUICtrlSetData($shutdownM, "00|05|10|15|20|25|30|35|40|45|50|55|none", "none")
- GUICtrlSetData($copytoDay, "เลือกวันนำเข้า|จันทร์|อังคาร|พุธ|พฤหัสบดี|ศุกร์|เสาร์|อาทิตย์", "เลือกวันนำเข้า")
- GUICtrlSetData($startH1, "00|01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19|20|21|22|23", "none")
- GUICtrlSetData($startH2, "00|01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19|20|21|22|23", "none")
- GUICtrlSetData($startH3, "00|01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19|20|21|22|23", "none")
- GUICtrlSetData($startH4, "00|01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19|20|21|22|23", "none")
- GUICtrlSetData($startH5, "00|01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19|20|21|22|23", "none")
- GUICtrlSetData($startH6, "00|01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19|20|21|22|23", "none")
- GUICtrlSetData($startH7, "00|01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19|20|21|22|23", "none")
- GUICtrlSetData($startH8, "00|01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19|20|21|22|23", "none")
- GUICtrlSetData($startH9, "00|01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19|20|21|22|23", "none")
- GUICtrlSetData($startH10, "00|01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19|20|21|22|23", "none")
- GUICtrlSetData($startM1, "00|05|10|15|20|25|30|35|40|45|50|55", "none")
- GUICtrlSetData($startM2, "00|05|10|15|20|25|30|35|40|45|50|55", "none")
- GUICtrlSetData($startM3, "00|05|10|15|20|25|30|35|40|45|50|55", "none")
- GUICtrlSetData($startM4, "00|05|10|15|20|25|30|35|40|45|50|55", "none")
- GUICtrlSetData($startM5, "00|05|10|15|20|25|30|35|40|45|50|55", "none")
- GUICtrlSetData($startM6, "00|05|10|15|20|25|30|35|40|45|50|55", "none")
- GUICtrlSetData($startM7, "00|05|10|15|20|25|30|35|40|45|50|55", "none")
- GUICtrlSetData($startM8, "00|05|10|15|20|25|30|35|40|45|50|55", "none")
- GUICtrlSetData($startM9, "00|05|10|15|20|25|30|35|40|45|50|55", "none")
- GUICtrlSetData($startM10, "00|05|10|15|20|25|30|35|40|45|50|55", "none")
- GUICtrlSetData($endH1, "00|01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19|20|21|22|23", "none")
- GUICtrlSetData($endH2, "00|01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19|20|21|22|23", "none")
- GUICtrlSetData($endH3, "00|01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19|20|21|22|23", "none")
- GUICtrlSetData($endH4, "00|01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19|20|21|22|23", "none")
- GUICtrlSetData($endH5, "00|01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19|20|21|22|23", "none")
- GUICtrlSetData($endH6, "00|01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19|20|21|22|23", "none")
- GUICtrlSetData($endH7, "00|01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19|20|21|22|23", "none")
- GUICtrlSetData($endH8, "00|01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19|20|21|22|23", "none")
- GUICtrlSetData($endH9, "00|01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19|20|21|22|23", "none")
- GUICtrlSetData($endH10, "00|01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19|20|21|22|23", "none")
- GUICtrlSetData($endM1, "00|05|10|15|20|25|30|35|40|45|50|55", "none")
- GUICtrlSetData($endM2, "00|05|10|15|20|25|30|35|40|45|50|55", "none")
- GUICtrlSetData($endM3, "00|05|10|15|20|25|30|35|40|45|50|55", "none")
- GUICtrlSetData($endM4, "00|05|10|15|20|25|30|35|40|45|50|55", "none")
- GUICtrlSetData($endM5, "00|05|10|15|20|25|30|35|40|45|50|55", "none")
- GUICtrlSetData($endM6, "00|05|10|15|20|25|30|35|40|45|50|55", "none")
- GUICtrlSetData($endM7, "00|05|10|15|20|25|30|35|40|45|50|55", "none")
- GUICtrlSetData($endM8, "00|05|10|15|20|25|30|35|40|45|50|55", "none")
- GUICtrlSetData($endM9, "00|05|10|15|20|25|30|35|40|45|50|55", "none")
- GUICtrlSetData($endM10, "00|05|10|15|20|25|30|35|40|45|50|55", "none")
- $resetButton = GUICtrlCreateButton("เคลียร์ค่า", 320, 560, 80, 25)
- $editButton = GUICtrlCreateButton("แก้ไข", 420, 560, 80, 25)
- $saveButton = GUICtrlCreateButton("บันทึกตารางเวลา", 630, 560, 100, 35)
- $browseButton = GUICtrlCreateButton("Browse", 680, 10, 60, 30)
- $viewButton = GUICtrlCreateButton("ค่าตัวแปร", 10, 10, 60, 25)
- $showDate = GUICtrlCreateLabel("ตั้งเวลา shutdown:", 515, 60, 90, 30)
- $enableButton = GUICtrlCreateButton("", 50, 445, 104, 44)
- GUICtrlSetColor(-1, 0xFFFFFF)
- GUICtrlSetFont(-1, 15, 500, 0, "Arial")
- $disableButton = GUICtrlCreateButton("", 160, 445, 104, 44)
- GUICtrlSetColor(-1, 0xFFFFFF)
- GUICtrlSetFont(-1, 15, 500, 0, "Arial")
- ;Label
- $showDate = GUICtrlCreateLabel("", 70, 50, 140, 80)
- GUICtrlSetFont(-1, 14, 500, 0, "Arial")
- GUICtrlSetStyle(-1, $SS_CENTER)
- $showTime = GUICtrlCreateLabel("", 280, 35, 140, 40, $SS_CENTER + $SS_CENTERIMAGE)
- GUICtrlSetFont(-1, 16, 600, 0, "Arial")
- GUICtrlSetColor(-1, 0xFFFFFF)
- GUICtrlSetBkColor(-1, 0x000000)
- $showBrowse = GUICtrlCreateLabel("ระบุที่อยู่ Folder ชื่อ Encoder File :", 515, 15, 160, 30)
- $tableTime = GUICtrlCreateLabel("ตารางเวลาในการถ่ายทอดสดและบันทึกวิดีโอ", 280, 85, 300, 30)
- GUICtrlSetFont(-1, 14, 600, 0, "Courier New")
- $startTime = GUICtrlCreateLabel("เวลาเริ่มต้น", 320, 114)
- $endTime = GUICtrlCreateLabel("เวลาสิ้นสุด", 560, 114)
- $beforeTime = GUICtrlCreateLabel("เริ่มก่อน: นาที", 50, 510, 80, 25)
- $afterTime = GUICtrlCreateLabel("ต่อหลังอีก: นาที", 150, 510, 80, 25)
- $fileExtensionSelection = GUICtrlCreateLabel("นามสกุลไฟล์", 50, 580, 60, 25)
- $runState = GUICtrlCreateLabel("สถานะ", 135, 415, 60, 30)
- GUICtrlSetFont(-1, 16, 500, 0, "Arial")
- $exitPress = GUICtrlCreateLabel("กดปุ่ม ESC - กรณีค้าง บังคับออกจากโปรแกรม", 50, 620, 700, 20)
- GUICtrlSetStyle(-1, $SS_CENTER)
- $check1 = GUICtrlCreateLabel("1.", 302, 140, 18, 20)
- $check2 = GUICtrlCreateLabel("2.", 302, 180, 18, 20)
- $check3 = GUICtrlCreateLabel("3.", 302, 220, 18, 20)
- $check4 = GUICtrlCreateLabel("4.", 302, 260, 18, 20)
- $check5 = GUICtrlCreateLabel("5.", 302, 300, 18, 20)
- $check6 = GUICtrlCreateLabel("6.", 302, 340, 18, 20)
- $check7 = GUICtrlCreateLabel("7.", 302, 380, 20, 20)
- $check8 = GUICtrlCreateLabel("8.", 302, 420, 20, 20)
- $check9 = GUICtrlCreateLabel("9.", 302, 460, 20, 20)
- $check10 = GUICtrlCreateLabel("10.", 302, 500, 20, 20)
- GUISetState(@SW_SHOW)
- #EndRegion ### END Koda GUI section ###
- Global $changeDate = 0
- Global $changeTime
- Global $setDay = @WDAY
- Global $day = ""
- Global $setting_state
- Global $auto_state = IniRead("setting.ini", "Auto", "auto_state", "0")
- Global $record_state = "start"
- Global $newEnd = 0
- Global $section = 0
- Global $filePart = IniRead("setting.ini", "Auto", "latest_part", "0")
- Global $shutdowntime
- Global $before = IniRead("setting.ini", "Auto", "startBefore", "0")
- Global $after = IniRead("setting.ini", "Auto", "endAfter", "0")
- Global $fileExtension = IniRead("setting.ini", "Auto", "Extension", ".flv")
- Global $target = IniRead("setting.ini", "Auto", "FileSelectFolder", "0")
- Global $save_file = ""
- Global $nametime
- HotKeySet("{ESC}", "Terminate")
- loadSetting($setDay)
- preload()
- While 1
- DateandTime()
- Switch GUIGetMsg()
- Case $GUI_EVENT_CLOSE
- ExitLoop
- Case $editButton
- edit()
- Case $resetButton
- reset()
- Case $saveButton
- save($setDay)
- Case $browseButton
- browse()
- Case $startBefore
- setTime()
- Case $endAfter
- setTime()
- Case $shutdownH
- setShutdown()
- Case $shutdownM
- setShutdown()
- Case $enableButton
- enable()
- Case $disableButton
- disable()
- Case $copytoDay
- copyDay()
- Case $viewButton
- view()
- Case $Radio1
- choiceDay(1)
- Case $Radio2
- choiceDay(2)
- Case $Radio3
- choiceDay(3)
- Case $Radio4
- choiceDay(4)
- Case $Radio5
- choiceDay(5)
- Case $Radio6
- choiceDay(6)
- Case $Radio7
- choiceDay(7)
- Case $extensionRadio1
- choiceExtension(0)
- Case $extensionRadio2
- choiceExtension(1)
- Case $lecture1
- choiceLecture(1)
- Case $lecture2
- choiceLecture(2)
- Case $lecture3
- choiceLecture(3)
- Case $lecture4
- choiceLecture(4)
- Case $lecture5
- choiceLecture(5)
- Case $lecture6
- choiceLecture(6)
- Case $lecture7
- choiceLecture(7)
- Case $lecture8
- choiceLecture(8)
- Case $lecture9
- choiceLecture(9)
- Case $lecture10
- choiceLecture(10)
- Case $MainForm
- EndSwitch
- Debug()
- Schedule()
- WEnd
- ; Delete the previous GUI and all controls.
- GUIDelete()
- Func Terminate()
- $auto_state = 0
- IniWrite("setting.ini", "Auto", "auto_state", $auto_state)
- Exit
- EndFunc ;==>Terminate
- Func loadSetting($iValue)
- GUICtrlSetState(Eval("Radio" & $iValue), $GUI_Checked)
- GUICtrlSetState($resetButton, $GUI_DISABLE)
- GUICtrlSetState($saveButton, $GUI_DISABLE)
- For $i = 1 To 10 Step 1
- $loadLecture = IniRead("setting.ini", "Day-" & $iValue, "lecture" & $i, "0")
- If $loadLecture = 1 Then
- If $i = 1 Then
- $setting_state = 1
- EndIf
- GUICtrlSetState(Eval("lecture" & $i), $GUI_Checked)
- $loadstartH = IniRead("setting.ini", "Period-" & $iValue, $i & "-startH", "none")
- GUICtrlSetData(Eval("startH" & $i), $loadstartH, "none")
- $loadstartM = IniRead("setting.ini", "Period-" & $iValue, $i & "-startM", "none")
- GUICtrlSetData(Eval("startM" & $i), $loadstartM, "none")
- $loadendH = IniRead("setting.ini", "Period-" & $iValue, $i & "-endH", "none")
- GUICtrlSetData(Eval("endH" & $i), $loadendH, "none")
- $loadendM = IniRead("setting.ini", "Period-" & $iValue, $i & "-endM", "none")
- GUICtrlSetData(Eval("endM" & $i), $loadendM, "none")
- Else
- If $i = 1 Then
- $setting_state = 0
- EndIf
- GUICtrlSetState(Eval("lecture" & $i), $GUI_Unchecked)
- GUICtrlSetData(Eval("startH" & $i), "none", "none")
- GUICtrlSetData(Eval("startM" & $i), "none", "none")
- GUICtrlSetData(Eval("endH" & $i), "none", "none")
- GUICtrlSetData(Eval("endM" & $i), "none", "none")
- GUICtrlSetState(Eval("check" & $i), $GUI_HIDE)
- EndIf
- Next
- disableSetting()
- If $auto_state = 1 Then
- For $i = 1 To 7 Step 1
- If GUICtrlRead(Eval("Radio" & $i)) = $GUI_Unchecked Then
- GUICtrlSetState(Eval("Radio" & $i), $GUI_DISABLE)
- EndIf
- Next
- Else
- GUICtrlSetState($editButton, $GUI_ENABLE)
- EndIf
- EndFunc ;==>loadSetting
- Func preload()
- If $auto_state = 1 Then
- GUICtrlSetState($disableButton, $GUI_ENABLE)
- GUICtrlSetData($disableButton, "Disable")
- GUICtrlSetBkColor($disableButton, 0xF44336)
- GUICtrlSetState($enableButton, $GUI_DISABLE)
- GUICtrlSetData($enableButton, "กำลังทำงาน")
- GUICtrlSetState($editButton, $GUI_DISABLE)
- GUICtrlSetState($browseButton, $GUI_DISABLE)
- If $fileExtension = ".flv" Then
- GUICtrlSetState($extensionRadio1, $GUI_CHECKED)
- GUICtrlSetState($extensionRadio2, $GUI_DISABLE)
- Else
- GUICtrlSetState($extensionRadio2, $GUI_CHECKED)
- GUICtrlSetState($extensionRadio1, $GUI_DISABLE)
- EndIf
- Else
- GUICtrlSetState($enableButton, $GUI_ENABLE)
- GUICtrlSetData($enableButton, "Enable")
- GUICtrlSetBkColor($enableButton, 0x4CAF50)
- GUICtrlSetState($disableButton, $GUI_DISABLE)
- GUICtrlSetData($disableButton, "หยุดทำงาน")
- GUICtrlSetState($editButton, $GUI_ENABLE)
- GUICtrlSetState($browseButton, $GUI_ENABLE)
- If $fileExtension = ".flv" Then
- GUICtrlSetState($extensionRadio1, $GUI_CHECKED)
- Else
- GUICtrlSetState($extensionRadio2, $GUI_CHECKED)
- EndIf
- GUICtrlSetState($extensionRadio1, $GUI_ENABLE)
- GUICtrlSetState($extensionRadio2, $GUI_ENABLE)
- EndIf
- GUICtrlSetData(Eval("startBefore"), $before)
- GUICtrlSetData(Eval("endAfter"), $after)
- $shutdownH1 = IniRead("setting.ini", "Auto", "shutdownH", "none")
- $shutdownM1 = IniRead("setting.ini", "Auto", "shutdownM", "none")
- GUICtrlSetData(Eval("shutdownH"), $shutdownH1)
- GUICtrlSetData(Eval("shutdownM"), $shutdownM1)
- If $shutdownH1 == "none" Or $shutdownM1 == "none" Then
- $shutdowntime = "none"
- Else
- $shutdowntime = Int($shutdownH1 & $shutdownM1)
- EndIf
- EndFunc ;==>preload
- Func DateandTime()
- If @MDAY <> $changeDate Then
- Switch @WDAY
- Case 1
- $day = "Sunday"
- Case 2
- $day = "Monday"
- Case 3
- $day = "Tuesday"
- Case 4
- $day = "Wednesday"
- Case 5
- $day = "Thursday"
- Case 6
- $day = "Friday"
- Case 7
- $day = "Saturday"
- Case Else
- $sday = "day"
- EndSwitch
- GUICtrlSetData($showDate, @MDAY & "/" & @MON & "/" & @YEAR & @LF & @LF & $day)
- ; กำหนด Folder จัดเก็บของแต่ละวัน
- $save_file = $target & "\" & $day & "\"
- If $changeDate > 0 Then
- $setDay = @WDAY
- loadSetting($setDay)
- EndIf
- $changeDate = @MDAY
- EndIf
- If @SEC <> $changeTime Then
- GUICtrlSetData($showTime, @HOUR & ":" & @MIN & ":" & @SEC)
- $changeTime = @SEC
- EndIf
- EndFunc ;==>DateandTime
- Func enable()
- If $target <> "0" Then
- If $setting_state = 2 Then
- MsgBox(0, "แจ้งเตือน", "โปรดทำการบันทึกตารางเวลา ก่อนจะเปิดการทำงาน")
- Else
- GUICtrlSetState($enableButton, $GUI_DISABLE)
- GUICtrlSetData($enableButton, "กำลังทำงาน")
- GUICtrlSetBkColor($enableButton, 0xFFFFFF)
- GUICtrlSetState($disableButton, $GUI_ENABLE)
- GUICtrlSetData($disableButton, "Disable")
- GUICtrlSetBkColor($disableButton, 0xF44336)
- GUICtrlSetState($browseButton, $GUI_DISABLE)
- GUICtrlSetState($editButton, $GUI_DISABLE)
- If $fileExtension = ".flv" Then
- GUICtrlSetState($extensionRadio2, $GUI_DISABLE)
- Else
- GUICtrlSetState($extensionRadio1, $GUI_DISABLE)
- EndIf
- For $i = 1 To 7 Step 1
- If GUICtrlRead(Eval("Radio" & $i)) = $GUI_Unchecked Then
- GUICtrlSetState(Eval("Radio" & $i), $GUI_DISABLE)
- EndIf
- Next
- $auto_state = 1
- IniWrite("setting.ini", "Auto", "auto_state", $auto_state)
- EndIf
- Else
- MsgBox(0, "แจ้งเตือน", "โปรดระบุที่อยู่ Folder ชื่อ Encoder File สำหรับการจัดเก็บ ก่อนจะเปิดการทำงาน")
- EndIf
- EndFunc ;==>enable
- Func disable()
- GUICtrlSetState($disableButton, $GUI_DISABLE)
- GUICtrlSetData($disableButton, "หยุดทำงาน")
- GUICtrlSetBkColor($disableButton, 0xFFFFFF)
- GUICtrlSetState($enableButton, $GUI_ENABLE)
- GUICtrlSetData($enableButton, "Enable")
- GUICtrlSetBkColor($enableButton, 0x4CAF50)
- GUICtrlSetState($editButton, $GUI_ENABLE)
- GUICtrlSetState($browseButton, $GUI_ENABLE)
- GUICtrlSetState($extensionRadio1, $GUI_ENABLE)
- GUICtrlSetState($extensionRadio2, $GUI_ENABLE)
- For $i = 1 To 7 Step 1
- GUICtrlSetState(Eval("Radio" & $i), $GUI_ENABLE)
- Next
- $auto_state = 0
- IniWrite("setting.ini", "Auto", "auto_state", $auto_state)
- EndFunc ;==>disable
- Func view()
- MsgBox(0, "ค่าสถานะ และรายละเอียด", "setting_state = " & $setting_state & @LF & "auto_state = " & $auto_state & @LF & "record_state = " & $record_state & @LF & @LF & "กำลังบันทึก section: " & $section & " โดยจะจบบันทึกเวลา: " & $newEnd& @LF & "Part ไฟล์: "& $filePart & @LF & "บันทึกก่อนเวลา: " & $before & " นาที" & @LF & "บันทึกหลังเวลาอีก: " & $after & " นาที" & @LF & "โฟลเดอร์จัดเก็บของวันนี้: " & $save_file & @LF & "นามสกุลไฟล์: " & $fileExtension & @LF &"เวลา Shutdown: "& $shutdowntime)
- EndFunc ;==>view
- Func Schedule()
- If $setting_state <> 2 And $auto_state = 1 Then
- Timer()
- EndIf
- EndFunc ;==>Schedule
- Func choiceDay($iValue)
- reset()
- $setDay = $iValue
- loadSetting($setDay)
- EndFunc ;==>choiceDay
- Func choiceLecture($i)
- If GUICtrlRead(Eval("lecture" & $i)) = $GUI_Checked Then
- GUICtrlSetState(Eval("check" & $i), $GUI_SHOW)
- GUICtrlSetState(Eval("check" & $i), $GUI_ENABLE)
- GUICtrlSetState(Eval("startH" & $i), $GUI_ENABLE)
- GUICtrlSetState(Eval("startM" & $i), $GUI_ENABLE)
- GUICtrlSetState(Eval("endH" & $i), $GUI_ENABLE)
- GUICtrlSetState(Eval("endM" & $i), $GUI_ENABLE)
- ElseIf GUICtrlRead(Eval("lecture" & $i)) = $GUI_Unchecked Then
- GUICtrlSetData(Eval("startH" & $i), "none", "none")
- GUICtrlSetData(Eval("startM" & $i), "none", "none")
- GUICtrlSetData(Eval("endH" & $i), "none", "none")
- GUICtrlSetData(Eval("endM" & $i), "none", "none")
- GUICtrlSetState(Eval("check" & $i), $GUI_HIDE)
- GUICtrlSetState(Eval("startH" & $i), $GUI_DISABLE)
- GUICtrlSetState(Eval("startM" & $i), $GUI_DISABLE)
- GUICtrlSetState(Eval("endH" & $i), $GUI_DISABLE)
- GUICtrlSetState(Eval("endM" & $i), $GUI_DISABLE)
- EndIf
- EndFunc ;==>choiceLecture
- Func choiceExtension($iValue)
- If $iValue = 0 Then
- $fileExtension = ".flv"
- IniWrite("setting.ini", "Auto", "Extension", ".flv")
- Else
- $fileExtension = ".f4v"
- IniWrite("setting.ini", "Auto", "Extension", ".f4v")
- EndIf
- EndFunc ;==>choiceExtension
- Func edit()
- $setting_state = 2
- GUICtrlSetState($editButton, $GUI_DISABLE)
- GUICtrlSetState($resetButton, $GUI_ENABLE)
- GUICtrlSetState($saveButton, $GUI_ENABLE)
- GUICtrlSetState($copytoDay, $GUI_ENABLE)
- For $i = 1 To 10 Step 1
- GUICtrlSetState(Eval("lecture" & $i), $GUI_ENABLE)
- If GUICtrlRead(Eval("lecture" & $i)) = $GUI_Checked Then
- GUICtrlSetState(Eval("startH" & $i), $GUI_ENABLE)
- GUICtrlSetState(Eval("startM" & $i), $GUI_ENABLE)
- GUICtrlSetState(Eval("endH" & $i), $GUI_ENABLE)
- GUICtrlSetState(Eval("endM" & $i), $GUI_ENABLE)
- GUICtrlSetState(Eval("check" & $i), $GUI_ENABLE)
- GUICtrlSetState(Eval("check" & $i), $GUI_SHOW)
- EndIf
- Next
- EndFunc ;==>edit
- Func reset()
- For $i = 1 To 10 Step 1
- GUICtrlSetState(Eval("lecture" & $i), $GUI_Unchecked)
- GUICtrlSetState(Eval("startH" & $i), $GUI_DISABLE)
- GUICtrlSetData(Eval("startH" & $i), "none", "none")
- GUICtrlSetState(Eval("startM" & $i), $GUI_DISABLE)
- GUICtrlSetData(Eval("startM" & $i), "none", "none")
- GUICtrlSetState(Eval("endH" & $i), $GUI_DISABLE)
- GUICtrlSetData(Eval("endH" & $i), "none", "none")
- GUICtrlSetState(Eval("endM" & $i), $GUI_DISABLE)
- GUICtrlSetData(Eval("endM" & $i), "none", "none")
- GUICtrlSetState(Eval("check" & $i), $GUI_HIDE)
- Next
- EndFunc ;==>reset
- Func save($iValue)
- If checkSection() = True And checkData() = True And checkTime() = True Then
- saveSetting($iValue)
- MsgBox(0, "แจ้งเตือน", "ระบบได้ทำการบันทึกตารางเวลาเรียบร้อยแล้ว")
- loadSetting($iValue)
- If GUICtrlRead(Eval("lecture1")) = $GUI_Checked Then
- $setting_state = 1
- Else
- $setting_state = 0
- EndIf
- EndIf
- EndFunc ;==>save
- Func saveSetting($iValue)
- If GUICtrlRead(Eval("Radio" & $iValue)) = $GUI_Checked Then
- For $i = 1 To 10 Step 1
- If GUICtrlRead(Eval("lecture" & $i)) = $GUI_Checked Then
- IniWrite("setting.ini", "Day-" & $iValue, "lecture" & $i, "1")
- IniWrite("setting.ini", "Period-" & $iValue, $i & "-startH", GUICtrlRead(Eval("startH" & $i)))
- IniWrite("setting.ini", "Period-" & $iValue, $i & "-startM", GUICtrlRead(Eval("startM" & $i)))
- IniWrite("setting.ini", "Period-" & $iValue, $i & "-endH", GUICtrlRead(Eval("endH" & $i)))
- IniWrite("setting.ini", "Period-" & $iValue, $i & "-endM", GUICtrlRead(Eval("endM" & $i)))
- Else
- IniWrite("setting.ini", "Day-" & $iValue, "lecture" & $i, "0")
- IniWrite("setting.ini", "Period-" & $iValue, $i & "-startH", "none")
- IniWrite("setting.ini", "Period-" & $iValue, $i & "-startM", "none")
- IniWrite("setting.ini", "Period-" & $iValue, $i & "-endH", "none")
- IniWrite("setting.ini", "Period-" & $iValue, $i & "-endM", "none")
- EndIf
- Next
- EndIf
- EndFunc ;==>saveSetting
- Func disableSetting()
- For $i = 1 To 10 Step 1
- If GUICtrlRead(Eval("lecture" & $i)) = $GUI_Checked Then
- GUICtrlSetState(Eval("check" & $i), $GUI_SHOW)
- EndIf
- GUICtrlSetState(Eval("lecture" & $i), $GUI_DISABLE)
- GUICtrlSetState(Eval("startH" & $i), $GUI_DISABLE)
- GUICtrlSetState(Eval("startM" & $i), $GUI_DISABLE)
- GUICtrlSetState(Eval("endH" & $i), $GUI_DISABLE)
- GUICtrlSetState(Eval("endM" & $i), $GUI_DISABLE)
- GUICtrlSetState(Eval("check" & $i), $GUI_DISABLE)
- Next
- GUICtrlSetData($copytoDay, "เลือกวันนำเข้า")
- GUICtrlSetState($copytoDay, $GUI_DISABLE)
- EndFunc ;==>disableSetting
- Func checkData()
- $ckData = True
- For $i = 1 To 10 Step 1
- If GUICtrlRead(Eval("lecture" & $i)) = $GUI_Checked Then
- If GUICtrlRead(Eval("startH" & $i)) == "none" Or GUICtrlRead(Eval("startM" & $i)) == "none" Or GUICtrlRead(Eval("endH" & $i)) == "none" Or GUICtrlRead(Eval("endM" & $i)) == "none" Then
- $ckData = False
- MsgBox(0, "แจ้งเตือน", "โปรดตั้งค่าตารางเวลาของ section " & $i & " ให้ครบ ก่อนทำการบันทึกตารางเวลา")
- ExitLoop
- EndIf
- Else
- ExitLoop
- EndIf
- Next
- Return $ckData
- EndFunc ;==>checkData
- Func checkSection()
- $ckSection = True
- For $i = 2 To 10 Step 1
- If GUICtrlRead(Eval("lecture" & $i)) = $GUI_Checked Then
- If GUICtrlRead(Eval("lecture" & $i - 1)) = $GUI_Unchecked Then
- $ckSection = False
- MsgBox(0, "แจ้งเตือน", "โปรดตั้งค่าตารางเวลาของ section " & $i - 1 & " อย่างถูกต้อง เสียก่อน")
- ExitLoop
- EndIf
- EndIf
- Next
- Return $ckSection
- EndFunc ;==>checkSection
- Func checkTime()
- $ckTime = True
- $temp = 0
- For $i = 1 To 10 Step 1
- If GUICtrlRead(Eval("lecture" & $i)) = $GUI_Checked Then
- Local $Diff
- Local $cStart
- $Start = Int(GUICtrlRead(Eval("startH" & $i)) & GUICtrlRead(Eval("startM" & $i)))
- $End = Int(GUICtrlRead(Eval("endH" & $i)) & GUICtrlRead(Eval("endM" & $i)))
- If $i > 1 Then
- If GUICtrlRead(Eval("startH" & $i)) = 00 Then
- ; 00:00 and 00:10
- $cStart = Int(GUICtrlRead(Eval("startM" & $i)))
- Else
- ; 01:00 => 00:60
- If GUICtrlRead(Eval("startM" & $i)) = 00 Then
- $cStart = Int((GUICtrlRead(Eval("startH" & $i)) - 1) & 60)
- ; 01:10 => 01:10
- Else
- $cStart = Int(GUICtrlRead(Eval("startH" & $i)) & GUICtrlRead(Eval("startM" & $i)))
- EndIf
- EndIf
- $Diff = $cStart - $temp
- If $temp >= $Start Or $Start >= $End Or $Diff = 5 Then
- $ckTime = False
- MsgBox(0, "แจ้งเตือน", "โปรดตั้งค่าตารางเวลาของ section " & $i & " อย่างถูกต้อง" & @LF & @LF & " - ต้องเรียงลำดับของเวลาเริ่มต้น - เวลาสิ้นสุด จากน้อยไปหามาก " & @LF & " - ต้องเว้นช่วงระยะห่างระหว่าง section 10 นาที")
- ExitLoop
- EndIf
- $temp = $End
- EndIf
- If $i = 1 Then
- If $Start >= $End Then
- $ckTime = False
- MsgBox(0, "แจ้งเตือน", "โปรดตั้งค่าตารางเวลาของ section " & $i & " อย่างถูกต้อง" & @LF & @LF & " - ต้องเรียงลำดับของเวลาเริ่มต้น - เวลาสิ้นสุด จากน้อยไปหามาก ")
- ExitLoop
- EndIf
- $temp = $End
- EndIf
- ;MsgBox(0,"Value", "$Start : "&$Start&@LF&"$End : "&$End&@LF&"$cStart : "&$cStart&@LF)
- Else
- ExitLoop
- EndIf
- Next
- Return $ckTime
- EndFunc ;==>checkTime
- Func Timer()
- Local $newStart
- Local $oldStart
- Local $oldEnd
- Local $current_time
- Local $tempstartH
- Local $tempstartM
- Local $tempendH
- Local $tempendM
- Switch $record_state
- Case "start"
- For $i = 1 To 10 Step 1
- If $GUI_Checked = GUICtrlRead(Eval("lecture" & $i)) Then
- ;~ Local $tempstartH
- ;~ Local $tempstartM
- ;~ Local $tempendH
- ;~ Local $tempendM
- If GUICtrlRead(Eval("startH" & $i)) = 00 Then
- $tempstartH = 00
- $tempstartM = GUICtrlRead(Eval("startM" & $i))
- Else
- If GUICtrlRead(Eval("startM" & $i)) = 00 Then
- $tempstartH = GUICtrlRead(Eval("startH" & $i)) - 1
- $tempstartM = 60
- Else
- $tempstartH = GUICtrlRead(Eval("startH" & $i))
- $tempstartM = GUICtrlRead(Eval("startM" & $i))
- EndIf
- EndIf
- $oldStart = Int($tempstartH & $tempstartM)
- $newStart = Int($oldStart - $before)
- If $oldStart = 0 Then
- $newStart = 0
- EndIf
- ;0005, 0055+5 => 0060
- $tempendH = GUICtrlRead(Eval("endH" & $i))
- $tempendM = GUICtrlRead(Eval("endM" & $i))
- $oldEnd = Int($tempendH & $tempendM)
- $current_time = Int(@HOUR & @MIN)
- If $current_time >= $newStart And $current_time < $oldEnd Then
- $section = $i
- $nametime = GUICtrlRead(Eval("startH" & $i)) & GUICtrlRead(Eval("startM" & $i))
- Local $checknametime = IniRead("setting.ini", "Auto", "latest_nametime", "2400")
- Local $checkDay = IniRead("setting.ini", "Auto", "latest_day", "0")
- ; กรณี Restart => filename__1, filename__2, filename__3
- If $nametime = $checknametime And $checkDay = @MDAY Then
- $filePart += 1
- IniWrite("setting.ini", "Auto", "latest_part", $filePart)
- ; กรณี Encoder file ปกติ => filename__0
- Else
- $filePart = 0
- IniWrite("setting.ini", "Auto", "latest_part", $filePart)
- IniWrite("setting.ini", "Auto", "latest_nametime", $nametime)
- IniWrite("setting.ini", "Auto", "latest_day", @MDAY)
- EndIf
- $newEnd = $oldEnd + $after
- If $newEnd = 2360 Then
- $newEnd = 2358
- EndIf
- ; กรณีคืนค่าเดิม
- ;IniWrite("setting.ini", "Auto", "latest_newEnd", $newEnd)
- ;IniWrite("setting.ini", "Auto", "latest_section", $section)
- $record_state = "stop"
- startRecord()
- ExitLoop
- EndIf
- Else
- doShutdown()
- ExitLoop
- EndIf
- Next
- Case "stop"
- $current_time = Int(@HOUR & @MIN)
- If $current_time >= $newEnd Then
- $record_state = "start"
- $newEnd = 0
- $section = 0
- stopRecord()
- ;;end state
- Local $startTime = $tempstartH & $tempstartM
- Local $endTime = $tempendH & $tempendM
- funcFileMove($startTime,$endTime) ;<<
- Sleep(5000)
- EndIf
- EndSwitch
- EndFunc ;==>Timer
- Func Debug()
- EndFunc
- Func funcFileMove($startTime,$endTime)
- $sDate = StringReplace(_NowDate(), "/", "-")
- $folderLocate = "C:\Encode File\"
- $todayFloder = $sDate &"\"
- $fileNameTime = $startTime&"_"& $startTime & "__" & $sDate
- $desFileName = $folderLocate & $todayFloder & $fileNameTime & ".wmv"
- FileMove($folderLocate&"temp.wmv", $desFileName, $FC_OVERWRITE + $FC_CREATEPATH)
- ConsoleWrite("FileMove Execute")
- EndFunc
- Func setTime()
- $before = GUICtrlRead(Eval("startBefore"))
- $after = GUICtrlRead(Eval("endAfter"))
- IniWrite("setting.ini", "Auto", "startBefore", $before)
- IniWrite("setting.ini", "Auto", "endAfter", $after)
- EndFunc ;==>setTime
- Func startRecord()
- WinActivate($title)
- If Not WinActive($title) Then
- Run("C:\Program Files\Windows Media Components\Encoder\wmenc.exe")
- WinWaitActive($title)
- WinActivate($title)
- Sleep(25000)
- ; กด Stop กำลังบันทึกปัจจุบัน เพื่อจะเริ่มกด Start ใหม่ต่อไป
- Else
- Local $status = ControlGetText($title, "", "[CLASS:Titan:CStatusBar; INSTANCE:1]")
- If $status == " Encoder capturing" Then
- Sleep(1000)
- ControlSend($title, "", "", "^+{S}")
- Do
- Local $status = ControlGetText($title, "", "[CLASS:Titan:CStatusBar; INSTANCE:1]")
- Sleep(10)
- Until $status == " Encoder ready"
- Sleep(4000)
- EndIf
- EndIf
- ;Sleep(1000)
- ;WinSetState("Adobe Flash Media Live Encoder 3.2", "", @SW_MAXIMIZE) ; Maximize windows
- ; กด Start
- $sDate = StringReplace(_NowDate(), "/", "-")
- $fileName = $save_file & $nametime & "__" & $sDate & "__" & $filePart & $fileExtension
- ;Sleep(1000)
- ;ControlSetText("Adobe Flash Media Live Encoder 3.2", "", "[CLASS:Edit;INSTANCE:24]", $fileName)
- Sleep(2000)
- ControlSend($title, "", "", "^+{E}")
- Sleep(5000)
- EndFunc ;==>startRecord
- Func stopRecord()
- Sleep(1000)
- WinActivate($title)
- Sleep(500)
- ControlSend($title, "", "", "^+{S}")
- ;~ Do
- ;~ Local $status = ControlGetText($title, "", "[CLASS:Titan:CStatusBar; INSTANCE:1]")
- ;~ Sleep(10)
- ;~ Until $status == " Encoder capturing"
- ;~
- ConsoleWrite("Stop")
- Sleep(5000)
- EndFunc ;==>stopRecord
- Func browse()
- ; Create a constant variable in Local scope of the message to display in FileSelectFolder.
- Local Const $sMessage = "เลือก Folder"
- ; Display an open dialog to select a file.
- Local $sFileSelectFolder = FileSelectFolder($sMessage, "")
- If @error Then
- ; Display the error message.
- $target = IniRead("setting.ini", "Auto", "FileSelectFolder", "0")
- $save_file = $target & "\" & $day & "\"
- MsgBox(0, "แจ้งเตือน", "คุณไม่ได้เลือกที่อยู่ Folder ชื่อ Encoder File ดังนั้น จะใช้ที่่อยู่ล่าสุดที่เคยเลือกไว้:" & @CRLF & $target)
- Else
- ; Display the selected folder.
- $target = $sFileSelectFolder
- IniWrite("setting.ini", "Auto", "FileSelectFolder", $target)
- $save_file = $target & "\" & $day & "\"
- MsgBox($MB_SYSTEMMODAL, "แจ้งเตือน", "คุณได้เลือกที่อยู่ Folder ชื่อ Encoder File สำหรับจัดเก็บข้อมูลดังต่อไปนี้:" & @CRLF & $target)
- EndIf
- EndFunc ;==>browse
- Func setShutdown()
- Local $shutdownH2 = GUICtrlRead(Eval("shutdownH"))
- Local $shutdownM2 = GUICtrlRead(Eval("shutdownM"))
- IniWrite("setting.ini", "Auto", "shutdownH", $shutdownH2)
- IniWrite("setting.ini", "Auto", "shutdownM", $shutdownM2)
- If $shutdownH2 == "none" Or $shutdownM2 == "none" Then
- $shutdowntime = "none"
- Else
- $shutdowntime = Int($shutdownH2 & $shutdownM2)
- EndIf
- EndFunc
- Func doShutdown()
- If $shutdowntime <> "none" Then
- $current_time = Int(@HOUR & @MIN)
- If $current_time = $shutdowntime Then
- Sleep(5000)
- WinClose("Adobe Flash Media Live Encoder 3.2")
- Sleep(10000)
- Shutdown(1)
- Exit
- EndIf
- EndIf
- EndFunc
- Func copyDay()
- $cday = GUICtrlRead(Eval("copytoDay"))
- Switch $cday
- Case "อาทิตย์"
- getSetting(1)
- Case "จันทร์"
- getSetting(2)
- Case "อังคาร"
- getSetting(3)
- Case "พุธ"
- getSetting(4)
- Case "พฤหัสบดี"
- getSetting(5)
- Case "ศุกร์"
- getSetting(6)
- Case "เสาร์"
- getSetting(7)
- EndSwitch
- EndFunc
- Func getSetting($iValue)
- reset()
- For $i = 1 To 10 Step 1
- $loadLecture = IniRead("setting.ini", "Day-" & $iValue, "lecture" & $i, "0")
- If $loadLecture = 1 Then
- GUICtrlSetState(Eval("lecture" & $i), $GUI_Checked)
- $loadstartH = IniRead("setting.ini", "Period-" & $iValue, $i & "-startH", "none")
- GUICtrlSetData(Eval("startH" & $i), $loadstartH, "none")
- $loadstartM = IniRead("setting.ini", "Period-" & $iValue, $i & "-startM", "none")
- GUICtrlSetData(Eval("startM" & $i), $loadstartM, "none")
- $loadendH = IniRead("setting.ini", "Period-" & $iValue, $i & "-endH", "none")
- GUICtrlSetData(Eval("endH" & $i), $loadendH, "none")
- $loadendM = IniRead("setting.ini", "Period-" & $iValue, $i & "-endM", "none")
- GUICtrlSetData(Eval("endM" & $i), $loadendM, "none")
- GUICtrlSetState(Eval("startH" & $i), $GUI_ENABLE)
- GUICtrlSetState(Eval("startM" & $i), $GUI_ENABLE)
- GUICtrlSetState(Eval("endH" & $i), $GUI_ENABLE)
- GUICtrlSetState(Eval("endM" & $i), $GUI_ENABLE)
- GUICtrlSetState(Eval("check" & $i), $GUI_ENABLE)
- GUICtrlSetState(Eval("check" & $i), $GUI_SHOW)
- Else
- GUICtrlSetState(Eval("lecture" & $i), $GUI_Unchecked)
- GUICtrlSetData(Eval("startH" & $i), "none", "none")
- GUICtrlSetData(Eval("startM" & $i), "none", "none")
- GUICtrlSetData(Eval("endH" & $i), "none", "none")
- GUICtrlSetData(Eval("endM" & $i), "none", "none")
- GUICtrlSetState(Eval("check" & $i), $GUI_HIDE)
- EndIf
- Next
- EndFunc ;==>getSetting
- Func _ReduceMemory($i_PID = -1)
- If $i_PID <> -1 Then
- Local $ai_Handle = DllCall("kernel32.dll", 'int', 'OpenProcess', 'int', 0x1f0fff, 'int', False, 'int', $i_PID)
- $ai_Return = DllCall("psapi.dll", 'int', 'EmptyWorkingSet', 'long', $ai_Handle[0])
- DllCall('kernel32.dll', 'int', 'CloseHandle', 'int', $ai_Handle[0])
- Else
- $ai_Return = DllCall("psapi.dll", 'int', 'EmptyWorkingSet', 'long', -1)
- EndIf
- Return $ai_Return[0]
- EndFunc ;==>_ReduceMemory
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement