Example #1
0
        private void RefreshDevicesStates(IDevice o)
        {
            var id = _coreData.GetId(o);

            var dev = Devices.FirstOrDefault(s => s.DeviceId == id);

            if (dev != null)
            {
                dev.Offline.Value = o.State != DeviceState.Online;
            }

            UpdateDeviceNames();
        }
        private void CreateCacheItem(IResource resource, ChangeType changeType)
        {
            var id = _coreData.GetId(resource);

            if (resource.Data != null && !File.Exists(GetFilePath(id)))
            {
                SaveToFile(id, resource.Data);
                lock (_cache)
                    _cache[id] = resource.Data;
            }
        }
        private void RefreshDeviceBasedState()
        {
            bool anyRequestedPreview = false;

            foreach (var device in _coreData.Root.Devices.Values)
            {
                bool remote = _coreData.GetId(device) != _coreData.ThisDeviceId;
                if ((device.PreviewSources || device.PreviewAudioSources) && device.State == DeviceState.Online)
                {
                    anyRequestedPreview = true;
                }
            }

            StartStopObservation(anyRequestedPreview);
        }
        private TranscodingChannelModel CreateModel(IChannel c)
        {
            var channelName = c.Name;

            if (channelName == null)
            {
                if (!string.IsNullOrEmpty(c.TargetId) && CoreData.Root.Targets.TryGetValue(c.TargetId, out var target))
                {
                    channelName = target.Name;
                }
                else
                {
                    channelName = "Custom";
                }
            }

            return(new TranscodingChannelModel
            {
                Id = CoreData.GetId(c),
                Name = channelName,
                Source = c,
                Move = () => ToggleChannel(c)
            });
        }
 internal void Remove(ChannelModel channelModel)
 {
     CoreData.Root.Channels.Remove(CoreData.GetId(channelModel.Source));
 }