Exemplo n.º 1
0
 /// <summary>
 ///  添加时间标签到时间标签列表
 /// </summary>
 /// <param name="label"></param>
 public void AddTimeLabel(TimeLabel label)
 {
     if (_fileOperation == FileOperation.OpenWithReadOnly)
     {
         throw new WaveformFileException(ErrorCode.CannotCall);
     }
     if (TimeLabels.FindIndex(t => t.Name == label.Name) >= 0) //不允许添加相同名字的标签
     {
         throw new WaveformFileException(ErrorCode.SameLabel);
     }
     TimeLabels.Add(label);//添加到时间标签列表
 }
Exemplo n.º 2
0
        /// <summary>
        /// 添加时间标签到时间标签列表
        /// </summary>
        /// <param name="name"></param>
        /// <param name="position"></param>
        /// <param name="time"></param>
        /// <param name="description"></param>
        public void AddTimeLabel(string name, long position, DateTime time, string description)
        {
            if (_fileOperation == FileOperation.OpenWithReadOnly)
            {
                throw new WaveformFileException(ErrorCode.CannotCall);
            }
            TimeLabel label = new TimeLabel(name, position, time, description);

            if (TimeLabels.FindIndex(t => t.Name == name) >= 0) //不允许添加相同名字的标签
            {
                throw new WaveformFileException(ErrorCode.SameLabel);
            }
            TimeLabels.Add(label);//添加到时间标签列表
        }
Exemplo n.º 3
0
        /// <summary>
        /// 获取指定时间标签信息
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        public TimeLabel GetTimeLabel(string name)
        {
            TimeLabel label = new TimeLabel();
            int       idx   = -1;

            if ((idx = TimeLabels.FindIndex(t => t.Name == name)) >= 0) //查找
            {
                label = TimeLabels[idx];
            }
            else//如果指定标签不存在
            {
                throw new WaveformFileException(ErrorCode.LabelNotExit);
            }
            return(label);
        }
Exemplo n.º 4
0
	public void Subscribe()
	{
		_slider = GameObject.FindGameObjectWithTag("Slider").GetComponent<Slider>();
		_animToggleButton = GameObject.FindGameObjectWithTag("AnimToggleButton").GetComponent<AnimToggleButton>();
		
		_slider.onSliderChanged += onSliderChanged;
		_slider.onSliderPressed += onSliderPressed;
		_slider.onSliderReleased += onSliderReleased;
		
		_animToggleButton.onToggleChanged += onToggleChanged;
		
		_timeLabels = GameObject.FindGameObjectWithTag("TimeLabels").GetComponent<TimeLabels>();
		_timeLabels.setDuration(desiredAnimationLength);
		//_timeLabels.setDuration(Mathf.Round(_animationDuration - animationStartTime));
		_timeLabels.setCurrentTime(0f);
	}