Logo Search packages:      
Sourcecode: rosegarden version File versions  Download package

void Rosegarden::RosegardenDocument::finalizeAudioFile ( InstrumentId  instrument )

Complete the add of an audio file when a new file has finished being recorded at the sequencer. This method will ensure that the audio file is added to the AudioFileManager, that a preview is generated and that the sequencer also knows to add the new file to its own hash table. Flow of control is a bit awkward around new audio files as timing is crucial - the gui can't access the file until lead-out information has been written by the sequencer.

Note that the sequencer doesn't know the audio file id (yet), only the instrument it was recorded to. (It does know the filename, but the instrument id is enough for us.)

!! mtr just for now?: or better to do this once after the fact? !! m_audioFileManager.generatePreviews();

Definition at line 2577 of file RosegardenDocument.cpp.

References Rosegarden::Segment::getComposition(), and Rosegarden::Segment::getStartTime().


                Segment *recordSegment = m_recordAudioSegments[iid];
                if (!recordSegment->getComposition()) {

                    // always insert straight away for audio


            } else {
                //         RG_DEBUG << "RosegardenDocument::updateRecordingAudioSegments: no segment for instr "
                //              << iid << endl;

    RG_DEBUG << "RosegardenDocument::stopRecordingAudio" << endl;

    for (RecordingSegmentMap::iterator ri = m_recordAudioSegments.begin();
            ri != m_recordAudioSegments.end(); ++ri) {

        Segment *recordSegment = ri->second;

        if (!recordSegment)

        // set the audio end time

        // now add the Segment
        RG_DEBUG << "RosegardenDocument::stopRecordingAudio - "
        << "got recorded segment" << endl;

        // now move the segment back by the record latency
          No.  I don't like this.
          The record latency doesn't always exist -- for example, if recording
          from a synth plugin there is no record latency, and we have no way
          here to distinguish.
          The record latency is a total latency figure that actually includes
          some play latency, and we compensate for that again on playback (see
          bug #1378766).
          The timeT conversion of record latency is approximate in frames,
          giving potential phase error.
          Cutting this out won't break any existing files, as the latency
          compensation there is already encoded into the file.
            RealTime adjustedStartTime =
                m_composition.getElapsedRealTime(recordSegment->getStartTime()) -

Here is the call graph for this function:

Generated by  Doxygen 1.6.0   Back to index