summaryrefslogtreecommitdiff
path: root/music.cpp
blob: f1623c4f4aec97bd59e693f1379174a319adcd4a (plain)
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
#include "music.h"

#include <iostream>

namespace music {

MusicDirectory *root_directory = NULL;

void init(const fs::path root) {
	root_directory = new MusicDirectory(root);
}

};

MusicTrack::MusicTrack(const fs::path path) {
	std::cout << path << std::endl;
	this->path = path;
}

MusicDirectory::MusicDirectory(const fs::path root) {
	std::cout << root << std::endl;

	fs::path p(root);

	fs::directory_iterator end_itr;
	for(fs::directory_iterator it(p); it != end_itr; it++) {
		if(fs::is_directory(it->status())) {
			directories.push_back(MusicDirectory(it->path().string()));
		} else if(fs::is_regular_file(it->status())) {
			tracks.push_back(MusicTrack(it->path().string()));
		}
	}
}