本文整理汇总了C++中k3b::Msf::totalFrames方法的典型用法代码示例。如果您正苦于以下问题:C++ Msf::totalFrames方法的具体用法?C++ Msf::totalFrames怎么用?C++ Msf::totalFrames使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类k3b::Msf
的用法示例。
在下文中一共展示了Msf::totalFrames方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: proxy
void K3b::TRM::start( const K3b::Msf& length )
{
if( KProtocolManager::useProxy() ) {
QUrl proxy( KProtocolManager::proxyFor("http") );
trm_SetProxy( d->trm, const_cast<char*>(proxy.host().toLatin1().constData()), short(proxy.port()) );
}
trm_SetPCMDataInfo( d->trm, 44100, 2, 16 );
trm_SetSongLength( d->trm, length.totalFrames()/75 );
}
示例2: return
bool K3bFFMpegFile::seek( const K3b::Msf& msf )
{
d->outputBufferSize = 0;
d->packetSize = 0;
double seconds = (double)msf.totalFrames()/75.0;
quint64 timestamp = (quint64)(seconds * (double)AV_TIME_BASE);
// FIXME: do we really need the start_time and why?
#if LIBAVFORMAT_BUILD >= 4619
return ( ::av_seek_frame( d->formatContext, -1, timestamp + d->formatContext->start_time, 0 ) >= 0 );
#else
return ( ::av_seek_frame( d->formatContext, -1, timestamp + d->formatContext->start_time ) >= 0 );
#endif
}
示例3: switch
void K3b::FillStatusDisplay::Private::setCdSize( const K3b::Msf& size )
{
// Remove check mark from the currently checked action
if( QAction* checked = cdSizeGroup->checkedAction() ) {
checked->setChecked( false );
}
switch( size.totalFrames() ) {
case MediaSizeCd74Min:
case 650*512:
displayWidget->setCdSize( MediaSizeCd74Min );
action74Min->setChecked( true );
break;
case MediaSizeCd80Min:
case 700*512:
displayWidget->setCdSize( MediaSizeCd80Min );
action80Min->setChecked( true );
break;
case MediaSizeCd100Min:
case 880*512:
displayWidget->setCdSize( MediaSizeCd100Min );
action100Min->setChecked( true );
break;
case MediaSizeDvd4Gb:
case 2306867: // rounded 4.4*1024*512
displayWidget->setCdSize( MediaSizeDvd4Gb );
actionDvd4_7GB->setChecked( true );
break;
case MediaSizeDvd8Gb:
case 8*1024*512:
displayWidget->setCdSize( MediaSizeDvd8Gb );
actionDvdDoubleLayer->setChecked( true );
break;
case MediaSizeBluRay25Gb:
//case 25*1024*512:
displayWidget->setCdSize( MediaSizeBluRay25Gb );
actionBD25->setChecked( true );
break;
case MediaSizeBluRay50Gb:
//case 50*1024*512:
displayWidget->setCdSize( MediaSizeBluRay50Gb );
actionBD50->setChecked( true );
break;
default:
displayWidget->setCdSize( size );
break;
}
}
示例4: if
bool K3bMadDecoder::seekInternal( const K3b::Msf& pos )
{
//
// we need to reset the complete mad stuff
//
if( !initDecoderInternal() )
return false;
//
// search a position
// This is all hacking, I don't really know what I am doing here... ;)
//
double mp3FrameSecs = static_cast<double>(d->firstHeader.duration.seconds)
+ static_cast<double>(d->firstHeader.duration.fraction) / static_cast<double>(MAD_TIMER_RESOLUTION);
double posSecs = static_cast<double>(pos.totalFrames()) / 75.0;
// seekPosition to seek after frame i
unsigned int frame = static_cast<unsigned int>( posSecs / mp3FrameSecs );
// Rob said: 29 frames is the theoretically max frame reservoir limit (whatever that means...)
// it seems that mad needs at most 29 frames to get ready
unsigned int frameReservoirProtect = ( frame > 29 ? 29 : frame );
frame -= frameReservoirProtect;
// seek in the input file behind the already decoded data
d->handle->inputSeek( d->seekPositions[frame] );
qDebug() << "(K3bMadDecoder) Seeking to frame " << frame << " with "
<< frameReservoirProtect << " reservoir frames." << endl;
// decode some frames ignoring MAD_ERROR_BADDATAPTR errors
unsigned int i = 1;
while( i <= frameReservoirProtect ) {
d->handle->fillStreamBuffer();
if( mad_frame_decode( d->handle->madFrame, d->handle->madStream ) ) {
if( MAD_RECOVERABLE( d->handle->madStream->error ) ) {
if( d->handle->madStream->error == MAD_ERROR_BUFLEN )
continue;
else if( d->handle->madStream->error != MAD_ERROR_BADDATAPTR ) {
qDebug() << "(K3bMadDecoder) Seeking: recoverable mad error ("
<< mad_stream_errorstr(d->handle->madStream) << ")" << endl;
continue;
}
else {
qDebug() << "(K3bMadDecoder) Seeking: ignoring ("
<< mad_stream_errorstr(d->handle->madStream) << ")" << endl;
}
}
else
return false;
}
if( i == frameReservoirProtect ) // synth only the last frame (Rob said so ;)
mad_synth_frame( d->handle->madSynth, d->handle->madFrame );
++i;
}
return true;
}