#660 Updates audio processing subsystem to use audio segments. Updates audio playback, recording and streaming to use audio segments. Adds support to UserPreferences for sound card selection and audio tone insertion during playback. Adds record preference for WAVE or MP3. Resolves issues with metadata in recordings. (#675)

This commit is contained in:
Denny Sheirer
2020-03-19 10:35:05 +00:00
committed by GitHub
parent de249c448b
commit fa16db129b
88 changed files with 4446 additions and 4183 deletions

View File

@@ -1,27 +1,25 @@
/*
* *****************************************************************************
* Copyright (C) 2014-2020 Dennis Sheirer
*
* * ******************************************************************************
* * Copyright (C) 2014-2020 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.source.tuner;
import io.github.dsheirer.record.RecorderManager;
import io.github.dsheirer.preference.UserPreferences;
import io.github.dsheirer.record.RecorderFactory;
import io.github.dsheirer.record.wave.ComplexBufferWaveRecorder;
import io.github.dsheirer.sample.Listener;
import io.github.dsheirer.sample.buffer.IReusableComplexBufferProvider;
@@ -476,11 +474,11 @@ public abstract class TunerController implements Tunable, ISourceEventProcessor,
* Records the complex I/Q buffers produced by the tuner
* @param recorderManager to obtain a baseband recorder
*/
public void startRecorder(RecorderManager recorderManager)
public void startRecorder(UserPreferences userPreferences)
{
if(!isRecording())
{
mRecorder = recorderManager.getBasebandRecorder("TUNER_" + getFrequency());
mRecorder = RecorderFactory.getBasebandRecorder("TUNER_" + getFrequency(), userPreferences);
mRecorder.setSampleRate((float)getSampleRate());
mRecorder.start();
addBufferListener(mRecorder);

View File

@@ -1,23 +1,20 @@
/*
* *****************************************************************************
* Copyright (C) 2014-2020 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.source.tuner;
@@ -26,7 +23,7 @@ import com.jidesoft.swing.JideSplitPane;
import io.github.dsheirer.gui.control.JFrequencyControl;
import io.github.dsheirer.gui.editor.Editor;
import io.github.dsheirer.gui.editor.EmptyEditor;
import io.github.dsheirer.record.RecorderManager;
import io.github.dsheirer.preference.UserPreferences;
import io.github.dsheirer.source.tuner.configuration.TunerConfiguration;
import io.github.dsheirer.source.tuner.configuration.TunerConfigurationEditor;
import io.github.dsheirer.source.tuner.configuration.TunerConfigurationFactory;
@@ -69,12 +66,12 @@ public class TunerEditor extends Editor<Tuner>
private JScrollPane mEditorScroller;
private Editor<TunerConfiguration> mEditor = new EmptyEditor<>("a tuner");
private JideSplitPane mEditorSplitPane = new JideSplitPane();
private RecorderManager mRecorderManager;
private UserPreferences mRecorderManager;
public TunerEditor(TunerConfigurationModel tunerConfigurationModel, RecorderManager recorderManager)
public TunerEditor(TunerConfigurationModel tunerConfigurationModel, UserPreferences userPreferences)
{
mTunerConfigurationModel = tunerConfigurationModel;
mRecorderManager = recorderManager;
mRecorderManager = userPreferences;
init();
}

View File

@@ -55,7 +55,6 @@ public class TunerManager
private final static Logger mLog = LoggerFactory.getLogger(TunerManager.class);
private static final int MAXIMUM_USB_2_DATA_RATE = 480000000;
private MixerManager mMixerManager;
private TunerModel mTunerModel;
private UserPreferences mUserPreferences;
private Map<Integer,List<Tuner>> mUSBBusTunerMap = new TreeMap<>();
@@ -72,9 +71,8 @@ public class TunerManager
LIBUSB_TRANSFER_PROCESSOR = new USBMasterProcessor();
}
public TunerManager(MixerManager mixerManager, TunerModel tunerModel, UserPreferences userPreferences)
public TunerManager(TunerModel tunerModel, UserPreferences userPreferences)
{
mMixerManager = mixerManager;
mTunerModel = tunerModel;
mUserPreferences = userPreferences;
@@ -563,8 +561,7 @@ public class TunerManager
*/
private MixerTunerDataLine getMixerTunerDataLine(TunerType tunerClass)
{
Collection<MixerTunerDataLine> datalines =
mMixerManager.getMixerTunerDataLines();
Collection<MixerTunerDataLine> datalines = MixerManager.getMixerTunerDataLines();
for(MixerTunerDataLine mixerTDL : datalines)
{

View File

@@ -1,23 +1,20 @@
/*
* *****************************************************************************
* Copyright (C) 2014-2020 Dennis Sheirer
*
* * ******************************************************************************
* * Copyright (C) 2014-2020 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.source.tuner;
@@ -25,7 +22,6 @@ package io.github.dsheirer.source.tuner;
import com.jidesoft.swing.JideSplitPane;
import io.github.dsheirer.preference.UserPreferences;
import io.github.dsheirer.preference.swing.JTableColumnWidthMonitor;
import io.github.dsheirer.record.RecorderManager;
import io.github.dsheirer.sample.Listener;
import io.github.dsheirer.source.tuner.TunerEvent.Event;
import io.github.dsheirer.source.tuner.recording.AddRecordingTunerDialog;
@@ -74,10 +70,10 @@ public class TunerViewPanel extends JPanel
private TunerEditor mTunerEditor;
private UserPreferences mUserPreferences;
public TunerViewPanel(TunerModel tunerModel, UserPreferences userPreferences, RecorderManager recorderManager)
public TunerViewPanel(TunerModel tunerModel, UserPreferences userPreferences)
{
mTunerModel = tunerModel;
mTunerEditor = new TunerEditor(mTunerModel.getTunerConfigurationModel(), recorderManager);
mTunerEditor = new TunerEditor(mTunerModel.getTunerConfigurationModel(), userPreferences);
mUserPreferences = userPreferences;
init();