Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

SMIL Namespace Reference


Classes

class  Time
class  MediaClippingTime

Functions

static string getFraction (string &time)
string framesToSmpte (int frames, int fps)


Function Documentation

string SMIL::framesToSmpte int  frames,
int  fps
 

Definition at line 558 of file smiltime.cc.

Referenced by SMIL::MediaClippingTime::parseFramesToString().

00559 {
00560     char s[ 12 ];
00561     int hours, mins, secs;
00562     int cur = frames;
00563 
00564     if ( fps == 29 )
00565         fps = 30;
00566 
00567     if ( frames == 0 )
00568     {
00569         hours = 0;
00570         mins = 0;
00571         secs = 0;
00572     }
00573     else
00574     {
00575         /* NTSC drop-frame */
00576         if ( fps == 30 )
00577         {
00578             int max_frames = cur;
00579             for ( int j = 1800; j <= max_frames; j += 1800 )
00580             {
00581                 if ( j % 18000 )
00582                 {
00583                     max_frames += 2;
00584                     cur += 2;
00585                 }
00586             }
00587         }
00588         hours = cur / ( fps * 3600 );
00589         cur -= hours * ( fps * 3600 );
00590         mins = cur / ( fps * 60 );
00591         cur -= mins * ( fps * 60 );
00592         secs = cur / fps;
00593         cur -= secs * fps;
00594     }
00595 
00596     snprintf( s, 12, "%2.2d:%2.2d:%2.2d%s%2.2d", hours, mins, secs, ( fps == 30 ) ? ";" : ":", cur );
00597     return string( s );
00598 }

static string SMIL::getFraction string &  time  )  [inline, static]
 

Definition at line 178 of file smiltime.cc.

Referenced by SMIL::Time::parseClockValue().

00179 {
00180     string::size_type pos;
00181     string fraction;
00182     if ( ( pos = time.find( '.' ) ) != string::npos )
00183     {
00184         fraction = time.substr( pos + 1 );
00185         //cerr << "smil: fraction = " << fraction << endl;
00186         time = time.substr( 0, pos );
00187     }
00188     return fraction;
00189 }


Generated on Sun Mar 11 22:13:29 2007 for Kino by  doxygen 1.4.2