source: products/Plone4ArtistsAudioPatch/trunk/extralibs/p4a.audiopatch/p4a/audiopatch/events.py @ 1

Last change on this file since 1 was 1, checked in by myroslav, 18 years ago

Building directory structure

  • Property svn:eol-style set to native
File size: 1.2 KB
Line 
1from zope.app.event import objectevent
2from p4a.audio.atct import _atct
3from p4a.audiopatch.interfaces import IAudioEncoded
4
5class AudioEncodingChangedEvent(objectevent.ObjectEvent):
6    """Audio encoding changed.
7    """ 
8   
9#event handler for IObjectModifiedEvent,
10#which repeats all functionality of _atct.sync_audio_metadata
11#but adds some neccesary assignment
12def sync_audio_metadata(obj, evt):
13    __doc__ = _atct.sync_audio_metadata.__doc__
14   
15    _atct.sync_audio_metadata(obj, evt)
16   
17    #audio._save_audio_metadata() stores id3 tag in 2.4 version
18    #and converts tag's text frames to 'utf-8'. That's why original_encoding
19    #will be different, also encoding isn't useful now.
20    #And we must set encoding and original_encoding to "".
21    #
22    #raised AttributeError: can't set attribute, but I don't know why
23    #
24    audio_encoded = IAudioEncoded(obj)
25    audio_encoded.original_encoding = ""
26    audio_encoded.encoding = ""
27   
28    #from zope.app.annotation.interfaces import IAnnotations
29    #from p4a.audiopatch.adapters import _ATCTFileAudioEncoded
30    #
31    #encoding_data = IAnnotations(obj).get(_ATCTFileAudioEncoded.ENCODING_KEY)
32    #encoding_data["encoding"] = encoding_data["original_encoding"] = ""
Note: See TracBrowser for help on using the repository browser.