Ejemplo n.º 1
0
 def onEntry(self, value):
     if type(value) != list:
         value = self.convertToList(value)
     if CeciliaLib.getVar("currentModule") is not None and self.rate == "k":
         getattr(CeciliaLib.getVar("currentModule"), self.name)(value)
     if self.popup is not None:
         self.popup[0].setValue(self.popup[1], True)
Ejemplo n.º 2
0
 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)
Ejemplo n.º 3
0
 def createGrapher(self, evt=None):
     buildGrapher(self.grapher)
     for slider in CeciliaLib.getVar("userSliders"):
         slider.refresh()
     if CeciliaLib.getVar("presetToLoad") is not None:
         CeciliaLib.loadPresetFromDict(CeciliaLib.getVar("presetToLoad"))
         CeciliaLib.setVar("presetToLoad", None)
Ejemplo n.º 4
0
 def openSpectrumWindow(self):
     if CeciliaLib.getVar('spectrumFrame') is None:
         f = SpectrumFrame(CeciliaLib.getVar("interface"))
         f.setAnalyzer(CeciliaLib.getVar("audioServer").spectrum)
         f.Center()
         f.Show()
         CeciliaLib.setVar('spectrumFrame', f)
Ejemplo n.º 5
0
    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 is None:
            self.Center()
        else:
            self.SetPosition(pos)

        self.Show()

        self.timer = wx.Timer(self)
        self.Bind(wx.EVT_TIMER, self.createGrapher, self.timer)
        self.timer.StartOnce(100)
Ejemplo n.º 6
0
 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()
Ejemplo n.º 7
0
 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()
Ejemplo n.º 8
0
 def setPlay(self, x):
     if x:
         self.mode = 2
         data = CeciliaLib.getVar("grapher").plotter.data
         for line in data:
             if line.getName() == self.name:
                 line.setShow(1)
                 CeciliaLib.getVar("grapher").plotter.draw()
     else:
         self.mode = 0
     self.Refresh()
Ejemplo n.º 9
0
 def marioSwitch(self, evt):
     if evt.GetInt() == 1:
         self.FindItemById(ID_MARIO).Check(1)
         for slider in CeciliaLib.getVar("userSliders"):
             slider.slider.useMario = True
             slider.slider.Refresh()
     else:
         self.FindItemById(ID_MARIO).Check(0)
         for slider in CeciliaLib.getVar("userSliders"):
             slider.slider.useMario = False
             slider.slider.Refresh()
Ejemplo n.º 10
0
    def createFileExportPanel(self, panel):
        fileExportPanel = wx.Panel(panel)
        fileExportPanel.SetBackgroundColour(BACKGROUND_COLOUR)

        box = wx.BoxSizer(wx.VERTICAL)

        # File Format
        textFileFormat = wx.StaticText(fileExportPanel, 0, 'File Format :')
        textFileFormat.SetForegroundColour(PREFS_FOREGROUND)
        textFileFormat.SetFont(self.font)
        self.choiceFileFormat = CustomMenu(
            fileExportPanel,
            choice=sorted(AUDIO_FILE_FORMATS.keys()),
            init=CeciliaLib.getVar("audioFileType"),
            size=(150, 20),
            outFunction=self.changeFileType)

        # Bit depth
        textBD = wx.StaticText(fileExportPanel, 0, 'Bit Depth :')
        textBD.SetForegroundColour(PREFS_FOREGROUND)
        textBD.SetFont(self.font)
        self.choiceBD = CustomMenu(fileExportPanel,
                                   choice=sorted(BIT_DEPTHS.keys()),
                                   size=(150, 20),
                                   outFunction=self.changeSampSize)
        for item in BIT_DEPTHS.items():
            if item[1] == CeciliaLib.getVar("sampSize"):
                self.choiceBD.setStringSelection(item[0])

        formatbox = wx.BoxSizer(wx.HORIZONTAL)
        formatbox.Add(textFileFormat, 0, wx.LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
        formatbox.AddStretchSpacer(1)
        formatbox.Add(self.choiceFileFormat, 0,
                      wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, PADDING)

        depthbox = wx.BoxSizer(wx.HORIZONTAL)
        depthbox.Add(textBD, 0, wx.LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
        depthbox.AddStretchSpacer(1)
        depthbox.Add(self.choiceBD, 0, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT,
                     PADDING)

        box.Add(
            Separator(fileExportPanel, size=(350, 1),
                      colour=BACKGROUND_COLOUR))
        box.Add(formatbox, 0, wx.EXPAND | wx.BOTTOM, 7)
        box.Add(depthbox, 0, wx.EXPAND | wx.BOTTOM, 7)

        fileExportPanel.SetSizerAndFit(box)

        return fileExportPanel
Ejemplo n.º 11
0
 def MouseRightDown(self, evt):
     if self._enable:
         rec = wx.Rect(5, 13, 45, 45)
         pos = evt.GetPosition()
         if rec.Contains(pos):
             if evt.ShiftDown():
                 self.setMidiCtl(None)
             else:
                 if CeciliaLib.getVar("useMidi"):
                     CeciliaLib.getVar("audioServer").midiLearn(self)
                     self.inMidiLearnMode()
                 else:
                     CeciliaLib.showErrorDialog("Midi not initialized!",
                         "There is no Midi interface connected!")
     evt.Skip()
Ejemplo n.º 12
0
    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)
Ejemplo n.º 13
0
    def setAutomationData(self, data):
        # convert values on scaling
        temp = []
        log = self.getLog()
        minval = self.getMinValue()
        maxval = self.getMaxValue()
        automationlength = self.getAutomationLength()
        frac = automationlength / CeciliaLib.getVar("totalTime")
        virtuallength = len(data) / frac
        data.extend([data[-1]] * int(((1 - frac) * virtuallength)))
        totallength = float(len(data))
        oldpos = 0
        oldval = data[0]
        if log:
            maxOnMin = maxval / minval
            torec = math.log10(oldval / minval) / math.log10(maxOnMin)
        else:
            maxMinusMin = maxval - minval
            torec = (oldval - minval) / maxMinusMin
        temp.append([0.0, torec])

        for i, val in enumerate(data):
            length = (i - oldpos) / totallength
            pos = oldpos / totallength + length
            if log:
                torec = math.log10(val / minval) / math.log10(maxOnMin)
            else:
                torec = (val - minval) / maxMinusMin
            temp.append([pos, torec])
            oldval = val
            oldpos = i

        self.automationData = temp
Ejemplo n.º 14
0
    def onSavePreset(self):
        dlg = wx.TextEntryDialog(self, 'Enter preset name:', 'Saving Preset', self.currentPreset)

        if dlg.ShowModal() == wx.ID_OK:
            newPreset = CeciliaLib.ensureNFD(dlg.GetValue())
        else:
            newPreset = ''
        dlg.Destroy()

        if newPreset == '':
            CeciliaLib.showErrorDialog('Failed saving preset', 'You must give a name to your preset!')
            return
        if newPreset == 'init':
            CeciliaLib.showErrorDialog('Failed saving preset', '"init" is reserved. You must give another name to your preset!')
            return
        ok = True
        if newPreset in CeciliaLib.getVar("presets").keys():
            dlg2 = wx.MessageDialog(self, 'The preset you entered already exists. Are you sure you want to overwrite it?',
                                    'Existing preset!', wx.YES_NO | wx.NO_DEFAULT | wx.ICON_INFORMATION)
            if dlg2.ShowModal() == wx.ID_NO:
                ok = False
            dlg2.Destroy()

        if ok:
            self.currentPreset = newPreset
            CeciliaLib.savePresetToDict(self.currentPreset)
            self.presetChoice.setChoice(self.orderingPresetNames(), False)
            self.presetChoice.setStringSelection(self.currentPreset)
            CeciliaLib.saveCeciliaFile(self, showDialog=False)
Ejemplo n.º 15
0
 def createTogglePopupPanel(self):
     panel = wx.Panel(self, -1, style=wx.BORDER_SIMPLE)
     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
Ejemplo n.º 16
0
 def createSlidersPanel(self):
     panel = wx.Panel(self, -1, style=wx.BORDER_SIMPLE)
     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
Ejemplo n.º 17
0
 def positionToClientArea(self, pos, size):
     position = None
     screen = 0
     if pos is not None:
         for i in range(CeciliaLib.getVar("numDisplays")):
             off = CeciliaLib.getVar("displayOffset")[i]
             dispsize = CeciliaLib.getVar("displaySize")[i]
             Xbounds = [off[0], dispsize[0] + off[0]]
             Ybounds = [off[1], dispsize[1] + off[1]]
             if pos[0] >= Xbounds[0] and pos[0] <= Xbounds[1] and \
                pos[1] >= Ybounds[0] and pos[1] <= Ybounds[1]:
                 position = pos
                 screen = i
                 break
     dispsize = CeciliaLib.getVar("displaySize")[screen]
     if size[0] <= dispsize[0] and size[1] <= dispsize[1]:
         newsize = size
     else:
         newsize = (dispsize[0] - 50, dispsize[1] - 50)
     return position, newsize
Ejemplo n.º 18
0
def onStart():
    ceciliaMainFrame = CeciliaMainFrame.CeciliaMainFrame(None, -1)
    CeciliaLib.setVar("mainFrame", ceciliaMainFrame)
    app.SetTopWindow(ceciliaMainFrame)

    file = ""
    if len(sys.argv) > 1:
        file = sys.argv[1]

    if os.path.isfile(file):
        ceciliaMainFrame.onOpen(file)
    elif CeciliaLib.getVar("lastCeciliaFile") != '' and os.path.isfile(CeciliaLib.getVar("lastCeciliaFile")):
        ceciliaMainFrame.onOpen(CeciliaLib.getVar("lastCeciliaFile"),
                                MODULES_PATH in CeciliaLib.getVar("lastCeciliaFile"))
    else:
        categories = [folder for folder in os.listdir(MODULES_PATH) if not folder.startswith(".")]
        category = random.choice(categories)
        files = [f for f in os.listdir(os.path.join(MODULES_PATH, category)) if f.endswith(FILE_EXTENSION)]
        file = random.choice(files)
        ceciliaMainFrame.onOpen(os.path.join(MODULES_PATH, category, file), True)
Ejemplo n.º 19
0
    def onQuit(self, event):
        ok = True
        msg = "Do you want to save the current state of the module?"
        dlg = wx.MessageDialog(self, msg, "Quit Cecilia5...", style=wx.YES_NO | wx.CANCEL | wx.STAY_ON_TOP)
        ret = dlg.ShowModal()
        if ret == wx.ID_YES:
            CeciliaLib.saveCeciliaFile(self, showDialog=False)
        elif ret == wx.ID_CANCEL:
            ok = False
        dlg.Destroy()
        if not ok:
            return

        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') is not 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()
Ejemplo n.º 20
0
 def updateTitle(self, isModified=False):
     title = os.path.split(CeciliaLib.getVar("currentCeciliaFile", unicode=True))[1]
     if CeciliaLib.getVar("interface"):
         if not isModified:
             CeciliaLib.getVar("interface").updateTitle('Interface - ' + title)
         else:
             CeciliaLib.getVar("interface").updateTitle('*** Interface - ' + title + ' ***')
Ejemplo n.º 21
0
 def onOpenPrefModule(self, event):
     menu = self.GetMenuBar()
     id = event.GetId()
     file = menu.FindItemById(id)
     filename = file.GetLabel()
     filedir = file.GetMenu().GetTitle()
     prefPath = CeciliaLib.getVar("prefferedPath")
     prefPaths = prefPath.split(';')
     prefBaseNames = [os.path.basename(path) for path in prefPaths]
     dirname = prefPaths[prefBaseNames.index(filedir)]
     if dirname:
         name = os.path.join(dirname, filename)
         CeciliaLib.openCeciliaFile(self, name)
Ejemplo n.º 22
0
 def applyBatchProcessingPreset(self, value):
     folderName = value
     if folderName == "":
         return
     cfileins = CeciliaLib.getControlPanel().getCfileinList()
     presets = CeciliaLib.getVar("presetPanel").getPresets()
     if "init" in presets:
         presets.remove("init")
     if "last save" in presets:
         presets.remove("last save")
     num_presets = len(presets)
     dlg = wx.ProgressDialog("Batch processing on preset sequence",
                             "", maximum=num_presets, parent=self,
                             style=wx.PD_APP_MODAL | wx.PD_AUTO_HIDE | wx.PD_SMOOTH)
     dlg.SetMinSize((600, -1))
     dlg.SetClientSize((600, 100))
     if len(cfileins) > 0:
         filepath = cfileins[0].filePath
     count = 0
     for preset in presets:
         CeciliaLib.loadPresetFromDict(preset)
         if len(cfileins) == 0:
             path = os.path.join(os.path.expanduser("~"), "Desktop")
             name = "batch"
             ext = "." + CeciliaLib.getVar("audioFileType")
         else:
             cfileins[0].onLoadFile(filepath)
             path, fname = os.path.split(cfileins[0].filePath)
             name, ext = os.path.splitext(fname)
         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, preset, ext))
         count += 1
         (keepGoing, skip) = dlg.Update(count, "Exporting %s" % filename)
         CeciliaLib.getControlPanel().onBatchProcessing(filename)
         while (CeciliaLib.getVar("audioServer").isAudioServerRunning()):
             time.sleep(.1)
     dlg.Destroy()
Ejemplo n.º 23
0
    def onDeletePreset(self):
        if self.currentPreset in CeciliaLib.getVar("presets"):
            dlg = wx.MessageDialog(self,
                                    'Preset %s will be deleted. Are you sure?' % self.currentPreset,
                                    'Warning!', wx.YES_NO | wx.NO_DEFAULT | wx.ICON_INFORMATION)
            if dlg.ShowModal() == wx.ID_NO:
                ok = False
            else:
                ok = True
            dlg.Destroy()

            if ok:
                CeciliaLib.deletePreset(self.currentPreset)
                self.presetChoice.setChoice(self.orderingPresetNames(), False)
                self.presetChoice.setStringSelection("")
                CeciliaLib.saveCeciliaFile(self, showDialog=False)
Ejemplo n.º 24
0
 def onPresetSelect(self, idxPreset, newPreset):
     if newPreset in CeciliaLib.getVar("presets"):
         CeciliaLib.loadPresetFromDict(newPreset)
         for preset in CeciliaLib.getVar("presets"):
             if preset != newPreset:
                 CeciliaLib.getVar("presets")[preset]['active'] = False
         CeciliaLib.getVar("presets")[newPreset]['active'] = True
         self.currentPreset = newPreset
     elif newPreset == 'init':
         CeciliaLib.loadPresetFromDict("init")
         for preset in CeciliaLib.getVar("presets"):
             CeciliaLib.getVar("presets")[preset]['active'] = False
         self.currentPreset = "init"
Ejemplo n.º 25
0
    def getPage(self, word):
        if word == self.oldPage:
            self.fromToolbar = False
            return
        page_count = self.GetPageCount()
        for i in range(page_count):
            text = self.GetPageText(i)
            if text == word:
                self.oldPage = word
                if not self.fromToolbar:
                    self.sequence = self.sequence[0:self.seq_index + 1]
                    self.sequence.append(i)
                    self.seq_index = len(self.sequence) - 1
                    self.history_check()
                self.parent.setTitle(text)
                self.SetSelection(i)
                panel = self.GetPage(self.GetSelection())
                if not panel.isLoad:
                    panel.isLoad = True
                    panel.win = stc.StyledTextCtrl(panel, -1, size=panel.GetSize(), style=wx.BORDER_SUNKEN)
                    panel.win.SetUseHorizontalScrollBar(False)
                    panel.win.LoadFile(os.path.join(CeciliaLib.ensureNFD(DOC_PATH), word))
                    panel.win.SetMarginWidth(1, 0)
                    if self.searchKey is not None:
                        words = complete_words_from_str(panel.win.GetText(), self.searchKey)
                        _ed_set_style(panel.win, words)
                    else:
                        _ed_set_style(panel.win)
                    panel.win.SetSelectionEnd(0)

                    def OnPanelSize(evt, win=panel.win):
                        win.SetPosition((0, 0))
                        win.SetSize(evt.GetSize())

                    panel.Bind(wx.EVT_SIZE, OnPanelSize)
                self.fromToolbar = False
                return
        try:
            win = self.makePanel(CeciliaLib.getVar("currentCeciliaFile"))
            self.AddPage(win, word)
            self.getPage(word)
        except:
            pass
Ejemplo n.º 26
0
    def addPrefPath(self):
        currentPath = CeciliaLib.getVar("prefferedPath")

        path = ''
        dlg = wx.DirDialog(self,
                           message="Choose a folder...",
                           defaultPath=CeciliaLib.ensureNFD(
                               os.path.expanduser('~')))

        if dlg.ShowModal() == wx.ID_OK:
            path = dlg.GetPath()
        dlg.Destroy()

        if path and currentPath != '':
            path = currentPath + ';' + path
        elif not path:
            return

        CeciliaLib.setVar("prefferedPath", path)
        self.textPrefPath.SetValue(path)
Ejemplo n.º 27
0
 def onChangePreset(self, x, label=None):
     if CeciliaLib.getVar("currentModule") is not None:
         CeciliaLib.getVar("audioServer").setPluginPreset(self.vpos, x, label)
Ejemplo n.º 28
0
 def onChangeKnob3(self, x):
     if self.knob3.getState()[1] in [0, 1]:
         if CeciliaLib.getVar("currentModule") is not None:
             CeciliaLib.getVar("audioServer").setPluginValue(self.vpos, 2, x)
Ejemplo n.º 29
0
    audioServer = audio.AudioServer()
    CeciliaLib.setVar("audioServer", audioServer)

    try:
        CeciliaLib.queryAudioMidiDrivers()
    except:
        pass

    app = CeciliaApp(redirect=False)
    wx.Log.SetLogLevel(0)
    wx.SetDefaultPyEncoding('utf-8')

    try:
        display = wx.Display()
        numDisp = display.GetCount()
        if CeciliaLib.getVar("DEBUG"):
            print 'Numbers of displays:', numDisp
        displays = []
        displayOffset = []
        displaySize = []
        for i in range(numDisp):
            displays.append(wx.Display(i))
            offset = displays[i].GetGeometry()[:2]
            size = displays[i].GetGeometry()[2:]
            if CeciliaLib.getVar("DEBUG"):
                print 'display %d:' % i
                print '    pos =', offset
                print '    size =', size
                print
            displayOffset.append(offset)
            displaySize.append(size)
Ejemplo n.º 30
0
 def MacOpenFiles(self, filenames):
     if type(filenames) == ListType:
         filenames = filenames[0]
     if CeciliaLib.getVar("mainFrame") is not None:
         CeciliaLib.getVar("mainFrame").onOpen(filenames)
Ejemplo n.º 31
0
 def getWithMidi(self):
     if self.getMidiCtl() is not None and CeciliaLib.getVar("useMidi"):
         return True
     else:
         return False
Ejemplo n.º 32
0
 def MacReopenApp(self):
     try:
         CeciliaLib.getVar("mainFrame").Raise()
     except:
         pass
Ejemplo n.º 33
0
 def onShortPlayStop(self, event):
     if CeciliaLib.getVar("audioServer").isAudioServerRunning():
         self.onPlayStop(0)
     else:
         self.onPlayStop(1)