本文整理汇总了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();
}
示例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);
});
}
}
示例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();
}
}
示例4:
void
WMFVideoMFTManager::ConfigurationChanged(const TrackInfo& aConfig)
{
MOZ_ASSERT(aConfig.GetAsVideoInfo());
mVideoInfo = *aConfig.GetAsVideoInfo();
mImageSize = mVideoInfo.mImage;
}
示例5: onPrev
void TrackStatusHandler::onPrev(wxCommandEvent& event) {
TrackTable* tt = m_mainFrame->getTrackTable();
TrackInfo info = tt->getPrev(true);
if (info.isValid()) {
m_playedTrack = info;
play();
}
}
示例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();
}
}
示例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();
}
示例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;
}
示例9: setCurrentTrack
void FingerprinterProgressBar::setCurrentTrack( TrackInfo& track )
{
QString elidedPath =
ui.trackLabel->fontMetrics().elidedText(
track.path(), Qt::ElideMiddle, ui.trackLabel->width() );
ui.trackLabel->setText( elidedPath );
}
示例10:
PlatformDecoderModule::ConversionRequired
AndroidDecoderModule::DecoderNeedsConversion(const TrackInfo& aConfig) const
{
if (aConfig.IsVideo()) {
return ConversionRequired::kNeedAnnexB;
}
return ConversionRequired::kNeedNone;
}
示例11:
PlatformDecoderModule::ConversionRequired
WMFDecoderModule::DecoderNeedsConversion(const TrackInfo& aConfig) const
{
if (aConfig.IsVideo() && MP4Decoder::IsH264(aConfig.mMimeType)) {
return ConversionRequired::kNeedAnnexB;
} else {
return ConversionRequired::kNeedNone;
}
}
示例12:
PlatformDecoderModule::ConversionRequired
EMEDecoderModule::DecoderNeedsConversion(const TrackInfo& aConfig) const
{
if (aConfig.IsVideo()) {
return kNeedAVCC;
} else {
return kNeedNone;
}
}
示例13: DecoderNeedsConversion
ConversionRequired
DecoderNeedsConversion(const TrackInfo& aConfig) const override
{
if (aConfig.IsVideo() && MP4Decoder::IsH264(aConfig.mMimeType)) {
return kNeedAVCC;
} else {
return kNeedNone;
}
}
示例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;
}
}
示例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();
}