当前位置: 首页>>代码示例>>Python>>正文


Python CeciliaLib.setVar方法代码示例

本文整理汇总了Python中CeciliaLib.setVar方法的典型用法代码示例。如果您正苦于以下问题:Python CeciliaLib.setVar方法的具体用法?Python CeciliaLib.setVar怎么用?Python CeciliaLib.setVar使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CeciliaLib的用法示例。


在下文中一共展示了CeciliaLib.setVar方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: onRememberInputSound

# 需要导入模块: import CeciliaLib [as 别名]
# 或者: from CeciliaLib import setVar [as 别名]
 def onRememberInputSound(self, event):
     if event.GetInt() == 1:
         CeciliaLib.getVar("interface").menubar.editMenu.FindItemById(ID_REMEMBER).Check(True)
         CeciliaLib.setVar("rememberedSound", True)
     else:
         CeciliaLib.getVar("interface").menubar.editMenu.FindItemById(ID_REMEMBER).Check(False)
         CeciliaLib.setVar("rememberedSound", False)
开发者ID:TylerKinkade,项目名称:cecilia5,代码行数:9,代码来源:CeciliaMainFrame.py

示例2: onPlayStop

# 需要导入模块: import CeciliaLib [as 别名]
# 或者: from CeciliaLib import setVar [as 别名]
 def onPlayStop(self, value):
     if value:
         CeciliaLib.getControlPanel().nonZeroTime = 0
         CeciliaLib.setVar("toDac", True)
         CeciliaLib.getVar("grapher").toolbar.loadingMsg.SetForegroundColour("#FFFFFF")
         CeciliaLib.getVar("grapher").toolbar.loadingMsg.Refresh()
         CeciliaLib.getControlPanel().transportButtons.setPlay(True)
         wx.CallLater(50, CeciliaLib.startCeciliaSound, True)
     else:
         CeciliaLib.stopCeciliaSound()
开发者ID:TylerKinkade,项目名称:cecilia5,代码行数:12,代码来源:CeciliaMainFrame.py

示例3: onClose

# 需要导入模块: import CeciliaLib [as 别名]
# 或者: from CeciliaLib import setVar [as 别名]
 def onClose(self, event):
     CeciliaLib.setVar("interfaceSize", self.GetSize())
     CeciliaLib.setVar("interfacePosition", self.GetPosition())
     CeciliaLib.resetWidgetVariables()
     try:
         self.Destroy()
     except:
         pass
     CeciliaLib.getVar("mainFrame").SetFocus()
     CeciliaLib.getVar("mainFrame").Hide()
开发者ID:flecavalier,项目名称:cecilia5,代码行数:12,代码来源:CeciliaInterface.py

示例4: createSlidersPanel

# 需要导入模块: import CeciliaLib [as 别名]
# 或者: from CeciliaLib import setVar [as 别名]
 def createSlidersPanel(self):
     if CeciliaLib.getVar("systemPlatform") == "win32":
         BORDER = wx.DOUBLE_BORDER
     else:
         BORDER = wx.SIMPLE_BORDER
     panel = wx.Panel(self, -1, style=BORDER)
     panel.SetBackgroundColour(BACKGROUND_COLOUR)
     widgets = CeciliaLib.getVar("interfaceWidgets")
     box, sl = buildHorizontalSlidersBox(panel, widgets)
     CeciliaLib.setVar("userSliders", sl)
     panel.SetSizerAndFit(box)
     size = panel.GetSize()
     return panel, size
开发者ID:flecavalier,项目名称:cecilia5,代码行数:15,代码来源:CeciliaInterface.py

示例5: createTogglePopupPanel

# 需要导入模块: import CeciliaLib [as 别名]
# 或者: from CeciliaLib import setVar [as 别名]
 def createTogglePopupPanel(self):
     if CeciliaLib.getVar("systemPlatform") == "win32":
         BORDER = wx.DOUBLE_BORDER
     else:
         BORDER = wx.SIMPLE_BORDER
     panel = wx.Panel(self, -1, style=BORDER)
     panel.SetBackgroundColour(BACKGROUND_COLOUR)
     widgets = CeciliaLib.getVar("interfaceWidgets")
     box, objs = buildTogglePopupBox(panel, widgets)
     panel.SetSizerAndFit(box)
     CeciliaLib.setVar("userTogglePopups", objs)
     size = panel.GetSize()
     return panel, objs, size
开发者ID:flecavalier,项目名称:cecilia5,代码行数:15,代码来源:CeciliaInterface.py

示例6: __init__

# 需要导入模块: import CeciliaLib [as 别名]
# 或者: from CeciliaLib import setVar [as 别名]
    def __init__(
        self, parent, id=-1, title="", mainFrame=None, pos=wx.DefaultPosition, size=wx.DefaultSize, style=style
    ):
        wx.Frame.__init__(self, parent, id, title, pos, size, style)

        self.SetBackgroundColour(BACKGROUND_COLOUR)
        self.ceciliaMainFrame = mainFrame
        self.menubar = InterfaceMenuBar(self, self.ceciliaMainFrame)
        self.SetMenuBar(self.menubar)

        self.box = wx.GridBagSizer(0, 0)

        self.controlBox = wx.BoxSizer(wx.VERTICAL)

        self.controlPanel = Control.CECControl(self, -1)
        togglePopupPanel, objs, tpsize = self.createTogglePopupPanel()
        slidersPanel, slPanelSize = self.createSlidersPanel()
        self.grapher = getGrapher(self)
        CeciliaLib.setVar("grapher", self.grapher)
        presetPanel = Preset.CECPreset(self)
        CeciliaLib.setVar("presetPanel", presetPanel)

        self.controlBox.Add(self.controlPanel, 1, wx.EXPAND | wx.RIGHT, -1)
        self.controlBox.Add(presetPanel, 0, wx.EXPAND | wx.TOP | wx.RIGHT, -1)
        self.controlBox.Add(togglePopupPanel, 0, wx.EXPAND | wx.TOP | wx.RIGHT, -1)

        self.box.Add(self.controlBox, (0, 0), span=(2, 1), flag=wx.EXPAND)
        self.box.Add(self.grapher, (0, 1), flag=wx.EXPAND)
        self.box.Add(slidersPanel, (1, 1), flag=wx.EXPAND | wx.TOP, border=-1)

        self.box.AddGrowableCol(1, 1)
        self.box.AddGrowableRow(0, 1)

        pos = CeciliaLib.getVar("interfacePosition")
        size = CeciliaLib.getVar("interfaceSize")
        pos, size = self.positionToClientArea(pos, size)

        self.SetSizer(self.box)
        self.SetSize(size)

        self.Bind(wx.EVT_CLOSE, self.onClose)

        if pos == None:
            self.Center()
        else:
            self.SetPosition(pos)

        self.Show(True)

        wx.CallAfter(self.createGrapher)
开发者ID:flecavalier,项目名称:cecilia5,代码行数:52,代码来源:CeciliaInterface.py

示例7: onQuit

# 需要导入模块: import CeciliaLib [as 别名]
# 或者: from CeciliaLib import setVar [as 别名]
 def onQuit(self, event):
     if not CeciliaLib.closeCeciliaFile(self):
         return
     try:
         self.prefs.onClose(event)
     except:
         pass
     if CeciliaLib.getVar("audioServer").isAudioServerRunning():
         CeciliaLib.getVar("audioServer").stop()
         time.sleep(.2)
     if CeciliaLib.getVar('spectrumFrame') != None:
         try:
             CeciliaLib.getVar('spectrumFrame')._destroy(None)
         except:
             pass
         finally:
             CeciliaLib.setVar('spectrumFrame', None)
     self.api_doc_frame.Destroy()
     self.mod_doc_frame.Destroy()
     self.closeInterface()
     CeciliaLib.writeVarToDisk()
     self.Destroy()
开发者ID:TylerKinkade,项目名称:cecilia5,代码行数:24,代码来源:CeciliaMainFrame.py

示例8: onUpdateInterface

# 需要导入模块: import CeciliaLib [as 别名]
# 或者: from CeciliaLib import setVar [as 别名]
 def onUpdateInterface(self, event):
     if event != None:
         snds = []
         if CeciliaLib.getVar("rememberedSound"):
             for key in CeciliaLib.getVar("userInputs").keys():
                 if CeciliaLib.getVar("userInputs")[key]['path'] != '':
                     snds.append(CeciliaLib.getVar("userInputs")[key]['path'])
     if CeciliaLib.getVar("audioServer").isAudioServerRunning():
         CeciliaLib.stopCeciliaSound()
     self.closeInterface()
     CeciliaLib.parseInterfaceText()
     title = os.path.split(CeciliaLib.getVar("currentCeciliaFile", unicode=True))[1]
     ceciliaInterface = CeciliaInterface.CeciliaInterface(None, title='Interface - %s' % title, mainFrame=self)
     ceciliaInterface.SetSize(CeciliaLib.getVar("interfaceSize"))
     ceciliaInterface.SetPosition(CeciliaLib.getVar("interfacePosition"))
     CeciliaLib.setVar("interface", ceciliaInterface)
     if CeciliaLib.getVar("presets") != {}:
         CeciliaLib.getVar("presetPanel").loadPresets()
     if event != None:
         for i, cfilein in enumerate(CeciliaLib.getControlPanel().getCfileinList()):
             if i >= len(snds):
                 break
             cfilein.onLoadFile(snds[i])
开发者ID:TylerKinkade,项目名称:cecilia5,代码行数:25,代码来源:CeciliaMainFrame.py

示例9: applyBatchProcessingFolder

# 需要导入模块: import CeciliaLib [as 别名]
# 或者: from CeciliaLib import setVar [as 别名]
    def applyBatchProcessingFolder(self, value):
        folderName = value
        if folderName == "":
            return 
        old_file_type = CeciliaLib.getVar("audioFileType")
        cfileins = CeciliaLib.getControlPanel().getCfileinList()
        num_snds = len(cfileins[0].fileMenu.choice)
        dlg = wx.ProgressDialog("Batch processing on sound folder", "", maximum = num_snds, parent=self,
                               style = wx.PD_APP_MODAL | wx.PD_AUTO_HIDE | wx.PD_SMOOTH)
        dlg.SetMinSize((600,-1))
        dlg.SetClientSize((600,100))
        count = 0
        totaltime = CeciliaLib.getVar("totalTime")
        for snd in cfileins[0].fileMenu.choice:
            cfileins[0].onSelectSound(-1, snd)
            if CeciliaLib.getVar("useSoundDur"):
                cfileins[0].setTotalTime()
            path, dump = os.path.split(cfileins[0].filePath)
            name, ext = os.path.splitext(snd)
            lext = ext.lower()
            if lext in [".wav", ".wave"]:
                CeciliaLib.setVar('audioFileType', "wav")
            elif lext in [".aif", ".aiff", ".aifc"]:
                CeciliaLib.setVar('audioFileType', "aif")
            elif lext in [".ogg"]:
                CeciliaLib.setVar('audioFileType', "ogg")
            elif lext in [".flac"]:
                CeciliaLib.setVar('audioFileType', "flac")
            elif lext in [".au"]:
                CeciliaLib.setVar('audioFileType', "au")
            elif lext in [".sd2"]:
                CeciliaLib.setVar('audioFileType', "sd2")
            elif lext in [".caf"]:
                CeciliaLib.setVar('audioFileType', "caf")
            if not os.path.isdir(os.path.join(path, folderName)):
                os.mkdir(os.path.join(path, folderName))
            filename = os.path.join(path, folderName, "%s-%s%s" % (name, folderName, ext))
            count += 1
            (keepGoing, skip) = dlg.Update(count, "Exporting %s" % filename)
            CeciliaLib.getControlPanel().onBatchProcessing(filename)
            while (CeciliaLib.getVar("audioServer").isAudioServerRunning()):
                time.sleep(.1)
        if CeciliaLib.getVar("useSoundDur"):
            CeciliaLib.getControlPanel().setTotalTime(totaltime)
            CeciliaLib.getControlPanel().updateDurationSlider()

        dlg.Destroy()
        CeciliaLib.setVar('audioFileType', old_file_type)
开发者ID:TylerKinkade,项目名称:cecilia5,代码行数:50,代码来源:CeciliaMainFrame.py

示例10: onUseMidi

# 需要导入模块: import CeciliaLib [as 别名]
# 或者: from CeciliaLib import setVar [as 别名]
 def onUseMidi(self, event):
     CeciliaLib.setVar("useMidi", event.GetInt())
开发者ID:TylerKinkade,项目名称:cecilia5,代码行数:4,代码来源:CeciliaMainFrame.py

示例11: onShowSpectrum

# 需要导入模块: import CeciliaLib [as 别名]
# 或者: from CeciliaLib import setVar [as 别名]
 def onShowSpectrum(self, event):
     if event.GetInt():
         CeciliaLib.setVar('showSpectrum', 1)
     else:
         CeciliaLib.setVar('showSpectrum', 0)
开发者ID:TylerKinkade,项目名称:cecilia5,代码行数:7,代码来源:CeciliaMainFrame.py

示例12: closeInterface

# 需要导入模块: import CeciliaLib [as 别名]
# 或者: from CeciliaLib import setVar [as 别名]
 def closeInterface(self):
     if CeciliaLib.getVar("interface"):
         CeciliaLib.getVar("interface").onClose(None)
         CeciliaLib.setVar("interface", None)
开发者ID:TylerKinkade,项目名称:cecilia5,代码行数:6,代码来源:CeciliaMainFrame.py

示例13: onSelectOutputFilename

# 需要导入模块: import CeciliaLib [as 别名]
# 或者: from CeciliaLib import setVar [as 别名]
 def onSelectOutputFilename(self):        
     file = CeciliaLib.saveFileDialog(self, AUDIO_FILE_WILDCARD, type='Save audio')
     if file != None:
         CeciliaLib.setVar("saveAudioFilePath", os.path.split(file)[0])
     return file
开发者ID:TylerKinkade,项目名称:cecilia5,代码行数:7,代码来源:CeciliaMainFrame.py

示例14: onUseSoundDuration

# 需要导入模块: import CeciliaLib [as 别名]
# 或者: from CeciliaLib import setVar [as 别名]
 def onUseSoundDuration(self, evt):
     CeciliaLib.setVar("useSoundDur", evt.GetInt())
开发者ID:TylerKinkade,项目名称:cecilia5,代码行数:4,代码来源:CeciliaMainFrame.py


注:本文中的CeciliaLib.setVar方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。