summaryrefslogtreecommitdiff
path: root/src/project.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/project.cc')
-rw-r--r--src/project.cc41
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();