We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 38d549e commit f77e2bdCopy full SHA for f77e2bd
main/src/domain/targets/track_peak_target.rs
@@ -60,17 +60,16 @@ impl<'a> Target<'a> for TrackPeakTarget {
60
impl TrackPeakTarget {
61
fn peak(&self) -> Option<Volume> {
62
let reaper = Reaper::get().medium_reaper();
63
-
64
let vu_mode = unsafe {
65
reaper.get_media_track_info_value(self.track.raw(), TrackAttributeKey::VuMode) as i32
66
};
67
- let mut channel_count = 2;
68
- if vu_mode == 2 || vu_mode == 8 {
69
- channel_count = unsafe {
+ let channel_count = if matches!(vu_mode, 2 | 8) {
+ unsafe {
70
reaper.get_media_track_info_value(self.track.raw(), TrackAttributeKey::Nchan) as i32
71
- };
72
- }
73
+ }
+ } else {
+ 2
+ };
74
if channel_count <= 0 {
75
return None;
76
}
0 commit comments