예제 #1
0
파일: Vix2Writer.cs 프로젝트: priyanr/Vixen
        public void OpenSession(SequenceSessionData sessionData)
        {
            _curPeriod   = 0;
            _sessionData = sessionData;
            try
            {
                _outfs = File.Create(_sessionData.OutFileName, _sessionData.ChannelNames.Count * 2, FileOptions.None);
            }
            catch (Exception e)
            {
                _outfs = null;
                throw e;
            }
            _xmlData          = new Vix2XMLData();
            _xmlData.Channels = new List <Vix2Channel>();

            _xmlData.Time = _sessionData.TimeMS.ToString();

            _xmlData.EventPeriodInMilliseconds = _sessionData.PeriodMS.ToString();

            _adder = 0;
            if (_sessionData.TimeMS % _sessionData.PeriodMS != 0)
            {
                _adder = 1;
            }

            _periodData = new Byte[sessionData.ChannelNames.Count * (_sessionData.NumPeriods + _adder)];

            _xmlData.MinimumLevel = "0";
            _xmlData.MaximumLevel = "255";
            _xmlData.AudioDevice  = "-1";
            _xmlData.AudioVolume  = "0";
        }
예제 #2
0
파일: HelixWriter.cs 프로젝트: stewmc/vixen
        public void OpenSession(SequenceSessionData sessionData)
        {
            _curPeriod = 0;
            _sessionData = sessionData;
            try
            {
                _outfs = File.Create(_sessionData.OutFileName, _sessionData.ChannelNames.Count * 2, FileOptions.None);
            }
            catch (Exception e)
            {
                _outfs = null;
                throw e;
            }
            _xmlData = new Vix2XMLData();
            _xmlData.Channels = new List<Vix2Channel>();

            _xmlData.Time = _sessionData.TimeMS.ToString();

            _xmlData.EventPeriodInMilliseconds = _sessionData.PeriodMS.ToString();

            _adder = 0;
            if (_sessionData.TimeMS % _sessionData.PeriodMS != 0)
            {
                _adder = 1;
            }

            _periodData = new Byte[sessionData.ChannelNames.Count * (_sessionData.NumPeriods + _adder)];

            _xmlData.MinimumLevel = "0";
            _xmlData.MaximumLevel = "255";
            _xmlData.AudioDevice = "-1";
            _xmlData.AudioVolume = "0";
        }