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


C++ TrackInfo类代码示例

本文整理汇总了C++中TrackInfo的典型用法代码示例。如果您正苦于以下问题:C++ TrackInfo类的具体用法?C++ TrackInfo怎么用?C++ TrackInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: while

TrackInfo
ITunesDevice::nextTrack()
{
    while ( m_handler->trackCount() < 20 && !m_file->atEnd() )
    {
        m_xmlInput->setData( m_file->read( 32768 ) );
        m_xmlReader->parseContinue();

        emit progress( (float)( (float)m_file->pos() / (float)m_file->size() ) * 100.0, m_handler->peekTrack() );
    }

    TrackInfo t = m_handler->takeTrack();
    if ( !t.isEmpty() )
    {
        return t;
    }

    if ( m_file->atEnd() )
    {
        // Finished with the database, let's close our stuff
        qDebug() << "Finished reading";

        m_file->close();
        delete m_file;
        m_file = 0;
    }

    return TrackInfo();
}
开发者ID:exic,项目名称:last.fm-dbus,代码行数:29,代码来源:itunesdevice.cpp

示例2: AddMediaFormatChecker

 void
 AddMediaFormatChecker(const TrackInfo& aTrackConfig)
 {
   if (aTrackConfig.IsVideo()) {
     auto mimeType = aTrackConfig.GetAsVideoInfo()->mMimeType;
     RefPtr<MediaByteBuffer> extraData =
       aTrackConfig.GetAsVideoInfo()->mExtraData;
     AddToCheckList([mimeType, extraData]() {
       if (MP4Decoder::IsH264(mimeType)) {
         mp4_demuxer::SPSData spsdata;
         // WMF H.264 Video Decoder and Apple ATDecoder
         // do not support YUV444 format.
         // For consistency, all decoders should be checked.
         if (mp4_demuxer::H264::DecodeSPSFromExtraData(extraData, spsdata)
             && (spsdata.profile_idc == 244 /* Hi444PP */
                 || spsdata.chroma_format_idc == PDMFactory::kYUV444)) {
           return CheckResult(
             SupportChecker::Reason::kVideoFormatNotSupported,
             MediaResult(NS_ERROR_DOM_MEDIA_FATAL_ERR,
                         RESULT_DETAIL("Decoder may not have the capability "
                                       "to handle the requested video format "
                                       "with YUV444 chroma subsampling.")));
         }
       }
       return CheckResult(SupportChecker::Reason::kSupported);
     });
   }
 }
开发者ID:bgrins,项目名称:gecko-dev,代码行数:28,代码来源:PDMFactory.cpp

示例3: getLocation

void StreamTable::onActivate(wxListEvent& event) {
    // find out what we have got in our second column:
    long index = event.GetIndex();
    const wxString& loc = getLocation(index);
    if (loc.IsEmpty()) {
        std::cerr << "Location is invalid (empty)" << std::endl;
        return;
    }

    try {
        TrackInfo* onDaHeap = new TrackInfo();
        onDaHeap->setLocation(loc);
        // We set a void* here. It's a pointer to the `onDaHeap' TrackInfo object.
        // Later on (see the `TrackStatusHandler::onStreamActivated' function), we
        // can cast it back to a TrackInfo* and work with it. That function must
        // also delete that very same pointer, or else we're fucked.
        event.SetClientObject(onDaHeap);

        // make sure this event is handled by event handlers up in the chain.
        event.Skip();
    } catch (AudioException& ex) {
        wxString msg;
        msg << wxT("Unable to open the URL `") << loc << wxT("'.\n\n");
        msg << wxT("GStreamer error description:\n") << ex.getAsWxString();
        wxMessageDialog dlg(this, msg, wxT("Error"), wxICON_ERROR | wxOK);
        dlg.ShowModal();
    }
}
开发者ID:krpors,项目名称:navi,代码行数:28,代码来源:streambrowser.cpp

示例4:

void
WMFVideoMFTManager::ConfigurationChanged(const TrackInfo& aConfig)
{
  MOZ_ASSERT(aConfig.GetAsVideoInfo());
  mVideoInfo = *aConfig.GetAsVideoInfo();
  mImageSize = mVideoInfo.mImage;
}
开发者ID:,项目名称:,代码行数:7,代码来源:

示例5: onPrev

void TrackStatusHandler::onPrev(wxCommandEvent& event) {
    TrackTable* tt = m_mainFrame->getTrackTable();
    TrackInfo info = tt->getPrev(true);
    if (info.isValid()) {
        m_playedTrack = info;
        play();
    }
}
开发者ID:krpors,项目名称:navi,代码行数:8,代码来源:main.cpp

示例6: onNext

void TrackStatusHandler::onNext(wxCommandEvent& event) {
    TrackTable* tt = m_mainFrame->getTrackTable();
    TrackInfo info = tt->getNext(true);
    if (info.isValid()) {
        std::cout << "Invoked by wxThread." << std::endl;
        m_playedTrack = info;
        play();
    }
}
开发者ID:krpors,项目名称:navi,代码行数:9,代码来源:main.cpp

示例7: tr

void
WizardBootstrapPage::onTrackFound( int percentage, const TrackInfo& track )
{
    uiProgress.progressBar->setValue( percentage );

    if ( !track.isEmpty() )
        uiProgress.bottomLabel->setText( tr( "Found" ) + QString( ": %1 - %2" )
                                         .arg( track.artist() ).arg( track.track() ) );

    qApp->processEvents();
}
开发者ID:exic,项目名称:last.fm-dbus,代码行数:11,代码来源:wizardbootstrappage.cpp

示例8: s

TrackInfo
ITunesLibrary::Track::trackInfo() const
{
    // NOTE we only what data we require for scrobbling, though we could fill in
    // more of the TrackInfo object
    TrackInfo t;
    t.setSource( TrackInfo::MediaDevice );

    QString source;
    if (!m_sourcePersistentId.isEmpty())
        source = "tell first source whose persistent ID is '" + m_sourcePersistentId + "' to ";

    // TODO compile once and pass pid as argument
    // NOTE trust me, the code is ugly, but doesn't work any other way, don't clean it up!
    AppleScript script;
    script << "tell application 'iTunes'"
        <<     source + "set lib to library playlist 1"
        <<     "set t to first track of lib whose persistent ID is '" + persistentId() + "'"
		<<     "if (get class of t) is list then set t to item 1 of t"
        <<     "set d to played date of t"
        << "end tell"

        << "try"
        <<     "set d to (year of d) & ':' & "
        "((month of d) as integer) & ':' & "
        "(day of d) & ':' & "
        "(time of d)"
        << "end try"

        << "tell application 'iTunes' to tell t"
        <<     "set l to location"
        <<     "try" << "set l to POSIX path of l" << "end try"
        <<     "return artist & '\n' & name & '\n' & (duration as integer)  & '\n' & album & '\n' & played count  & '\n' & d & '\n' & l"
        << "end tell";

    QString out = script.exec();
    QTextStream s( &out, QIODevice::ReadOnly );

    t.setArtist( s.readLine() );
    t.setTrack( s.readLine() );
    t.setDuration( (uint) s.readLine().toFloat() );
    t.setAlbum( s.readLine() );
    t.setPlayCount( s.readLine().toInt() );
    t.setTimeStamp( qDateTimeFromScriptString( s.readLine() ).toTime_t() );

    QFileInfo fileinfo( s.readLine() );
    t.setFileName( fileinfo.fileName() );
    t.setPath( fileinfo.absolutePath() );

    return t;
}
开发者ID:exic,项目名称:last.fm-dbus,代码行数:51,代码来源:ITunesLibrary_mac.cpp

示例9: setCurrentTrack

void FingerprinterProgressBar::setCurrentTrack( TrackInfo& track )
{
    QString elidedPath =
        ui.trackLabel->fontMetrics().elidedText(
            track.path(), Qt::ElideMiddle, ui.trackLabel->width() );
    ui.trackLabel->setText( elidedPath );
}
开发者ID:RJ,项目名称:lastfm-desktop,代码行数:7,代码来源:FingerprinterProgressBar.cpp

示例10:

PlatformDecoderModule::ConversionRequired
AndroidDecoderModule::DecoderNeedsConversion(const TrackInfo& aConfig) const
{
  if (aConfig.IsVideo()) {
    return ConversionRequired::kNeedAnnexB;
  }
  return ConversionRequired::kNeedNone;
}
开发者ID:cstipkovic,项目名称:gecko-dev,代码行数:8,代码来源:AndroidDecoderModule.cpp

示例11:

PlatformDecoderModule::ConversionRequired
WMFDecoderModule::DecoderNeedsConversion(const TrackInfo& aConfig) const
{
  if (aConfig.IsVideo() && MP4Decoder::IsH264(aConfig.mMimeType)) {
    return ConversionRequired::kNeedAnnexB;
  } else {
    return ConversionRequired::kNeedNone;
  }
}
开发者ID:MichaelKohler,项目名称:gecko-dev,代码行数:9,代码来源:WMFDecoderModule.cpp

示例12:

PlatformDecoderModule::ConversionRequired
EMEDecoderModule::DecoderNeedsConversion(const TrackInfo& aConfig) const
{
  if (aConfig.IsVideo()) {
    return kNeedAVCC;
  } else {
    return kNeedNone;
  }
}
开发者ID:Manishearth,项目名称:gecko-dev,代码行数:9,代码来源:EMEDecoderModule.cpp

示例13: DecoderNeedsConversion

 ConversionRequired
 DecoderNeedsConversion(const TrackInfo& aConfig) const override
 {
   if (aConfig.IsVideo() && MP4Decoder::IsH264(aConfig.mMimeType)) {
     return kNeedAVCC;
   } else {
     return kNeedNone;
   }
 }
开发者ID:zbraniecki,项目名称:gecko-dev,代码行数:9,代码来源:BlankDecoderModule.cpp

示例14:

PlatformDecoderModule::ConversionRequired
GMPDecoderModule::DecoderNeedsConversion(const TrackInfo& aConfig) const
{
  // GMPVideoCodecType::kGMPVideoCodecH264 specifies that encoded frames must be in AVCC format.
  if (aConfig.IsVideo() && MP4Decoder::IsH264(aConfig.mMimeType)) {
    return ConversionRequired::kNeedAVCC;
  } else {
    return ConversionRequired::kNeedNone;
  }
}
开发者ID:MichaelKohler,项目名称:gecko-dev,代码行数:10,代码来源:GMPDecoderModule.cpp

示例15: SupportsMimeType

already_AddRefed<MediaDataDecoder>
PlatformDecoderModule::CreateDecoder(const TrackInfo& aConfig,
                                     FlushableTaskQueue* aTaskQueue,
                                     MediaDataDecoderCallback* aCallback,
                                     layers::LayersBackend aLayersBackend,
                                     layers::ImageContainer* aImageContainer)
{
  nsRefPtr<MediaDataDecoder> m;

  bool hasPlatformDecoder = SupportsMimeType(aConfig.mMimeType);

  if (aConfig.GetAsAudioInfo()) {
    if (!hasPlatformDecoder && VorbisDataDecoder::IsVorbis(aConfig.mMimeType)) {
      m = new VorbisDataDecoder(*aConfig.GetAsAudioInfo(),
                                aTaskQueue,
                                aCallback);
    } else if (!hasPlatformDecoder && OpusDataDecoder::IsOpus(aConfig.mMimeType)) {
      m = new OpusDataDecoder(*aConfig.GetAsAudioInfo(),
                              aTaskQueue,
                              aCallback);
    } else {
      m = CreateAudioDecoder(*aConfig.GetAsAudioInfo(),
                             aTaskQueue,
                             aCallback);
    }
    return m.forget();
  }

  if (!aConfig.GetAsVideoInfo()) {
    return nullptr;
  }

  if (H264Converter::IsH264(aConfig)) {
    m = new H264Converter(this,
                          *aConfig.GetAsVideoInfo(),
                          aLayersBackend,
                          aImageContainer,
                          aTaskQueue,
                          aCallback);
  } else if (!hasPlatformDecoder && VPXDecoder::IsVPX(aConfig.mMimeType)) {
    m = new VPXDecoder(*aConfig.GetAsVideoInfo(),
                       aImageContainer,
                       aTaskQueue,
                       aCallback);
  } else {
    m = CreateVideoDecoder(*aConfig.GetAsVideoInfo(),
                           aLayersBackend,
                           aImageContainer,
                           aTaskQueue,
                           aCallback);
  }
  return m.forget();
}
开发者ID:norihirou,项目名称:gecko-dev,代码行数:53,代码来源:PlatformDecoderModule.cpp


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