3 #import sys # モジュール属性 argv を取得するため
12 mypath = str(os.path.dirname(os.path.abspath(__file__))) + "/"
13 def tv2tsmix(pout, ch, time):
15 if len(ch) > 2:#BS/CSは100とかCS??とかなので3文字以上
16 status.changeBSCSRecording(1)
17 #status.setBSCSRecording(status.getBSCSRecording() + 1)
19 #status.setTERecording(status.getTERecording() + 1)
20 status.changeTERecording(1)
21 tv2b25ts(pout + ".b25", ch, time)
22 if len(ch) > 2:#BS/CSは100とかCS??とかなので3文字以上
23 #status.setBSCSRecording(status.getBSCSRecording()-1)
24 status.changeBSCSRecording(-1)
26 #status.setTERecording(status.getTERecording()-1)
27 status.changeTERecording(-1)
28 b252tsmix(pout + ".b25", pout)
29 #os.remove(pout+".b25")
30 if os.access(pout, os.F_OK):
32 os.remove(pout + ".b25")
35 def tv2ts(pout, ch, csch, time):
36 ext = os.path.splitext(pout)[1]#ext=".なんたら"
37 tempt = os.path.split(pout)
39 if len(ch) > 2:#BS/CSは100とかCS??とかなので3文字以上
40 status.changeBSCSRecording(1)
41 #status.setBSCSRecording(status.getBSCSRecording() + 1)
43 #status.setTERecording(status.getTERecording() + 1)
44 status.changeTERecording(1)
45 tv2b25ts(pout + ".b25", ch, time)
46 if len(ch) > 2:#BS/CSは100とかCS??とかなので3文字以上
47 #status.setBSCSRecording(status.getBSCSRecording()-1)
48 status.changeBSCSRecording(-1)
50 #status.setTERecording(status.getTERecording()-1)
51 status.changeTERecording(-1)
52 b252tsmix(pout + ".b25", pout + ".tsmix")
53 tsmix2ts(pout + ".tsmix", pout, csch)
54 #os.remove(path+"/"+t+"."+temp[1])
55 if os.access(pout, os.F_OK):
57 os.remove(path + "/" + t + ext)
60 def b252ts(pout, ch, csch):
61 ext = os.path.splitext(pout)[1]#ext=".なんたら"
62 #t=hashlib.md5(pout).hexdigest()
63 tempt = os.path.split(pout)
65 b252tsmix(pout + ".b25", pout + ".tsmix")
66 tsmix2ts(pout + ".tsmix", pout, csch)
67 if os.access(pout, os.F_OK):
69 os.remove(path + "/" + t + ext)
73 def tv2b25ts(pout, ch, time):
74 exe = configreader.getpath('recpt1')
75 #print [exe,ch,time,pout]
77 doexe = exe + ' ' + ch + ' ' + time + ' \'' + pout + '\''
79 def tv2b25ts_b25(pout, ch, time):
80 exe = configreader.getpath('recpt1')
81 doexe = exe + ' --b25 ' + ch + ' ' + time + ' \'' + pout + '\''
83 def b252tsmix(pin, pout):
84 exe = configreader.getpath('b25')
85 #doexe = exe.encode('utf-8') + u' \"' + pin.encode('utf-8') + u'\" \"' + pout.encode('utf-8') + u'\"'
86 doexe = exe + u' \"' + pin + u'\" \"' + pout + u'\"'
87 doexe = "nice -n 17 " + doexe
90 txt = commands.getoutput(doexe)
91 f=open(pin+".log",'w')
94 def tsmix2ts(pin, pout, csch):#csch=0ならcsの処理をしない
97 shutil.move(pin, pout)
99 doexe = configreader.getpath("tssplitter_lite") + " \"" + pin + "\" \"" + pout + "\" " + str(csch)
100 doexe = "nice -n 18 " + doexe
105 if os.access(pout, os.F_OK):