00001 /*************************************************************************** 00002 * Copyright (C) 2006 by Michael Schulze * 00003 * mike.s@genion.de * 00004 * * 00005 * This program is free software; you can redistribute it and/or modify * 00006 * it under the terms of the GNU General Public License as published by * 00007 * the Free Software Foundation; either version 2 of the License, or * 00008 * (at your option) any later version. * 00009 * * 00010 * This program is distributed in the hope that it will be useful, * 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00013 * GNU General Public License for more details. * 00014 * * 00015 * You should have received a copy of the GNU General Public License * 00016 * along with this program; if not, write to the * 00017 * Free Software Foundation, Inc., * 00018 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 00019 ***************************************************************************/ 00020 00021 #include "test.h" 00022 #include "itunesdb.h" 00023 00024 /** 00025 * @brief All kinds of tests listing tracks and playlists 00026 */ 00027 class ListTests : public Test { 00028 00029 00030 /** 00031 * Creates a smart playlist with a rule for the matching the songs played in 00032 * the last 2 weeks and a limit for the 30 last played songs. 00033 */ 00034 void createRecentlyPlayedList( ITunesDB& itunesdb ); 00035 00036 /** 00037 * Creates a smart playlist with a rule for the matching the songs skipped in 00038 * the last 2 weeks and a limit for the 30 last played songs. 00039 */ 00040 void createRecentlySkippedList( ITunesDB& itunesdb ); 00041 00042 /** 00043 * Creates a smart playlist for the 25 most often played tracks 00044 */ 00045 void createTop25List( ITunesDB& itunesdb ); 00046 00047 /** 00048 * Creates a new smart playlist with all the tracks that haven't been played 00049 * or skipped yet 00050 */ 00051 void createNeverPlayedBeforeList( ITunesDB& itunsdb ); 00052 00053 /** 00054 * Creates a new smart playlist with all the top rated tracks in random 00055 * sort order. 00056 */ 00057 void createHighestRated( ITunesDB& itunesdb ); 00058 00059 /** 00060 * Creates a playlist with the tracks added in the last 2 weeks 00061 */ 00062 void createNewestAdditionsList( ITunesDB& itunesdb ); 00063 00064 /** 00065 * Prints the contents of a playlist in the desired order to stdout. 00066 */ 00067 void printSortedBy( ITunesDBPlaylist& playlist, itunesdb::Playlist::Sortorder order ); 00068 00069 /** 00070 * prints out all the tracks grouped by artist and album 00071 */ 00072 void printTracksByArtist( const ITunesDB& itunesdb ); 00073 00074 /** 00075 * Print out all the playlists. 00076 */ 00077 void printPlaylists( const ITunesDB& itunesdb ); 00078 00079 public: 00080 00081 virtual QString getName(); 00082 00083 virtual int run( QStringList& ); 00084 00085 }; 00086