File tree Expand file tree Collapse file tree 2 files changed +22
-6
lines changed
Expand file tree Collapse file tree 2 files changed +22
-6
lines changed Original file line number Diff line number Diff line change @@ -218,7 +218,26 @@ void CConfig::Load (void)
218218 m_bEncoderEnabled = m_Properties.GetNumber (" EncoderEnabled" , 0 ) != 0 ;
219219 m_nEncoderPinClock = m_Properties.GetNumber (" EncoderPinClock" , 10 );
220220 m_nEncoderPinData = m_Properties.GetNumber (" EncoderPinData" , 9 );
221- m_nEncoderDetents = m_Properties.GetNumber (" EncoderDetents" , 4 );
221+
222+ // Parse encoder resolution
223+ const char *pResolution = m_Properties.GetString (" EncoderResolution" , " full" );
224+ if (strcasecmp (pResolution, " full" ) == 0 )
225+ {
226+ m_nEncoderDetents = 4 ;
227+ }
228+ else if (strcasecmp (pResolution, " half" ) == 0 )
229+ {
230+ m_nEncoderDetents = 2 ;
231+ }
232+ else if (strcasecmp (pResolution, " quarter" ) == 0 )
233+ {
234+ m_nEncoderDetents = 1 ;
235+ }
236+ else
237+ {
238+ // Invalid value, use default
239+ m_nEncoderDetents = 4 ;
240+ }
222241
223242 m_bMIDIDumpEnabled = m_Properties.GetNumber (" MIDIDumpEnabled" , 0 ) != 0 ;
224243 m_bProfileEnabled = m_Properties.GetNumber (" ProfileEnabled" , 0 ) != 0 ;
Original file line number Diff line number Diff line change @@ -151,11 +151,8 @@ MIDIButtonTGDown=56
151151EncoderEnabled =1
152152EncoderPinClock =10
153153EncoderPinData =9
154- # Detents per rotation to be recognized:
155- # 1 = Quarter Step Encoder
156- # 2 = Half Step Encoder
157- # 4 = Full Step Encoder (default)
158- EncoderDetents =4
154+ # Encoder resolution: full, half, or quarter (default: full)
155+ EncoderResolution =full
159156
160157# Debug
161158MIDIDumpEnabled =0
You can’t perform that action at this time.
0 commit comments