Esempio n. 1
0
        public static HapticFeedbackFile ToHapticFeedbackFile(string jsonStr)
        {
            HapticFeedbackFile feedbackFile = new HapticFeedbackFile();

            JSONObject jsonObject = JSON.Parse(jsonStr).AsObject;
            var        projectObj = jsonObject["project"];

            feedbackFile.Project = BhapticsProject.ToProject(projectObj.AsObject);
            return(feedbackFile);
        }
Esempio n. 2
0
        private int CalculateClipDutationTime(HapticFeedbackFile hapticFeedbackFile)
        {
            int res = 0;

            if (hapticFeedbackFile != null)
            {
                foreach (var track in hapticFeedbackFile.Project.Tracks)
                {
                    foreach (var effect in track.Effects)
                    {
                        var effectTime = effect.StartTime + effect.OffsetTime;
                        if (res < effectTime)
                        {
                            res = effectTime;
                        }
                    }
                }
            }
            return(res);
        }