rem stringlengths 0 322k | add stringlengths 0 2.05M | context stringlengths 8 228k |
|---|---|---|
elif config.has_option('i18n', lang.split("_")[0]): | elif lang and config.has_option('i18n', lang.split("_")[0]): | def _cacheInstrumentsGenerator(): """The current list of instruments, cached""" basepath = os.path.dirname(os.path.abspath(__file__)) instrpath = os.path.join(basepath, "..", "Instruments") files = os.walk(instrpath).next()[2] instrFiles = [x for x in files if x.endswith(".instr")] for f in instrFiles: config = SafeC... |
Globals.debug("time: " + str(current-1000000) + " vol: " + str(0.0)) | def PrepareClick(self): '''Prepare the click track''' | |
Globals.debug("time: " + str(current) + " vol: " + str(1.0)) | def PrepareClick(self): '''Prepare the click track''' | |
Globals.debug("time: " + str(current+1000000) + " vol: " + str(0.0)) | def PrepareClick(self): '''Prepare the click track''' | |
self.SetProperties() | def bus_message_statechange(self, bus, message): """ Handler for the GStreamer statechange message. """ # state has changed try: q = self.bin.query_duration(gst.FORMAT_TIME) if self.duration == 0: self.duration = float(q[0] / float(gst.SECOND)) self.SetProperties() #update position with proper duration self.MoveButDoNo... | |
self.output = "audioconvert ! vorbisenc ! oggmux ! filesink location=%s"%file | self.output = "audioconvert ! vorbisenc ! oggmux ! filesink location=%s"%file.replace(" ", "\ ") | def record(self): '''Record to this instrument's temporary file.''' |
reponse = self.mainwindow.OnRecentProjectsItem(self, item[2], item[1]) if reponse: | response = self.mainwindow.OnRecentProjectsItem(self, item[2], item[1]) if response: | def OnRecentProjectSelected(self, treeview, path, view_column): """This method is called when one of the entries in the recent projects list is selected.""" item = self.model[path] reponse = self.mainwindow.OnRecentProjectsItem(self, item[2], item[1]) if reponse: #it opened without error, so close our window self.wind... |
self.eventLane.modify_bg(gtk.STATE_NORMAL, self.UNSELECTED_COLOUR) | self.eventLane.modify_bg(gtk.STATE_NORMAL, self.UNSELECTED_COLOUR) self.imageeventbox.modify_bg(gtk.STATE_NORMAL, self.UNSELECTED_COLOUR) | def Update(self): """ Called when requested by projectview.Update() to update the display in response to a change in state in any object it is listening to. In turn calls EventLaneViewer.Update() for its EventLaneViewer. """ self.Updating = True |
self.settingstable.attach(label, 0, 1, count, count+1) | self.settingstable.attach(label, 0, 1, count, count+1, gtk.SHRINK) | def OnEffectSetting(self, button): """ Show a dialog filled with settings sliders for a specific effect """ # TODO: Make this modal or as part of the effects window""" |
self.settingstable.attach(wlabel, 1, 2, count, count+1) | self.settingstable.attach(wlabel, 1, 2, count, count+1, gtk.SHRINK) | def OnEffectSetting(self, button): """ Show a dialog filled with settings sliders for a specific effect """ # TODO: Make this modal or as part of the effects window""" |
self.settingstable.attach(self.sliderdict[property.name], 1, 2, count, count+1) | self.settingstable.attach(self.sliderdict[property.name], 1, 2, count, count+1, gtk.FILL|gtk.EXPAND) | def OnEffectSetting(self, button): """ Show a dialog filled with settings sliders for a specific effect """ # TODO: Make this modal or as part of the effects window""" |
Opens the jokosher website in the user's default web browser. | Opens the Jokosher website in the user's default web browser. | def AboutLinkActivate(self, widget, link): """ Opens the jokosher website in the user's default web browser. |
wvalue = self.element.get_property(property.name) | wvalue = element.get_property(property.name) | def OnEffectSetting(self, button): """Show specific effects settings""" """TODO: Make this modal or as part of the effects window""" |
self.GenerateWaveform() | fileModified = True try: n = node.getElementsByTagName("FileLastModified")[0] except IndexError: pass else: if n.nodeType == xml.Node.ELEMENT_NODE: value = int(n.getAttribute("value")) timestamp = os.stat(self.file)[stat.ST_MTIME] fileModified = timestamp > value if fileModified: self.GenerateWaveform() else: try: lev... | def LoadFromXML(self, node): params = node.getElementsByTagName("Parameters")[0] for n in params.childNodes: if n.nodeType == xml.Node.ELEMENT_NODE: if n.getAttribute("type") == "int": setattr(self, n.tagName, int(n.getAttribute("value"))) elif n.getAttribute("type") == "float": setattr(self, n.tagName, float(n.getAtt... |
if self.alignment.size_request()[0] != 0 and width > 1: padding = self.alignment.get_padding()[3] padding += (width - self.alignment.size_request()[0]) padding -= 2 if padding >= 0: self.alignment.set_padding(0, 0, 0, padding) else: if self.mainview.recording: for ident, iv in self.mainview.recording.views: iv.Resiz... | maxwidth=self.headerhbox.size_request()[0] for ident, iv in instrumentviews: if iv.instrument in iv.mainview.project.instruments: if iv.headerBox.size_request()[0] > maxwidth: maxwidth = iv.headerBox.size_request()[0] for ident, iv in instrumentviews: if iv.headerAlign.size_request()[0] != (maxwidth+2): iv.ResizeHead... | def Update(self, width): if not self.Updating: self.Updating = True #Make sure everything has finished realisation if self.alignment.size_request()[0] != 0 and width > 1: #Adjust padding on header to match instrument headers #(so the timeline bar lines up regardless of themes/fonts etc.) padding = self.alignment.get_p... |
return | def Update(self, width): if not self.Updating: self.Updating = True #Make sure everything has finished realisation if self.alignment.size_request()[0] != 0 and width > 1: #Adjust padding on header to match instrument headers #(so the timeline bar lines up regardless of themes/fonts etc.) padding = self.alignment.get_p... | |
currentItem = getCachedInstruments()[i[0]] | currentItem = self.model[i[0]] | def OnOK(self, button=None): sel = self.tree.get_selected_items() for i in sel: currentItem = getCachedInstruments()[i[0]] filenameList = [] for i in currentItem[3].split(","): filenameList.append(i.strip()) if len(filenameList) == 1 and len(filenameList[0]) == 0: filenameList = [] #this instrument has no imports, so... |
indent = self.DEBUG_PREFIX, | indent = self.DEBUG_PREFIX | def ShowPipelineTree(self, pipeline, recurseDepth = 0, maxDepth = 3): '''Display a tree of pipeline elements and their children''' if recurseDepth > maxDepth: return |
indent += "\t", | indent += "\t" | def ShowPipelineTree(self, pipeline, recurseDepth = 0, maxDepth = 3): '''Display a tree of pipeline elements and their children''' if recurseDepth > maxDepth: return |
def OnContributingLinkButtonClicked(self, button): | def OnContributingLinkButtonClicked(self, widget): | def OnContributingLinkButtonClicked(self, button): """ Opens the Jokosher contributing website in the user's default web browser. Parameters: widget -- reserved for GTK callbacks, don't use it explicitly. """ Utils.OpenExternalURL("http://www.jokosher.org/contribute", _("<big>Couldn't launch the contributing website a... |
print "EFFECTS:" print self.instrument.effects print self.instrument.name | self.currentedit = None | def __init__(self, instrument): self.instrument = instrument self.res = gtk.glade.XML(Globals.GLADE_PATH, "InstrumentEffectsDialog") |
self.currentedit = buttonpos | def OnEffectSetting(self, button): print "Showing plugin settings" | |
for property in proplist: | for property in proplist: scale = gtk.HScale() | def OnEffectSetting(self, button): print "Showing plugin settings" |
scale = gtk.HScale() | def OnEffectSetting(self, button): print "Showing plugin settings" | |
def __init__(self, openproject = None, loadExtensions = True, startuptype = None): | def __init__(self, openproject=None, loadExtensions=True, startuptype=None): """ Creates a new instance of MainApp. Parameters: openproject -- filename of the project to open at startup. loadExtensions -- whether the extensions should be loaded. startuptype -- determines the startup state of Jokosher: 0 = Open the pro... | def __init__(self, openproject = None, loadExtensions = True, startuptype = None): gtk.glade.bindtextdomain(Globals.LOCALE_APP, Globals.LOCALE_PATH) gtk.glade.textdomain(Globals.LOCALE_APP) |
"on_instrumentconnections_activate" : self.OnInstrumentConnectonsDialog, | "on_instrumentconnections_activate" : self.OnInstrumentConnectionsDialog, | def __init__(self, openproject = None, loadExtensions = True, startuptype = None): gtk.glade.bindtextdomain(Globals.LOCALE_APP, Globals.LOCALE_PATH) gtk.glade.textdomain(Globals.LOCALE_APP) |
def About(self, widget = None): '''Display about dialog''' | def About(self, widget=None): """ Creates and shows the "About" dialog box. Parameters: widget -- reserved for GTK callbacks, don't use it explicitly. """ | def About(self, widget = None): '''Display about dialog''' aboutTree = gtk.glade.XML(Globals.GLADE_PATH, "AboutDialog") dlg = aboutTree.get_widget("AboutDialog") dlg.set_transient_for(self.window) dlg.set_icon(self.icon) dlg.run() dlg.destroy() |
def Play(self, widget = None): '''Toggle playing''' | def Play(self, widget=None): """ Toggles playback. Parameters: widget -- reserved for GTK callbacks, don't use it explicitly. """ | def Play(self, widget = None): '''Toggle playing''' |
def Stop(self, widget = None): '''Stop recording/playing (whichever is happening)''' | def Stop(self, widget=None): """ Stops the current record/playback (whichever is happening) operation. Parameters: widget -- reserved for GTK callbacks, don't use it explicitly. """ | def Stop(self, widget = None): '''Stop recording/playing (whichever is happening)''' |
def OnRewindPressed(self, widget = None): | def OnRewindPressed(self, widget=None): """ Starts moving backward within the project's timeline. Parameters: widget -- reserved for GTK callbacks, don't use it explicitly. """ | def OnRewindPressed(self, widget = None): self.project.transport.Reverse(True) |
def OnRewindReleased(self, widget = None): | def OnRewindReleased(self, widget=None): """ Stops the current rewind operation. Parameters: widget -- reserved for GTK callbacks, don't use it explicitly. """ | def OnRewindReleased(self, widget = None): self.project.transport.Reverse(False) |
def OnForwardPressed(self, widget = None): | def OnForwardPressed(self, widget=None): """ Starts moving forward within the project's timeline. Parameters: widget -- reserved for GTK callbacks, don't use it explicitly. """ | def OnForwardPressed(self, widget = None): self.project.transport.Forward(True) |
def OnForwardReleased(self, widget = None): | def OnForwardReleased(self, widget=None): """ Stops the current forward operation. Parameters: widget -- reserved for GTK callbacks, don't use it explicitly. """ | def OnForwardReleased(self, widget = None): self.project.transport.Forward(False) |
def InstrumentSelected(self, widget = None, event = None): '''If an instrument has been selected, enable the record button''' | def InstrumentSelected(self, widget=None, event=None): """ Enables the record button if an instrument has been selected. Parameters: widget -- reserved for GTK callbacks, don't use it explicitly. event -- reserved for GTK callbacks, don't use it explicitly. """ | def InstrumentSelected(self, widget = None, event = None): '''If an instrument has been selected, enable the record button''' for instr in self.project.instruments: if instr.isSelected: self.record.set_sensitive(True) |
def OnExport(self, widget = None): '''Display a save dialog allowing the user to export as ogg or mp3''' | def OnExport(self, widget=None): """ Creates and shows a save file dialog which allows the user to export the project as ogg or mp3. Parameters: widget -- reserved for GTK callbacks, don't use it explicitly. """ | def OnExport(self, widget = None): '''Display a save dialog allowing the user to export as ogg or mp3''' buttons = (gtk.STOCK_CANCEL,gtk.RESPONSE_CANCEL,gtk.STOCK_SAVE,gtk.RESPONSE_OK) chooser = gtk.FileChooserDialog(_("Mixdown Project"), self.window, gtk.FILE_CHOOSER_ACTION_SAVE, buttons) chooser.set_current_folder(Gl... |
def OnSaveProject(self, widget=None): | def OnSaveProject(self, widget=None): """ Saves the current project file. Parameters: widget -- reserved for GTK callbacks, don't use it explicitly. """ | def OnSaveProject(self, widget=None): if self.project: self.project.SelectInstrument(None) self.project.ClearEventSelections() self.project.saveProjectFile() |
a = self.wTree.get_widget("show_as_bars_beats_ticks") b = self.wTree.get_widget("show_as_hours_minutes_seconds") t = self.project.transport a.set_active(t.mode == t.MODE_BARS_BEATS) b.set_active(t.mode == t.MODE_HOURS_MINS_SECS) | modeBars = self.wTree.get_widget("show_as_bars_beats_ticks") modeHours = self.wTree.get_widget("show_as_hours_minutes_seconds") transport = self.project.transport modeBars.set_active(transport.mode == transport.MODE_BARS_BEATS) modeHours.set_active(transport.mode == transport.MODE_HOURS_MINS_SECS) | def OnStateChanged(self, obj=None, change=None, *extra): #for when undo and redo history change |
def OnInstrumentConnectonsDialog(self, widget): | def OnInstrumentConnectionsDialog(self, widget): """ Creates and shows the "Instrument Connections Dialog". Parameters: widget -- reserved for GTK callbacks, don't use it explicitly. """ | def OnInstrumentConnectonsDialog(self, widget): InstrumentConnectionsDialog.InstrumentConnectionsDialog(self.project, self) |
def main(): | def main(): """ Main entry point for Jokosher. """ | def main(): MainApp() gtk.main() |
pixxFM_left = x1 + 1 - self._PIXX_FADEMARKER_WIDTH | pixxFM_left = x1 + 1 if x1 + 1 >= self._PIXX_FADEMARKER_WIDTH: pixxFM_left -= self._PIXX_FADEMARKER_WIDTH | def OnDraw(self, widget, event): """ This function blits the waveform data onto the screen, and then draws the play cursor over it. """ c = self.cachedDrawArea e = event.area #check if the expose area is within the already cached rectangle if e.x < c.x or (e.x + e.width > c.x + c.width) or self.redrawWaveform: self.Dr... |
pixx = self.PixXFromSec(firstPoint[0]) | pixx = self.PixXFromSec(firstPoint[0]) - rect.x | def DrawWaveform(self, exposeArea): """ This function uses Cairo to draw the waveform level information onto a canvas in memory. """ allocArea = self.get_allocation() rect = gtk.gdk.Rectangle(exposeArea.x - exposeArea.width, exposeArea.y, exposeArea.width*3, exposeArea.height) #Check if our area to cache is outside th... |
pixx = self.PixXFromSec(sec) | pixx = self.PixXFromSec(sec) - rect.x | def DrawWaveform(self, exposeArea): """ This function uses Cairo to draw the waveform level information onto a canvas in memory. """ allocArea = self.get_allocation() rect = gtk.gdk.Rectangle(exposeArea.x - exposeArea.width, exposeArea.y, exposeArea.width*3, exposeArea.height) #Check if our area to cache is outside th... |
self.headerCairoImage.set_size_request(750, 60) | self.headerCairoImage.set_size_request(self.window.allocation.width, 60) | def __init__(self, instrument, destroyCallback): """ This constructor enables a bunch of variables, reads in the glade file for the main dialog, and populates the effects and presets combo boxes """ # a reference to the instrument object self.instrument = instrument self.res = gtk.glade.XML(Globals.GLADE_PATH, "Instr... |
shortname = longname[:45] if len(longname) > 45: | shortname = longname[:30] if len(longname) > 30: | def __init__(self, instrument, destroyCallback): """ This constructor enables a bunch of variables, reads in the glade file for the main dialog, and populates the effects and presets combo boxes """ # a reference to the instrument object self.instrument = instrument self.res = gtk.glade.XML(Globals.GLADE_PATH, "Instr... |
if Globals.LADSPA_NAME_MAP[effectindex][1] != self.effectsEntry.get_text(): | if self.effectscombo.get_model()[effectindex][0] != self.effectsEntry.get_text(): | def OnAddEffect(self, widget): """ Get the name of the currently selected effect and add it to the instrument. """ effectindex = self.effectscombo.get_active() # quit if there is no active selection if effectindex == -1: return # check the actively selected name matches the # value in the gtk.Entry if it doesn't then... |
if recentprojectitems and os.path.exists(recentprojectitems[0][0]): self.lastopenedproject = recentprojectitems[0] | def OpenRecentProjects(self): '''Populate the self.recentprojectpaths with items from global settings''' self.recentprojectitems = [] if Globals.settings.general.has_key("recentprojects"): filestring = Globals.settings.general["recentprojects"] filestring = filestring.split(",") recentprojectitems = [] for i in filestr... | |
if len(self.recentprojectitems) > 0: path = self.recentprojectitems[0][0] name = self.recentprojectitems[0][1] | if self.lastopenedproject: path = self.lastopenedproject[0] name = self.lastopenedproject[1] | def OpenLastProject(self): if len(self.recentprojectitems) > 0: path = self.recentprojectitems[0][0] name = self.recentprojectitems[0][1] try: self.SetProject(Project.LoadFromFile(path)) except Project.OpenProjectError: dlg = gtk.MessageDialog(self.window, gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT, gtk.MESSAGE_... |
dlg = gtk.MessageDialog(self.window, gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT, gtk.MESSAGE_ERROR, gtk.BUTTONS_OK, "The previous project file could not be opened.\n") dlg.run() dlg.destroy() WelcomeDialog.WelcomeDialog(self) return | pass dlg = gtk.MessageDialog(self.window, gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT, gtk.MESSAGE_ERROR, gtk.BUTTONS_OK, "The previous project file could not be opened.\n") dlg.run() dlg.destroy() WelcomeDialog.WelcomeDialog(self) | def OpenLastProject(self): if len(self.recentprojectitems) > 0: path = self.recentprojectitems[0][0] name = self.recentprojectitems[0][1] try: self.SetProject(Project.LoadFromFile(path)) except Project.OpenProjectError: dlg = gtk.MessageDialog(self.window, gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT, gtk.MESSAGE_... |
zoom.set_range(-5.0, 5.0) zoom.set_increments(1, 1) | zoom.set_range(5, 75.0) zoom.set_increments(0.2, 0.2) | def __init__(self, project, mainview, mixView=None, small=False): """ project - the current active project mainview - the main Jokosher window mixView - the CompactMixView object that holds this if we are in mixing view. If we are in recording view then None small - set to True if we want small edit views (i.e. for mix... |
zoom.set_value(0) | zoom.set_value(40.0) | def __init__(self, project, mainview, mixView=None, small=False): """ project - the current active project mainview - the main Jokosher window mixView - the CompactMixView object that holds this if we are in mixing view. If we are in recording view then None small - set to True if we want small edit views (i.e. for mix... |
print self.lastzoom if self.lastzoom < widget.get_value(): self.lastzoom = widget.get_value() self.OnZoomIn() if self.lastzoom > widget.get_value(): self.lastzoom = widget.get_value() self.OnZoomOut() | self.project.SetViewScale(widget.get_value()) | def OnZoom(self, widget): """ Callback for the zoom slider being moved. """ print self.lastzoom if self.lastzoom < widget.get_value(): self.lastzoom = widget.get_value() self.OnZoomIn() if self.lastzoom > widget.get_value(): self.lastzoom = widget.get_value() self.OnZoomOut() |
items = [ (_("Import Audio File"), audioimg, self.importaudio), (_("Change Instrument Type"), None, self.OnChangeInstrument), (_("Remove Selected Instrument"), gtk.image_new_from_stock(gtk.STOCK_REMOVE, gtk.ICON_SIZE_MENU), self.removeinstr) | items = [ (_("_Import Audio File"), audioimg, self.importaudio), (_("_Change Instrument Type"), None, self.OnChangeInstrument), (_("_Remove Selected Instrument"), gtk.image_new_from_stock(gtk.STOCK_REMOVE, gtk.ICON_SIZE_MENU), self.removeinstr) | def OnInstrumentMenuItem(self, widget): audioimg = gtk.Image() audioimg.set_from_pixbuf(self.audioFilePixbuf) items = self.instrumentmenu.get_children() for i in items: self.instrumentmenu.remove(i) items = [ (_("Import Audio File"), audioimg, self.importaudio), (_("Change Instrument Type"), None, self.OnChangeInstrum... |
for label, img, cb in items: if label == "---": | for i, img, cb in items: if i == "---": | def OnInstrumentMenuItem(self, widget): audioimg = gtk.Image() audioimg.set_from_pixbuf(self.audioFilePixbuf) items = self.instrumentmenu.get_children() for i in items: self.instrumentmenu.remove(i) items = [ (_("Import Audio File"), audioimg, self.importaudio), (_("Change Instrument Type"), None, self.OnChangeInstrum... |
a = gtk.ImageMenuItem(label, True) | a = gtk.ImageMenuItem(i, True) | def OnInstrumentMenuItem(self, widget): audioimg = gtk.Image() audioimg.set_from_pixbuf(self.audioFilePixbuf) items = self.instrumentmenu.get_children() for i in items: self.instrumentmenu.remove(i) items = [ (_("Import Audio File"), audioimg, self.importaudio), (_("Change Instrument Type"), None, self.OnChangeInstrum... |
a = gtk.MenuItem(label) | a = gtk.MenuItem(label=i) | def OnInstrumentMenuItem(self, widget): audioimg = gtk.Image() audioimg.set_from_pixbuf(self.audioFilePixbuf) items = self.instrumentmenu.get_children() for i in items: self.instrumentmenu.remove(i) items = [ (_("Import Audio File"), audioimg, self.importaudio), (_("Change Instrument Type"), None, self.OnChangeInstrum... |
def OnCut(self, widget, cut=True): | def OnCut(self, widget=None, cut=True): | def OnCut(self, widget, cut=True): if self.instrNameEntry: #if an instrument name is currently being edited if cut: self.instrNameEntry.cut_clipboard() else: self.instrNameEntry.copy_clipboard() return #Wipe the clipboard clean self.project.clipboardList = [] for instr in self.project.instruments: for event in instr.e... |
def OnCopy(self, widget): | def OnCopy(self, widget=None): | def OnCopy(self, widget): self.OnCut(widget, False) |
def OnPaste(self, widget): | def OnPaste(self, widget=None): | def OnPaste(self, widget): if self.instrNameEntry: #if an instrument name is currently being edited self.instrNameEntry.paste_clipboard() return for instr in self.project.instruments: if instr.isSelected: for event in self.project.clipboardList: instr.addEventFromEvent(0, event) break self.UpdateDisplay() |
keysdict = { 65471:self.OnRecordingView, 65472:self.OnCompactMixView, 65535:self.OnDelete, 65288:self.OnDelete, } | if 'GDK_CONTROL_MASK' in event.state.value_names: keysdict = { 120:self.OnCut, 99: self.OnCopy, 118:self.OnPaste, } else: keysdict = { 65471:self.OnRecordingView, 65472:self.OnCompactMixView, 65535:self.OnDelete, 65288:self.OnDelete, } | def OnKeyPress(self, widget, event): keysdict = { 65471:self.OnRecordingView, # F2 - Recording View 65472:self.OnCompactMixView, # F3 - Compact Mix View 65535:self.OnDelete, # delete key - remove selected item 65288:self.OnDelete, # backspace key } |
newfile = "%s_%d_%d.%s" % (basecomp[0], self.id, int(time.time()), basecomp[1]) | if len(basecomp) > 1: newfile = "%s_%d_%d.%s" % (basecomp[0], self.id, int(time.time()), basecomp[len(basecomp)-1]) else: newfile = "%s_%d_%d" % (basecomp[0], self.id, int(time.time())) | def addEventFromFile(self, start, file, copyfile=False): ''' Adds an event to this instrument, and attaches the specified file to it. start - The offset time in seconds file - file path copyfile - if True copy file to project audio dir undo : DeleteEvent(%(temp)d) ''' if copyfile: basename = os.path.split(file.repla... |
bin = gst.gst_parse_bin_from_description(encodeBin) | bin = gst.gst_parse_bin_from_description("audioconvert ! %s" % encodeBin, True) | def add_export_format(self, description, extension, encodeBin): """ Adds a new format that the use can select from the filetype drop down box in the 'Mixdown Project' dialog. description - string for the drop down box. ex: 'Ogg Vorbis (.ogg)' extension - string of the file extension without a '.'. ex: 'ogg' encodeBin -... |
print "LIST OF ACs" print self.aclist | for effect in self.effects: self.effectsbin.add(effect) | def PrepareEffectsBin(self): aclistnum = 1 |
for effect in self.effects: print "effect iter" self.effectsbin.add(effect) self.effectsbin.add(self.aclist[acnum]) | effectnum = 0 itertimes = (numeffects * 2) - 1 gst.debug("link effects") for i in range(itertimes): | def PrepareEffectsBin(self): aclistnum = 1 |
effect.link(self.aclist[acnum]) | self.effects[effectnum].link(self.aclist[acnum]) effectnum += 1 | def PrepareEffectsBin(self): aclistnum = 1 |
print "link effect to audioconvert" | def PrepareEffectsBin(self): aclistnum = 1 | |
self.aclist[acnum].link(effect) | self.aclist[acnum].link(self.effects[effectnum]) acnum += 1 | def PrepareEffectsBin(self): aclistnum = 1 |
print "link audioconvert to effect" acnum += 1 | def PrepareEffectsBin(self): aclistnum = 1 | |
print "PADS" print self.aclist[-1].get_pad("src") print self.effects[0].get_pad("Input") | def PrepareEffectsBin(self): aclistnum = 1 | |
self.pipeline.set_state(gst.STATE_PAUSED) | if self.isPlaying: self.pipeline.set_state(gst.STATE_PAUSED) | def Reverse(self, turnOn): if self.isReversing == turnOn: #there is no change in reversing state return self.isReversing = turnOn if turnOn: #Pause playback while seeking self.pipeline.set_state(gst.STATE_PAUSED) self.StartUpdateTimeout() else: self.SeekTo(self.GetPosition()) if self.isPlaying: #resume playback if it ... |
self.pipeline.set_state(gst.STATE_PAUSED) | if self.isPlaying: self.pipeline.set_state(gst.STATE_PAUSED) | def Forward(self, turnOn): if self.isForwarding == turnOn: #there is no change in the forwarding state return self.isForwarding = turnOn if turnOn: #Pause playback while seeking self.pipeline.set_state(gst.STATE_PAUSED) self.StartUpdateTimeout() else: self.SeekTo(self.GetPosition()) if self.isPlaying: #resume playback... |
self.SetPosition(self.position - self.SEEK_RATE/self.FPS) | newpos = self.position - self.SEEK_RATE/self.FPS self.SetPosition(max(newpos, 0)) | def OnUpdate(self): if self.isReversing: self.SetPosition(self.position - self.SEEK_RATE/self.FPS) elif self.isForwarding: self.SetPosition(self.position + self.SEEK_RATE/self.FPS) elif self.isPlaying: try: newpos = self.pipeline.query_position(gst.FORMAT_TIME)[0] except gst.QueryError: pass else: pos = float(newpos) /... |
peaktotal = reduce(lambda x,y: x+y, st["peak"]) peaktotal /= len(st["peak"]) | negInf = float("-inf") peaktotal = 0 peakcount = 0 for peak in st["peak"]: if peak != negInf: peaktotal += peak peakcount += 1 if peakcount > 0: peaktotal /= peakcount if peaktotal == 0: peaktotal = negInf | def bus_message(self, bus, message): """ Handler for the GStreamer bus messages relevant to this Event. At the moment this is used to report on how the loading progress is going. """ |
self.currentedit = None | def __init__(self, instrument): self.instrument = instrument self.res = gtk.glade.XML(Globals.GLADE_PATH, "InstrumentEffectsDialog") | |
buttonpos = self.effectsbox.child_get_property(button, "position") | self.effectpos = self.effectsbox.child_get_property(button, "position") | def OnEffectSetting(self, button): """Show specific effects settings""" """TODO: Make this modal or as part of the effects window""" |
proplist = gobject.list_properties(self.instrument.effects[buttonpos]) | proplist = gobject.list_properties(self.instrument.effects[self.effectpos]) | def OnEffectSetting(self, button): """Show specific effects settings""" """TODO: Make this modal or as part of the effects window""" |
element = self.instrument.effects[buttonpos] | element = self.instrument.effects[self.effectpos] | def OnEffectSetting(self, button): """Show specific effects settings""" """TODO: Make this modal or as part of the effects window""" |
print "int" | def SetEffectSetting(self, slider, name, property): """set the value of an effects slider to its property""" if not((property.value_type == gobject.TYPE_FLOAT) or (property.value_type == gobject.TYPE_DOUBLE)): value = int(slider.get_value()) print "int" else: value = slider.get_value() print "float" self.instrument.e... | |
print "float" self.instrument.effects[self.currentedit].set_property(name, value) | self.instrument.effects[self.effectpos].set_property(name, value) | def SetEffectSetting(self, slider, name, property): """set the value of an effects slider to its property""" if not((property.value_type == gobject.TYPE_FLOAT) or (property.value_type == gobject.TYPE_DOUBLE)): value = int(slider.get_value()) print "int" else: value = slider.get_value() print "float" self.instrument.e... |
effect = self.instrument.effects[self.currentedit] | effect = self.instrument.effects[self.effectpos] | def OnSaveSingleEffectPreset(self, widget): """Grab the effect properties and send it to the presets code to be saved""" |
pos = float(newpos) / gst.SECOND + self.startPosition | pos = float(newpos) / gst.SECOND | def OnUpdate(self): if self.isReversing: newpos = self.position - self.SEEK_RATE/self.FPS self.SetPosition(max(newpos, 0)) elif self.isForwarding: self.SetPosition(self.position + self.SEEK_RATE/self.FPS) elif self.isPlaying: try: newpos = self.pipeline.query_position(gst.FORMAT_TIME)[0] except gst.QueryError: pass els... |
Globals.debug("FADE POINT: time(%.2f) vol(%.2f)" % (ev.start + point[0], point[1])) self.control.set("volume", (ev.start + point[0]) * gst.SECOND, point[1]) | if point[1] == 1.0: vol = 0.99 Globals.debug("FADE POINT: time(%.2f) vol(%.2f)" % (ev.start + point[0], vol)) self.control.set("volume", (ev.start + point[0]) * gst.SECOND, vol) else: vol = point[1] Globals.debug("FADE POINT: time(%.2f) vol(%.2f)" % (ev.start + point[0], point[1])) self.control.set("volume", (ev.start ... | def PrepareController(self): """Fills the gst.Controller for the instrument with its list of fade times.""" Globals.debug("Preparing the controller") self.control.unset_all("volume") for ev in self.events: for point in ev.audioFadePoints: Globals.debug("FADE POINT: time(%.2f) vol(%.2f)" % (ev.start + point[0], point[1... |
dlg.destroy() | else: dlg.hide() | def CreateEventFromFile(self, evt): buttons = (gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL, gtk.STOCK_OPEN, gtk.RESPONSE_OK) |
if self.event.audioFadePoints: context.set_source_rgb(*self._FADELINE_RGB) firstPoint = self.event.audioFadePoints[0] pixx = self.PixXFromSec(firstPoint[0]) - rect.x pixy = self.PixYFromVol(firstPoint[1]) context.move_to(pixx, pixy) for sec, vol in self.event.audioFadePoints[1:]: pixx = self.PixXFromSec(sec) - rect.x... | def DrawWaveform(self, exposeArea): """ This function uses Cairo to draw the waveform level information onto a canvas in memory. """ allocArea = self.get_allocation() rect = gtk.gdk.Rectangle(exposeArea.x - exposeArea.width, exposeArea.y, exposeArea.width*3, exposeArea.height) #Check if our area to cache is outside th... | |
leftOfLeft = max([x for x in points if x <= left]) | leftOfLeft = max([x for x in points if x < left]) | def SnapSelectionToFadePoints(self, event): if len(self.event.audioFadePoints) < 2: #not enough levels return points = [x[0] for x in self.event.audioFadePoints] left, right = self.event.selection leftOfLeft = max([x for x in points if x <= left]) rightOfLeft = min([x for x in points if x >= left]) leftOfRight = max... |
leftOfRight = max([x for x in points if x <= right]) | leftOfRight = max([x for x in points if x < right]) | def SnapSelectionToFadePoints(self, event): if len(self.event.audioFadePoints) < 2: #not enough levels return points = [x[0] for x in self.event.audioFadePoints] left, right = self.event.selection leftOfLeft = max([x for x in points if x <= left]) rightOfLeft = min([x for x in points if x >= left]) leftOfRight = max... |
if abs(leftOfRight - right) > abs(rightOfLeft - left): | if abs(leftOfRight - right) > abs(rightOfRight - right): | def SnapSelectionToFadePoints(self, event): if len(self.event.audioFadePoints) < 2: #not enough levels return points = [x[0] for x in self.event.audioFadePoints] left, right = self.event.selection leftOfLeft = max([x for x in points if x <= left]) rightOfLeft = min([x for x in points if x >= left]) leftOfRight = max... |
try: call(args=["xdg-open", url]) return except OSError: pass try: call(args=["gnome-open", url]) return except OSError: pass try: call(args=["kfmclient", "exec", url]) return except OSError: pass try: call(args=["exo-open", url]) except OSError: dlg = gtk.MessageDialog(self.window, | for command in ("xdg-open", "gnome-open", "kfmclient exec", "exo-open"): try: call(command.split() + [url]) return except OSError: pass dlg = gtk.MessageDialog(self.window, | def OnForumsMenu(self, widget): """ Opens the Jokosher forum in the user's default web browser. It'll try launchers in the following order: xdg-open gnome-open kfmclient exec exo-open Parameters: widget -- reserved for GTK callbacks, don't use it explicitly. """ url = "http://www.jokosher.org/forums" try: call(args=["... |
dlg.set_markup(_("<big>Couldn't launch the forums website automatically.</big>\n\nPlease visit "+url+" to access them.")) dlg.run() dlg.destroy() | dlg.set_markup(_("<big>Couldn't launch the forums website automatically.</big>\n\nPlease visit %s to access them.") % url) dlg.run() dlg.destroy() | def OnForumsMenu(self, widget): """ Opens the Jokosher forum in the user's default web browser. It'll try launchers in the following order: xdg-open gnome-open kfmclient exec exo-open Parameters: widget -- reserved for GTK callbacks, don't use it explicitly. """ url = "http://www.jokosher.org/forums" try: call(args=["... |
"isMuted", "isSolo", "input", "output", "effects", | "isMuted", "isSolo", "input", "output", | def StoreToXML(self, doc, parent, graveyard=False): if graveyard: ins = doc.createElement("DeadInstrument") else: ins = doc.createElement("Instrument") parent.appendChild(ins) ins.setAttribute("id", str(self.id)) items = ["path", "name", "isArmed", "isMuted", "isSolo", "input", "output", "effects", "isSelected", "pixb... |
self.checkActuallyIsMuted() | self.OnMute() | def LoadFromXML(self, node): params = node.getElementsByTagName("Parameters")[0] LoadParametersFromXML(self, params) #figure out the instrument's path based on the location of the projectfile self.path = os.path.join(os.path.dirname(self.project.projectfile), "audio") globaleffect = node.getElementsByTagName("Globa... |
undo : Resurrect | undo : Resurrect: temp | def Delete(self): """ Deletes this Event and sends it to the graveyard to reflect on what it has done. |
undo : Delete | undo : Delete: temp | def Resurrect(self): """ Brings this Event back from the graveyard. |
dlg.set_markup(_("<big>Notes about this release</big>\n\nThis version of Jokosher (0.1) is a pre-release version, and is infact, our very first release. As such, you may encounter some bugs and functionality that is not present.")) | dlg.set_markup(_("<big>Notes about this release</big>\n\nThis version of Jokosher (0.2) is a pre-release version, and is infact, our very first release. As such, you may encounter some bugs and functionality that is not present.")) | def OnPreReleaseNotes(self, widget): dlg = gtk.MessageDialog(self.window, gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT, gtk.MESSAGE_WARNING, gtk.BUTTONS_CLOSE) dlg.set_markup(_("<big>Notes about this release</big>\n\nThis version of Jokosher (0.1) is a pre-release version, and is infact, our very first release. As... |
""" Creates a new project. projecturi The filesystem location for the new project. Currently, only file:// URIs are considered valid. name The name of the project. author The name of the project's author. | """ Creates a new project. Parameters: projecturi -- the filesystem location for the new project. Currently, only file:// URIs are considered valid. name -- the name of the project. author - the name of the project's author. Returns: the newly created Project object. | def CreateNew(projecturi, name, author): """ Creates a new project. projecturi The filesystem location for the new project. Currently, only file:// URIs are considered valid. name The name of the project. author The name of the project's author. """ if name == "" or author == "" or projecturi == "": raise CreateProjec... |
p = Project() | project = Project() | def LoadFromFile(uri): """ Loads a project from a save file on disk. uri The filesystem location of the project file to load. Currently only file:// URIs are considered valid. """ p = Project() (scheme, domain, projectfile, params, query, fragment) = urlparse.urlparse(uri, "file") if scheme != "file": # raise "The UR... |
raise OpenProjectError(2,projectfile) p.projectfile = projectfile | raise OpenProjectError(2, projectfile) project.projectfile = projectfile | def LoadFromFile(uri): """ Loads a project from a save file on disk. uri The filesystem location of the project file to load. Currently only file:// URIs are considered valid. """ p = Project() (scheme, domain, projectfile, params, query, fragment) = urlparse.urlparse(uri, "file") if scheme != "file": # raise "The UR... |
LoadFromZPOFile(p, doc) | LoadFromZPOFile(project, doc) | def LoadFromFile(uri): """ Loads a project from a save file on disk. uri The filesystem location of the project file to load. Currently only file:// URIs are considered valid. """ p = Project() (scheme, domain, projectfile, params, query, fragment) = urlparse.urlparse(uri, "file") if scheme != "file": # raise "The UR... |
return p | return project | def LoadFromFile(uri): """ Loads a project from a save file on disk. uri The filesystem location of the project file to load. Currently only file:// URIs are considered valid. """ p = Project() (scheme, domain, projectfile, params, query, fragment) = urlparse.urlparse(uri, "file") if scheme != "file": # raise "The UR... |
LoadParametersFromXML(p, params) | LoadParametersFromXML(project, params) | def LoadFromFile(uri): """ Loads a project from a save file on disk. uri The filesystem location of the project file to load. Currently only file:// URIs are considered valid. """ p = Project() (scheme, domain, projectfile, params, query, fragment) = urlparse.urlparse(uri, "file") if scheme != "file": # raise "The UR... |
p.transport.SetMode(p.transportMode) p.transport.SetBPM(p.transportbpm) | project.transport.SetMode(project.transportMode) project.transport.SetBPM(project.transportbpm) | def LoadFromFile(uri): """ Loads a project from a save file on disk. uri The filesystem location of the project file to load. Currently only file:// URIs are considered valid. """ p = Project() (scheme, domain, projectfile, params, query, fragment) = urlparse.urlparse(uri, "file") if scheme != "file": # raise "The UR... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.