mixer
[goodguy/history.git] / cinelerra-5.1 / cinelerra / tracks.C
index 8db132bc1eff7c9c50838b9147d46d9745c57bef..1eec0d4179c1dcae49829432aa7027c5c4666e6a 100644 (file)
@@ -491,15 +491,18 @@ double Tracks::total_playable_length()
        double total = 0;
        for(Track *current = first; current; current = NEXT)
        {
-               double length = current->get_length();
-               if(length > total) total = length;
+               if( current->play )
+               {
+                       double length = current->get_length();
+                       if(length > total) total = length;
+               }
        }
        return total;
 }
 
 double Tracks::total_recordable_length()
 {
-       double total = 0;
+       double total = -1;
        for(Track *current = first; current; current = NEXT)
        {
                if(current->record)
@@ -516,7 +519,8 @@ double Tracks::total_length()
        double total = 0;
        for(Track *current = first; current; current = NEXT)
        {
-               if(current->get_length() > total) total = current->get_length();
+               double length = current->get_length();
+               if(length > total) total = length;
        }
        return total;
 }