diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2024-07-27 13:39:32 +0200 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2024-07-27 13:39:32 +0200 |
commit | fc29354d86e6a8b5601e92405b89a1da27406ce7 (patch) | |
tree | e31069154ad5bd9497764b6205dd4d3a411b40eb /src/project.cc | |
parent | 329110e3230a6518f024c612842b04afdea1cd03 (diff) |
WIP
Diffstat (limited to 'src/project.cc')
-rw-r--r-- | src/project.cc | 56 |
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 |