Added Utility and Type namespaces
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
#ifndef ALBUMREPOSITORY_H_
|
||||
#define ALBUMREPOSITORY_H_
|
||||
|
||||
#include "database/base_repository.h"
|
||||
#include "models/models.h"
|
||||
|
||||
namespace Database
|
||||
{
|
||||
class albumRepository : public base_repository
|
||||
{
|
||||
public:
|
||||
albumRepository(const Model::BinaryPath&);
|
||||
private:
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace Database
|
||||
coverArtRepository(const std::string&);
|
||||
coverArtRepository(const Model::BinaryPath&);
|
||||
|
||||
Model::Cover retrieveRecord(Model::Cover&, coverFilter);
|
||||
Model::Cover retrieveRecord(Model::Cover&, Type::coverFilter);
|
||||
|
||||
void deleteRecord(const Model::Cover&);
|
||||
void saveRecord(const Model::Cover&);
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
#ifndef GENREREPOSITORY_H_
|
||||
#define GENREREPOSITORY_H_
|
||||
|
||||
#include "database/base_repository.h"
|
||||
#include "models/models.h"
|
||||
|
||||
namespace Database
|
||||
{
|
||||
class genreRepository : public base_repository
|
||||
{
|
||||
public:
|
||||
genreRepository(const Model::BinaryPath&);
|
||||
private:
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace Database
|
||||
|
||||
std::vector<Model::Song> retrieveRecords();
|
||||
|
||||
Model::Song retrieveRecord(Model::Song&, songFilter);
|
||||
Model::Song retrieveRecord(Model::Song&, Type::songFilter);
|
||||
|
||||
void deleteRecord(const Model::Song&);
|
||||
void saveRecord(const Model::Song&);
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
#ifndef YEARREPOSITORY_H_
|
||||
#define YEARREPOSITORY_H_
|
||||
|
||||
#include "database/base_repository.h"
|
||||
#include "models/models.h"
|
||||
|
||||
namespace Database
|
||||
{
|
||||
class yearRepository : public base_repository
|
||||
{
|
||||
public:
|
||||
yearRepository(const Model::BinaryPath&);
|
||||
private:
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
#ifndef ALBUMMANAGER_H_
|
||||
#define ALBUMMANAGER_H_
|
||||
|
||||
#include "models/models.h"
|
||||
|
||||
namespace Manager
|
||||
{
|
||||
class albumManager
|
||||
{
|
||||
public:
|
||||
albumManager(const Model::BinaryPath&);
|
||||
private:
|
||||
Model::BinaryPath m_bConf;
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
#ifndef ARTISTMANAGER_H_
|
||||
#define ARTISTMANAGER_H_
|
||||
|
||||
#include "models/models.h"
|
||||
|
||||
namespace Manager
|
||||
{
|
||||
class artistManager
|
||||
{
|
||||
public:
|
||||
artistManager(const Model::BinaryPath&);
|
||||
private:
|
||||
Model::BinaryPath m_bConf;
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
#ifndef GENREMANAGER_H_
|
||||
#define GENREMANAGER_H_
|
||||
|
||||
#include "models/models.h"
|
||||
|
||||
namespace Manager
|
||||
{
|
||||
class genreManager
|
||||
{
|
||||
public:
|
||||
genreManager(const Model::BinaryPath&);
|
||||
private:
|
||||
Model::BinaryPath m_bConf;
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace Manager
|
||||
Model::loginResult retrieve_token(std::string_view);
|
||||
Model::loginResult retrieve_token(const Model::BinaryPath&);
|
||||
|
||||
bool is_token_valid(std::string&, Scope);
|
||||
bool is_token_valid(std::string&, Type::Scope);
|
||||
private:
|
||||
Model::auth_credentials parse_auth_credentials(std::string_view);
|
||||
Model::auth_credentials parse_auth_credentials(const Model::BinaryPath&);
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
#ifndef YEARMANAGER_H_
|
||||
#define YEARMANAGER_H_
|
||||
|
||||
#include "models/models.h"
|
||||
|
||||
namespace Manager
|
||||
{
|
||||
class yearManager
|
||||
{
|
||||
public:
|
||||
yearManager(const Model::BinaryPath&);
|
||||
private:
|
||||
Model::BinaryPath m_bConf;
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
#ifndef COVERFILTER_H_
|
||||
#define COVERFILTER_H_
|
||||
|
||||
enum class coverFilter
|
||||
namespace Type
|
||||
{
|
||||
id = 0,
|
||||
songTitle,
|
||||
imagePath
|
||||
};
|
||||
enum class coverFilter
|
||||
{
|
||||
id = 0,
|
||||
songTitle,
|
||||
imagePath
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
#ifndef SCOPES_H_
|
||||
#define SCOPES_H_
|
||||
|
||||
enum class Scope
|
||||
namespace Type
|
||||
{
|
||||
upload = 0,
|
||||
download
|
||||
};
|
||||
enum class Scope
|
||||
{
|
||||
upload = 0,
|
||||
download
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,14 +1,17 @@
|
||||
#ifndef SONGFILTER_H_
|
||||
#define SONGFILTER_H_
|
||||
|
||||
enum class songFilter
|
||||
namespace Type
|
||||
{
|
||||
id = 0,
|
||||
title,
|
||||
album,
|
||||
artist,
|
||||
genre,
|
||||
year
|
||||
};
|
||||
enum class songFilter
|
||||
{
|
||||
id = 0,
|
||||
title,
|
||||
album,
|
||||
artist,
|
||||
genre,
|
||||
year
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
#ifndef IMAGEFILE_H_
|
||||
#define IMAGEFILE_H_
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#include <attachedpictureframe.h>
|
||||
@@ -10,15 +13,20 @@
|
||||
#include <tpropertymap.h>
|
||||
#include <id3v2tag.h>
|
||||
|
||||
class imageFile : public TagLib::File
|
||||
namespace Utility
|
||||
{
|
||||
public:
|
||||
imageFile(const char *file);
|
||||
class imageFile : public TagLib::File
|
||||
{
|
||||
public:
|
||||
imageFile(const char *file);
|
||||
|
||||
TagLib::ByteVector data();
|
||||
TagLib::ByteVector data();
|
||||
|
||||
private:
|
||||
virtual TagLib::Tag *tag() const { return 0; }
|
||||
virtual TagLib::AudioProperties *audioProperties() const { return 0; }
|
||||
virtual bool save() { return false; }
|
||||
};
|
||||
private:
|
||||
virtual TagLib::Tag *tag() const { return 0; }
|
||||
virtual TagLib::AudioProperties *audioProperties() const { return 0; }
|
||||
virtual bool save() { return false; }
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -6,14 +6,17 @@
|
||||
|
||||
#include "models/models.h"
|
||||
|
||||
class metadata_retriever
|
||||
namespace Utility
|
||||
{
|
||||
public:
|
||||
Model::Song retrieve_metadata(std::string&);
|
||||
Model::Cover update_cover_art(const Model::Song&, Model::Cover& cov, const std::string&);
|
||||
class metadata_retriever
|
||||
{
|
||||
public:
|
||||
Model::Song retrieve_metadata(std::string&);
|
||||
Model::Cover update_cover_art(const Model::Song&, Model::Cover& cov, const std::string&);
|
||||
|
||||
void update_metadata(Model::Song updated_song, const Model::Song old_song);
|
||||
private:
|
||||
};
|
||||
void update_metadata(Model::Song updated_song, const Model::Song old_song);
|
||||
private:
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user