void
CollectionLocation::prepareCopy( Meta::TrackPtr track, CollectionLocation *destination )
{
    Q_ASSERT(destination);
    Meta::TrackList list;
    list.append( track );
    prepareCopy( list, destination );
}
예제 #2
0
void
Playlist::PrettyListView::editTrackInformation()
{
    Meta::TrackList tl;
    foreach( const QModelIndex &index, selectedIndexes() )
    {
        tl.append( index.data( TrackRole ).value<Meta::TrackPtr>() );
    }
예제 #3
0
Meta::TrackList*
APG::ConstraintSolver::crossover( Meta::TrackList* top, Meta::TrackList* bot ) const
{
    const double crossoverPt = 0.5; // TODO: choose different values

    int topV = (int)( crossoverPt * (double)top->size() );
    int botV = (int)( crossoverPt * (double)bot->size() );

    Meta::TrackList* newlist = new Meta::TrackList( top->mid( 0, topV ) );
    newlist->append( bot->mid( botV ) );

    delete top;
    return newlist;
}
void TestPlaylistFileProvider::testSave()
{
    Meta::TrackList tempTrackList;
    const KUrl trackUrl = dataPath( "data/audio/Platz 01.mp3" );
    tempTrackList.append( CollectionManager::instance()->trackForUrl( trackUrl ) );
    QCOMPARE( tempTrackList.size(), 1 );

    QFETCH(QString, name);
    QFETCH(QString, result);

    Playlists::PlaylistPtr testPlaylist = m_testPlaylistFileProvider->save( tempTrackList, name );
    QVERIFY( testPlaylist );

    QVERIFY( QFile::exists( Amarok::saveLocation( "playlists" ) + result ) );
    QCOMPARE( testPlaylist->name(), QString( result ) );
    QCOMPARE( testPlaylist->tracks().size(), 1 );
    QFile::remove( Amarok::saveLocation( "playlists" ) + result );
}