Refactor tagging and add library scanning
- Replace `Tag` class with utility helpers for hashing and file type parsing - Change `Track.artwork` from `std::string` to `TagLib::VariantMap` - Add `importArtwork`, rename `importFolder` to `scanFolder` - Add `scanLibrary`, `updateLibrary`, `editMetadata`, and `seek` methods to `Player` hierarchy - Remove obsolete `Tag.h`/`Tag.cpp` files
This commit is contained in:
+21
-1
@@ -1,5 +1,10 @@
|
||||
#include "../include/PlayerLocal.h"
|
||||
#include "../include/Player.h"
|
||||
#include "../include/File.h"
|
||||
#include "../include/Database.h"
|
||||
#include "../include/Containers.h"
|
||||
|
||||
using db = Database;
|
||||
|
||||
void Player::play () { PE_.startPlayback(); }
|
||||
void Player::stop () { PE_.stopPlayback(); }
|
||||
@@ -20,7 +25,7 @@ void PlayerLocal::previous() {
|
||||
ma_uint64 Player::getPlayheadPosition () { return PE_.getPosition(); };
|
||||
|
||||
void PlayerLocal::loadFile ( Track track ) {
|
||||
const char *fp = track.filePath;
|
||||
const char *fp = track.filePath.c_str();
|
||||
PE_.initDecoder ( fp );
|
||||
}
|
||||
|
||||
@@ -35,3 +40,18 @@ void::PlayerLocal::playQueue() {
|
||||
++currentTrack_;
|
||||
}
|
||||
}
|
||||
|
||||
void PlayerLocal::scanLibrary(){
|
||||
File f;
|
||||
Track t;
|
||||
std::vector<Track> tracks;
|
||||
|
||||
f.scanFolder( musicFolder_, tracks );
|
||||
|
||||
for ( auto t : tracks ) {
|
||||
db_.addArtist( t.artist.toCString() );
|
||||
db_.addGenre( t.genre.toCString() );
|
||||
db_.addAlbum( t );
|
||||
db_.addTrack( t );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user