Part of a larger restructure, added MusicPlayer which is the main controller and a structure for the song queue
This commit is contained in:
36
src/core/song/song.cpp
Normal file
36
src/core/song/song.cpp
Normal file
@@ -0,0 +1,36 @@
|
||||
#include "song.h"
|
||||
|
||||
Song::Song(
|
||||
std::string title,
|
||||
std::string album,
|
||||
std::string artist,
|
||||
std::string codec,
|
||||
std::string comment,
|
||||
std::string copyright,
|
||||
std::string publisher,
|
||||
std::string genre,
|
||||
std::string encoded_by,
|
||||
std::string date,
|
||||
std::string language,
|
||||
std::string albumCoverPath,
|
||||
std::string path,
|
||||
int length,
|
||||
std::string discoveredPath
|
||||
) : title(title),
|
||||
album(album),
|
||||
artist(artist),
|
||||
codec(codec),
|
||||
comment(comment),
|
||||
copyright(copyright),
|
||||
publisher(publisher),
|
||||
genre(genre),
|
||||
encoded_by(encoded_by),
|
||||
date(date),
|
||||
language(language),
|
||||
albumCoverPath(albumCoverPath),
|
||||
path(path),
|
||||
length(length) {
|
||||
|
||||
}
|
||||
|
||||
Song::~Song( ) { }
|
||||
54
src/core/song/song.h
Normal file
54
src/core/song/song.h
Normal file
@@ -0,0 +1,54 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
|
||||
class Song {
|
||||
private:
|
||||
// Song information
|
||||
const std::string& title;
|
||||
const std::string& album;
|
||||
const std::string& artist;
|
||||
const std::string& codec;
|
||||
const std::string& comment;
|
||||
const std::string& copyright;
|
||||
const std::string& publisher;
|
||||
const std::string& genre;
|
||||
const std::string& encoded_by;
|
||||
const std::string& date;
|
||||
const std::string& language;
|
||||
const std::string& albumCoverPath;
|
||||
const std::string& path;
|
||||
const int& length;
|
||||
|
||||
// Our own Metadata
|
||||
bool favorite = false;
|
||||
int playCount = 0;
|
||||
std::string discovered;
|
||||
|
||||
public:
|
||||
Song(
|
||||
std::string title,
|
||||
std::string album,
|
||||
std::string artist,
|
||||
std::string codec,
|
||||
std::string comment,
|
||||
std::string copyright,
|
||||
std::string publisher,
|
||||
std::string genre,
|
||||
std::string encoded_by,
|
||||
std::string date,
|
||||
std::string language,
|
||||
std::string albumCoverPath,
|
||||
std::string path,
|
||||
int length,
|
||||
std::string discoveredPath
|
||||
);
|
||||
~Song( );
|
||||
|
||||
void SetFavorite(bool fav) { favorite = fav; }
|
||||
|
||||
void IncrementPlayCount( ) { playCount++; }
|
||||
|
||||
std::string GetPath( ) { return path; };
|
||||
|
||||
};
|
||||
Reference in New Issue
Block a user