diff --git a/src/channelinfomodel.cpp b/src/channelinfomodel.cpp --- a/src/channelinfomodel.cpp +++ b/src/channelinfomodel.cpp @@ -401,6 +401,7 @@ void ChannelInfoModel::resetInfos() endResetModel(); } +// TODO: fix repetitive code, ChannelInfoModel::reset* functions void ChannelInfoModel::resetNames() { beginResetModel(); @@ -431,6 +432,28 @@ void ChannelInfoModel::resetVisibility(b endResetModel(); } +void ChannelInfoModel::resetGains() +{ + beginResetModel(); + for (unsigned ci = 0; (int) ci < infos.length(); ci++) + { + infos[ci].gain = ChannelInfo(ci).gain; + infos[ci].gainEn = ChannelInfo(ci).gainEn; + } + endResetModel(); +} + +void ChannelInfoModel::resetOffsets() +{ + beginResetModel(); + for (unsigned ci = 0; (int) ci < infos.length(); ci++) + { + infos[ci].offset = ChannelInfo(ci).offset; + infos[ci].offsetEn = ChannelInfo(ci).offsetEn; + } + endResetModel(); +} + void ChannelInfoModel::saveSettings(QSettings* settings) const { settings->beginGroup(SettingGroup_Channels);