예제 #1
0
        public void AddConnection(long id)
        {
            var connectionDto = _moduleConnectionService.GetById(id);
            var source        = _modules.FirstOrDefault(m => m.Id == connectionDto.SourceId);
            var target        = _modules.FirstOrDefault(m => m.Id == connectionDto.TargetId);

            if (source != null && target != null)
            {
                source.AddOutput(target);
            }
        }
예제 #2
0
        private dynamic UpdateConnection(ModuleConnectionDto connectionDto)
        {
            var existing = _moduleConnectionService.GetById(connectionDto.Id);

            if (existing == null)
            {
                return(false);
            }

            _audioEngine.RemoveConnection(connectionDto.Id);

            if (!_moduleConnectionService.Update(connectionDto))
            {
                return(false);
            }

            _audioEngine.AddConnection(connectionDto.Id);

            return(connectionDto);
        }