Commit 06c849ef authored by Bart van der Velden's avatar Bart van der Velden

Intermediate check in (#65)

parent 23df36dc
......@@ -16,3 +16,49 @@
*****************************************************************************/
#include "Album.h"
using namespace std;
using namespace mc::collection;
//! Construct an album
Album::Album(const QString& albumName, const QString& albumArtist)
: m_albumName(albumName),
m_albumArtist(albumArtist)
{
}
//! Add a track to the album
void Album::AddTrack(Track* track)
{
m_tracks.append(track);
}
//! Set the album name
void Album::SetAlbumName(const QString& albumName)
{
m_albumName = albumName;
}
//! Retrieve the album name
QString Album::AlbumName() const
{
return m_albumName;
}
//! Set the album artist name
void Album::SetAlbumArtist(const QString& albumArtist)
{
m_albumArtist = albumArtist;
}
//! Retrieve the album artist name
QString Album::AlbumArtist() const
{
return m_albumArtist;
}
//! Give access to all the tracks that form this album
const QList<Track*>& Album::Tracks() const
{
return m_tracks;
}
......@@ -18,28 +18,52 @@
#ifndef MUSICCOLLECTION_COLLECTION_ALBUM_H_INCLUDED
#define MUSICCOLLECTION_COLLECTION_ALBUM_H_INCLUDED
#include "QString"
#include <QString>
#include <QList>
namespace mc
{
namespace collection
{
// Forward declarations
class Directory;
class Track;
//! An album track as read from a file system
/*! This class is used to collect all album data that was extracted from the track that
/*! This class is used to collect all album data that was extracted from the tracks that
* form the album
*/
class Album
{
public:
Album(const QString& albumName);
//! Construct an album
Album(const QString& albumName, const QString& albumArtist);
//! Add a track to the album
void AddTrack(Track* track);
//! Set the album name
void SetAlbumName(const QString& albumName);
//! Retrieve the album name
QString AlbumName() const;
//! Set the album artist name
void SetAlbumArtist(const QString& albumArtist);
//! Retrieve the album artist name
QString AlbumArtist() const;
//! Give access to all the tracks that form this album
const QList<Track*>& Tracks() const;
private:
QString m_albumName;
QString m_albumArtist;
QList<Track*> m_tracks;
private:
//! The default constructor is not implemented
Album();
Album(const Album&);
Album& operator=(const Album&);
Q_DISABLE_COPY(Album)
};
} // namespace collection
......
......@@ -24,16 +24,22 @@ namespace mc
{
namespace collection
{
// Forward declaration
class Track;
//! A Directory and its contents as scanned from the file system
class Directory
{
public:
//! Construct a directory
Directory(const QString& path);
//! Give access to the tracks in this directory
const QList<Track*> Tracks() const;
private:
//! The default constructor is not implemented
Directory();
Directory(const Directory&);
Directory& operator=(const Directory&);
Q_DISABLE_COPY(Directory)
};
} // namespace collection
......
......@@ -49,7 +49,7 @@ namespace mc
QString m_path;
QString m_relativePath;
private:
// Not implemented
//! The default constructor is not implemented
Track();
Q_DISABLE_COPY(Track)
};
......
......@@ -48,8 +48,9 @@ private:
std::string m_minorVersion;
std::string m_gitSha1;
// Not implemented
Version(const Version&);
//! The copy constructor is not implemented
Version(const Version&);
//! The assignment operator is not implemented
Version& operator=(const Version&);
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment