From 8a3a2834b84ba9cdb4b9c505b124774f14034d27 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Wed, 16 May 2018 20:19:09 +0200 Subject: Store file list in instrument and make initial connections fomr UI connections to project storage. --- src/project.cc | 41 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) (limited to 'src/project.cc') 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 +#include + 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(); -- cgit v1.2.3