-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmusicorg.cpp
More file actions
98 lines (67 loc) · 2.4 KB
/
musicorg.cpp
File metadata and controls
98 lines (67 loc) · 2.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
// musicorg.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream>
#include <taglib/tag.h>
#include <taglib/fileref.h>
#include "SongOperations.h"
#include "Song.h"
#include <iostream>
#include <string>
#include "FileHandler.h"
#include <sstream>
#include "ConfigReader.h"
// Set of desired file extensions
std::set<std::string> fileExtensions;
void seperateExtensions(std::string extensions, std::set<std::string>& fileExtensions)
{
std::stringstream ss(extensions);
std::string token;
while (std::getline(ss, token, ','))
{
fileExtensions.insert(token);
}
}
int main()
{
if (!doesConfigExist())
{
createDefaultConfig();
}
//std::cout << "asda" << std::endl;
std::map<std::string, std::string> config = ReadConfig();
seperateExtensions(config["FileTypes"], fileExtensions);
std::vector<fs::path> songpaths;
std::string sourceFolderPath;
std::string destinationFolderPath;
try {
std::cout << "Enter the source folder path: ";
std::getline(std::cin, sourceFolderPath);
std::cout << "Enter the destination folder path: ";
std::getline(std::cin, destinationFolderPath);
fs::path sourceDir(sourceFolderPath);
fs::path destinationDir(destinationFolderPath);
if (!fs::exists(sourceDir) || !fs::is_directory(sourceDir) ||
!fs::exists(destinationDir) || !fs::is_directory(destinationDir)) {
std::cerr << "Invalid source or destination folder." << std::endl;
return 1;
}
songpaths = findFiles(sourceDir, fileExtensions);
}
catch (const std::exception& e) {
std::cerr << "Error: " << e.what() << std::endl;
return 1;
}
std::vector<Song> songs = importMusic(songpaths, destinationFolderPath, config["Dir layout"]);
AttemptMove(songs);
///convert to .sound
// Get the tag of the file
}
// Run program: Ctrl + F5 or Debug > Start Without Debugging menu
// Debug program: F5 or Debug > Start Debugging menu
// Tips for Getting Started:
// 1. Use the Solution Explorer window to add/manage files
// 2. Use the Team Explorer window to connect to source control
// 3. Use the Output window to see build output and other messages
// 4. Use the Error List window to view errors
// 5. Go to Project > Add New Item to create new code files, or Project > Add Existing Item to add existing code files to the project
// 6. In the future, to open this project again, go to File > Open > Project and select the .sln file