File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- using VRCFaceTracking . Core . Params . Data ;
1+ using Microsoft . Extensions . Logging ;
2+ using VRCFaceTracking . Core . Params . Data ;
23using VRCFaceTracking . Core . Params . Expressions ;
34using VRCFaceTracking . Core . Types ;
45
@@ -14,6 +15,13 @@ public class V1Mapper : IExpressionMapper
1415 { "RightEyeX" , 0f } ,
1516 { "EyesY" , 0f } ,
1617 } ;
18+
19+ private ILogger _logger ;
20+
21+ public V1Mapper ( ILogger logger )
22+ {
23+ _logger = logger ;
24+ }
1725
1826 public void handleOSCMessage ( OSCMessage message )
1927 {
Original file line number Diff line number Diff line change 1- using VRCFaceTracking . Core . Params . Data ;
1+ using Microsoft . Extensions . Logging ;
2+ using VRCFaceTracking . Core . Params . Data ;
23
34namespace ETVRTrackingModule . ExpressionStrategies ;
45
@@ -16,7 +17,12 @@ public class V2Mapper : IExpressionMapper
1617 { "EyeLidRight" , 0f } ,
1718 } ;
1819
20+ private ILogger _logger ;
1921
22+ public V2Mapper ( ILogger logger )
23+ {
24+ _logger = logger ;
25+ }
2026 public void handleOSCMessage ( OSCMessage message )
2127 {
2228 string paramToMap = IExpressionMapper . GetParamToMap ( message . address ) ;
@@ -28,6 +34,5 @@ public void handleOSCMessage(OSCMessage message)
2834
2935 public void UpdateVRCFTEyeData ( ref UnifiedEyeData eyeData , ref UnifiedExpressionShape [ ] eyeShapes )
3036 {
31- throw new NotImplementedException ( ) ;
3237 }
3338}
Original file line number Diff line number Diff line change @@ -12,24 +12,29 @@ public class ExpressionsMapper
1212 public ExpressionsMapper ( ILogger logger )
1313 {
1414 _logger = logger ;
15- _mappingStrategy = new V2Mapper ( ) ;
15+ _mappingStrategy = new V2Mapper ( _logger ) ;
1616 }
1717 public void MapMessage ( OSCMessage msg )
1818 {
19+ _logger . LogInformation ( "parsing message" ) ;
1920 if ( ! msg . success )
2021 return ;
2122
22- var nextStrategy = IsV2Param ( msg ) ? ( IExpressionMapper ) new V2Mapper ( ) : new V1Mapper ( ) ;
23+ var nextStrategy = IsV2Param ( msg ) ? ( IExpressionMapper ) new V2Mapper ( _logger ) : new V1Mapper ( _logger ) ;
24+
2325 if ( _mappingStrategy . GetType ( ) != nextStrategy . GetType ( ) )
2426 {
27+ _logger . LogInformation ( $ "Detected differing strategy, changing from { _mappingStrategy . GetType ( ) } to { nextStrategy . GetType ( ) } ") ;
2528 _mappingStrategy = nextStrategy ;
2629 }
2730 _mappingStrategy . handleOSCMessage ( msg ) ;
2831 }
2932
3033 private bool IsV2Param ( OSCMessage oscMessage )
3134 {
32- return oscMessage . address . Contains ( "/v2/" ) ;
35+ var isv2Param = oscMessage . address . Contains ( "/v2/" ) ;
36+ _logger . LogInformation ( $ "is V2 param: { isv2Param . ToString ( ) } ") ;
37+ return isv2Param ;
3338 }
3439
3540 public void UpdateVRCFTEyeData ( )
Original file line number Diff line number Diff line change @@ -63,6 +63,9 @@ private void OSCListen()
6363 {
6464 var length = _receiver . Receive ( buffer ) ;
6565 OSCMessage msg = ParseOSCMessage ( buffer , length ) ;
66+
67+ _logger . LogInformation ( $ "{ msg . address } { msg . value } { msg . success } ") ;
68+
6669 _expressionMapper . MapMessage ( msg ) ;
6770 }
6871 }
You can’t perform that action at this time.
0 commit comments