diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2018-05-16 20:19:09 +0200 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2018-05-16 20:19:09 +0200 |
commit | 8a3a2834b84ba9cdb4b9c505b124774f14034d27 (patch) | |
tree | fa361c19792ca6580135197db7672fc5fa7cf911 /src/project.cc | |
parent | 2840e3b4047fd0987095fb17ecbb154def019a2d (diff) |
Store file list in instrument and make initial connections fomr UI connections to project storage.
Diffstat (limited to 'src/project.cc')
-rw-r--r-- | src/project.cc | 41 |
1 files changed, 40 insertions, 1 deletions
diff --git a/src/project.cc b/src/project.cc index ba7f279..0baf67d 100644 --- a/src/project.cc +++ b/src/project.cc @@ -28,6 +28,8 @@ #include <QtGlobal> +#include <iostream> + Instrument::Instrument(Project& project, int id) : id(id) , project(project) @@ -57,6 +59,42 @@ void Instrument::setInstrumentName(const QString& instrument_name) } } +QString Instrument::getMasterFile() const +{ + return master_file; +} + +void Instrument::setMasterFile(const QString& master_file) +{ + if(this->master_file == master_file) + { + return; + } + + { + Project::RAIIBulkUpdate bulkUpdate(project); + this->master_file = master_file; + } +} + +AudioFileList Instrument::getFileList() const +{ + return file_list; +} + +void Instrument::setFileList(const AudioFileList& file_list) +{ + if(this->file_list == file_list) + { + return; + } + + { + Project::RAIIBulkUpdate bulkUpdate(project); + this->file_list = file_list; + } +} + void Project::bulkUpdateBegin() { ++update_count; @@ -121,6 +159,7 @@ void Project::setRawFileRoot(const QString& raw_file_root) Instrument& Project::getInstrument(int id) { + std::cout << "get " << id << std::endl; for(auto& instrument : instruments) { if(instrument.getId() == id) @@ -136,7 +175,7 @@ int Project::createInstrument() { RAIIBulkUpdate bulkUpdate(*this); - instruments.emplace_back(Instrument(*this, next_id)); + instruments.emplace_back(*this, next_id); ++next_id; return instruments.back().getId(); |