当前位置: 首页>>代码示例>>C++>>正文


C++ Msf::audioBytes方法代码示例

本文整理汇总了C++中k3b::Msf::audioBytes方法的典型用法代码示例。如果您正苦于以下问题:C++ Msf::audioBytes方法的具体用法?C++ Msf::audioBytes怎么用?C++ Msf::audioBytes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在k3b::Msf的用法示例。


在下文中一共展示了Msf::audioBytes方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1:

void K3b::AudioRippingDialog::refresh()
{
    d->viewTracks->clear();
    d->filenames.clear();

    QString baseDir = K3b::prepareDir( m_optionWidget->baseDir() );
    d->fsInfo.setPath( baseDir );

    KIO::filesize_t overallSize = 0;

    K3b::Device::Toc toc = m_medium.toc();

    if( m_optionWidget->createSingleFile() ) {
        long length = 0;
        for( QList<int>::const_iterator it = m_trackNumbers.constBegin();
             it != m_trackNumbers.constEnd(); ++it ) {
            length += ( m_checkUseIndex0->isChecked()
                        ? toc[*it].realAudioLength().lba()
                        : toc[*it].length().lba() );
        }

        QString filename;
        QString extension;
        long long fileSize = 0;
        if( m_optionWidget->encoder() == 0 ) {
            extension = "wav";
            fileSize = length * 2352 + 44;
        }
        else {
            extension = m_optionWidget->extension();
            fileSize = m_optionWidget->encoder()->fileSize( extension, length );
        }

        if( fileSize > 0 )
            overallSize = fileSize;

        filename = d->fsInfo.fixupPath( K3b::PatternParser::parsePattern( m_cddbEntry, 1,
                                                                          extension,
                                                                          m_patternWidget->playlistPattern(),
                                                                          m_patternWidget->replaceBlanks(),
                                                                          m_patternWidget->blankReplaceString() ) );

        d->addTrack( filename,
                     K3b::Msf(length).toString(),
                     fileSize < 0 ? i18n("unknown") : KIO::convertSize( fileSize ),
                     i18n("Audio") );

        d->filenames.append( baseDir + filename );

        if( m_optionWidget->createCueFile() ) {
            QString cueFileName = d->fsInfo.fixupPath( K3b::PatternParser::parsePattern( m_cddbEntry, 1,
                                                                                         QLatin1String( "cue" ),
                                                                                         m_patternWidget->playlistPattern(),
                                                                                         m_patternWidget->replaceBlanks(),
                                                                                         m_patternWidget->blankReplaceString() ) );
            d->addTrack( cueFileName, "-", "-", i18n("Cue-file") );
        }
    }
    else {
        for( int i = 0; i < m_trackNumbers.count(); ++i ) {
            int trackIndex = m_trackNumbers[i];

            QString extension;
            long long fileSize = 0;
            K3b::Msf trackLength = ( m_checkUseIndex0->isChecked()
                                     ? toc[trackIndex].realAudioLength()
                                     : toc[trackIndex].length() );
            if( m_optionWidget->encoder() == 0 ) {
                extension = "wav";
                fileSize = trackLength.audioBytes() + 44;
            }
            else {
                extension = m_optionWidget->extension();
                fileSize = m_optionWidget->encoder()->fileSize( extension, trackLength );
            }

            if( fileSize > 0 )
                overallSize += fileSize;

            if( toc[trackIndex].type() == K3b::Device::Track::TYPE_DATA ) {
                extension = ".iso";
                continue;  // TODO: find out how to rip the iso data
            }


            QString filename;

            filename = K3b::PatternParser::parsePattern( m_cddbEntry, trackIndex+1,
                                                         extension,
                                                         m_patternWidget->filenamePattern(),
                                                         m_patternWidget->replaceBlanks(),
                                                         m_patternWidget->blankReplaceString() );
            if ( filename.isEmpty() ){
                filename = i18n("Track%1", QString::number( trackIndex+1 ).rightJustified( 2, '0' ) ) + '.' + extension;
            }
            filename = d->fsInfo.fixupPath( filename );

            d->addTrack( filename,
                         trackLength.toString(),
                         fileSize < 0 ? i18n("unknown") : KIO::convertSize( fileSize ),
//.........这里部分代码省略.........
开发者ID:KDE,项目名称:k3b,代码行数:101,代码来源:k3baudiorippingdialog.cpp


注:本文中的k3b::Msf::audioBytes方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。