3 #import sys # モジュール属性 argv を取得するため
12 mypath = str(os.path.dirname(os.path.abspath(__file__))) + "/"
13 def tv2tsmix(pout, ch, time):
14 #if len(ch) > 2:#BS/CSは100とかCS??とかなので3文字以上
15 # status.changeBSCSRecording(1)
17 # status.changeTERecording(1)
18 tv2b25ts(pout + ".b25", ch, time)
19 #if len(ch) > 2:#BS/CSは100とかCS??とかなので3文字以上
20 # status.changeBSCSRecording(-1)
22 # status.changeTERecording(-1)
23 b252tsmix(pout + ".b25", pout)
24 if os.access(pout, os.F_OK):
26 os.remove(pout + ".b25")
29 def tv2ts(pout, ch, csch, time):
30 ext = os.path.splitext(pout)[1]#ext=".なんたら"
31 tempt = os.path.split(pout)
33 if len(ch) > 2:#BS/CSは100とかCS??とかなので3文字以上
34 status.changeBSCSRecording(1)
36 status.changeTERecording(1)
37 tv2b25ts(pout + ".b25", ch, time)
38 if len(ch) > 2:#BS/CSは100とかCS??とかなので3文字以上
39 status.changeBSCSRecording(-1)
41 status.changeTERecording(-1)
42 b252tsmix(pout + ".b25", pout + ".tsmix")
43 tsmix2ts(pout + ".tsmix", pout, csch)
44 if os.access(pout, os.F_OK):
46 os.remove(path + "/" + t + ext)
49 def b252ts(pout, ch, csch):
50 ext = os.path.splitext(pout)[1]#ext=".なんたら"
51 tempt = os.path.split(pout)
53 b252tsmix(pout + ".b25", pout + ".tsmix")
54 tsmix2ts(pout + ".tsmix", pout, csch)
55 if os.access(pout, os.F_OK):
57 os.remove(path + "/" + t + ext)
60 def tv2b25ts(pout, ch, time):
61 exe = configreader.getpath('recpt1')
62 if len(ch) > 2:#BS/CSは100とかCS??とかなので3文字以上
63 status.changeBSCSRecording(1)
65 status.changeTERecording(1)
66 doexe = exe + ' ' + ch + ' ' + time + ' \'' + pout + '\''
68 txt="####recpt1-log####\n"
69 txt = txt + commands.getoutput(doexe)
70 logo=pout.replace(".ts.b25",".log")
74 if len(ch) > 2:#BS/CSは100とかCS??とかなので3文字以上
75 status.changeBSCSRecording(-1)
77 status.changeTERecording(-1)
78 def tv2b25ts_b25(pout, ch, time):
79 exe = configreader.getpath('recpt1')
80 doexe = exe + ' --b25 ' + ch + ' ' + time + ' \'' + pout + '\''
82 def b252tsmix(pin, pout):
83 exe = configreader.getpath('b25')
84 #doexe = exe.encode('utf-8') + u' \"' + pin.encode('utf-8') + u'\" \"' + pout.encode('utf-8') + u'\"'
85 doexe = exe + u' \"' + pin + u'\" \"' + pout + u'\"'
86 doexe = "nice -n 17 " + doexe
89 logo=pin.replace(".ts.b25",".log")
90 txt = commands.getoutput(doexe)
102 txt = "\n####b25-log####\n"+stxt
106 def tsmix2ts(pin, pout, csch):#csch=0ならcsの処理をしない
109 shutil.move(pin, pout)
111 doexe = configreader.getpath("tssplitter_lite") + " \"" + pin + "\" \"" + pout + "\" " + str(csch)
112 doexe = "nice -n 18 " + doexe
117 if os.access(pout, os.F_OK):