traverso-commit
[Top][All Lists]
Advanced

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

[Traverso-commit] traverso/src/core Song.cpp TimeLine.cpp TimeLine.h


From: Remon Sijrier
Subject: [Traverso-commit] traverso/src/core Song.cpp TimeLine.cpp TimeLine.h
Date: Thu, 22 Nov 2007 14:46:59 +0000

CVSROOT:        /sources/traverso
Module name:    traverso
Changes by:     Remon Sijrier <r_sijrier>       07/11/22 14:46:59

Modified files:
        src/core       : Song.cpp TimeLine.cpp TimeLine.h 

Log message:
        * correctly calculate the first marker, which doesn't have to be the 
first in TimeLines Marker list!! 
        Closes bug: #21022

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/traverso/src/core/Song.cpp?cvsroot=traverso&r1=1.154&r2=1.155
http://cvs.savannah.gnu.org/viewcvs/traverso/src/core/TimeLine.cpp?cvsroot=traverso&r1=1.9&r2=1.10
http://cvs.savannah.gnu.org/viewcvs/traverso/src/core/TimeLine.h?cvsroot=traverso&r1=1.7&r2=1.8

Patches:
Index: Song.cpp
===================================================================
RCS file: /sources/traverso/traverso/src/core/Song.cpp,v
retrieving revision 1.154
retrieving revision 1.155
diff -u -b -r1.154 -r1.155
--- Song.cpp    19 Nov 2007 11:18:53 -0000      1.154
+++ Song.cpp    22 Nov 2007 14:46:59 -0000      1.155
@@ -354,10 +354,12 @@
                        // wait a number (max 10) of process() cycles to be 
sure we really stopped transport
                        while (m_transport) {
                                spec->thread->sleep_for(msecs);
+                               count++;
                                if (count > 10) {
                                        break;
                                }
                        }
+                       printf("Song::prepare_export: had to wait %d process 
cycles before the transport was stopped\n", count);
                }
                
                m_rendering = true;
@@ -388,17 +390,17 @@
        
        if (spec->isCdExport) {
                QList<Marker*> markers = m_timeline->get_markers();
-               if (markers.size() >= 2) {
-                       startlocation = markers.at(0)->get_when();
+               
+               if (m_timeline->get_start_location(startlocation)) {
                        PMESG2("  Start marker found at %s", 
QS_C(timeref_to_ms(startlocation)));
-                       // round down to the start of the CD frome (75th of a 
sec)
+                       // round down to the start of the CD frame (75th of a 
sec)
                        startlocation = 
cd_to_timeref(timeref_to_cd(startlocation));
                        spec->startLocation = startlocation;
                } else {
                        PMESG2("  No start marker found");
                }
                
-               if (m_timeline->get_end_position(endlocation)) {
+               if (m_timeline->get_end_location(endlocation)) {
                        PMESG2("  End marker found at %s", 
QS_C(timeref_to_ms(endlocation)));
                        spec->endLocation = endlocation;
                } else {

Index: TimeLine.cpp
===================================================================
RCS file: /sources/traverso/traverso/src/core/TimeLine.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- TimeLine.cpp        5 Nov 2007 15:49:30 -0000       1.9
+++ TimeLine.cpp        22 Nov 2007 14:46:59 -0000      1.10
@@ -125,11 +125,11 @@
        return 0;
 }
 
-bool TimeLine::get_end_position(TimeRef& pos)
+bool TimeLine::get_end_location(TimeRef& location)
 {
        foreach(Marker* marker, m_markers) {
                if (marker->get_type() == Marker::ENDMARKER) {
-                       pos = marker->get_when();
+                       location = marker->get_when();
                        return true;
                }
        }
@@ -137,6 +137,27 @@
        return false;
 }
 
+bool TimeLine::get_start_location(TimeRef & location)
+{
+       TimeRef result(LONG_LONG_MAX);
+       
+       foreach(Marker* marker, m_markers) {
+               if ( ! (marker->get_type() == Marker::ENDMARKER) ) {
+                       if (marker->get_when() < result) {
+                               result = marker->get_when();
+                       }
+               }
+       }
+       
+       if (result != LONG_LONG_MAX) {
+               location = result;
+               return true;
+       }
+       
+       return false;
+}
+
+
 bool TimeLine::has_end_marker()
 {
        foreach(Marker* marker, m_markers) {

Index: TimeLine.h
===================================================================
RCS file: /sources/traverso/traverso/src/core/TimeLine.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- TimeLine.h  10 Sep 2007 18:42:49 -0000      1.7
+++ TimeLine.h  22 Nov 2007 14:46:59 -0000      1.8
@@ -44,7 +44,8 @@
        Song *get_song() const {return m_song;}
        
        Marker* get_marker(qint64 id);
-       bool get_end_position(TimeRef& pos);
+       bool get_end_location(TimeRef& location);
+       bool get_start_location(TimeRef& location);
        bool has_end_marker();
 
        Command* add_marker(Marker* marker, bool historable=true);




reply via email to

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