Updates pull request from Roman Tsypuk to convert the build system from

ant to gradle.  Removes linux and windows application launch scripts and
produces an executable jar with all resources included.
This commit is contained in:
Denny
2017-12-17 07:28:03 -05:00
parent a1535c4157
commit 9316599dec
981 changed files with 8368 additions and 9049 deletions

View File

@@ -0,0 +1,99 @@
/*******************************************************************************
* SDR Trunk
* Copyright (C) 2014 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/>
******************************************************************************/
package io.github.dsheirer.audio.invert;
import io.github.dsheirer.dsp.filter.FilterFactory;
import io.github.dsheirer.dsp.filter.FloatFIRFilter;
import io.github.dsheirer.dsp.filter.Window.WindowType;
import io.github.dsheirer.dsp.mixer.Oscillator;
/**
* Based on the AudioType applied, produces normal, muted, or audio invert
* audio output.
*/
public class AudioAdapter
{
private static int mGain = 5;
private Oscillator mSineWaveGenerator;
private FloatFIRFilter mPostInversionFilter;
private FloatFIRFilter mAudioHighPassFilter;
private AudioType mAudioType = AudioType.NORMAL;
private int mSampleRate;
public AudioAdapter( int sampleRate )
{
mSampleRate = sampleRate;
mSineWaveGenerator = new Oscillator( 3000, mSampleRate );
mAudioHighPassFilter = new FloatFIRFilter(
FilterFactory.getHighPass( mSampleRate, 200, 1600, 48,
WindowType.HAMMING, true ), mGain );
mPostInversionFilter = new FloatFIRFilter(
FilterFactory.getLowPass( mSampleRate, 3000, 5000, 48,
WindowType.HAMMING, true ), mGain );
}
public void setAudioType( AudioType type )
{
if( type != null && type != mAudioType )
{
mAudioType = type;
int inversionFrequency = type.getAudioInversionFrequency();
if( inversionFrequency != 0 )
{
mSineWaveGenerator.setFrequency( inversionFrequency );;
}
}
}
public float get( float sample )
{
float retVal;
switch( mAudioType )
{
case NORMAL:
retVal = mAudioHighPassFilter.get( sample );
break;
case MUTE:
retVal = 0.0f;
break;
case INV2632:
case INV2718:
case INV2868:
case INV3023:
case INV3107:
case INV3196:
case INV3333:
case INV3339:
case INV3496:
case INV3729:
case INV4096:
default:
retVal = (float)( mPostInversionFilter.get(
mAudioHighPassFilter.get( sample ) *
mSineWaveGenerator.getFloat() ) );
mSineWaveGenerator.rotate();
break;
}
return retVal;
}
}

View File

@@ -0,0 +1,85 @@
/*******************************************************************************
* SDR Trunk
* Copyright (C) 2014 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/>
******************************************************************************/
package io.github.dsheirer.audio.invert;
import io.github.dsheirer.audio.InversionFrequency;
import io.github.dsheirer.sample.real.RealSampleListener;
import io.github.dsheirer.dsp.filter.Filters;
import io.github.dsheirer.dsp.filter.FloatFIRFilter;
import io.github.dsheirer.dsp.mixer.Oscillator;
/**
* Applies audio inversion (or un-inversion) to a broadcast of float audio samples
* by multiplying each successive sample by either a 1 or a -1 value.
*/
public class AudioInverter implements RealSampleListener
{
private Oscillator mSineWaveGenerator;
private FloatFIRFilter mPostInversionLowPassFilter;
private RealSampleListener mListener;
public AudioInverter( int inversionFrequency, int sampleRate )
{
mSineWaveGenerator = new Oscillator( inversionFrequency, sampleRate );
mPostInversionLowPassFilter = new FloatFIRFilter(
Filters.FIRLP_55TAP_48000FS_3000FC.getCoefficients(), 1.04f );
mPostInversionLowPassFilter.setListener( new FilteredSampleProcessor() );
}
public AudioInverter( InversionFrequency frequency, int sampleRate )
{
this( frequency.getFrequency(), sampleRate );
}
public void setListener( RealSampleListener listener )
{
mListener = listener;
}
@Override
public void receive( float sample )
{
//Multiply the sample by the folding frequency and then send it to
//the low pass filter
if( mPostInversionLowPassFilter != null )
{
mPostInversionLowPassFilter.receive(
sample * mSineWaveGenerator.getFloat() );
mSineWaveGenerator.rotate();
}
}
/**
* Simple class to receive the output of the FIR low pass filter and then
* send it to the registered listener(s)
*/
class FilteredSampleProcessor implements RealSampleListener
{
@Override
public void receive( float sample )
{
if( mListener != null )
{
mListener.receive( sample );
}
}
}
}

View File

@@ -0,0 +1,87 @@
/*******************************************************************************
* SDR Trunk
* Copyright (C) 2014 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/>
******************************************************************************/
package io.github.dsheirer.audio.invert;
public enum AudioType
{
NORMAL( "Normal Audio", "Clear", 0 ),
MUTE( "Muted Audio", "Muted", 0 ),
INV2500( "Inverted Audio 2500Hz", "Inverted", 2500 ),
INV2550( "Inverted Audio 2550Hz", "Inverted", 2550 ),
INV2600( "Inverted Audio 2600Hz", "Inverted", 2600 ),
INV2632( "Inverted Audio 2632Hz", "Inverted", 2632 ),
INV2675( "Inverted Audio 2675Hz", "Inverted", 2675 ),
INV2718( "Inverted Audio 2718Hz", "Inverted", 2718 ),
INV2725( "Inverted Audio 2725Hz", "Inverted", 2725 ),
INV2750( "Inverted Audio 2750Hz", "Inverted", 2750 ),
INV2760( "Inverted Audio 2760Hz", "Inverted", 2760 ),
INV2775( "Inverted Audio 2775Hz", "Inverted", 2775 ),
INV2800( "Inverted Audio 2800Hz", "Inverted", 2800 ),
INV2825( "Inverted Audio 2825Hz", "Inverted", 2825 ),
INV2868( "Inverted Audio 2868Hz", "Inverted", 2868 ),
INV3023( "Inverted Audio 3023Hz", "Inverted", 3023 ),
INV3107( "Inverted Audio 3107Hz", "Inverted", 3107 ),
INV3196( "Inverted Audio 3196Hz", "Inverted", 3196 ),
INV3333( "Inverted Audio 3333Hz", "Inverted", 3333 ),
INV3339( "Inverted Audio 3339Hz", "Inverted", 3339 ),
INV3360( "Inverted Audio 3360Hz", "Inverted", 3360 ),
INV3375( "Inverted Audio 3375Hz", "Inverted", 3375 ),
INV3400( "Inverted Audio 3400Hz", "Inverted", 3400 ),
INV3450( "Inverted Audio 3450Hz", "Inverted", 3450 ),
INV3496( "Inverted Audio 3496Hz", "Inverted", 3496 ),
INV3729( "Inverted Audio 3729Hz", "Inverted", 3729 ),
INV4096( "Inverted Audio 4096Hz", "Inverted", 4096 ),
INV4300( "Inverted Audio 4300Hz", "Inverted", 4300 ),
INV4500( "Inverted Audio 4500Hz", "Inverted", 4500 ),
INV4700( "Inverted Audio 4700Hz", "Inverted", 4700 ),
INV4900( "Inverted Audio 4900Hz", "Inverted", 4900 );
private String mDisplayString;
private String mShortDisplayString;
private int mAudioInversionFrequency;
AudioType( String displayString,
String shortDisplayString,
int inversionFrequency )
{
mDisplayString = displayString;
mShortDisplayString = shortDisplayString;
mAudioInversionFrequency = inversionFrequency;
}
public String getDisplayString()
{
return mDisplayString;
}
public String getShortDisplayString()
{
return mShortDisplayString;
}
public int getAudioInversionFrequency()
{
return mAudioInversionFrequency;
}
@Override
public String toString()
{
return mDisplayString;
}
}

View File

@@ -0,0 +1,24 @@
/*******************************************************************************
* SDR Trunk
* Copyright (C) 2014 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/>
******************************************************************************/
package io.github.dsheirer.audio.invert;
public interface IAudioTypeListener
{
public void setAudioType( AudioType type );
}