HamBook – Diff between revs 14 and 54
?pathlinks?
Rev 14 | Rev 54 | |||
---|---|---|---|---|
Line 1... | Line -... | |||
1 | using Configuration.Annotations; |
- | ||
2 | using System; |
- | ||
3 | using System.Collections.Generic; |
- | ||
4 | using System.ComponentModel; |
1 | using System.ComponentModel; |
|
5 | using System.Linq; |
- | ||
6 | using System.Runtime.CompilerServices; |
2 | using System.Runtime.CompilerServices; |
|
7 | using System.Text; |
- | ||
8 | using System.Threading.Tasks; |
3 | using Configuration.Annotations; |
|
Line 9... | Line 4... | |||
9 | |
4 | |
|
10 | namespace Configuration |
5 | namespace Configuration |
|
11 | { |
6 | { |
|
12 | public class Spectrogram : INotifyPropertyChanged |
7 | public class Spectrogram : INotifyPropertyChanged |
|
13 | { |
- | ||
14 | private bool _pinToDesktop = false; |
- | ||
15 | private int _sampleRate = 8192; |
- | ||
16 | private int _fftSamples = 1024; |
8 | { |
|
- | 9 | private int _audioBufferTimespan = 20; |
||
- | 10 | private int _fftSamples = 1024; |
||
- | 11 | private bool _pinToDesktop; |
||
17 | private int _audioBufferTimespan = 20; |
12 | private int _sampleRate = 8192; |
|
Line 18... | Line 13... | |||
18 | private int _spectrumIntensity = 5; |
13 | private int _spectrumIntensity = 5; |
|
19 | |
14 | |
|
20 | public bool PinToDesktop |
15 | public bool PinToDesktop |
|
21 | { |
16 | { |
|
22 | get => _pinToDesktop; |
17 | get => _pinToDesktop; |
|
23 | set |
18 | set |
|
24 | { |
- | ||
25 | if (value == _pinToDesktop) |
- | ||
26 | { |
- | ||
Line 27... | Line 19... | |||
27 | return; |
19 | { |
|
28 | } |
20 | if (value == _pinToDesktop) return; |
|
29 | |
21 | |
|
30 | _pinToDesktop = value; |
22 | _pinToDesktop = value; |
|
Line 35... | Line 27... | |||
35 | public int SampleRate |
27 | public int SampleRate |
|
36 | { |
28 | { |
|
37 | get => _sampleRate; |
29 | get => _sampleRate; |
|
38 | set |
30 | set |
|
39 | { |
31 | { |
|
40 | if (value == _sampleRate) |
32 | if (value == _sampleRate) return; |
|
41 | { |
- | ||
42 | return; |
- | ||
43 | } |
- | ||
Line 44... | Line 33... | |||
44 | |
33 | |
|
45 | _sampleRate = value; |
34 | _sampleRate = value; |
|
46 | OnPropertyChanged(); |
35 | OnPropertyChanged(); |
|
47 | } |
36 | } |
|
Line 50... | Line 39... | |||
50 | public int SpectrumIntensity |
39 | public int SpectrumIntensity |
|
51 | { |
40 | { |
|
52 | get => _spectrumIntensity; |
41 | get => _spectrumIntensity; |
|
53 | set |
42 | set |
|
54 | { |
43 | { |
|
55 | if (value == _spectrumIntensity) |
44 | if (value == _spectrumIntensity) return; |
|
56 | { |
- | ||
57 | return; |
- | ||
58 | } |
- | ||
Line 59... | Line 45... | |||
59 | |
45 | |
|
60 | _spectrumIntensity = value; |
46 | _spectrumIntensity = value; |
|
61 | OnPropertyChanged(); |
47 | OnPropertyChanged(); |
|
62 | } |
48 | } |
|
Line 63... | Line 49... | |||
63 | } |
49 | } |
|
64 | |
50 | |
|
65 | public int FFTSamples |
51 | public int FftSamples |
|
66 | { |
52 | { |
|
67 | get => _fftSamples; |
53 | get => _fftSamples; |
|
68 | set |
54 | set |
|
69 | { |
- | ||
70 | if (value == _fftSamples) |
- | ||
71 | { |
- | ||
Line 72... | Line 55... | |||
72 | return; |
55 | { |
|
73 | } |
56 | if (value == _fftSamples) return; |
|
74 | |
57 | |
|
75 | _fftSamples = value; |
58 | _fftSamples = value; |
|
Line 80... | Line 63... | |||
80 | public int AudioBufferTimespan |
63 | public int AudioBufferTimespan |
|
81 | { |
64 | { |
|
82 | get => _audioBufferTimespan; |
65 | get => _audioBufferTimespan; |
|
83 | set |
66 | set |
|
84 | { |
67 | { |
|
85 | if (value == _audioBufferTimespan) |
68 | if (value == _audioBufferTimespan) return; |
|
86 | { |
- | ||
87 | return; |
- | ||
88 | } |
- | ||
Line 89... | Line 69... | |||
89 | |
69 | |
|
90 | _audioBufferTimespan = value; |
70 | _audioBufferTimespan = value; |
|
91 | OnPropertyChanged(); |
71 | OnPropertyChanged(); |
|
92 | } |
72 | } |
|
Line 93... | Line -... | |||
93 | } |
- | ||
94 | |
- | ||
95 | public Spectrogram() |
- | ||
96 | { |
- | ||
97 | } |
73 | } |
|
Line 98... | Line 74... | |||
98 | |
74 | |
|
99 | public event PropertyChangedEventHandler PropertyChanged; |
75 | public event PropertyChangedEventHandler PropertyChanged; |
|
100 | |
76 | |
|
101 | [NotifyPropertyChangedInvocator] |
77 | [NotifyPropertyChangedInvocator] |
|
102 | protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) |
78 | protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) |
|
103 | { |
79 | { |
|
104 | PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); |
80 | PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); |
|
105 | } |
81 | } |