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


C++ pTrack函数代码示例

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


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

示例1: m_label

LocalMediaStream::LocalMediaStream(const talk_base::scoped_refptr<webrtc::LocalMediaStreamInterface>& pStream)
    : FB::JSAPIAuto("MediaStream")
    , m_label(pStream->label())
    , m_videoTracks(FB::variant_list_of())
    , m_audioTracks(FB::variant_list_of())
{
    registerProperty("label", make_property(this, &LocalMediaStream::get_label));
    registerProperty("videoTracks", make_property(this,&LocalMediaStream::get_videoTracks));
    registerProperty("audioTracks", make_property(this, &LocalMediaStream::get_audioTracks));

    for(int i=0; i<pStream->video_tracks()->count(); i++)
    {
        talk_base::scoped_refptr<webrtc::VideoTrackInterface> pTrack(pStream->video_tracks()->at(i));
        talk_base::scoped_refptr<webrtc::LocalVideoTrackInterface> pTrack_(
            static_cast<webrtc::LocalVideoTrackInterface*>(pTrack.get())
        );

        AddTrack(LocalVideoTrack::Create(pTrack_));
    }

    for(int i=0; i<pStream->audio_tracks()->count(); i++)
    {
        talk_base::scoped_refptr<webrtc::AudioTrackInterface> pTrack(pStream->audio_tracks()->at(i));
        talk_base::scoped_refptr<webrtc::LocalAudioTrackInterface> pTrack_(
            static_cast<webrtc::LocalAudioTrackInterface*>(pTrack.get())
        );

        AddTrack(LocalAudioTrack::Create(pTrack_));
    }
}
开发者ID:bobwolff68,项目名称:gocastmain,代码行数:30,代码来源:GCPMediaStream.cpp

示例2: TEST_F

TEST_F(SearchQueryParserTest, MultipleTermsMultipleColumnsNegation) {
    QStringList searchColumns;
    searchColumns << "artist"
                  << "album";

    QScopedPointer<QueryNode> pQuery(
        m_parser.parseQuery("asdf -zxcv", searchColumns, ""));

    TrackPointer pTrack(new TrackInfoObject());
    pTrack->setTitle("asdf zxcv");
    EXPECT_FALSE(pQuery->match(pTrack));
    pTrack->setAlbum("asDF");
    EXPECT_TRUE(pQuery->match(pTrack));
    pTrack->setArtist("zXcV");
    EXPECT_FALSE(pQuery->match(pTrack));
    pTrack->setArtist("");
    pTrack->setAlbum("ASDF ZXCV");
    EXPECT_FALSE(pQuery->match(pTrack));

    EXPECT_STREQ(
        qPrintable(QString(
            "((artist LIKE '%asdf%') OR (album LIKE '%asdf%')) "
            "AND NOT ((artist LIKE '%zxcv%') OR (album LIKE '%zxcv%'))")),
        qPrintable(pQuery->toSql()));
}
开发者ID:cardinot,项目名称:mixxx,代码行数:25,代码来源:searchqueryparsertest.cpp

示例3: TEST_F

TEST_F(SearchQueryParserTest, TextFilterTrailingSpace) {
    QStringList searchColumns;
    searchColumns << "artist"
                  << "album";

    auto pQuery(
        m_parser.parseQuery("comment:\"asdf \"", searchColumns, ""));

    TrackPointer pTrack(Track::newTemporary());
    pTrack->setArtist("asdf");
    EXPECT_FALSE(pQuery->match(pTrack));
    pTrack->setComment("test ASDF test");
    EXPECT_TRUE(pQuery->match(pTrack));

    EXPECT_STREQ(
        qPrintable(QString("comment LIKE '%asdf _%'")),
        qPrintable(pQuery->toSql()));

    // We allow to search for two consequitve spaces
    auto pQuery2(
        m_parser.parseQuery("comment:\"  \"", searchColumns, ""));

    EXPECT_FALSE(pQuery2->match(pTrack));

    EXPECT_STREQ(
        qPrintable(QString("comment LIKE '%  _%'")),
        qPrintable(pQuery2->toSql()));
}
开发者ID:WaylonR,项目名称:mixxx,代码行数:28,代码来源:searchqueryparsertest.cpp

示例4: pTrack

TrackPointer BaseTrackPlayerImpl::loadFakeTrack(bool bPlay, double filebpm) {
    TrackPointer pTrack(Track::newTemporary());
    pTrack->setSampleRate(44100);
    // 10 seconds
    pTrack->setDuration(10);
    if (filebpm > 0) {
        pTrack->setBpm(filebpm);
    }

    TrackPointer pOldTrack = m_pLoadedTrack;
    m_pLoadedTrack = pTrack;
    if (m_pLoadedTrack) {
        // Listen for updates to the file's BPM
        connect(m_pLoadedTrack.get(), SIGNAL(bpmUpdated(double)),
                m_pFileBPM.get(), SLOT(set(double)));

        connect(m_pLoadedTrack.get(), SIGNAL(keyUpdated(double)),
                m_pKey.get(), SLOT(set(double)));

        // Listen for updates to the file's Replay Gain
        connect(m_pLoadedTrack.get(), SIGNAL(ReplayGainUpdated(mixxx::ReplayGain)),
                this, SLOT(slotSetReplayGain(mixxx::ReplayGain)));
    }

    // Request a new track from EngineBuffer
    EngineBuffer* pEngineBuffer = m_pChannel->getEngineBuffer();
    pEngineBuffer->loadFakeTrack(pTrack, bPlay);

    // await slotTrackLoaded()/slotLoadFailed()
    emit(loadingTrack(pTrack, pOldTrack));

    return pTrack;
}
开发者ID:daschuer,项目名称:mixxx,代码行数:33,代码来源:basetrackplayer.cpp

示例5: pTrack

void DlgTrackInfo::reloadTrackMetadata() {
    if (m_pLoadedTrack) {
        TrackPointer pTrack(new TrackInfoObject(m_pLoadedTrack->getLocation(),
                                                m_pLoadedTrack->getSecurityToken()));
        populateFields(pTrack);
    }
}
开发者ID:Adna1206,项目名称:mixxx,代码行数:7,代码来源:dlgtrackinfo.cpp

示例6: TEST_F

TEST_F(SoundSourceProxyTest, readArtist) {
    TrackPointer pTrack(new TrackInfoObject(
            QDir::currentPath().append("/src/test/id3-test-data/artist.mp3")));
    SoundSourceProxy proxy(pTrack);
    Mixxx::TrackMetadata trackMetadata;
    EXPECT_EQ(OK, proxy.parseTrackMetadata(&trackMetadata));
    EXPECT_EQ("Test Artist", trackMetadata.getArtist());
}
开发者ID:tarche,项目名称:mixxx,代码行数:8,代码来源:soundproxy_test.cpp

示例7: TEST_F

TEST_F(SoundSourceProxyTest, readArtist) {
    TrackPointer pTrack(Track::newTemporary(
            kTestDir.absoluteFilePath("artist.mp3")));
    SoundSourceProxy proxy(pTrack);
    Mixxx::TrackMetadata trackMetadata;
    EXPECT_EQ(OK, proxy.parseTrackMetadata(&trackMetadata));
    EXPECT_EQ("Test Artist", trackMetadata.getArtist());
}
开发者ID:22degrees,项目名称:mixxx,代码行数:8,代码来源:soundproxy_test.cpp

示例8: pTrack

//static
QImage CoverArtUtils::extractEmbeddedCover(
        const QFileInfo& fileInfo,
        SecurityTokenPointer pToken) {
    // TODO(uklotzde): Resolve the TrackPointer from the track cache
    // to avoid accessing reading the file while it is written.
    TrackPointer pTrack(
            Track::newTemporary(fileInfo, pToken));
    return SoundSourceProxy(pTrack).parseCoverImage();
}
开发者ID:chegestar,项目名称:mixxx,代码行数:10,代码来源:coverartutils.cpp

示例9: TEST_F

TEST_F(SearchQueryParserTest, EmptySearch) {
    QScopedPointer<QueryNode> pQuery(
        m_parser.parseQuery("", QStringList(), ""));

    TrackPointer pTrack(new TrackInfoObject());
    EXPECT_FALSE(pQuery->match(pTrack));

    EXPECT_STREQ(qPrintable(QString("")),
                 qPrintable(pQuery->toSql()));
}
开发者ID:Mauru,项目名称:mixxx,代码行数:10,代码来源:searchqueryparsertest.cpp

示例10: timer

void ImportFilesTask::run() {
    ScopedTimer timer("ImportFilesTask::run");
    foreach (const QFileInfo& file, m_filesToImport) {
        // If a flag was raised telling us to cancel the library scan then stop.
        if (m_scannerGlobal->shouldCancel()) {
            setSuccess(false);
            return;
        }

        QString filePath = file.filePath();
        //qDebug() << "ImportFilesTask::run" << filePath;

        // If the file does not exist in the database then add it. If it
        // does then it is either in the user's library OR the user has
        // "removed" the track via "Right-Click -> Remove". These tracks
        // stay in the library, but their mixxx_deleted column is 1.
        if (m_scannerGlobal->trackExistsInDatabase(filePath)) {
            // If the track is in the database, mark it as existing. This code gets
            // executed when other files in the same directory have changed (the
            // directory hash has changed).
            emit(trackExists(filePath));
        } else {
            // Parse the track including cover art from metadata. This is a new
            // (never before seen) track so it is safe to parse cover art
            // without checking if we have cover art that is USER_SELECTED. If
            // this changes in the future you MUST check that the cover art is
            // not USER_SELECTED first.
            TrackPointer pTrack(
                new TrackInfoObject(filePath, m_pToken));
            SoundSourceProxy(pTrack).loadTrackMetadataAndCoverArt();

            // If cover art is not found in the track metadata, populate from
            // possibleCovers.
            // This is a new (never before seen) track so it is safe
            // to parse cover art without checking if we have cover art
            // that is USER_SELECTED. If this changes in the future you
            // MUST check that the cover art is not USER_SELECTED first.
            if (pTrack->getCoverArt().image.isNull()) {
                CoverArt art = CoverArtUtils::selectCoverArtForTrack(
                    pTrack.data(), m_possibleCovers);
                if (!art.image.isNull()) {
                    pTrack->setCoverArt(art);
                }
            }

            emit(addNewTrack(pTrack));
        }
    }
    // Insert or update the hash in the database.
    emit(directoryHashedAndScanned(m_dirPath, !m_prevHashExists, m_newHash));
    setSuccess(true);
}
开发者ID:tarche,项目名称:mixxx,代码行数:52,代码来源:importfilestask.cpp

示例11: TEST_F

TEST_F(SearchQueryParserTest, TextFilterAllowsSpace) {
    QStringList searchColumns;
    searchColumns << "artist"
                  << "album";

    auto pQuery(
        m_parser.parseQuery("comment: asdf", searchColumns, ""));

    TrackPointer pTrack(new TrackInfoObject());
    pTrack->setArtist("asdf");
    EXPECT_FALSE(pQuery->match(pTrack));
    pTrack->setComment("test ASDF test");
    EXPECT_TRUE(pQuery->match(pTrack));

    EXPECT_STREQ(
        qPrintable(QString("comment LIKE '%asdf%'")),
        qPrintable(pQuery->toSql()));
}
开发者ID:Frydac,项目名称:mixxx,代码行数:18,代码来源:searchqueryparsertest.cpp

示例12: loadCoverFromMetadata

    void loadCoverFromMetadata(QString trackLocation) {
        CoverInfo info;
        info.type = CoverInfo::METADATA;
        info.source = CoverInfo::GUESSED;
        info.coverLocation = QString();
        info.trackLocation = trackLocation;

        CoverArtCache::FutureResult res;
        res = CoverArtCache::loadCover(info, NULL, 0, false);
        EXPECT_QSTRING_EQ(QString(), res.cover.coverLocation);
        EXPECT_EQ(info.hash, res.cover.hash);

        SecurityTokenPointer securityToken = Sandbox::openSecurityToken(
            QDir(trackLocation), true);
        TrackPointer pTrack(Track::newTemporary(trackLocation, securityToken));
        SoundSourceProxy proxy(pTrack);
        QImage img(SoundSourceProxy(pTrack).parseCoverImage());
        EXPECT_FALSE(img.isNull());
        EXPECT_EQ(img, res.cover.image);
    }
开发者ID:aalex,项目名称:mixxx,代码行数:20,代码来源:coverartcache_test.cpp


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