Changeset 587


Ignore:
Timestamp:
12-07-12 11:38:59 (11 months ago)
Author:
thomas
Message:

add new file

Location:
trunk/morituri/common
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/morituri/common/checksum.py

    r571 r587  
    77 
    88# This file is part of morituri. 
    9 #  
     9# 
    1010# morituri is free software: you can redistribute it and/or modify 
    1111# it under the terms of the GNU General Public License as published by 
    1212# the Free Software Foundation, either version 3 of the License, or 
    1313# (at your option) any later version. 
    14 #  
     14# 
    1515# morituri is distributed in the hope that it will be useful, 
    1616# but WITHOUT ANY WARRANTY; without even the implied warranty of 
    1717# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    1818# GNU General Public License for more details. 
    19 #  
     19# 
    2020# You should have received a copy of the GNU General Public License 
    2121# along with morituri.  If not, see <http://www.gnu.org/licenses/>. 
     
    144144 
    145145    def stopped(self): 
     146        self.debug('stopped') 
    146147        if not self._last: 
     148            self.debug('raising EmptyError') 
    147149            # see http://bugzilla.gnome.org/show_bug.cgi?id=578612 
    148150            self.debug('not a single buffer gotten, raising') 
     
    270272        return checksum 
    271273 
    272 class TRMTask(gstreamer.GstPipelineTask): 
     274class TRMTask(task.GstPipelineTask): 
    273275    """ 
    274276    I calculate a MusicBrainz TRM fingerprint. 
  • trunk/morituri/common/encode.py

    r513 r587  
    2727 
    2828from morituri.common import common, log 
     29from morituri.common import task as ctask 
    2930 
    3031from morituri.extern.task import task, gstreamer 
     
    125126ALL_PROFILES.update(LOSSY_PROFILES) 
    126127 
    127 class EncodeTask(gstreamer.GstPipelineTask): 
     128class EncodeTask(ctask.GstPipelineTask): 
    128129    """ 
    129130    I am a task that encodes a .wav file. 
     
    219220        bus.connect('message::element', self._message_element_cb) 
    220221        self._level = self.pipeline.get_by_name('level') 
     222 
     223        # set an interval that is smaller than the duration 
     224        # FIXME: check level and make sure it emits level up to the last 
     225        # sample, even if input is small 
     226        interval = 1000000000L 
     227        if interval < duration: 
     228            interval = duration / 2 
     229        self._level.set_property('interval', interval) 
    221230        # add a probe so we can track progress 
    222231        # we connect to level because this gives us offset in samples 
     
    269278        else: 
    270279            self.warning('No peak found, something went wrong!') 
     280            # workaround for when the file is too short to have volume ? 
     281            # self.peak = 0.0 
    271282 
    272283class TagReadTask(gstreamer.GstPipelineTask): 
Note: See TracChangeset for help on using the changeset viewer.