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")
52 tsmix2ts(pout + ".tsmix", pout, tch)
53 if os.access(pout, os.F_OK):
55 os.remove(path + "/" + t + ext)
58 def b252ts(pout, ch, csch):
59 ext = os.path.splitext(pout)[1]#ext=".なんたら"
60 tempt = os.path.split(pout)
62 b252tsmix(pout + ".b25", pout + ".tsmix")
72 tsmix2ts(pout + ".tsmix", pout, tch)
73 if os.access(pout, os.F_OK):
75 os.remove(path + "/" + t + ext)
78 def tv2b25ts(pout, ch, time):
79 exe = configreader.getpath('recpt1')
80 if len(ch) > 2:#BS/CSは100とかCS??とかなので3文字以上
81 status.changeBSCSRecording(1)
83 status.changeTERecording(1)
84 doexe = exe + ' ' + ch + ' ' + time + ' \'' + pout + '\''
86 txt="####recpt1-log####\n"
87 txt = txt + commands.getoutput(doexe)
88 logo=pout.replace(".ts.b25",".log")
92 if len(ch) > 2:#BS/CSは100とかCS??とかなので3文字以上
93 status.changeBSCSRecording(-1)
95 status.changeTERecording(-1)
96 def tv2b25ts_b25(pout, ch, time):
97 exe = configreader.getpath('recpt1')
98 doexe = exe + ' --b25 ' + ch + ' ' + time + ' \'' + pout + '\''
100 def b252tsmix(pin, pout):
101 exe = configreader.getpath('b25')
102 #doexe = exe.encode('utf-8') + u' \"' + pin.encode('utf-8') + u'\" \"' + pout.encode('utf-8') + u'\"'
103 doexe = exe + u' \"' + pin + u'\" \"' + pout + u'\"'
104 doexe = "nice -n 17 " + doexe
107 logo=pin.replace(".ts.b25",".log")
108 txt = commands.getoutput(doexe)
120 txt = "\n####b25-log####\n"+stxt
124 def tsmix2ts(pin, pout, csch):#csch=0ならcsの処理をしない
127 shutil.move(pin, pout)
129 doexe = configreader.getpath("tssplitter_lite") + " \"" + pin + "\" \"" + pout + "\" " + str(csch)
130 doexe = "nice -n 18 " + doexe
135 if os.access(pout, os.F_OK):