예제 #1
0
TrackList Search::tracks() const
{
    TrackList list;
    for (int i = 0; i < trackCount(); ++i)
        list << trackAt(i);

    return list;
}
예제 #2
0
void
TrackProxyModel::setFilter( const QString& pattern )
{
    PlaylistInterface::setFilter( pattern );
    setFilterRegExp( pattern );

    emit filterChanged( pattern );
    emit trackCountChanged( trackCount() );
}
예제 #3
0
int PlaylistModel::randomTrack() const
{
    if (trackCount() < 2)
    {
        return 0;
    }

    qsrand(QDateTime::currentDateTime().toTime_t());

    KRandomSequence sequence(qrand() % 1000);
    int randomTrack = currentTrack();

    while (randomTrack == currentTrack())
    {
        randomTrack = sequence.getLong(trackCount() - 1);
    }

    return randomTrack;
}
예제 #4
0
파일: Recorder.cpp 프로젝트: aothms/ear
void Recorder::Add(Recorder* r) {
	if ( trackCount() != r->trackCount() ) throw;
	for ( unsigned int i = 0;
		i < r->processed_tracks.size(); ++ i ) {
			if ( i == processed_tracks.size() )
				processed_tracks.push_back(new RecorderTrack());
			processed_tracks[i]->Add(r->processed_tracks[i]);
	}
	is_processed = true;
}
예제 #5
0
QList<int> VlcVideo::trackIds() const
{
    QList<int> ids;

    if (_vlcMediaPlayer) {
        libvlc_track_description_t *desc;
        desc = libvlc_video_get_track_description(_vlcMediaPlayer);
        VlcError::errmsg();

        ids << desc->i_id;
        if (trackCount() > 1) {
            for(int i = 1; i < trackCount(); i++) {
                desc = desc->p_next;
                ids << desc->i_id;
            }
        }
    }

    return ids;
}
예제 #6
0
QStringList VlcVideo::trackDescription() const
{
    QStringList descriptions;

    if (_vlcMediaPlayer) {
        libvlc_track_description_t *desc;
        desc = libvlc_video_get_track_description(_vlcMediaPlayer);
        VlcError::errmsg();

        descriptions << QString().fromUtf8(desc->psz_name);
        if (trackCount() > 1) {
            for(int i = 1; i < trackCount(); i++) {
                desc = desc->p_next;
                descriptions << QString().fromUtf8(desc->psz_name);
            }
        }
    }

    return descriptions;
}
예제 #7
0
 foreach (const QString &f, files) {
     m_playlist->addMedia(QMediaContent(QUrl::fromLocalFile(dir.absolutePath() + "/" + f)));
     emit tracksChanged(tracks());
     emit trackCountChanged(trackCount());
 }
void QSpotifyAlbumBrowse::test()
{
    qDebug()<<trackCount();
}