traverso-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Traverso-commit] traverso/src/core Project.cpp Sheet.cpp


From: Nicola Doebelin
Subject: [Traverso-commit] traverso/src/core Project.cpp Sheet.cpp
Date: Sun, 26 Apr 2009 19:22:29 +0000

CVSROOT:        /sources/traverso
Module name:    traverso
Changes by:     Nicola Doebelin <n_doebelin>    09/04/26 19:22:29

Modified files:
        src/core       : Project.cpp Sheet.cpp 

Log message:
        * added some comments to help understand how export works

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/traverso/src/core/Project.cpp?cvsroot=traverso&r1=1.68&r2=1.69
http://cvs.savannah.gnu.org/viewcvs/traverso/src/core/Sheet.cpp?cvsroot=traverso&r1=1.24&r2=1.25

Patches:
Index: Project.cpp
===================================================================
RCS file: /sources/traverso/traverso/src/core/Project.cpp,v
retrieving revision 1.68
retrieving revision 1.69
diff -u -b -r1.68 -r1.69
--- Project.cpp 26 Jan 2009 20:11:42 -0000      1.68
+++ Project.cpp 26 Apr 2009 19:22:29 -0000      1.69
@@ -523,7 +523,7 @@
        return cmd;
 }
 
-
+// this is called from the export and CD-writing dialog
 int Project::export_project(ExportSpecification* spec)
 {
        PENTER;
@@ -551,11 +551,15 @@
        spec->breakout = false;
 
        m_exportThread->set_specification(spec);
+
+        // this will start the thread by executing ExportThread::run(),
+        // which calls Project::start_export()
        m_exportThread->start();
 
        return 0;
 }
 
+// this is called from the ExportThread::run() function
 int Project::start_export(ExportSpecification* spec)
 {
        PMESG("Starting export, rate is %d bitdepth is %d", spec->sample_rate, 
spec->data_width );
@@ -568,6 +572,7 @@
        overallExportProgress = renderedSheets = 0;
        sheetsToRender.clear();
 
+        // determine which sheets to export, store them in sheetsToRender
        if (spec->allSheets) {
                foreach(Sheet* sheet, m_sheets) {
                        sheetsToRender.append(sheet);
@@ -579,6 +584,9 @@
                }
        }
 
+        // process each sheet in the list sheetsToRender. here we set the 
renderpass mode,
+        // and then call Sheet::repare_export() and Sheet::render(), which do 
the actual
+        // processing.
        foreach(Sheet* sheet, sheetsToRender) {
                PMESG("Starting export for sheet %lld", sheet->get_id());
                emit exportStartedForSheet(sheet);
@@ -587,6 +595,7 @@
                sheet->readbuffer = readbuffer;
                
                if (spec->normalize) {
+                        // start one render pass in mode "CALC_NORM_FACTOR"
                        spec->peakvalue = 0.0;
                        spec->renderpass = 
ExportSpecification::CALC_NORM_FACTOR;
                        
@@ -610,13 +619,16 @@
                        }
                }
 
+                // start the real render pass in mode "WRITE_TO_HARDDISK"
                spec->renderpass = ExportSpecification::WRITE_TO_HARDDISK;
                
+                // first call Sheet::prepare_export()...
                if (sheet->prepare_export(spec) < 0) {
                        PERROR("Failed to prepare sheet for export");
                        break;
                }
                
+                // ... then start the render process and wait until it's 
finished
                while(sheet->render(spec) > 0) {}
                
                if (!QMetaObject::invokeMethod(sheet, "set_transport_pos",  
Qt::QueuedConnection, Q_ARG(TimeRef, spec->resumeTransportLocation))) {
@@ -693,7 +705,7 @@
                        return -1;
                }
                output += sheet->get_cdrdao_tracklist(spec, pregap);
-               pregap = false; // only add the pregap at the first sheet
+               pregap = false; // only add the pregap at the first sheet
        }
        
 

Index: Sheet.cpp
===================================================================
RCS file: /sources/traverso/traverso/src/core/Sheet.cpp,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -b -r1.24 -r1.25
--- Sheet.cpp   14 Mar 2009 22:04:58 -0000      1.24
+++ Sheet.cpp   26 Apr 2009 19:22:29 -0000      1.25
@@ -366,7 +366,10 @@
        return false;
 }
 
-
+// this function is called from the parent project before it calls 
Sheet::render().
+// depending on the renderpass mode, additional information is gathered here 
for
+// the ExportSpecification (e.g. the start and end location, the marker list,
+// transport is stopped, a new writeSource is created etc.)
 int Sheet::prepare_export(ExportSpecification* spec)
 {
        PENTER;
@@ -494,6 +497,9 @@
        return 0;
 }
 
+// this function is called from the parent project. It sends the audio data
+// to Sheet::export_process(), which does the acutal processing, but 
normalisation
+// and writing to disk is done here.
 int Sheet::render(ExportSpecification* spec)
 {
        int chn;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]