mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-12 08:37:25 -05:00
#1190 Tuner management redesign. Updates all tuners with direct threaded support. Incorporates USB Hotplug support. Adds black/white listing of tuners. Updates all tuner editors to have a common look and feel. Changes location of tuner configuration file and changes format to JSON. (#1208)
Co-authored-by: Dennis Sheirer <dsheirer@github.com>
This commit is contained in:
@@ -1,30 +1,27 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2022 Dennis Sheirer
|
||||
*
|
||||
* * ******************************************************************************
|
||||
* * Copyright (C) 2014-2019 Dennis Sheirer
|
||||
* *
|
||||
* * This program is free software: you can redistribute it and/or modify
|
||||
* * it under the terms of the GNU General Public License as published by
|
||||
* * the Free Software Foundation, either version 3 of the License, or
|
||||
* * (at your option) any later version.
|
||||
* *
|
||||
* * This program is distributed in the hope that it will be useful,
|
||||
* * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* * GNU General Public License for more details.
|
||||
* *
|
||||
* * You should have received a copy of the GNU General Public License
|
||||
* * along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
* * *****************************************************************************
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
* ****************************************************************************
|
||||
*/
|
||||
package io.github.dsheirer.spectrum;
|
||||
|
||||
import io.github.dsheirer.properties.SystemProperties;
|
||||
import io.github.dsheirer.source.tuner.Tuner;
|
||||
import io.github.dsheirer.source.tuner.TunerEvent;
|
||||
import io.github.dsheirer.source.tuner.TunerModel;
|
||||
import io.github.dsheirer.source.tuner.ui.DiscoveredTunerModel;
|
||||
|
||||
import javax.swing.JMenuItem;
|
||||
import java.awt.EventQueue;
|
||||
@@ -33,13 +30,13 @@ import java.awt.event.ActionListener;
|
||||
|
||||
public class ShowTunerMenuItem extends JMenuItem
|
||||
{
|
||||
private TunerModel mTunerModel;
|
||||
private DiscoveredTunerModel mDiscoveredTunerModel;
|
||||
private Tuner mTuner;
|
||||
|
||||
public ShowTunerMenuItem(TunerModel tunerModel, Tuner tuner)
|
||||
public ShowTunerMenuItem(DiscoveredTunerModel discoveredTunerModel, Tuner tuner)
|
||||
{
|
||||
super(tuner != null ? "Show: " + tuner.getName() : "(empty)");
|
||||
mTunerModel = tunerModel;
|
||||
super(tuner != null ? "Show: " + tuner.getPreferredName() : "(empty)");
|
||||
mDiscoveredTunerModel = discoveredTunerModel;
|
||||
mTuner = tuner;
|
||||
|
||||
addActionListener(new ActionListener()
|
||||
@@ -52,7 +49,7 @@ public class ShowTunerMenuItem extends JMenuItem
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
mTunerModel.broadcast(new TunerEvent(mTuner, TunerEvent.Event.REQUEST_MAIN_SPECTRAL_DISPLAY));
|
||||
mDiscoveredTunerModel.broadcast(new TunerEvent(mTuner, TunerEvent.Event.REQUEST_MAIN_SPECTRAL_DISPLAY));
|
||||
SystemProperties properties = SystemProperties.getInstance();
|
||||
properties.set(SpectralDisplayPanel.SPECTRAL_DISPLAY_ENABLED, true);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user