private void DoEdit(MemoryEntry memoryEntry, bool isNew) { var dialog = new DialogEntryInfo(memoryEntry, _groups); if (dialog.ShowDialog() == DialogResult.OK) { if (isNew) { _entries.Add(memoryEntry); _entries.Sort((e1, e2) => e1.Frequency.CompareTo(e2.Frequency)); } _settingsPersister.PersistStoredFrequencies(_entries); if (!_groups.Contains(memoryEntry.GroupName)) { _groups.Add(memoryEntry.GroupName); ProcessGroups(memoryEntry.GroupName); } else { if ((string)comboGroups.SelectedItem == AllGroups || (string)comboGroups.SelectedItem == memoryEntry.GroupName || ((string)comboGroups.SelectedItem == FavouriteGroup && memoryEntry.IsFavourite)) { if (isNew) { _displayedEntries.Add(memoryEntry); } } else { comboGroups.SelectedItem = memoryEntry.GroupName; } } } }
public MemoryEntry(MemoryEntry memoryEntry) { _name = memoryEntry._name; _groupName = memoryEntry._groupName; _detectorType = memoryEntry._detectorType; _frequency = memoryEntry._frequency; _shift = memoryEntry._shift; _centerFrequency = memoryEntry._centerFrequency; _filterBandwidth = memoryEntry._filterBandwidth; _isFavourite = memoryEntry._isFavourite; _stayTunedLevel = memoryEntry._stayTunedLevel; }
public DialogEntryInfo(MemoryEntry memoryEntry, List <string> groups) { _memoryEntry = memoryEntry; InitializeComponent(); textBoxName.Text = memoryEntry.Name; comboGroupName.Text = memoryEntry.GroupName; frequencyNumericUpDown.Value = memoryEntry.Frequency; shiftNumericUpDown.Value = memoryEntry.Shift; lblMode.Text = memoryEntry.DetectorType.ToString(); comboGroupName.Items.AddRange(groups.ToArray()); nudFilterBandwidth.Value = memoryEntry.FilterBandwidth; favouriteCb.Checked = memoryEntry.IsFavourite; numericUpDownStayTunedLevel.Value = memoryEntry.StayTunedLevel; ValidateForm(); }
private void DoReTuning(MemoryEntry Entry) { InitAverager(); _controlInterface.FrequencyShiftEnabled = false; if (Entry.Shift != 0) { Entry.Frequency += Entry.Shift; } _controlInterface.DetectorType = Entry.DetectorType; _controlInterface.FilterBandwidth = (int)Entry.FilterBandwidth; _controlInterface.Frequency = Entry.Frequency; UpdateTimeLeft(_scanTime); }
public DialogEntryInfo(MemoryEntry memoryEntry, List<string> groups) { _memoryEntry = memoryEntry; InitializeComponent(); textBoxName.Text = memoryEntry.Name; comboGroupName.Text = memoryEntry.GroupName; frequencyNumericUpDown.Value = memoryEntry.Frequency; shiftNumericUpDown.Value = memoryEntry.Shift; lblMode.Text = memoryEntry.DetectorType.ToString(); comboGroupName.Items.AddRange(groups.ToArray()); nudFilterBandwidth.Value = memoryEntry.FilterBandwidth; favouriteCb.Checked = memoryEntry.IsFavourite; numericUpDownStayTunedLevel.Value = memoryEntry.StayTunedLevel; ValidateForm(); }
public void Bookmark() { //if (_controlInterface.Frequency == 0) return; if (!_controlInterface.IsPlaying) { return; } var memoryEntry = new MemoryEntry(); memoryEntry.DetectorType = _controlInterface.DetectorType; memoryEntry.Frequency = _controlInterface.Frequency; memoryEntry.FilterBandwidth = _controlInterface.FilterBandwidth; memoryEntry.Shift = _controlInterface.FrequencyShiftEnabled ? _controlInterface.FrequencyShift : 0; memoryEntry.GroupName = "Misc"; if (_controlInterface.DetectorType == DetectorType.WFM) { var stationName = _controlInterface.RdsProgramService.Trim(); memoryEntry.Name = string.Empty; if (!string.IsNullOrEmpty(stationName)) { memoryEntry.Name = stationName; } else { memoryEntry.Name = GetFrequencyDisplay(_controlInterface.Frequency) + " " + memoryEntry.DetectorType; } } else { memoryEntry.Name = GetFrequencyDisplay(_controlInterface.Frequency) + " " + memoryEntry.DetectorType; } memoryEntry.IsFavourite = true; DoEdit(memoryEntry, true); }
public MemoryInfoEventArgs(MemoryEntry entry) { _memoryEntry = entry; }
public void Bookmark() { //if (_controlInterface.Frequency == 0) return; if (!_controlInterface.IsPlaying) return; var memoryEntry = new MemoryEntry(); memoryEntry.DetectorType = _controlInterface.DetectorType; memoryEntry.Frequency = _controlInterface.Frequency; memoryEntry.FilterBandwidth = _controlInterface.FilterBandwidth; memoryEntry.Shift = _controlInterface.FrequencyShiftEnabled ? _controlInterface.FrequencyShift : 0; memoryEntry.GroupName = "Misc"; if (_controlInterface.DetectorType == DetectorType.WFM) { var stationName = _controlInterface.RdsProgramService.Trim(); memoryEntry.Name = string.Empty; if (!string.IsNullOrEmpty(stationName)) { memoryEntry.Name = stationName; } else { memoryEntry.Name = GetFrequencyDisplay(_controlInterface.Frequency) + " " + memoryEntry.DetectorType; } } else { memoryEntry.Name = GetFrequencyDisplay(_controlInterface.Frequency) + " " + memoryEntry.DetectorType; } memoryEntry.IsFavourite = true; DoEdit(memoryEntry, true); }
private void DoEdit(MemoryEntry memoryEntry, bool isNew) { var dialog = new DialogEntryInfo(memoryEntry, _groups); if (dialog.ShowDialog() == DialogResult.OK) { if (isNew) { _entries.Add(memoryEntry); _entries.Sort((e1, e2) => e1.Frequency.CompareTo(e2.Frequency)); } _settingsPersister.PersistStoredFrequencies(_entries); if (!_groups.Contains(memoryEntry.GroupName)) { _groups.Add(memoryEntry.GroupName); ProcessGroups(memoryEntry.GroupName); } else { if ((string)comboGroups.SelectedItem == AllGroups || (string)comboGroups.SelectedItem == memoryEntry.GroupName || ((string)comboGroups.SelectedItem == FavouriteGroup && memoryEntry.IsFavourite)) { if (isNew) _displayedEntries.Add(memoryEntry); } else comboGroups.SelectedItem = memoryEntry.GroupName; } } }