本文整理汇总了Python中QLiveLib.toSysEncoding方法的典型用法代码示例。如果您正苦于以下问题:Python QLiveLib.toSysEncoding方法的具体用法?Python QLiveLib.toSysEncoding怎么用?Python QLiveLib.toSysEncoding使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QLiveLib
的用法示例。
在下文中一共展示了QLiveLib.toSysEncoding方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: recStart
# 需要导入模块: import QLiveLib [as 别名]
# 或者: from QLiveLib import toSysEncoding [as 别名]
def recStart(self, filename="", fileformat=0, sampletype=0):
self.server.recordOptions(fileformat=fileformat, sampletype=sampletype)
if not filename:
filename = os.path.basename(QLiveLib.getVar("currentProject"))
filename, ext = os.path.splitext(filename)
filename = os.path.join(QLiveLib.getVar("projectFolder"), "bounce", filename)
if fileformat >= 0 and fileformat < 8:
ext = RECORD_EXTENSIONS[fileformat]
else:
ext = ".wav"
date = time.strftime('_%d_%b_%Y_%Hh%M')
complete_filename = QLiveLib.toSysEncoding(filename+date+ext)
self.server.recstart(complete_filename)
示例2: newRecent
# 需要导入模块: import QLiveLib [as 别名]
# 或者: from QLiveLib import toSysEncoding [as 别名]
def newRecent(self, file):
filename = QLiveLib.ensureNFD(OPEN_RECENT_PATH)
try:
f = codecs.open(filename, "r", encoding="utf-8")
lines = [line.replace("\n", "") for line in f.readlines()]
f.close()
except:
lines = []
if not file in lines:
f = codecs.open(filename, "w", encoding="utf-8")
lines.insert(0, file)
if len(lines) > 20:
lines = lines[0:20]
for line in lines:
f.write(line + '\n')
f.close()
subId = 2000
if lines != []:
for item in self.submenu1.GetMenuItems():
self.submenu1.DeleteItem(item)
for file in lines:
self.submenu1.Append(subId, QLiveLib.toSysEncoding(file))
subId += 1