~ubuntu-branches/ubuntu/quantal/jokosher/quantal

« back to all changes in this revision

Viewing changes to Jokosher/EffectPresets.py

  • Committer: Bazaar Package Importer
  • Author(s): Luca Falavigna, Luca Falavigna, Piotr Ożarowski
  • Date: 2009-05-12 00:37:15 UTC
  • mfrom: (1.3.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20090512003715-3hp2ycoqjlzwfnlv
Tags: 0.11.2-1
[ Luca Falavigna ]
* New upstream release (Closes: #517234).
  - Jokosher now appears under Sound & Video (Closes: #443788).
* New Maintainer (Closes: #523167).
* Add Python Applications Packaging Team to Uploaders.
* Add Vcs-* fields in source stanza.
* Adjust copyright informations:
  - Refresh upstream authors and copyright holders.
  - Link to /usr/share/common-licenses/GPL-2.
  - Adjust copyright holders for Debian packaging.
  - Replace (c) with ©.
* Apply changes from Ubuntu by Daniel Holbach (thanks!):
  - Drop scrollkeeper from Build-Depends.
  - Drop useless dependencies: python-alsaaudio, gstreamer0.10-gnomevfs,
    librsvg2-common, python-gnome2.
  - Bump gstreamer0.10-plugins-good requirement to >= 0.10.9.
  - Drop debian/jokosher.sh, useless.
  - Provide debian/watch file.
* Switch to debhelper 7.
* Install Jokosher module in private directory.
* Unpack egg files to let python-support handle them.
* Drop python-dev from Build-Depends, use python (>= 2.4) instead.
* Depend on python-gobject.
* Switch dependency from python-setuptools to python-pkg-resources
  because of package rename (Closes: #468728).
* debian/patches/10_update_mime_database.dpatch:
  - Refresh for new upstream release.
* debian/patches/20_LevelList_IOError.dpatch:
  - Fix IOError exception trying to add an audio file to a project.
* debian/patches/30_desktop_file.dpatch:
  - Adhere to Freedesktop.org standards by removing deprecated entries.
* debian/patches/50_CreateNewProject_return.dpatch:
  - Return class while creating a new project.
* Provide a simple man page for jokosher.
* Bump Standards-Version to 3.8.1:
  - Provide Homepage field in source stanza.
  - Provide debian/README.source to document dpatch usage.

[ Piotr Ożarowski ]
* Add 40_load_extensions_from_unpacked_eggs patch so that extensions in
  unzipped Eggs are recognized as well

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
import pygst
21
21
pygst.require("0.10")
22
22
import gst
 
23
import gobject
23
24
import xml.dom.minidom as xml
24
25
import os
25
26
import Globals
26
27
from Utils import *
27
28
import glob
28
29
import string
29
 
from Monitored import Monitored
30
30
 
31
31
#=========================================================================
32
32
 
33
 
class EffectPresets(Monitored):
 
33
class EffectPresets(gobject.GObject):
34
34
        """
35
35
        This class implements support for effects presets. These presets are used
36
36
        to store settings for single effects and multiple effects strung together
37
37
        (called a 'chain').
 
38
 
 
39
        Signals:
 
40
                "single-preset" -- The waveform date for this event has changed.
 
41
                "chain-preset" -- The starting position of this event has changed.
 
42
 
38
43
        """
 
44
        __gsignals__ = {
 
45
                "single-preset"         : ( gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, () ),
 
46
                "chain-preset"  : ( gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, () )
 
47
        }
39
48
        
40
49
        #_____________________________________________________________________  
41
50
        
44
53
                Creates a new instance of EffectsPresets. If needed, it populates the
45
54
                LADSPA and effect presets registries.
46
55
                """
47
 
                Monitored.__init__(self)
 
56
                gobject.GObject.__init__(self)
48
57
                
49
58
                # Version of the preset files xml format
50
59
                Globals.EFFECT_PRESETS_VERSION = "0.2"
147
156
                self.effecttype = effecttype
148
157
        
149
158
                if not Globals.EFFECT_PRESETS_PATH:
150
 
                        raise "No preset save path specified!"
 
159
                        raise Exception("No preset save path specified!")
151
160
                
152
161
                doc = xml.Document()
153
162
                head = doc.createElement("JokosherPreset")
177
186
                file.write(doc.toprettyxml())
178
187
                file.close()
179
188
                
180
 
                self.StateChanged("singlePreset")
 
189
                self.emit("single-preset")
181
190
        #_____________________________________________________________________
182
191
 
183
192
        def SaveEffectChain(self, label, effectlist, instrumenttype):
193
202
                self.effecttype = None
194
203
                
195
204
                if not Globals.EFFECT_PRESETS_PATH:
196
 
                        raise "No effect chain preset save path specified!"
 
205
                        raise Exception("No effect chain preset save path specified!")
197
206
                
198
207
                doc = xml.Document()
199
208
                head = doc.createElement("JokosherPreset")
240
249
                presetfile.write(doc.toprettyxml())
241
250
                presetfile.close()
242
251
                
243
 
                self.StateChanged("chainPreset")
 
252
                self.emit("chain-preset")
244
253
                
245
254
        #_____________________________________________________________________
246
255
        
334
343
                                                        belongs to.
335
344
                """
336
345
                self._DeletePresetFile(self._PresetFilename(effectName, presetName))
337
 
                self.StateChanged("singlePreset")
 
346
                self.emit("single-preset")
338
347
        
339
348
        #_____________________________________________________________________
340
349
        
347
356
                        instrType -- type of the Instrument the preset belongs to.
348
357
                """
349
358
                self._DeletePresetFile(self._PresetFilename(instrType, presetName))
350
 
                self.StateChanged("chainPreset")
 
359
                self.emit("chain-preset")
351
360
        
352
361
        #_____________________________________________________________________
353
362