本文整理汇总了Python中QLiveLib.getRecentFiles方法的典型用法代码示例。如果您正苦于以下问题:Python QLiveLib.getRecentFiles方法的具体用法?Python QLiveLib.getRecentFiles怎么用?Python QLiveLib.getRecentFiles使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QLiveLib
的用法示例。
在下文中一共展示了QLiveLib.getRecentFiles方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: import QLiveLib [as 别名]
# 或者: from QLiveLib import getRecentFiles [as 别名]
def __init__(self, parent):
wx.Dialog.__init__(self, parent, wx.ID_ANY, "QLive Intro",
size=wx.DefaultSize, pos=wx.DefaultPosition,
style=wx.DEFAULT_DIALOG_STYLE)
self.Bind(wx.EVT_CLOSE, self.onQuit)
self.filepath = ""
self.createDir = False
sizer = wx.BoxSizer(wx.VERTICAL)
msg = "Choose a QLive project to open or create a new one..."
label = wx.StaticText(self, -1, msg)
sizer.Add(label, 0, wx.ALIGN_CENTER|wx.ALL, 10)
box = wx.BoxSizer(wx.HORIZONTAL)
openbut = wx.Button(self, wx.ID_OPEN)
self.Bind(wx.EVT_BUTTON, self.open, id=wx.ID_OPEN)
box.Add(openbut, 1, wx.ALIGN_CENTER_HORIZONTAL|wx.ALL, 25)
newbut = wx.Button(self, wx.ID_NEW)
self.Bind(wx.EVT_BUTTON, self.new, id=wx.ID_NEW)
box.Add(newbut, 1, wx.ALIGN_CENTER_HORIZONTAL|wx.ALL, 25)
sizer.Add(box, 0, wx.GROW|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5)
hsizerRecentFiles = wx.BoxSizer(wx.HORIZONTAL)
recentFiles = QLiveLib.getRecentFiles()
self.recentFilesLabel = wx.StaticText(self, -1, "Recent projects: ")
self.recentFilesLabel.Disable()
self.recentFilesChoice = wx.Choice(self, -1, choices=recentFiles,
size=(350,-1))
self.recentFilesChoice.Disable()
self.recentFilesChoice.Bind(wx.EVT_CHOICE, self.openRecent)
hsizerRecentFiles.Add(self.recentFilesLabel, 0,
wx.LEFT|wx.ALIGN_CENTER, 10)
hsizerRecentFiles.Add(self.recentFilesChoice, 1,
wx.TOP|wx.BOTTOM|wx.RIGHT, 10)
sizer.Add(hsizerRecentFiles, 0, wx.ALL|wx.EXPAND, 0)
box = wx.BoxSizer(wx.HORIZONTAL)
self.pathtext = wx.StaticText(self, -1, "")
box.Add(self.pathtext, 1, wx.EXPAND|wx.ALIGN_LEFT|wx.TOP|wx.BOTTOM, 15)
sizer.Add(box, 0, wx.EXPAND|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 10)
line = wx.StaticLine(self, -1, size=(20,-1), style=wx.LI_HORIZONTAL)
sizer.Add(line, 0, wx.GROW|wx.ALIGN_CENTER_VERTICAL|wx.TOP,25)
btnsizer = wx.StdDialogButtonSizer()
self.okbtn = wx.Button(self, wx.ID_OK)
self.okbtn.Disable()
btnsizer.AddButton(self.okbtn)
# set the most recent project as default for one click action
if recentFiles:
self.recentFilesLabel.Enable()
self.recentFilesChoice.Enable()
self.okbtn.Enable()
self.filepath = recentFiles[0]
self.createDir = False
self.showPath(self.filepath)
focusbutton = self.okbtn
self.recentFilesChoice.SetSelection(0)
else:
focusbutton = openbut
btnsizer.Realize()
sizer.Add(btnsizer, 0,
wx.ALIGN_RIGHT|wx.ALIGN_CENTER_VERTICAL|wx.TOP|wx.BOTTOM, 5)
if PLATFORM == "darwin":
focusbutton.SetDefault()
else:
focusbutton.SetFocus()
self.SetSizer(sizer)
sizer.Fit(self)
示例2: __init__
# 需要导入模块: import QLiveLib [as 别名]
# 或者: from QLiveLib import getRecentFiles [as 别名]
def __init__(self, pos, size):
wx.Frame.__init__(self, None, pos=pos, size=size)
self.SetMinSize((600, 400))
self.SetTitle("QLive Session")
# Status bar, the third field is unused yet.
self.status = self.CreateStatusBar(3)
self.status.SetStatusWidths([100, 150, -1])
self.status.SetStatusText("CPU: 0.0 %", 0)
self.status.SetStatusText("MEM: 0.00 Mb", 1)
# Retrieve the current process
self.process = psutil.Process()
# Start a timer to update CPU and memory usage
self.timer = wx.Timer(self)
self.Bind(wx.EVT_TIMER, self.updateUsage, self.timer)
self.timer.Start(1000)
# Query & load available Audio and MIDI drivers
QLiveLib.queryAudioMidiDrivers()
self.audioServer = AudioServer()
QLiveLib.setVar("AudioServer", self.audioServer)
self.midiServer = MidiServer()
QLiveLib.setVar("MidiServer", self.midiServer)
self.saveState = None
menubar = wx.MenuBar()
menu1 = wx.Menu()
menu1.Append(wx.ID_NEW, "New\tCtrl+N")
self.Bind(wx.EVT_MENU, self.onNew, id=wx.ID_NEW)
menu1.Append(wx.ID_OPEN, "Open\tCtrl+O")
self.Bind(wx.EVT_MENU, self.onLoad, id=wx.ID_OPEN)
self.submenu1 = wx.Menu()
ID_OPEN_RECENT = 2000
recentFiles = QLiveLib.getRecentFiles()
if recentFiles:
for file in recentFiles:
self.submenu1.Append(ID_OPEN_RECENT, file)
self.Bind(wx.EVT_MENU, self.openRecent, id=ID_OPEN_RECENT)
ID_OPEN_RECENT += 1
menu1.AppendMenu(1999, "Open Recent...", self.submenu1)
menu1.AppendSeparator()
menu1.Append(wx.ID_CLOSE, "Close\tCtrl+W")
self.Bind(wx.EVT_MENU, self.onClose, id=wx.ID_CLOSE)
menu1.Append(wx.ID_SAVE, "Save\tCtrl+S")
self.Bind(wx.EVT_MENU, self.onSave, id=wx.ID_SAVE)
menu1.Append(wx.ID_SAVEAS, "Save As...\tShift+Ctrl+S")
self.Bind(wx.EVT_MENU, self.onSaveAs, id=wx.ID_SAVEAS)
if PLATFORM != "darwin":
menu1.AppendSeparator()
prefItem = menu1.Append(wx.ID_PREFERENCES, "Preferences...\tCtrl+;")
self.Bind(wx.EVT_MENU, self.openPrefs, prefItem)
if PLATFORM != "darwin":
menu1.AppendSeparator()
quitItem = menu1.Append(wx.ID_EXIT, "Quit\tCtrl+Q")
self.Bind(wx.EVT_MENU, self.OnQuit, quitItem)
menubar.Append(menu1, 'File')
menu4 = wx.Menu()
menu4.Append(CUE_CUT_ID, "Cut Cue\tCtrl+X")
self.Bind(wx.EVT_MENU, self.onCueCut, id=CUE_CUT_ID)
menu4.Append(CUE_COPY_ID, "Copy Cue\tCtrl+C")
self.Bind(wx.EVT_MENU, self.onCueCopy, id=CUE_COPY_ID)
menu4.Append(CUE_PASTE_ID, "Paste Cue\tCtrl+V")
self.Bind(wx.EVT_MENU, self.onCuePaste, id=CUE_PASTE_ID)
menubar.Append(menu4, 'Cues')
menu2 = wx.Menu()
menu2.Append(NEW_TRACK_ID, "Add Track\tCtrl+T")
self.Bind(wx.EVT_MENU, self.onNewTrack, id=NEW_TRACK_ID)
menu2.Append(DELETE_TRACK_ID, "Delete Track\tShift+Ctrl+D")
self.Bind(wx.EVT_MENU, self.onDeleteTrack, id=DELETE_TRACK_ID)
menubar.Append(menu2, 'Tracks')
menu3 = wx.Menu()
menu3.AppendCheckItem(MIDI_LEARN_ID, "Midi Learn Mode\tShift+Ctrl+M")
self.Bind(wx.EVT_MENU, self.onMidiLearn, id=MIDI_LEARN_ID)
menu3.AppendSeparator()
menu3.Append(INTERP_TIME_ID, "Set Global Interpolation Time\tCtrl+G")
self.Bind(wx.EVT_MENU, self.onNewInterpTime, id=INTERP_TIME_ID)
menu3.AppendSeparator()
menu3.AppendCheckItem(VIEW_CUE_WINDOW_ID,
"Show Current Cue Window\tShift+Ctrl+C")
self.Bind(wx.EVT_MENU, self.onViewCurrentCue, id=VIEW_CUE_WINDOW_ID)
menu3.AppendSeparator()
menu3.AppendCheckItem(LINK_STEREO_ID, "Link Mixer Sliders\tCtrl+L")
self.Bind(wx.EVT_MENU, self.onLinkSliders, id=LINK_STEREO_ID)
menubar.Append(menu3, 'Actions')
self.SetMenuBar(menubar)
tabId = wx.NewId()
self.prevId = KEY_EVENT_FIRST_ID
self.nextId = KEY_EVENT_FIRST_ID + 1
self.cueZeroId = KEY_EVENT_FIRST_ID + 2
self.cue1Id = KEY_EVENT_FIRST_ID + 3
#.........这里部分代码省略.........