summaryrefslogtreecommitdiff
path: root/src/project.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/project.cc')
-rw-r--r--src/project.cc56
1 files changed, 49 insertions, 7 deletions
diff --git a/src/project.cc b/src/project.cc
index 9cac537..bc96e07 100644
--- a/src/project.cc
+++ b/src/project.cc
@@ -127,8 +127,27 @@ void AudioFile::setMainChannel(bool main_channel)
}
}
+bool AudioFile::getPositionChannel() const
+{
+ return pos_channel;
+}
+
+void AudioFile::setPositionChannel(bool pos_channel)
+{
+ if(this->pos_channel == pos_channel)
+ {
+ return;
+ }
+
+ {
+ Project::RAIIBulkUpdate bulkUpdate(instrument.getProject());
+ this->pos_channel = pos_channel;
+ }
+}
+
Instrument::Instrument(Project& project, int id)
- : id(id)
+ : QObject(nullptr)
+ , id(id)
, project(project)
{
}
@@ -317,12 +336,12 @@ void Instrument::setFadeLength(std::size_t fade_length)
}
}
-float Instrument::getThreshold() const
+double Instrument::getThreshold() const
{
return threshold;
}
-void Instrument::setThreshold(float threshold)
+void Instrument::setThreshold(double threshold)
{
if(this->threshold == threshold)
{
@@ -333,19 +352,42 @@ void Instrument::setThreshold(float threshold)
Project::RAIIBulkUpdate bulkUpdate(project);
this->threshold = threshold;
}
+
+ emit thresholdChanged();
}
-Selections Instrument::getSelections() const
+double Instrument::getPositionThreshold() const
{
- return selections;
+ return position_threshold;
}
-void Instrument::setSelections(const Selections& selections)
+void Instrument::setPositionThreshold(double position_threshold)
{
+ std::cout << __PRETTY_FUNCTION__ << std::endl;
+ std::cout << position_threshold << std::endl;
+ if(this->position_threshold == position_threshold)
+ {
+ return;
+ }
+
{
Project::RAIIBulkUpdate bulkUpdate(project);
- this->selections = selections;
+ this->position_threshold = position_threshold;
}
+
+ emit positionThresholdChanged();
+}
+
+Ranges Instrument::getRanges() const
+{
+ return ranges;
+}
+
+void Instrument::setRanges(const Ranges& ranges)
+{
+ Project::RAIIBulkUpdate bulkUpdate(project);
+ this->ranges = ranges;
+ emit rangesChanged();
}
QString Instrument::getPrefix() const