Click here to Skip to main content
15,886,110 members
Articles / Programming Languages / C#

LyricsFetcher - The Easiest Way to Find Lyrics for your Songs

Rate me:
Please Sign up or sign in to vote.
4.93/5 (82 votes)
29 Oct 2009GPL325 min read 201.2K   2.4K   184  
An article describing the development of a non-trivial C#/.NET application to fetch lyrics for songs.
/*
 * MockObjects - Dummy implementations useful for testing
 *
 * Author: Phillip Piper
 * Date: 2009-02-07 11:15 AM
 *
 * Change log:
 * 2009-02-071  JPP  Initial version
 */
using System;

namespace LyricsFetcher.Tests
{
    /// <summary>
    /// A do-nothing Song for testing purposes
    /// </summary>
    public class TestSong : Song
    {
        public TestSong() {

        }

        public TestSong(string title, string artist, string album, string genre) :
            base(title, artist, album, genre)
        {
        }

        public override string FullPath {
            get { return String.Empty; }
        }

        public override void Commit()
        {
        }

        public override void GetLyrics()
        {
        }
    }

    public class AlwaysSuccessLyricsSource : ILyricsSource
    {
        public string Name
        {
            get { return "alwaysSuccess"; }
        }

        public string GetLyrics(Song s)
        {
            System.Threading.Thread.Sleep(10);
            return "this lyrics";
        }
    }

    public class AlwaysFailLyricsSource : ILyricsSource
    {
        public string Name
        {
            get { return "alwaysFail"; }
        }

        public string GetLyrics(Song s)
        {
            System.Threading.Thread.Sleep(10);
            return "";
        }
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The GNU General Public License (GPLv3)


Written By
Team Leader
Australia Australia
Phillip has been playing with computers since the Apple II was the hottest home computer available. He learned the fine art of C programming and Guru meditation on the Amiga.

C# and Python are his languages of choice. Smalltalk is his mentor for simplicity and beauty. C++ is to programming what drills are to visits to the dentist.

He worked for longer than he cares to remember as Lead Programmer and System Architect of the Objective document management system. (www.objective.com)

He has lived for 10 years in northern Mozambique, teaching in villages.

He has developed high volume trading software, low volume FX trading software, and is currently working for Atlassian on HipChat.

Comments and Discussions