Updates PlaylistManager to use faster jackson XML serialization.

Removes native xml.bind serialization for improved compatibility with
 Java 9.

 Global optimize imports on the entire project.
This commit is contained in:
Denny
2017-12-21 07:18:26 -05:00
parent 47cc194415
commit ee6aeafa84
303 changed files with 3457 additions and 4687 deletions

View File

@@ -1,22 +1,25 @@
/*******************************************************************************
* SDR Trunk
* Copyright (C) 2014-2016 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.alias;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
import io.github.dsheirer.alias.action.AliasAction;
import io.github.dsheirer.alias.id.AliasID;
import io.github.dsheirer.alias.id.AliasIDType;
@@ -24,283 +27,184 @@ import io.github.dsheirer.alias.id.broadcast.BroadcastChannel;
import io.github.dsheirer.alias.id.nonrecordable.NonRecordable;
import io.github.dsheirer.alias.id.priority.Priority;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlSeeAlso;
import javax.xml.bind.annotation.XmlTransient;
import java.awt.*;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.TreeSet;
@XmlSeeAlso( { AliasID.class, AliasAction.class } )
@XmlRootElement( name = "alias")
@JacksonXmlRootElement(localName = "alias")
public class Alias
{
private String mList;
private String mGroup;
private String mName;
private int mColor;
private String mIconName;
private List<AliasID> mAliasIDs = new ArrayList<AliasID>();
private List<AliasAction> mAliasActions = new ArrayList<AliasAction>();
public Alias()
{
}
private String mList;
private String mGroup;
private String mName;
private int mColor;
private String mIconName;
private List<AliasID> mAliasIDs = new ArrayList<AliasID>();
private List<AliasAction> mAliasActions = new ArrayList<AliasAction>();
public Alias( String name )
{
mName = name;
}
public String toString()
{
return getName();
}
public Alias()
{
}
@XmlAttribute( name="name" )
public String getName()
{
return mName;
}
public void setName( String name )
{
mName = name;
}
public Alias(String name)
{
mName = name;
}
@XmlAttribute( name="list" )
public String getList()
{
return mList;
}
public void setList( String list )
{
mList = list;
}
public boolean hasList()
{
return mList != null;
}
public String toString()
{
return getName();
}
@XmlAttribute( name="group" )
public String getGroup()
{
return mGroup;
}
public void setGroup( String group )
{
mGroup = group;
}
public boolean hasGroup()
{
return mGroup != null;
}
@JacksonXmlProperty(isAttribute = true, localName = "name")
public String getName()
{
return mName;
}
@XmlAttribute
public int getColor()
{
return mColor;
}
public void setName(String name)
{
mName = name;
}
public void setColor( int color )
{
mColor = color;
}
@JacksonXmlProperty(isAttribute = true, localName = "list")
public String getList()
{
return mList;
}
public Color getDisplayColor()
{
return new Color( getColor() );
}
@XmlAttribute
public String getIconName()
{
return mIconName;
}
public void setIconName( String iconName )
{
mIconName = iconName;
}
@XmlElement( name="id" )
public List<AliasID> getId()
{
return mAliasIDs;
}
public void setId( ArrayList<AliasID> id )
{
mAliasIDs = id;
}
public void addAliasID( AliasID id )
{
mAliasIDs.add( id );
}
public void removeAliasID( AliasID id )
{
mAliasIDs.remove( id );
}
@XmlElement( name="action" )
public List<AliasAction> getAction()
{
return mAliasActions;
}
public void setAction( List<AliasAction> actions )
{
mAliasActions = actions;
}
public void addAliasAction( AliasAction action )
{
mAliasActions.add( action );
}
public void removeAliasAction( AliasAction action )
{
mAliasActions.remove( action );
}
public boolean hasActions()
{
return !mAliasActions.isEmpty();
}
public void setList(String list)
{
mList = list;
}
/**
* Perform any validation/cleanup actions on this alias.
*/
public void validate()
{
}
/**
* Returns the priority level of this alias, if defined, or the default priority
*/
@XmlTransient
public int getCallPriority()
{
for( AliasID id: mAliasIDs )
{
if( id.getType() == AliasIDType.PRIORITY)
{
return ((Priority)id).getPriority();
}
}
return Priority.DEFAULT_PRIORITY;
}
public boolean hasCallPriority()
{
for( AliasID id: mAliasIDs )
{
if( id.getType() == AliasIDType.PRIORITY)
{
return true;
}
}
public boolean hasList()
{
return mList != null;
}
return false;
}
@JacksonXmlProperty(isAttribute = true, localName = "group")
public String getGroup()
{
return mGroup;
}
/**
* Sets or updates the call priority
*/
public void setCallPriority( int priority )
{
if( priority == Priority.DO_NOT_MONITOR ||
( Priority.MIN_PRIORITY <= priority && priority <= Priority.MAX_PRIORITY ) )
{
for( AliasID id: mAliasIDs )
{
if( id.getType() == AliasIDType.PRIORITY)
{
((Priority)id).setPriority( priority );
return;
}
}
//If we don't find a priority id, create one
Priority p = new Priority();
p.setPriority( priority );
addAliasID( p );
}
}
public void setGroup(String group)
{
mGroup = group;
}
/**
* Inspects the alias for a non-recordable alias id. Default is true;
*/
@XmlTransient
public boolean isRecordable()
{
for( AliasID id: getId() )
{
if( id.getType() == AliasIDType.NON_RECORDABLE)
{
return false;
}
}
return true;
}
public boolean hasGroup()
{
return mGroup != null;
}
/**
* Sets or removes the non-recordable alias ID for this alias.
*/
public void setRecordable( boolean recordable )
{
if( recordable )
{
AliasID toRemove = null;
for( AliasID id: getId() )
{
if( id.getType() == AliasIDType.NON_RECORDABLE)
{
toRemove = id;
break;
}
}
if( toRemove != null )
{
removeAliasID( toRemove );
}
}
else
{
for( AliasID id: getId() )
{
if( id.getType() == AliasIDType.NON_RECORDABLE)
{
return;
}
}
addAliasID( new NonRecordable() );
}
}
@JacksonXmlProperty(isAttribute = true, localName = "color")
public int getColor()
{
return mColor;
}
public void setColor(int color)
{
mColor = color;
}
@JsonIgnore
public Color getDisplayColor()
{
return new Color(getColor());
}
@JacksonXmlProperty(isAttribute = true, localName = "iconName")
public String getIconName()
{
return mIconName;
}
public void setIconName(String iconName)
{
mIconName = iconName;
}
@JacksonXmlProperty(isAttribute = false, localName = "id")
public List<AliasID> getId()
{
return mAliasIDs;
}
public void setId(ArrayList<AliasID> id)
{
mAliasIDs = id;
}
public void addAliasID(AliasID id)
{
mAliasIDs.add(id);
}
public void removeAliasID(AliasID id)
{
mAliasIDs.remove(id);
}
@JacksonXmlProperty(isAttribute = false, localName = "action")
public List<AliasAction> getAction()
{
return mAliasActions;
}
public void setAction(List<AliasAction> actions)
{
mAliasActions = actions;
}
public void addAliasAction(AliasAction action)
{
mAliasActions.add(action);
}
public void removeAliasAction(AliasAction action)
{
mAliasActions.remove(action);
}
public boolean hasActions()
{
return !mAliasActions.isEmpty();
}
/**
* Inspects the alias for broadcast channel/streamable alias ids. Default is false;
* Perform any validation/cleanup actions on this alias.
*/
@XmlTransient
public boolean isStreamable()
public void validate()
{
for( AliasID id: getId() )
}
/**
* Returns the priority level of this alias, if defined, or the default priority
*/
@JsonIgnore
public int getCallPriority()
{
for(AliasID id : mAliasIDs)
{
if( id.getType() == AliasIDType.BROADCAST_CHANNEL)
if(id.getType() == AliasIDType.PRIORITY)
{
return ((Priority)id).getPriority();
}
}
return Priority.DEFAULT_PRIORITY;
}
public boolean hasCallPriority()
{
for(AliasID id : mAliasIDs)
{
if(id.getType() == AliasIDType.PRIORITY)
{
return true;
}
@@ -310,43 +214,138 @@ public class Alias
}
/**
* List of broadcast channels specified for this alias.
*/
@XmlTransient
public Set<BroadcastChannel> getBroadcastChannels()
{
Set<BroadcastChannel> broadcastChannels = new TreeSet<>();
* Sets or updates the call priority
*/
public void setCallPriority(int priority)
{
if(priority == Priority.DO_NOT_MONITOR ||
(Priority.MIN_PRIORITY <= priority && priority <= Priority.MAX_PRIORITY))
{
for(AliasID id : mAliasIDs)
{
if(id.getType() == AliasIDType.PRIORITY)
{
((Priority)id).setPriority(priority);
return;
}
}
for(AliasID id: getId())
{
if(id.getType() == AliasIDType.BROADCAST_CHANNEL)
{
broadcastChannels.add((BroadcastChannel)id);
}
}
//If we don't find a priority id, create one
Priority p = new Priority();
p.setPriority(priority);
addAliasID(p);
}
}
return broadcastChannels;
}
/**
* Inspects the alias for a non-recordable alias id. Default is true;
*/
@JsonIgnore
public boolean isRecordable()
{
for(AliasID id : getId())
{
if(id.getType() == AliasIDType.NON_RECORDABLE)
{
return false;
}
}
/**
* Indicates if this alias contains a broadcast channel alias id with the channel name.
*/
public boolean hasBroadcastChannel(String channel)
{
if(channel == null || channel.isEmpty())
{
return false;
}
return true;
}
for(AliasID id: getId())
{
if(id.getType() == AliasIDType.BROADCAST_CHANNEL &&
((BroadcastChannel)id).getChannelName().contentEquals(channel))
{
return true;
}
}
/**
* Sets or removes the non-recordable alias ID for this alias.
*/
public void setRecordable(boolean recordable)
{
if(recordable)
{
AliasID toRemove = null;
return false;
}
for(AliasID id : getId())
{
if(id.getType() == AliasIDType.NON_RECORDABLE)
{
toRemove = id;
break;
}
}
if(toRemove != null)
{
removeAliasID(toRemove);
}
}
else
{
for(AliasID id : getId())
{
if(id.getType() == AliasIDType.NON_RECORDABLE)
{
return;
}
}
addAliasID(new NonRecordable());
}
}
/**
* Inspects the alias for broadcast channel/streamable alias ids. Default is false;
*/
@JsonIgnore
public boolean isStreamable()
{
for(AliasID id : getId())
{
if(id.getType() == AliasIDType.BROADCAST_CHANNEL)
{
return true;
}
}
return false;
}
/**
* List of broadcast channels specified for this alias.
*/
@JsonIgnore
public Set<BroadcastChannel> getBroadcastChannels()
{
Set<BroadcastChannel> broadcastChannels = new TreeSet<>();
for(AliasID id : getId())
{
if(id.getType() == AliasIDType.BROADCAST_CHANNEL)
{
broadcastChannels.add((BroadcastChannel)id);
}
}
return broadcastChannels;
}
/**
* Indicates if this alias contains a broadcast channel alias id with the channel name.
*/
public boolean hasBroadcastChannel(String channel)
{
if(channel == null || channel.isEmpty())
{
return false;
}
for(AliasID id : getId())
{
if(id.getType() == AliasIDType.BROADCAST_CHANNEL &&
((BroadcastChannel)id).getChannelName().contentEquals(channel))
{
return true;
}
}
return false;
}
}

View File

@@ -19,12 +19,12 @@ package io.github.dsheirer.alias;
import com.jidesoft.swing.JideTabbedPane;
import io.github.dsheirer.alias.action.AliasActionEditor;
import io.github.dsheirer.alias.id.AliasIdentifierEditor;
import io.github.dsheirer.audio.broadcast.BroadcastModel;
import io.github.dsheirer.gui.editor.Editor;
import io.github.dsheirer.icon.IconManager;
import io.github.dsheirer.sample.Listener;
import net.miginfocom.swing.MigLayout;
import io.github.dsheirer.alias.id.AliasIdentifierEditor;
import javax.swing.*;
import java.awt.*;

View File

@@ -17,31 +17,25 @@
******************************************************************************/
package io.github.dsheirer.alias;
import io.github.dsheirer.alias.action.AliasActionType;
import io.github.dsheirer.alias.action.clip.ClipAction;
import io.github.dsheirer.alias.id.broadcast.BroadcastChannel;
import io.github.dsheirer.alias.id.fleetsync.FleetsyncIDEditor;
import io.github.dsheirer.alias.id.lojack.LoJackIDEditor;
import io.github.dsheirer.alias.id.mdc.MDC1200ID;
import io.github.dsheirer.alias.id.priority.Priority;
import io.github.dsheirer.alias.id.siteID.SiteID;
import io.github.dsheirer.alias.id.uniqueID.UniqueIDEditor;
import io.github.dsheirer.audio.broadcast.BroadcastModel;
import io.github.dsheirer.gui.editor.Editor;
import io.github.dsheirer.gui.editor.EmptyEditor;
import io.github.dsheirer.alias.action.AliasAction;
import io.github.dsheirer.alias.action.AliasActionType;
import io.github.dsheirer.alias.action.beep.BeepAction;
import io.github.dsheirer.alias.action.beep.BeepActionEditor;
import io.github.dsheirer.alias.action.clip.ClipAction;
import io.github.dsheirer.alias.action.clip.ClipActionEditor;
import io.github.dsheirer.alias.action.script.ScriptAction;
import io.github.dsheirer.alias.action.script.ScriptActionEditor;
import io.github.dsheirer.alias.id.AliasID;
import io.github.dsheirer.alias.id.AliasIDType;
import io.github.dsheirer.alias.id.broadcast.BroadcastChannel;
import io.github.dsheirer.alias.id.broadcast.BroadcastChannelEditor;
import io.github.dsheirer.alias.id.esn.ESNEditor;
import io.github.dsheirer.alias.id.esn.Esn;
import io.github.dsheirer.alias.id.fleetsync.FleetsyncID;
import io.github.dsheirer.alias.id.fleetsync.FleetsyncIDEditor;
import io.github.dsheirer.alias.id.lojack.LoJackFunctionAndID;
import io.github.dsheirer.alias.id.lojack.LoJackIDEditor;
import io.github.dsheirer.alias.id.mdc.MDC1200ID;
import io.github.dsheirer.alias.id.mdc.MDC1200IDEditor;
import io.github.dsheirer.alias.id.mobileID.MINEditor;
import io.github.dsheirer.alias.id.mobileID.Min;
@@ -49,13 +43,19 @@ import io.github.dsheirer.alias.id.mpt1327.MPT1327ID;
import io.github.dsheirer.alias.id.mpt1327.MPT1327IDEditor;
import io.github.dsheirer.alias.id.nonrecordable.NonRecordable;
import io.github.dsheirer.alias.id.nonrecordable.NonRecordableEditor;
import io.github.dsheirer.alias.id.priority.Priority;
import io.github.dsheirer.alias.id.priority.PriorityEditor;
import io.github.dsheirer.alias.id.siteID.SiteID;
import io.github.dsheirer.alias.id.siteID.SiteIDEditor;
import io.github.dsheirer.alias.id.status.StatusID;
import io.github.dsheirer.alias.id.status.StatusIDEditor;
import io.github.dsheirer.alias.id.talkgroup.TalkgroupID;
import io.github.dsheirer.alias.id.talkgroup.TalkgroupIDEditor;
import io.github.dsheirer.alias.id.uniqueID.UniqueID;
import io.github.dsheirer.alias.id.uniqueID.UniqueIDEditor;
import io.github.dsheirer.audio.broadcast.BroadcastModel;
import io.github.dsheirer.gui.editor.Editor;
import io.github.dsheirer.gui.editor.EmptyEditor;
public class AliasFactory
{

View File

@@ -18,6 +18,7 @@
******************************************************************************/
package io.github.dsheirer.alias;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import io.github.dsheirer.alias.id.AliasID;
import io.github.dsheirer.alias.id.WildcardID;
import io.github.dsheirer.alias.id.esn.Esn;
@@ -35,7 +36,6 @@ import io.github.dsheirer.sample.Listener;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.xml.bind.annotation.XmlAttribute;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
@@ -625,7 +625,7 @@ public class AliasList implements Listener<AliasEvent>
/**
* Alias list name
*/
@XmlAttribute
@JacksonXmlProperty(isAttribute = true, localName = "name")
public String getName()
{
return mName;

View File

@@ -1,5 +1,6 @@
package io.github.dsheirer.alias;
import io.github.dsheirer.alias.id.AliasIDType;
import io.github.dsheirer.alias.id.broadcast.BroadcastChannel;
import io.github.dsheirer.alias.id.priority.Priority;
import io.github.dsheirer.audio.broadcast.BroadcastModel;
@@ -11,7 +12,6 @@ import io.github.dsheirer.sample.Listener;
import net.miginfocom.swing.MigLayout;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import io.github.dsheirer.alias.id.AliasIDType;
import javax.swing.*;
import javax.swing.event.ChangeEvent;

View File

@@ -20,12 +20,12 @@ package io.github.dsheirer.alias;
import io.github.dsheirer.alias.action.AliasAction;
import io.github.dsheirer.alias.id.AliasID;
import io.github.dsheirer.alias.id.AliasIDType;
import io.github.dsheirer.alias.id.broadcast.BroadcastChannel;
import io.github.dsheirer.alias.id.priority.Priority;
import io.github.dsheirer.alias.id.talkgroup.TalkgroupID;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import io.github.dsheirer.alias.id.AliasIDType;
import java.util.ArrayList;
import java.util.List;

View File

@@ -18,41 +18,48 @@
******************************************************************************/
package io.github.dsheirer.alias.action;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
import io.github.dsheirer.alias.Alias;
import io.github.dsheirer.alias.action.beep.BeepAction;
import io.github.dsheirer.alias.action.clip.ClipAction;
import io.github.dsheirer.alias.action.script.ScriptAction;
import io.github.dsheirer.message.Message;
import io.github.dsheirer.alias.action.beep.BeepAction;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlSeeAlso;
import javax.xml.bind.annotation.XmlTransient;
import java.util.concurrent.ScheduledExecutorService;
/**
* Alias action defines an action to execute when an alias is detected active.
*/
@XmlSeeAlso( { BeepAction.class, ClipAction.class, ScriptAction.class } )
@XmlRootElement( name = "action" )
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type")
@JsonSubTypes({
@JsonSubTypes.Type(value = BeepAction.class, name="beepAction"),
@JsonSubTypes.Type(value = ClipAction.class, name = "clipAction"),
@JsonSubTypes.Type(value = RecurringAction.class, name = "recurringAction"),
@JsonSubTypes.Type(value = ScriptAction.class, name = "scriptAction")
})
@JacksonXmlRootElement(localName = "action")
public abstract class AliasAction
{
public AliasAction()
{
}
public AliasAction()
{
}
@XmlTransient
public abstract AliasActionType getType();
/**
* Task to execute when an alias action is defined. The message argument is
* the original message containing one or more aliases that have an alias
* action attached. The alias argument is the parent alias containing the
* alias action.
*/
public abstract void execute(ScheduledExecutorService scheduledExecutorService, Alias alias, Message message );
@JsonIgnore
public abstract AliasActionType getType();
/**
* Dismiss a persistent alias action
*/
public abstract void dismiss( boolean reset );
/**
* Task to execute when an alias action is defined. The message argument is
* the original message containing one or more aliases that have an alias
* action attached. The alias argument is the parent alias containing the
* alias action.
*/
public abstract void execute(ScheduledExecutorService scheduledExecutorService, Alias alias, Message message);
/**
* Dismiss a persistent alias action
*/
public abstract void dismiss(boolean reset);
}

View File

@@ -18,13 +18,13 @@
package io.github.dsheirer.alias.action;
import io.github.dsheirer.alias.Alias;
import io.github.dsheirer.gui.editor.Editor;
import io.github.dsheirer.gui.editor.EmptyEditor;
import net.miginfocom.swing.MigLayout;
import io.github.dsheirer.alias.AliasEvent;
import io.github.dsheirer.alias.AliasEvent.Event;
import io.github.dsheirer.alias.AliasFactory;
import io.github.dsheirer.alias.AliasModel;
import io.github.dsheirer.gui.editor.Editor;
import io.github.dsheirer.gui.editor.EmptyEditor;
import net.miginfocom.swing.MigLayout;
import javax.swing.*;
import javax.swing.event.ListSelectionEvent;

View File

@@ -1,11 +1,11 @@
package io.github.dsheirer.alias.action;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import io.github.dsheirer.alias.Alias;
import io.github.dsheirer.message.Message;
import javax.swing.*;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlTransient;
import java.awt.*;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ScheduledFuture;
@@ -14,11 +14,11 @@ import java.util.concurrent.atomic.AtomicBoolean;
public abstract class RecurringAction extends AliasAction
{
@XmlTransient
@JsonIgnore
protected AtomicBoolean mRunning = new AtomicBoolean(false);
@XmlTransient
@JsonIgnore
private ScheduledFuture<?> mPerpetualAction;
@XmlTransient
@JsonIgnore
protected ScheduledExecutorService mScheduledExecutorService;
protected Interval mInterval = Interval.ONCE;
@@ -107,7 +107,7 @@ public abstract class RecurringAction extends AliasAction
}
}
@XmlAttribute
@JacksonXmlProperty(isAttribute = true, localName = "period")
public int getPeriod()
{
return mPeriod;
@@ -118,7 +118,7 @@ public abstract class RecurringAction extends AliasAction
mPeriod = period;
}
@XmlAttribute
@JacksonXmlProperty(isAttribute = true, localName = "interval")
public Interval getInterval()
{
return mInterval;
@@ -164,8 +164,8 @@ public abstract class RecurringAction extends AliasAction
@Override
public void run()
{
/* Don't use the performThreadedAction() method, since this is
* already running in a separate thread */
/* Don't use the performThreadedAction() method, since this is
* already running in a separate thread */
performAction(mAlias, mMessage);
}
}

View File

@@ -1,5 +1,6 @@
package io.github.dsheirer.alias.action.beep;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import io.github.dsheirer.alias.Alias;
import io.github.dsheirer.alias.action.AliasActionType;
import io.github.dsheirer.alias.action.RecurringAction;
@@ -8,6 +9,7 @@ import io.github.dsheirer.message.Message;
public class BeepAction extends RecurringAction
{
@JacksonXmlProperty(isAttribute = true, localName = "type", namespace = "http://www.w3.org/2001/XMLSchema-instance")
@Override
public AliasActionType getType()
{

View File

@@ -1,107 +1,109 @@
package io.github.dsheirer.alias.action.clip;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import io.github.dsheirer.alias.Alias;
import io.github.dsheirer.alias.action.AliasActionType;
import io.github.dsheirer.alias.action.RecurringAction;
import io.github.dsheirer.message.Message;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import io.github.dsheirer.alias.action.RecurringAction;
import javax.sound.sampled.AudioInputStream;
import javax.sound.sampled.AudioSystem;
import javax.sound.sampled.Clip;
import javax.xml.bind.annotation.XmlTransient;
import java.io.File;
public class ClipAction extends RecurringAction
{
private final static Logger mLog = LoggerFactory.getLogger( ClipAction.class );
private final static Logger mLog = LoggerFactory.getLogger(ClipAction.class);
private String mFilePath;
private String mFilePath;
@XmlTransient
private Clip mClip;
public ClipAction()
{
}
@Override
public AliasActionType getType()
{
return AliasActionType.CLIP;
}
@JsonIgnore
private Clip mClip;
public String getPath()
{
return mFilePath;
}
public void setPath( String path )
{
mFilePath = path;
}
@Override
public void performAction(Alias alias, Message message )
{
try
{
play();
}
catch( Exception e )
{
mLog.error( "Couldn't play audio clip", e );
}
}
public void play() throws Exception
{
try
{
if( mFilePath != null )
{
if( mClip == null )
{
mClip = AudioSystem.getClip();
AudioInputStream ais =
AudioSystem.getAudioInputStream( new File( mFilePath ) );
mClip.open( ais );
}
public ClipAction()
{
}
if( mClip.isRunning() )
{
mClip.stop();
}
mClip.setFramePosition( 0 );
mClip.start();
}
}
catch( Exception e )
{
mClip = null;
@JacksonXmlProperty(isAttribute = true, localName = "type", namespace = "http://www.w3.org/2001/XMLSchema-instance")
@Override
public AliasActionType getType()
{
return AliasActionType.CLIP;
}
mLog.error( "Error playing sound clip [" + mFilePath + "] - " + e.getMessage() );
throw e;
}
}
public String getPath()
{
return mFilePath;
}
@Override
public String toString()
{
if( mFilePath == null )
{
return "Play Clip";
}
else
{
return "Play Clip: " + mFilePath;
}
}
public void setPath(String path)
{
mFilePath = path;
}
@Override
public void performAction(Alias alias, Message message)
{
try
{
play();
}
catch(Exception e)
{
mLog.error("Couldn't play audio clip", e);
}
}
public void play() throws Exception
{
try
{
if(mFilePath != null)
{
if(mClip == null)
{
mClip = AudioSystem.getClip();
AudioInputStream ais =
AudioSystem.getAudioInputStream(new File(mFilePath));
mClip.open(ais);
}
if(mClip.isRunning())
{
mClip.stop();
}
mClip.setFramePosition(0);
mClip.start();
}
}
catch(Exception e)
{
mClip = null;
mLog.error("Error playing sound clip [" + mFilePath + "] - " + e.getMessage());
throw e;
}
}
@Override
public String toString()
{
if(mFilePath == null)
{
return "Play Clip";
}
else
{
return "Play Clip: " + mFilePath;
}
}
}

View File

@@ -1,96 +1,98 @@
package io.github.dsheirer.alias.action.script;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import io.github.dsheirer.alias.Alias;
import io.github.dsheirer.alias.action.AliasActionType;
import io.github.dsheirer.alias.action.RecurringAction;
import io.github.dsheirer.message.Message;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import io.github.dsheirer.alias.action.RecurringAction;
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class ScriptAction extends RecurringAction
{
private final static Logger mLog = LoggerFactory.getLogger( ScriptAction.class );
private final static Logger mLog = LoggerFactory.getLogger(ScriptAction.class);
private String mScript;
private String mScript;
public ScriptAction()
{
}
@Override
public AliasActionType getType()
{
return AliasActionType.SCRIPT;
}
public ScriptAction()
{
}
public String getScript()
{
return mScript;
}
public void setScript( String script )
{
mScript = script;
}
@Override
public void performAction(Alias alias, Message message )
{
try
{
play();
}
catch( Exception e )
{
mLog.error( "Couldn't execute script [" + mScript + "]", e );
}
}
public void play() throws Exception
{
if( mScript != null )
{
ProcessBuilder pb = new ProcessBuilder( mScript );
pb.redirectErrorStream( true );
@JacksonXmlProperty(isAttribute = true, localName = "type", namespace = "http://www.w3.org/2001/XMLSchema-instance")
@Override
public AliasActionType getType()
{
return AliasActionType.SCRIPT;
}
Process p = pb.start();
int exitCode = p.waitFor();
BufferedReader reader = new BufferedReader(
new InputStreamReader( p.getInputStream() ) );
public String getScript()
{
return mScript;
}
String line = "";
public void setScript(String script)
{
mScript = script;
}
@Override
public void performAction(Alias alias, Message message)
{
try
{
play();
}
catch(Exception e)
{
mLog.error("Couldn't execute script [" + mScript + "]", e);
}
}
public void play() throws Exception
{
if(mScript != null)
{
ProcessBuilder pb = new ProcessBuilder(mScript);
pb.redirectErrorStream(true);
Process p = pb.start();
int exitCode = p.waitFor();
BufferedReader reader = new BufferedReader(
new InputStreamReader(p.getInputStream()));
String line = "";
StringBuilder sb = new StringBuilder();
while( ( line = reader.readLine() ) != null )
while((line = reader.readLine()) != null)
{
sb.append(line + "\n");
sb.append(line + "\n");
}
if( exitCode != 0 )
if(exitCode != 0)
{
throw new RuntimeException( "Exit Code: " + exitCode +
" Console:" + sb.toString() );
throw new RuntimeException("Exit Code: " + exitCode +
" Console:" + sb.toString());
}
}
}
@Override
public String toString()
{
if( mScript == null )
{
return "Run Script";
}
else
{
return "Run Script: " + mScript;
}
}
}
}
@Override
public String toString()
{
if(mScript == null)
{
return "Run Script";
}
else
{
return "Run Script: " + mScript;
}
}
}

View File

@@ -17,6 +17,10 @@
******************************************************************************/
package io.github.dsheirer.alias.id;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
import io.github.dsheirer.alias.id.broadcast.BroadcastChannel;
import io.github.dsheirer.alias.id.esn.Esn;
import io.github.dsheirer.alias.id.fleetsync.FleetsyncID;
@@ -30,28 +34,35 @@ import io.github.dsheirer.alias.id.siteID.SiteID;
import io.github.dsheirer.alias.id.status.StatusID;
import io.github.dsheirer.alias.id.talkgroup.TalkgroupID;
import io.github.dsheirer.alias.id.uniqueID.UniqueID;
import io.github.dsheirer.playlist.version1.Group;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlSeeAlso;
import javax.xml.bind.annotation.XmlTransient;
@SuppressWarnings( "deprecation" )
@XmlSeeAlso( {BroadcastChannel.class, Esn.class, FleetsyncID.class, Group.class, LoJackFunctionAndID.class,
MDC1200ID.class, Min.class, MPT1327ID.class, NonRecordable.class,
Priority.class, SiteID.class, StatusID.class, TalkgroupID.class,
UniqueID.class } )
@XmlRootElement( name = "id" )
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include= JsonTypeInfo.As.PROPERTY, property="type")
@JsonSubTypes({
@JsonSubTypes.Type(value=BroadcastChannel.class, name="broadcastChannel"),
@JsonSubTypes.Type(value=Esn.class, name="esn"),
@JsonSubTypes.Type(value=FleetsyncID.class, name="fleetsyncID"),
@JsonSubTypes.Type(value = LoJackFunctionAndID.class, name = "loJackFunctionAndID"),
@JsonSubTypes.Type(value = MDC1200ID.class, name = "mdc1200ID"),
@JsonSubTypes.Type(value = Min.class, name = "min"),
@JsonSubTypes.Type(value = MPT1327ID.class, name = "mpt1327ID"),
@JsonSubTypes.Type(value = NonRecordable.class, name = "nonRecordable"),
@JsonSubTypes.Type(value = Priority.class, name = "priority"),
@JsonSubTypes.Type(value = SiteID.class, name = "siteID"),
@JsonSubTypes.Type(value = StatusID.class, name = "statusID"),
@JsonSubTypes.Type(value = TalkgroupID.class, name = "talkgroupID"),
@JsonSubTypes.Type(value = UniqueID.class, name = "uniqueID")
})
@JacksonXmlRootElement( localName = "id" )
public abstract class AliasID
{
public AliasID()
{
}
@JsonIgnore
public abstract AliasIDType getType();
public abstract boolean matches( AliasID id );
@XmlTransient
@JsonIgnore
public abstract boolean isValid();
}

View File

@@ -18,11 +18,10 @@
******************************************************************************/
package io.github.dsheirer.alias.id.broadcast;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import io.github.dsheirer.alias.id.AliasID;
import io.github.dsheirer.alias.id.AliasIDType;
import javax.xml.bind.annotation.XmlAttribute;
public class BroadcastChannel extends AliasID implements Comparable<BroadcastChannel>
{
private String mChannelName;
@@ -83,7 +82,7 @@ public class BroadcastChannel extends AliasID implements Comparable<BroadcastCha
/**
* Name of the broadcastAudio channel configuration
*/
@XmlAttribute(name = "channel")
@JacksonXmlProperty(isAttribute = true, localName = "channel")
public String getChannelName()
{
return mChannelName;
@@ -97,6 +96,7 @@ public class BroadcastChannel extends AliasID implements Comparable<BroadcastCha
mChannelName = channel;
}
@JacksonXmlProperty(isAttribute = true, localName = "type", namespace = "http://www.w3.org/2001/XMLSchema-instance")
@Override
public AliasIDType getType()
{

View File

@@ -18,11 +18,11 @@
******************************************************************************/
package io.github.dsheirer.alias.id.broadcast;
import io.github.dsheirer.alias.id.AliasID;
import io.github.dsheirer.audio.broadcast.BroadcastConfiguration;
import io.github.dsheirer.audio.broadcast.BroadcastModel;
import io.github.dsheirer.gui.editor.DocumentListenerEditor;
import net.miginfocom.swing.MigLayout;
import io.github.dsheirer.alias.id.AliasID;
import javax.swing.*;
import java.awt.*;

View File

@@ -17,9 +17,9 @@
******************************************************************************/
package io.github.dsheirer.alias.id.esn;
import io.github.dsheirer.alias.id.AliasID;
import io.github.dsheirer.gui.editor.DocumentListenerEditor;
import net.miginfocom.swing.MigLayout;
import io.github.dsheirer.alias.id.AliasID;
import javax.swing.*;
import java.awt.*;

View File

@@ -17,11 +17,10 @@
******************************************************************************/
package io.github.dsheirer.alias.id.esn;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import io.github.dsheirer.alias.id.AliasID;
import io.github.dsheirer.alias.id.AliasIDType;
import javax.xml.bind.annotation.XmlAttribute;
public class Esn extends AliasID
{
private String mEsn;
@@ -30,7 +29,7 @@ public class Esn extends AliasID
{
}
@XmlAttribute
@JacksonXmlProperty(isAttribute = true, localName = "esn")
public String getEsn()
{
return mEsn;
@@ -70,6 +69,7 @@ public class Esn extends AliasID
return retVal;
}
@JacksonXmlProperty(isAttribute = true, localName = "type", namespace = "http://www.w3.org/2001/XMLSchema-instance")
@Override
public AliasIDType getType()
{

View File

@@ -17,12 +17,10 @@
******************************************************************************/
package io.github.dsheirer.alias.id.fleetsync;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import io.github.dsheirer.alias.id.AliasID;
import io.github.dsheirer.alias.id.AliasIDType;
import javax.xml.bind.annotation.XmlAttribute;
public class FleetsyncID extends AliasID
{
private String mID;
@@ -31,7 +29,7 @@ public class FleetsyncID extends AliasID
{
}
@XmlAttribute
@JacksonXmlProperty(isAttribute = true, localName = "ident")
public String getIdent()
{
return mID;
@@ -71,6 +69,7 @@ public class FleetsyncID extends AliasID
return retVal;
}
@JacksonXmlProperty(isAttribute = true, localName = "type", namespace = "http://www.w3.org/2001/XMLSchema-instance")
@Override
public AliasIDType getType()
{

View File

@@ -17,11 +17,11 @@
******************************************************************************/
package io.github.dsheirer.alias.id.fleetsync;
import io.github.dsheirer.alias.id.AliasID;
import io.github.dsheirer.gui.editor.DocumentListenerEditor;
import net.miginfocom.swing.MigLayout;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import io.github.dsheirer.alias.id.AliasID;
import javax.swing.*;
import javax.swing.text.MaskFormatter;

View File

@@ -1,138 +1,151 @@
/*******************************************************************************
* SDR Trunk
* Copyright (C) 2015 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.alias.id.lojack;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import io.github.dsheirer.alias.id.AliasID;
import io.github.dsheirer.alias.id.AliasIDType;
import io.github.dsheirer.module.decode.lj1200.LJ1200Message;
import javax.xml.bind.annotation.XmlAttribute;
public class LoJackFunctionAndID extends AliasID
{
private LJ1200Message.Function mFunction = LJ1200Message.Function.F0_UNKNOWN;
private String mID = "*****";
public LoJackFunctionAndID()
{
}
private LJ1200Message.Function mFunction = LJ1200Message.Function.F0_UNKNOWN;
private String mID = "*****";
@XmlAttribute( name="id" )
public String getID()
{
return mID;
}
public void setID( String id )
{
mID = id;
}
@XmlAttribute( name="function" )
public LJ1200Message.Function getFunction()
{
return mFunction;
}
public void setFunction( LJ1200Message.Function function )
{
mFunction = function;
}
@Override
public boolean isValid()
{
return mFunction != null && mID != null;
}
public String toString()
{
return "LoJack FUNC: " + mFunction.getLabel() + " ID:" + ( mID == null ? "" : mID );
}
/**
* Indicates if the function and id combination match this alias id
*/
public boolean matches(LJ1200Message.Function function, String id )
{
return mFunction == function &&
mID != null &&
id != null &&
id.matches( mID.replace( "*", ".?" ) );
}
@Override
public boolean matches( AliasID id )
public LoJackFunctionAndID()
{
boolean retVal = false;
if( mID != null && id instanceof LoJackFunctionAndID )
{
LoJackFunctionAndID otherLojack = (LoJackFunctionAndID)id;
if( otherLojack.getFunction() == mFunction )
{
//Create a pattern - replace * wildcards with regex single-char wildcard
String pattern = mID.replace( "*", ".?" );
retVal = otherLojack.getID().matches( pattern );
}
}
return retVal;
}
@Override
@JacksonXmlProperty(isAttribute = true, localName = "id")
public String getID()
{
return mID;
}
public void setID(String id)
{
mID = id;
}
@JacksonXmlProperty(isAttribute = true, localName = "function")
public LJ1200Message.Function getFunction()
{
return mFunction;
}
public void setFunction(LJ1200Message.Function function)
{
mFunction = function;
}
@Override
public boolean isValid()
{
return mFunction != null && mID != null;
}
public String toString()
{
return "LoJack FUNC: " + mFunction.getLabel() + " ID:" + (mID == null ? "" : mID);
}
/**
* Indicates if the function and id combination match this alias id
*/
public boolean matches(LJ1200Message.Function function, String id)
{
return mFunction == function &&
mID != null &&
id != null &&
id.matches(mID.replace("*", ".?"));
}
@Override
public boolean matches(AliasID id)
{
boolean retVal = false;
if(mID != null && id instanceof LoJackFunctionAndID)
{
LoJackFunctionAndID otherLojack = (LoJackFunctionAndID)id;
if(otherLojack.getFunction() == mFunction)
{
//Create a pattern - replace * wildcards with regex single-char wildcard
String pattern = mID.replace("*", ".?");
retVal = otherLojack.getID().matches(pattern);
}
}
return retVal;
}
@JacksonXmlProperty(isAttribute = true, localName = "type", namespace = "http://www.w3.org/2001/XMLSchema-instance")
@Override
public AliasIDType getType()
{
return AliasIDType.LOJACK;
return AliasIDType.LOJACK;
}
@Override
public int hashCode()
{
final int prime = 31;
int result = 1;
result = prime * result
+ ( ( mFunction == null ) ? 0 : mFunction.hashCode() );
result = prime * result + ( ( mID == null ) ? 0 : mID.hashCode() );
return result;
}
@Override
public boolean equals( Object obj )
{
if ( this == obj )
return true;
if ( obj == null )
return false;
if ( getClass() != obj.getClass() )
return false;
LoJackFunctionAndID other = (LoJackFunctionAndID) obj;
if ( mFunction != other.mFunction )
return false;
if ( mID == null )
{
if ( other.mID != null )
return false;
} else if ( !mID.equals( other.mID ) )
return false;
return true;
}
@Override
public int hashCode()
{
final int prime = 31;
int result = 1;
result = prime * result
+ ((mFunction == null) ? 0 : mFunction.hashCode());
result = prime * result + ((mID == null) ? 0 : mID.hashCode());
return result;
}
@Override
public boolean equals(Object obj)
{
if(this == obj)
{
return true;
}
if(obj == null)
{
return false;
}
if(getClass() != obj.getClass())
{
return false;
}
LoJackFunctionAndID other = (LoJackFunctionAndID)obj;
if(mFunction != other.mFunction)
{
return false;
}
if(mID == null)
{
if(other.mID != null)
{
return false;
}
}
else if(!mID.equals(other.mID))
{
return false;
}
return true;
}
}

View File

@@ -17,11 +17,11 @@
******************************************************************************/
package io.github.dsheirer.alias.id.lojack;
import io.github.dsheirer.gui.editor.DocumentListenerEditor;
import net.miginfocom.swing.MigLayout;
import io.github.dsheirer.alias.id.AliasID;
import io.github.dsheirer.gui.editor.DocumentListenerEditor;
import io.github.dsheirer.module.decode.lj1200.LJ1200Message;
import io.github.dsheirer.module.decode.lj1200.LJ1200Message.Function;
import net.miginfocom.swing.MigLayout;
import javax.swing.*;
import javax.swing.text.MaskFormatter;

View File

@@ -1,80 +1,79 @@
/*******************************************************************************
* 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.alias.id.mdc;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import io.github.dsheirer.alias.id.AliasID;
import io.github.dsheirer.alias.id.AliasIDType;
import javax.xml.bind.annotation.XmlAttribute;
public class MDC1200ID extends AliasID
{
private String mID;
public MDC1200ID()
{
}
private String mID;
@XmlAttribute
public String getIdent()
{
return mID;
}
public void setIdent( String ident )
{
mID = ident;
}
@Override
public boolean isValid()
{
return mID != null;
}
public String toString()
{
return "MDC-1200: " + mID;
}
@Override
public boolean matches( AliasID id )
public MDC1200ID()
{
boolean retVal = false;
if( mID != null && id instanceof MDC1200ID )
{
MDC1200ID tgid = (MDC1200ID)id;
//Create a pattern - replace * wildcards with regex single-char wildcard
String pattern = mID.replace( "*", ".?" );
retVal = tgid.getIdent().matches( pattern );
}
return retVal;
}
@Override
@JacksonXmlProperty(isAttribute = true, localName = "ident")
public String getIdent()
{
return mID;
}
public void setIdent(String ident)
{
mID = ident;
}
@Override
public boolean isValid()
{
return mID != null;
}
public String toString()
{
return "MDC-1200: " + mID;
}
@Override
public boolean matches(AliasID id)
{
boolean retVal = false;
if(mID != null && id instanceof MDC1200ID)
{
MDC1200ID tgid = (MDC1200ID)id;
//Create a pattern - replace * wildcards with regex single-char wildcard
String pattern = mID.replace("*", ".?");
retVal = tgid.getIdent().matches(pattern);
}
return retVal;
}
@JacksonXmlProperty(isAttribute = true, localName = "type", namespace = "http://www.w3.org/2001/XMLSchema-instance")
@Override
public AliasIDType getType()
{
return AliasIDType.MDC1200;
return AliasIDType.MDC1200;
}
}

View File

@@ -17,9 +17,9 @@
******************************************************************************/
package io.github.dsheirer.alias.id.mdc;
import io.github.dsheirer.alias.id.AliasID;
import io.github.dsheirer.gui.editor.DocumentListenerEditor;
import net.miginfocom.swing.MigLayout;
import io.github.dsheirer.alias.id.AliasID;
import javax.swing.*;
import javax.swing.text.MaskFormatter;

View File

@@ -1,82 +1,82 @@
/*******************************************************************************
* 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.alias.id.mobileID;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import io.github.dsheirer.alias.id.AliasID;
import io.github.dsheirer.alias.id.AliasIDType;
import javax.xml.bind.annotation.XmlAttribute;
/**
* Mobile ID Number
*/
public class Min extends AliasID
{
private String mMin;
public Min()
{
}
private String mMin;
@XmlAttribute
public String getMin()
{
return mMin;
}
public void setMin( String min )
{
mMin = min;
}
@Override
public boolean isValid()
{
return mMin != null;
}
public String toString()
{
return "MIN: " + mMin;
}
@Override
public boolean matches( AliasID id )
public Min()
{
boolean retVal = false;
if( mMin != null && id instanceof Min )
{
Min min = (Min)id;
//Create a pattern - replace * wildcards with regex single-char wildcard
String pattern = mMin.replace( "*", ".?" );
retVal = min.getMin().matches( pattern );
}
return retVal;
}
@Override
@JacksonXmlProperty(isAttribute = true, localName = "min")
public String getMin()
{
return mMin;
}
public void setMin(String min)
{
mMin = min;
}
@Override
public boolean isValid()
{
return mMin != null;
}
public String toString()
{
return "MIN: " + mMin;
}
@Override
public boolean matches(AliasID id)
{
boolean retVal = false;
if(mMin != null && id instanceof Min)
{
Min min = (Min)id;
//Create a pattern - replace * wildcards with regex single-char wildcard
String pattern = mMin.replace("*", ".?");
retVal = min.getMin().matches(pattern);
}
return retVal;
}
@JacksonXmlProperty(isAttribute = true, localName = "type", namespace = "http://www.w3.org/2001/XMLSchema-instance")
@Override
public AliasIDType getType()
{
return AliasIDType.MIN;
return AliasIDType.MIN;
}
}

View File

@@ -1,79 +1,79 @@
/*******************************************************************************
* 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.alias.id.mpt1327;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import io.github.dsheirer.alias.id.AliasID;
import io.github.dsheirer.alias.id.AliasIDType;
import javax.xml.bind.annotation.XmlAttribute;
public class MPT1327ID extends AliasID
{
private String mID;
public MPT1327ID()
{
}
private String mID;
@XmlAttribute
public String getIdent()
{
return mID;
}
public void setIdent( String ident )
{
mID = ident;
}
@Override
public boolean isValid()
{
return mID != null;
}
public String toString()
{
return "MPT-1327: " + mID;
}
@Override
public boolean matches( AliasID id )
public MPT1327ID()
{
boolean retVal = false;
if( mID != null && id instanceof MPT1327ID )
{
MPT1327ID tgid = (MPT1327ID)id;
//Create a pattern - replace * wildcards with regex single-char wildcard
String pattern = mID.replace( "*", ".?" );
retVal = tgid.getIdent().matches( pattern );
}
return retVal;
}
@Override
@JacksonXmlProperty(isAttribute = true, localName = "ident")
public String getIdent()
{
return mID;
}
public void setIdent(String ident)
{
mID = ident;
}
@Override
public boolean isValid()
{
return mID != null;
}
public String toString()
{
return "MPT-1327: " + mID;
}
@Override
public boolean matches(AliasID id)
{
boolean retVal = false;
if(mID != null && id instanceof MPT1327ID)
{
MPT1327ID tgid = (MPT1327ID)id;
//Create a pattern - replace * wildcards with regex single-char wildcard
String pattern = mID.replace("*", ".?");
retVal = tgid.getIdent().matches(pattern);
}
return retVal;
}
@JacksonXmlProperty(isAttribute = true, localName = "type", namespace = "http://www.w3.org/2001/XMLSchema-instance")
@Override
public AliasIDType getType()
{
return AliasIDType.MPT1327;
return AliasIDType.MPT1327;
}
}

View File

@@ -17,9 +17,9 @@
******************************************************************************/
package io.github.dsheirer.alias.id.mpt1327;
import io.github.dsheirer.alias.id.AliasID;
import io.github.dsheirer.gui.editor.DocumentListenerEditor;
import net.miginfocom.swing.MigLayout;
import io.github.dsheirer.alias.id.AliasID;
import javax.swing.*;
import javax.swing.text.MaskFormatter;

View File

@@ -1,31 +1,33 @@
package io.github.dsheirer.alias.id.nonrecordable;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import io.github.dsheirer.alias.id.AliasID;
import io.github.dsheirer.alias.id.AliasIDType;
public class NonRecordable extends AliasID
{
@Override
public AliasIDType getType()
{
return AliasIDType.NON_RECORDABLE;
}
@JacksonXmlProperty(isAttribute = true, localName = "type", namespace = "http://www.w3.org/2001/XMLSchema-instance")
@Override
public AliasIDType getType()
{
return AliasIDType.NON_RECORDABLE;
}
@Override
public boolean isValid()
{
return true;
}
@Override
public boolean isValid()
{
return true;
}
@Override
public boolean matches( AliasID id )
{
return false;
}
@Override
public String toString()
{
return "Audio Non-Recordable";
}
@Override
public boolean matches(AliasID id)
{
return false;
}
@Override
public String toString()
{
return "Audio Non-Recordable";
}
}

View File

@@ -17,9 +17,9 @@
******************************************************************************/
package io.github.dsheirer.alias.id.nonrecordable;
import io.github.dsheirer.alias.id.AliasID;
import io.github.dsheirer.gui.editor.DocumentListenerEditor;
import net.miginfocom.swing.MigLayout;
import io.github.dsheirer.alias.id.AliasID;
import javax.swing.*;
import java.awt.*;

View File

@@ -1,83 +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.alias.id.priority;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import io.github.dsheirer.alias.id.AliasID;
import io.github.dsheirer.alias.id.AliasIDType;
import javax.xml.bind.annotation.XmlAttribute;
/**
* Specifies an (audio) priority level for this alias.
*/
public class Priority extends AliasID
{
public static final int DO_NOT_MONITOR = -1;
public static final int SELECTED_PRIORITY = 0;
public static final int MIN_PRIORITY = 1;
public static final int MAX_PRIORITY = 100;
public static final int DEFAULT_PRIORITY = 100;
private int mPriority = DEFAULT_PRIORITY;
public Priority()
{
}
public static final int DO_NOT_MONITOR = -1;
public static final int SELECTED_PRIORITY = 0;
public static final int MIN_PRIORITY = 1;
public static final int MAX_PRIORITY = 100;
public static final int DEFAULT_PRIORITY = 100;
@Override
public boolean isValid()
{
return true;
}
private int mPriority = DEFAULT_PRIORITY;
/**
* Indicates the associated alias should not be monitored or tracked.
*/
public boolean isDoNotMonitor()
{
return mPriority == DO_NOT_MONITOR;
}
@XmlAttribute
public int getPriority()
{
return mPriority;
}
public void setPriority( int priority )
{
mPriority = priority;
}
public String toString()
{
return "Audio Priority: " + ( isDoNotMonitor() ? "Do Not Monitor" : mPriority );
}
@Override
public boolean matches( AliasID id )
public Priority()
{
return false;
}
@Override
@Override
public boolean isValid()
{
return true;
}
/**
* Indicates the associated alias should not be monitored or tracked.
*/
@JsonIgnore
public boolean isDoNotMonitor()
{
return mPriority == DO_NOT_MONITOR;
}
@JacksonXmlProperty(isAttribute = true, localName = "priority")
public int getPriority()
{
return mPriority;
}
public void setPriority(int priority)
{
mPriority = priority;
}
public String toString()
{
return "Audio Priority: " + (isDoNotMonitor() ? "Do Not Monitor" : mPriority);
}
@Override
public boolean matches(AliasID id)
{
return false;
}
@JacksonXmlProperty(isAttribute = true, localName = "type", namespace = "http://www.w3.org/2001/XMLSchema-instance")
@Override
public AliasIDType getType()
{
return AliasIDType.PRIORITY;
return AliasIDType.PRIORITY;
}
}

View File

@@ -1,70 +1,68 @@
/*******************************************************************************
* 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.alias.id.siteID;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import io.github.dsheirer.alias.id.AliasID;
import io.github.dsheirer.alias.id.AliasIDType;
import io.github.dsheirer.alias.id.AliasID;
import io.github.dsheirer.alias.id.AliasIDType;
import javax.xml.bind.annotation.XmlAttribute;
public class SiteID extends AliasID
{
private String mSite;
public SiteID()
{
}
private String mSite;
@XmlAttribute
public String getSite()
{
return mSite;
}
public void setSite( String site )
{
mSite = site;
}
@Override
public boolean isValid()
{
return mSite != null;
}
public String toString()
{
return "Site: " + mSite;
}
@Override
public boolean matches( AliasID otherID )
public SiteID()
{
return otherID != null &&
otherID instanceof SiteID &&
getSite().contentEquals( ( (SiteID)otherID).getSite() );
}
@Override
@JacksonXmlProperty(isAttribute = true, localName = "site")
public String getSite()
{
return mSite;
}
public void setSite(String site)
{
mSite = site;
}
@Override
public boolean isValid()
{
return mSite != null;
}
public String toString()
{
return "Site: " + mSite;
}
@Override
public boolean matches(AliasID otherID)
{
return otherID != null &&
otherID instanceof SiteID &&
getSite().contentEquals(((SiteID)otherID).getSite());
}
@JacksonXmlProperty(isAttribute = true, localName = "type", namespace = "http://www.w3.org/2001/XMLSchema-instance")
@Override
public AliasIDType getType()
{
return AliasIDType.SITE;
return AliasIDType.SITE;
}
}

View File

@@ -17,9 +17,9 @@
******************************************************************************/
package io.github.dsheirer.alias.id.siteID;
import io.github.dsheirer.alias.id.AliasID;
import io.github.dsheirer.gui.editor.DocumentListenerEditor;
import net.miginfocom.swing.MigLayout;
import io.github.dsheirer.alias.id.AliasID;
import javax.swing.*;
import java.awt.*;

View File

@@ -1,75 +1,75 @@
/*******************************************************************************
* 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.alias.id.status;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import io.github.dsheirer.alias.id.AliasID;
import io.github.dsheirer.alias.id.AliasIDType;
import javax.xml.bind.annotation.XmlAttribute;
public class StatusID extends AliasID
{
private int mStatus;
public StatusID()
{
}
private int mStatus;
@XmlAttribute
public int getStatus()
{
return mStatus;
}
public void setStatus( int status )
{
this.mStatus = status;
}
@Override
public boolean isValid()
{
return true;
}
public String toString()
{
return "Status: " + String.format( "%03d", mStatus );
}
@Override
public boolean matches( AliasID id )
public StatusID()
{
boolean retVal = false;
if( id instanceof StatusID )
{
StatusID statusId = (StatusID)id;
retVal = ( mStatus == statusId.getStatus() );
}
return retVal;
}
@Override
@JacksonXmlProperty(isAttribute = true, localName = "status")
public int getStatus()
{
return mStatus;
}
public void setStatus(int status)
{
this.mStatus = status;
}
@Override
public boolean isValid()
{
return true;
}
public String toString()
{
return "Status: " + String.format("%03d", mStatus);
}
@Override
public boolean matches(AliasID id)
{
boolean retVal = false;
if(id instanceof StatusID)
{
StatusID statusId = (StatusID)id;
retVal = (mStatus == statusId.getStatus());
}
return retVal;
}
@JacksonXmlProperty(isAttribute = true, localName = "type", namespace = "http://www.w3.org/2001/XMLSchema-instance")
@Override
public AliasIDType getType()
{
return AliasIDType.STATUS;
return AliasIDType.STATUS;
}
}

View File

@@ -18,12 +18,10 @@
package io.github.dsheirer.alias.id.talkgroup;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import io.github.dsheirer.alias.id.AliasID;
import io.github.dsheirer.alias.id.AliasIDType;
import javax.xml.bind.annotation.XmlAttribute;
public class TalkgroupID extends AliasID
{
private String mTalkgroup;
@@ -38,7 +36,7 @@ public class TalkgroupID extends AliasID
mTalkgroup = talkgroup;
}
@XmlAttribute
@JacksonXmlProperty(isAttribute = true, localName = "talkgroup")
public String getTalkgroup()
{
return mTalkgroup;
@@ -71,7 +69,7 @@ public class TalkgroupID extends AliasID
if(id instanceof TalkgroupID)
{
TalkgroupID tgid = (TalkgroupID) id;
TalkgroupID tgid = (TalkgroupID)id;
//Create a pattern - replace * wildcards with regex single-char wildcard
String pattern = mTalkgroup.replace("*", ".?");
@@ -82,6 +80,7 @@ public class TalkgroupID extends AliasID
return retVal;
}
@JacksonXmlProperty(isAttribute = true, localName = "type", namespace = "http://www.w3.org/2001/XMLSchema-instance")
@Override
public AliasIDType getType()
{

View File

@@ -17,9 +17,9 @@
******************************************************************************/
package io.github.dsheirer.alias.id.talkgroup;
import io.github.dsheirer.alias.id.AliasID;
import io.github.dsheirer.gui.editor.DocumentListenerEditor;
import net.miginfocom.swing.MigLayout;
import io.github.dsheirer.alias.id.AliasID;
import javax.swing.*;
import java.awt.*;

View File

@@ -1,75 +1,75 @@
/*******************************************************************************
* 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.alias.id.uniqueID;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import io.github.dsheirer.alias.id.AliasID;
import io.github.dsheirer.alias.id.AliasIDType;
import javax.xml.bind.annotation.XmlAttribute;
public class UniqueID extends AliasID
{
private int mUid;
public UniqueID()
{
}
private int mUid;
@XmlAttribute
public int getUid()
{
return mUid;
}
public void setUid( int uid )
{
this.mUid = uid;
}
@Override
public boolean isValid()
{
return true;
}
public String toString()
{
return "UniqueID: " + mUid;
}
@Override
public boolean matches( AliasID id )
public UniqueID()
{
boolean retVal = false;
if( id instanceof UniqueID )
{
UniqueID uid = (UniqueID)id;
retVal = mUid == uid.getUid();
}
return retVal;
}
@Override
@JacksonXmlProperty(isAttribute = true, localName = "uid")
public int getUid()
{
return mUid;
}
public void setUid(int uid)
{
this.mUid = uid;
}
@Override
public boolean isValid()
{
return true;
}
public String toString()
{
return "UniqueID: " + mUid;
}
@Override
public boolean matches(AliasID id)
{
boolean retVal = false;
if(id instanceof UniqueID)
{
UniqueID uid = (UniqueID)id;
retVal = mUid == uid.getUid();
}
return retVal;
}
@JacksonXmlProperty(isAttribute = true, localName = "type", namespace = "http://www.w3.org/2001/XMLSchema-instance")
@Override
public AliasIDType getType()
{
return AliasIDType.LTR_NET_UID;
return AliasIDType.LTR_NET_UID;
}
}

View File

@@ -17,9 +17,9 @@
******************************************************************************/
package io.github.dsheirer.alias.id.uniqueID;
import io.github.dsheirer.alias.id.AliasID;
import io.github.dsheirer.gui.editor.DocumentListenerEditor;
import net.miginfocom.swing.MigLayout;
import io.github.dsheirer.alias.id.AliasID;
import javax.swing.*;
import java.awt.*;

View File

@@ -18,6 +18,7 @@
******************************************************************************/
package io.github.dsheirer.audio;
import io.github.dsheirer.alias.Alias;
import io.github.dsheirer.audio.output.AudioOutput;
import io.github.dsheirer.channel.metadata.Metadata;
import io.github.dsheirer.icon.IconManager;
@@ -30,7 +31,6 @@ import io.github.dsheirer.settings.SettingsManager;
import net.miginfocom.swing.MigLayout;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import io.github.dsheirer.alias.Alias;
import javax.swing.*;
import java.awt.*;

View File

@@ -18,25 +18,25 @@
******************************************************************************/
package io.github.dsheirer.audio.broadcast;
import io.github.dsheirer.audio.broadcast.broadcastify.BroadcastifyConfiguration;
import io.github.dsheirer.audio.broadcast.icecast.IcecastHTTPConfiguration;
import io.github.dsheirer.audio.broadcast.icecast.IcecastTCPConfiguration;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
import io.github.dsheirer.audio.broadcast.icecast.IcecastConfiguration;
import io.github.dsheirer.audio.broadcast.shoutcast.v1.ShoutcastV1Configuration;
import io.github.dsheirer.audio.broadcast.shoutcast.v2.ShoutcastV2Configuration;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlSeeAlso;
import javax.xml.bind.annotation.XmlTransient;
import java.net.InetSocketAddress;
import java.net.SocketAddress;
@XmlSeeAlso({BroadcastifyConfiguration.class,
IcecastTCPConfiguration.class,
IcecastHTTPConfiguration.class,
ShoutcastV1Configuration.class,
ShoutcastV2Configuration.class})
@XmlRootElement(name = "stream")
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type")
@JsonSubTypes({
@JsonSubTypes.Type(value = IcecastConfiguration.class, name="icecastConfiguration"),
@JsonSubTypes.Type(value = ShoutcastV1Configuration.class, name="shoutcastV1Configuration"),
@JsonSubTypes.Type(value = ShoutcastV2Configuration.class, name="shoutcastV2Configuration"),
})
@JacksonXmlRootElement(localName = "stream")
public abstract class BroadcastConfiguration
{
private BroadcastFormat mBroadcastFormat = BroadcastFormat.MP3;
@@ -69,13 +69,18 @@ public abstract class BroadcastConfiguration
/**
* Broadcast server type
*/
@XmlAttribute(name = "type")
@JacksonXmlProperty(isAttribute = true, localName = "type", namespace = "http://www.w3.org/2001/XMLSchema-instance")
public abstract BroadcastServerType getBroadcastServerType();
private void setBroadcastServerType(BroadcastServerType type)
{
//Do nothing
}
/**
* Name identifying this broadcastAudio configuration.
*/
@XmlAttribute(name = "name")
@JacksonXmlProperty(isAttribute = true, localName = "name")
public String getName()
{
return mName;
@@ -102,7 +107,7 @@ public abstract class BroadcastConfiguration
/**
* BROADCAST server host name.
*/
@XmlAttribute(name = "host")
@JacksonXmlProperty(isAttribute = true, localName = "host")
public String getHost()
{
return mHost;
@@ -129,7 +134,7 @@ public abstract class BroadcastConfiguration
/**
* BROADCAST server port number;
*/
@XmlAttribute(name = "port")
@JacksonXmlProperty(isAttribute = true, localName = "port")
public int getPort()
{
return mPort;
@@ -153,6 +158,7 @@ public abstract class BroadcastConfiguration
return mPort > 0;
}
@JsonIgnore
public SocketAddress getAddress()
{
return new InetSocketAddress(getHost(), getPort());
@@ -161,7 +167,7 @@ public abstract class BroadcastConfiguration
/**
* Password to authenticate with the streaming server.
*/
@XmlAttribute(name = "password")
@JacksonXmlProperty(isAttribute = true, localName = "password")
public String getPassword()
{
return mPassword;
@@ -188,7 +194,7 @@ public abstract class BroadcastConfiguration
/**
* Audio broadcastAudio content type (e.g. mp3)
*/
@XmlAttribute(name = "format")
@JacksonXmlProperty(isAttribute = false, localName = "format")
public BroadcastFormat getBroadcastFormat()
{
return mBroadcastFormat;
@@ -202,7 +208,7 @@ public abstract class BroadcastConfiguration
/**
* Audio broadcastAudio delay from recording start until the audio file is broadcastAudio to the server.
*/
@XmlAttribute(name = "delay")
@JacksonXmlProperty(isAttribute = true, localName = "delay")
public long getDelay()
{
return mDelay;
@@ -222,7 +228,7 @@ public abstract class BroadcastConfiguration
* queue awaiting streaming before it is purged from the queue. This value is in addition to the delay setting.
* @return age in milliseconds
*/
@XmlAttribute(name = "maximum_recording_age")
@JacksonXmlProperty(isAttribute = true, localName = "maximum_recording_age")
public long getMaximumRecordingAge()
{
return mMaximumRecordingAge;
@@ -241,7 +247,7 @@ public abstract class BroadcastConfiguration
/**
* Indicates if this broadcaster is enable, meaning that it will automatically connect on startup.
*/
@XmlAttribute(name = "enabled")
@JacksonXmlProperty(isAttribute = true, localName = "enabled")
public boolean isEnabled()
{
return mEnabled;
@@ -293,7 +299,7 @@ public abstract class BroadcastConfiguration
* Indicates if this configuration is valid. A minimal check will ensure that it contains at least a hostname and
* port number.
*/
@XmlTransient
@JsonIgnore
public boolean isValid()
{
return mHost != null && mPort > 0;

View File

@@ -18,9 +18,9 @@
******************************************************************************/
package io.github.dsheirer.audio.broadcast;
import io.github.dsheirer.alias.AliasModel;
import io.github.dsheirer.gui.editor.DocumentListenerEditor;
import io.github.dsheirer.icon.IconManager;
import io.github.dsheirer.alias.AliasModel;
import javax.swing.*;

View File

@@ -18,6 +18,7 @@
******************************************************************************/
package io.github.dsheirer.audio.broadcast;
import io.github.dsheirer.alias.AliasModel;
import io.github.dsheirer.audio.broadcast.broadcastify.BroadcastifyConfiguration;
import io.github.dsheirer.audio.broadcast.broadcastify.BroadcastifyConfigurationEditor;
import io.github.dsheirer.audio.broadcast.icecast.IcecastHTTPAudioBroadcaster;
@@ -43,7 +44,6 @@ import io.github.dsheirer.record.AudioRecorder;
import io.github.dsheirer.record.mp3.MP3Recorder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import io.github.dsheirer.alias.AliasModel;
import java.nio.file.Path;

View File

@@ -18,6 +18,7 @@
******************************************************************************/
package io.github.dsheirer.audio.broadcast;
import io.github.dsheirer.alias.id.broadcast.BroadcastChannel;
import io.github.dsheirer.audio.AudioPacket;
import io.github.dsheirer.channel.metadata.Metadata;
import io.github.dsheirer.icon.IconManager;
@@ -27,7 +28,6 @@ import io.github.dsheirer.sample.Listener;
import io.github.dsheirer.util.ThreadPool;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import io.github.dsheirer.alias.id.broadcast.BroadcastChannel;
import javax.swing.*;
import javax.swing.table.AbstractTableModel;

View File

@@ -19,13 +19,13 @@
package io.github.dsheirer.audio.broadcast;
import com.jidesoft.swing.JideSplitPane;
import io.github.dsheirer.alias.AliasModel;
import io.github.dsheirer.gui.editor.Editor;
import io.github.dsheirer.gui.editor.EmptyEditor;
import io.github.dsheirer.icon.IconManager;
import net.miginfocom.swing.MigLayout;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import io.github.dsheirer.alias.AliasModel;
import javax.swing.*;
import javax.swing.event.ListSelectionEvent;

View File

@@ -18,13 +18,12 @@
******************************************************************************/
package io.github.dsheirer.audio.broadcast.broadcastify;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import io.github.dsheirer.audio.broadcast.BroadcastConfiguration;
import io.github.dsheirer.audio.broadcast.BroadcastFormat;
import io.github.dsheirer.audio.broadcast.BroadcastServerType;
import io.github.dsheirer.audio.broadcast.icecast.IcecastTCPConfiguration;
import javax.xml.bind.annotation.XmlAttribute;
public class BroadcastifyConfiguration extends IcecastTCPConfiguration
{
private int mFeedID;
@@ -77,13 +76,14 @@ public class BroadcastifyConfiguration extends IcecastTCPConfiguration
return copy;
}
@JacksonXmlProperty(isAttribute = true, localName = "type", namespace = "http://www.w3.org/2001/XMLSchema-instance")
@Override
public BroadcastServerType getBroadcastServerType()
{
return BroadcastServerType.BROADCASTIFY;
}
@XmlAttribute(name="feed_id")
@JacksonXmlProperty(isAttribute = true, localName = "feed_id")
public int getFeedID()
{
return mFeedID;

View File

@@ -19,6 +19,7 @@
package io.github.dsheirer.audio.broadcast.broadcastify;
import com.radioreference.api.soap2.UserFeedBroadcast;
import io.github.dsheirer.alias.AliasModel;
import io.github.dsheirer.audio.broadcast.BroadcastConfiguration;
import io.github.dsheirer.audio.broadcast.BroadcastConfigurationEditor;
import io.github.dsheirer.audio.broadcast.BroadcastEvent;
@@ -29,7 +30,6 @@ import io.github.dsheirer.sample.Listener;
import net.miginfocom.swing.MigLayout;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import io.github.dsheirer.alias.AliasModel;
import javax.swing.*;
import javax.swing.event.ChangeEvent;

View File

@@ -18,13 +18,20 @@
******************************************************************************/
package io.github.dsheirer.audio.broadcast.icecast;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import io.github.dsheirer.audio.broadcast.BroadcastConfiguration;
import io.github.dsheirer.audio.broadcast.BroadcastFormat;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlTransient;
import java.util.Base64;
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type")
@JsonSubTypes({
@JsonSubTypes.Type(value = IcecastHTTPConfiguration.class, name="icecastHTTPConfiguration"),
@JsonSubTypes.Type(value = IcecastTCPConfiguration.class, name="icecastTCPConfiguration"),
})
public abstract class IcecastConfiguration extends BroadcastConfiguration
{
protected String mUserName = "source";
@@ -49,7 +56,7 @@ public abstract class IcecastConfiguration extends BroadcastConfiguration
/**
* Base64 encoded version of the username and password with prepended 'Basic ' tag.
*/
@XmlTransient
@JsonIgnore
public String getBase64EncodedCredentials()
{
StringBuilder sb = new StringBuilder();
@@ -68,7 +75,7 @@ public abstract class IcecastConfiguration extends BroadcastConfiguration
return "Basic " + base64;
}
@XmlAttribute( name="user_name" )
@JacksonXmlProperty(isAttribute = true, localName = "user_name")
public String getUserName()
{
return mUserName;
@@ -86,9 +93,10 @@ public abstract class IcecastConfiguration extends BroadcastConfiguration
/**
* Mount point or path to the stream
*
* @return mount point
*/
@XmlAttribute( name="mount_point" )
@JacksonXmlProperty(isAttribute = true, localName = "mount_point")
public String getMountPoint()
{
return mMountPoint;
@@ -96,6 +104,7 @@ public abstract class IcecastConfiguration extends BroadcastConfiguration
/**
* Sets the mount point (path) for the stream
*
* @param mountPoint
*/
public void setMountPoint(String mountPoint)
@@ -118,7 +127,7 @@ public abstract class IcecastConfiguration extends BroadcastConfiguration
return mMountPoint != null;
}
@XmlAttribute( name="description" )
@JacksonXmlProperty(isAttribute = true, localName = "description")
public String getDescription()
{
return mDescription;
@@ -137,7 +146,7 @@ public abstract class IcecastConfiguration extends BroadcastConfiguration
/**
* Stream genre
*/
@XmlAttribute( name="genre" )
@JacksonXmlProperty(isAttribute = true, localName = "genre")
public String getGenre()
{
return mGenre;
@@ -145,6 +154,7 @@ public abstract class IcecastConfiguration extends BroadcastConfiguration
/**
* Stream genre
*
* @param genre
*/
public void setGenre(String genre)
@@ -160,7 +170,7 @@ public abstract class IcecastConfiguration extends BroadcastConfiguration
/**
* Public visibility of the broadcastAudio
*/
@XmlAttribute( name="public" )
@JacksonXmlProperty(isAttribute = true, localName = "public")
public boolean isPublic()
{
return mPublic;
@@ -168,6 +178,7 @@ public abstract class IcecastConfiguration extends BroadcastConfiguration
/**
* Sets public visibility of the broadcastAudio
*
* @param isPublic indicates if the broadcastAudio should be visible to the public
*/
public void setPublic(boolean isPublic)
@@ -178,7 +189,7 @@ public abstract class IcecastConfiguration extends BroadcastConfiguration
/**
* Number of audio channels in the broadcastAudio
*/
@XmlAttribute( name="channels" )
@JacksonXmlProperty(isAttribute = true, localName = "channels")
public int getChannels()
{
return mChannels;
@@ -200,7 +211,7 @@ public abstract class IcecastConfiguration extends BroadcastConfiguration
/**
* Bit rate in bits per second
*/
@XmlAttribute( name="bitrate" )
@JacksonXmlProperty(isAttribute = true, localName = "bitrate")
public int getBitRate()
{
return mBitRate;
@@ -208,6 +219,7 @@ public abstract class IcecastConfiguration extends BroadcastConfiguration
/**
* Bit rate
*
* @param bitRate in samples per second
*/
public void setBitRate(int bitRate)
@@ -220,7 +232,7 @@ public abstract class IcecastConfiguration extends BroadcastConfiguration
return mBitRate > 0;
}
@XmlAttribute( name="sample_rate" )
@JacksonXmlProperty(isAttribute = true, localName = "sample_rate")
public int getSampleRate()
{
return mSampleRate;
@@ -239,7 +251,7 @@ public abstract class IcecastConfiguration extends BroadcastConfiguration
/**
* URL associated with the broadcastAudio where users can find additional details.
*/
@XmlAttribute( name="url" )
@JacksonXmlProperty(isAttribute = true, localName = "url")
public String getURL()
{
return mURL;
@@ -247,6 +259,7 @@ public abstract class IcecastConfiguration extends BroadcastConfiguration
/**
* URL associated with the broadcastAudio where users can find additional details.
*
* @param url
*/
public void setURL(String url)

View File

@@ -18,10 +18,13 @@
******************************************************************************/
package io.github.dsheirer.audio.broadcast.icecast;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import io.github.dsheirer.audio.broadcast.BroadcastConfiguration;
import io.github.dsheirer.audio.broadcast.BroadcastFormat;
import io.github.dsheirer.audio.broadcast.BroadcastServerType;
@JsonSubTypes.Type(value=IcecastHTTPConfiguration.class, name="icecastHTTPConfiguration")
public class IcecastHTTPConfiguration extends IcecastConfiguration
{
public IcecastHTTPConfiguration()
@@ -66,11 +69,10 @@ public class IcecastHTTPConfiguration extends IcecastConfiguration
return copy;
}
@JacksonXmlProperty(isAttribute = true, localName = "type", namespace = "http://www.w3.org/2001/XMLSchema-instance")
@Override
public BroadcastServerType getBroadcastServerType()
{
return BroadcastServerType.ICECAST_HTTP;
}
}

View File

@@ -18,6 +18,7 @@
******************************************************************************/
package io.github.dsheirer.audio.broadcast.icecast;
import io.github.dsheirer.alias.AliasModel;
import io.github.dsheirer.audio.broadcast.BroadcastConfiguration;
import io.github.dsheirer.audio.broadcast.BroadcastConfigurationEditor;
import io.github.dsheirer.audio.broadcast.BroadcastEvent;
@@ -27,7 +28,6 @@ import io.github.dsheirer.icon.IconManager;
import net.miginfocom.swing.MigLayout;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import io.github.dsheirer.alias.AliasModel;
import javax.swing.*;
import javax.swing.event.ChangeEvent;

View File

@@ -18,6 +18,9 @@
******************************************************************************/
package io.github.dsheirer.audio.broadcast.icecast;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import io.github.dsheirer.audio.broadcast.BroadcastConfiguration;
import io.github.dsheirer.audio.broadcast.BroadcastFormat;
import io.github.dsheirer.audio.broadcast.BroadcastServerType;
@@ -25,9 +28,10 @@ import io.github.dsheirer.audio.broadcast.broadcastify.BroadcastifyConfiguration
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.xml.bind.annotation.XmlSeeAlso;
@XmlSeeAlso( {BroadcastifyConfiguration.class } )
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type")
@JsonSubTypes({
@JsonSubTypes.Type(value = BroadcastifyConfiguration.class, name="broadcastifyConfiguration"),
})
public class IcecastTCPConfiguration extends IcecastConfiguration
{
private final static Logger mLog = LoggerFactory.getLogger( IcecastTCPConfiguration.class );
@@ -70,6 +74,7 @@ public class IcecastTCPConfiguration extends IcecastConfiguration
return copy;
}
@JacksonXmlProperty(isAttribute = true, localName = "type", namespace = "http://www.w3.org/2001/XMLSchema-instance")
@Override
public BroadcastServerType getBroadcastServerType()
{

View File

@@ -18,6 +18,7 @@
******************************************************************************/
package io.github.dsheirer.audio.broadcast.icecast;
import io.github.dsheirer.alias.AliasModel;
import io.github.dsheirer.audio.broadcast.BroadcastConfiguration;
import io.github.dsheirer.audio.broadcast.BroadcastConfigurationEditor;
import io.github.dsheirer.audio.broadcast.BroadcastEvent;
@@ -27,7 +28,6 @@ import io.github.dsheirer.icon.IconManager;
import net.miginfocom.swing.MigLayout;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import io.github.dsheirer.alias.AliasModel;
import javax.swing.*;
import javax.swing.event.ChangeEvent;

View File

@@ -18,12 +18,11 @@
******************************************************************************/
package io.github.dsheirer.audio.broadcast.shoutcast.v1;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import io.github.dsheirer.audio.broadcast.BroadcastConfiguration;
import io.github.dsheirer.audio.broadcast.BroadcastFormat;
import io.github.dsheirer.audio.broadcast.BroadcastServerType;
import javax.xml.bind.annotation.XmlAttribute;
public class ShoutcastV1Configuration extends BroadcastConfiguration
{
private String mGenre;
@@ -73,7 +72,7 @@ public class ShoutcastV1Configuration extends BroadcastConfiguration
/**
* Stream genre
*/
@XmlAttribute(name="genre")
@JacksonXmlProperty(isAttribute = true, localName = "genre")
public String getGenre()
{
return mGenre;
@@ -81,6 +80,7 @@ public class ShoutcastV1Configuration extends BroadcastConfiguration
/**
* Stream genre
*
* @param genre
*/
public void setGenre(String genre)
@@ -91,7 +91,7 @@ public class ShoutcastV1Configuration extends BroadcastConfiguration
/**
* Stream description
*/
@XmlAttribute(name="description")
@JacksonXmlProperty(isAttribute = true, localName = "description")
public String getDescription()
{
return mDescription;
@@ -99,6 +99,7 @@ public class ShoutcastV1Configuration extends BroadcastConfiguration
/**
* Stream description
*
* @param description
*/
public void setDescription(String description)
@@ -109,7 +110,7 @@ public class ShoutcastV1Configuration extends BroadcastConfiguration
/**
* Public visibility of the broadcastAudio
*/
@XmlAttribute(name="public")
@JacksonXmlProperty(isAttribute = true, localName = "public")
public boolean isPublic()
{
return mPublic;
@@ -117,6 +118,7 @@ public class ShoutcastV1Configuration extends BroadcastConfiguration
/**
* Sets public visibility of the broadcastAudio
*
* @param isPublic indicates if the broadcastAudio should be visible to the public
*/
public void setPublic(boolean isPublic)
@@ -127,7 +129,7 @@ public class ShoutcastV1Configuration extends BroadcastConfiguration
/**
* Number of audio channels in the broadcastAudio
*/
@XmlAttribute(name="channels")
@JacksonXmlProperty(isAttribute = true, localName = "channels")
public int getChannels()
{
return mChannels;
@@ -144,7 +146,7 @@ public class ShoutcastV1Configuration extends BroadcastConfiguration
/**
* Bit rate in bits per second
*/
@XmlAttribute(name="bitrate")
@JacksonXmlProperty(isAttribute = true, localName = "bitrate")
public int getBitRate()
{
return mBitRate;
@@ -152,6 +154,7 @@ public class ShoutcastV1Configuration extends BroadcastConfiguration
/**
* Bit rate
*
* @param bitRate in samples per second
*/
public void setBitRate(int bitRate)
@@ -163,8 +166,8 @@ public class ShoutcastV1Configuration extends BroadcastConfiguration
public boolean isValid()
{
return getName() != null && !getName().isEmpty() &&
getHost() != null && !getHost().isEmpty() &&
getPort() > 0 && getPort() < 65535 &&
getPassword() != null && !getPassword().isEmpty();
getHost() != null && !getHost().isEmpty() &&
getPort() > 0 && getPort() < 65535 &&
getPassword() != null && !getPassword().isEmpty();
}
}

View File

@@ -18,6 +18,7 @@
******************************************************************************/
package io.github.dsheirer.audio.broadcast.shoutcast.v1;
import io.github.dsheirer.alias.AliasModel;
import io.github.dsheirer.audio.broadcast.BroadcastConfiguration;
import io.github.dsheirer.audio.broadcast.BroadcastConfigurationEditor;
import io.github.dsheirer.audio.broadcast.BroadcastEvent;
@@ -27,7 +28,6 @@ import io.github.dsheirer.icon.IconManager;
import net.miginfocom.swing.MigLayout;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import io.github.dsheirer.alias.AliasModel;
import javax.swing.*;
import javax.swing.event.ChangeEvent;

View File

@@ -18,13 +18,12 @@
******************************************************************************/
package io.github.dsheirer.audio.broadcast.shoutcast.v2;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import io.github.dsheirer.audio.broadcast.BroadcastConfiguration;
import io.github.dsheirer.audio.broadcast.BroadcastFormat;
import io.github.dsheirer.audio.broadcast.BroadcastServerType;
import org.apache.commons.lang3.Validate;
import javax.xml.bind.annotation.XmlAttribute;
public class ShoutcastV2Configuration extends BroadcastConfiguration
{
private int mStreamID;
@@ -78,7 +77,7 @@ public class ShoutcastV2Configuration extends BroadcastConfiguration
/**
* Stream ID
*/
@XmlAttribute(name = "stream_id")
@JacksonXmlProperty(isAttribute = true, localName = "stream_id")
public int getStreamID()
{
return mStreamID;
@@ -98,7 +97,7 @@ public class ShoutcastV2Configuration extends BroadcastConfiguration
/**
* User ID
*/
@XmlAttribute(name = "user_id")
@JacksonXmlProperty(isAttribute = true, localName = "user_id")
public String getUserID()
{
return mUserID;
@@ -106,6 +105,7 @@ public class ShoutcastV2Configuration extends BroadcastConfiguration
/**
* Sets the user ID
*
* @param userID
*/
public void setUserID(String userID)
@@ -116,7 +116,7 @@ public class ShoutcastV2Configuration extends BroadcastConfiguration
/**
* Bit rate in kilobits per second
*/
@XmlAttribute(name = "bitrate")
@JacksonXmlProperty(isAttribute = true, localName = "bitrate")
public int getBitRate()
{
return mBitRate;
@@ -124,6 +124,7 @@ public class ShoutcastV2Configuration extends BroadcastConfiguration
/**
* Bit rate
*
* @param bitRate in kilobits per second
*/
public void setBitRate(int bitRate)
@@ -134,7 +135,7 @@ public class ShoutcastV2Configuration extends BroadcastConfiguration
/**
* Stream genre
*/
@XmlAttribute(name = "genre")
@JacksonXmlProperty(isAttribute = true, localName = "genre")
public String getGenre()
{
return mGenre;
@@ -157,7 +158,7 @@ public class ShoutcastV2Configuration extends BroadcastConfiguration
/**
* Public visibility of the broadcastAudio
*/
@XmlAttribute(name = "public")
@JacksonXmlProperty(isAttribute = true, localName = "public")
public boolean isPublic()
{
return mPublic;
@@ -165,6 +166,7 @@ public class ShoutcastV2Configuration extends BroadcastConfiguration
/**
* Sets public visibility of the broadcastAudio
*
* @param isPublic indicates if the broadcastAudio should be visible to the public
*/
public void setPublic(boolean isPublic)
@@ -175,7 +177,7 @@ public class ShoutcastV2Configuration extends BroadcastConfiguration
/**
* URL associated with the broadcastAudio where users can find additional details.
*/
@XmlAttribute(name = "url")
@JacksonXmlProperty(isAttribute = true, localName = "url")
public String getURL()
{
return mURL;
@@ -183,6 +185,7 @@ public class ShoutcastV2Configuration extends BroadcastConfiguration
/**
* URL associated with the broadcastAudio where users can find additional details.
*
* @param url
*/
public void setURL(String url)

View File

@@ -18,6 +18,7 @@
******************************************************************************/
package io.github.dsheirer.audio.broadcast.shoutcast.v2;
import io.github.dsheirer.alias.AliasModel;
import io.github.dsheirer.audio.broadcast.BroadcastConfiguration;
import io.github.dsheirer.audio.broadcast.BroadcastConfigurationEditor;
import io.github.dsheirer.audio.broadcast.BroadcastEvent;
@@ -27,7 +28,6 @@ import io.github.dsheirer.icon.IconManager;
import net.miginfocom.swing.MigLayout;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import io.github.dsheirer.alias.AliasModel;
import javax.swing.*;
import javax.swing.event.ChangeEvent;

View File

@@ -18,10 +18,10 @@
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;
import io.github.dsheirer.sample.real.RealSampleListener;
/**
* Applies audio inversion (or un-inversion) to a broadcast of float audio samples

View File

@@ -17,10 +17,10 @@
******************************************************************************/
package io.github.dsheirer.bits;
import io.github.dsheirer.sample.Broadcaster;
import io.github.dsheirer.sample.Listener;
import io.github.dsheirer.dsp.symbol.SyncDetectListener;
import io.github.dsheirer.dsp.symbol.SyncDetectProvider;
import io.github.dsheirer.sample.Broadcaster;
import io.github.dsheirer.sample.Listener;
import java.util.ArrayList;
import java.util.Iterator;

View File

@@ -21,9 +21,9 @@ package io.github.dsheirer.channel.details;
import io.github.dsheirer.channel.state.DecoderState;
import io.github.dsheirer.controller.channel.Channel;
import io.github.dsheirer.controller.channel.ChannelProcessingManager;
import io.github.dsheirer.module.ProcessingChain;
import io.github.dsheirer.sample.Listener;
import net.miginfocom.swing.MigLayout;
import io.github.dsheirer.module.ProcessingChain;
import javax.swing.*;
import javax.swing.text.DefaultCaret;

View File

@@ -18,11 +18,13 @@
******************************************************************************/
package io.github.dsheirer.channel.metadata;
import io.github.dsheirer.alias.Alias;
import io.github.dsheirer.channel.state.State;
import io.github.dsheirer.controller.channel.Channel;
import io.github.dsheirer.controller.channel.ChannelProcessingManager;
import io.github.dsheirer.controller.channel.ChannelUtils;
import io.github.dsheirer.icon.IconManager;
import io.github.dsheirer.module.ProcessingChain;
import io.github.dsheirer.properties.SystemProperties;
import io.github.dsheirer.sample.Broadcaster;
import io.github.dsheirer.sample.Listener;
@@ -30,8 +32,6 @@ import net.miginfocom.swing.MigLayout;
import org.apache.commons.lang3.Validate;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import io.github.dsheirer.alias.Alias;
import io.github.dsheirer.module.ProcessingChain;
import javax.swing.*;
import javax.swing.event.ListSelectionEvent;

View File

@@ -23,11 +23,11 @@ import com.jidesoft.swing.JideTabbedPane;
import io.github.dsheirer.channel.details.ChannelDetailPanel;
import io.github.dsheirer.controller.channel.ChannelProcessingManager;
import io.github.dsheirer.icon.IconManager;
import io.github.dsheirer.module.decode.event.CallEventPanel;
import io.github.dsheirer.module.decode.event.MessageActivityPanel;
import io.github.dsheirer.settings.SettingsManager;
import io.github.dsheirer.spectrum.ChannelSpectrumPanel;
import net.miginfocom.swing.MigLayout;
import io.github.dsheirer.module.decode.event.CallEventPanel;
import io.github.dsheirer.module.decode.event.MessageActivityPanel;
import javax.swing.*;
import java.awt.*;

View File

@@ -18,13 +18,13 @@
******************************************************************************/
package io.github.dsheirer.channel.metadata;
import io.github.dsheirer.channel.state.State;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import io.github.dsheirer.alias.Alias;
import io.github.dsheirer.alias.id.broadcast.BroadcastChannel;
import io.github.dsheirer.alias.id.priority.Priority;
import io.github.dsheirer.channel.state.State;
import io.github.dsheirer.module.decode.DecoderType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.Set;
import java.util.TreeSet;

View File

@@ -19,11 +19,11 @@
package io.github.dsheirer.channel.metadata;
import io.github.dsheirer.channel.state.State;
import io.github.dsheirer.module.decode.DecoderType;
import io.github.dsheirer.sample.Broadcaster;
import io.github.dsheirer.sample.Listener;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import io.github.dsheirer.module.decode.DecoderType;
public class MutableMetadata extends Metadata implements Listener<AttributeChangeRequest>
{

View File

@@ -19,6 +19,8 @@
package io.github.dsheirer.controller;
import com.jidesoft.swing.JideTabbedPane;
import io.github.dsheirer.alias.AliasController;
import io.github.dsheirer.alias.AliasModel;
import io.github.dsheirer.audio.AudioManager;
import io.github.dsheirer.audio.AudioPanel;
import io.github.dsheirer.audio.broadcast.BroadcastModel;
@@ -36,8 +38,6 @@ import io.github.dsheirer.source.SourceManager;
import io.github.dsheirer.source.tuner.TunerModel;
import io.github.dsheirer.source.tuner.TunerViewPanel;
import net.miginfocom.swing.MigLayout;
import io.github.dsheirer.alias.AliasController;
import io.github.dsheirer.alias.AliasModel;
import javax.swing.*;
import java.awt.*;

View File

@@ -18,6 +18,9 @@
******************************************************************************/
package io.github.dsheirer.controller.channel;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
import io.github.dsheirer.controller.config.Configuration;
import io.github.dsheirer.module.decode.DecoderFactory;
import io.github.dsheirer.module.decode.DecoderType;
@@ -38,24 +41,11 @@ import io.github.dsheirer.source.tuner.TunerChannel.Type;
import io.github.dsheirer.source.tuner.frequency.FrequencyChangeEvent;
import io.github.dsheirer.source.tuner.frequency.FrequencyChangeEvent.Event;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlSeeAlso;
import javax.xml.bind.annotation.XmlTransient;
@XmlSeeAlso({Configuration.class})
@XmlRootElement(name = "channel")
@JacksonXmlRootElement(localName = "channel")
public class Channel extends Configuration implements Listener<FrequencyChangeEvent>
{
// Standard channels are persisted and traffic channels are temporary
public enum ChannelType
{
STANDARD, TRAFFIC
}
;
public enum ChannelType {STANDARD, TRAFFIC}
// Static unique channel identifier tracking
private static int UNIQUE_ID = 0;
@@ -161,7 +151,7 @@ public class Channel extends Configuration implements Listener<FrequencyChangeEv
/**
* Unique identifier for this channel. Value is transient (not persisted).
*/
@XmlTransient
@JsonIgnore
public int getChannelID()
{
return mChannelID;
@@ -171,7 +161,7 @@ public class Channel extends Configuration implements Listener<FrequencyChangeEv
* Indicates if this channel has been selected for prioritized audio output
* and display of processing chain products
*/
@XmlTransient
@JsonIgnore
public boolean isSelected()
{
return mSelected;
@@ -191,7 +181,7 @@ public class Channel extends Configuration implements Listener<FrequencyChangeEv
mSelected = selected;
}
@XmlTransient
@JsonIgnore
public ChannelType getChannelType()
{
return mChannelType;
@@ -200,7 +190,7 @@ public class Channel extends Configuration implements Listener<FrequencyChangeEv
/**
* Returns the owning system for this channel.
*/
@XmlAttribute(name = "system")
@JacksonXmlProperty(isAttribute = true, localName = "system")
public String getSystem()
{
return mSystem;
@@ -219,7 +209,7 @@ public class Channel extends Configuration implements Listener<FrequencyChangeEv
/**
* Returns the owning site for this channel.
*/
@XmlAttribute(name = "site")
@JacksonXmlProperty(isAttribute = true, localName = "site")
public String getSite()
{
return mSite;
@@ -238,7 +228,7 @@ public class Channel extends Configuration implements Listener<FrequencyChangeEv
/**
* Returns the name of this channel.
*/
@XmlAttribute(name = "name")
@JacksonXmlProperty(isAttribute = true, localName = "name")
public String getName()
{
return mName;
@@ -270,7 +260,7 @@ public class Channel extends Configuration implements Listener<FrequencyChangeEv
/**
* Indicates if this channel is enabled for processing.
*/
@XmlAttribute(name = "enabled")
@JacksonXmlProperty(isAttribute = true, localName = "enabled")
public boolean getEnabled()
{
return mEnabled;
@@ -295,7 +285,7 @@ public class Channel extends Configuration implements Listener<FrequencyChangeEv
* Returns the alias list that is used by this channel for looking up alias
* values for the various identifiers produced by the decoder(s).
*/
@XmlElement(name = "alias_list_name")
@JacksonXmlProperty(isAttribute = false, localName = "alias_list_name")
public String getAliasListName()
{
return mAliasListName;
@@ -313,7 +303,7 @@ public class Channel extends Configuration implements Listener<FrequencyChangeEv
/**
* Gets the primary decoder configuration used by this channel
*/
@XmlElement(name = "decode_configuration")
@JacksonXmlProperty(isAttribute = false, localName = "decode_configuration")
public DecodeConfiguration getDecodeConfiguration()
{
return mDecodeConfiguration;
@@ -331,7 +321,7 @@ public class Channel extends Configuration implements Listener<FrequencyChangeEv
* Gets the aux decoder configuration used by this channel. Aux decoders
* operate on demodulated audio
*/
@XmlElement(name = "aux_decode_configuration")
@JacksonXmlProperty(isAttribute = false, localName = "aux_decode_configuration")
public AuxDecodeConfiguration getAuxDecodeConfiguration()
{
return mAuxDecodeConfiguration;
@@ -349,7 +339,7 @@ public class Channel extends Configuration implements Listener<FrequencyChangeEv
* Returns the source configuration for this channel. A channel source
* identifies where the processing chain will get source sample data from.
*/
@XmlElement(name = "source_configuration")
@JacksonXmlProperty(isAttribute = false, localName = "source_configuration")
public SourceConfiguration getSourceConfiguration()
{
return mSourceConfiguration;
@@ -370,7 +360,7 @@ public class Channel extends Configuration implements Listener<FrequencyChangeEv
/**
* Returns the event logger configuration for this channel.
*/
@XmlElement(name = "event_log_configuration")
@JacksonXmlProperty(isAttribute = false, localName = "event_log_configuration")
public EventLogConfiguration getEventLogConfiguration()
{
return mEventLogConfiguration;
@@ -387,7 +377,7 @@ public class Channel extends Configuration implements Listener<FrequencyChangeEv
/**
* Returns the recorder configuration for this channel.
*/
@XmlElement(name = "record_configuration")
@JacksonXmlProperty(isAttribute = false, localName = "record_configuration")
public RecordConfiguration getRecordConfiguration()
{
return mRecordConfiguration;
@@ -409,7 +399,7 @@ public class Channel extends Configuration implements Listener<FrequencyChangeEv
* If the source configuration is not a tuner or recording, this method
* returns null.
*/
@XmlTransient
@JsonIgnore
public TunerChannel getTunerChannel()
{
if(mTunerChannel == null)
@@ -462,9 +452,10 @@ public class Channel extends Configuration implements Listener<FrequencyChangeEv
/**
* Current channel frequency correction value (when this channel is processing)
*
* @return
*/
@XmlTransient
@JsonIgnore
public int getChannelFrequencyCorrection()
{
return mChannelFrequencyCorrection;

View File

@@ -1,12 +1,12 @@
package io.github.dsheirer.controller.channel;
import com.jidesoft.swing.JideSplitPane;
import io.github.dsheirer.alias.AliasModel;
import io.github.dsheirer.controller.channel.map.ChannelMapModel;
import io.github.dsheirer.source.SourceManager;
import net.coderazzi.filters.gui.AutoChoices;
import net.coderazzi.filters.gui.TableFilterHeader;
import net.miginfocom.swing.MigLayout;
import io.github.dsheirer.alias.AliasModel;
import javax.swing.*;
import javax.swing.event.ListSelectionEvent;

View File

@@ -18,17 +18,17 @@
package io.github.dsheirer.controller.channel;
import com.jidesoft.swing.JideTabbedPane;
import io.github.dsheirer.alias.AliasModel;
import io.github.dsheirer.controller.channel.map.ChannelMapModel;
import io.github.dsheirer.gui.editor.Editor;
import io.github.dsheirer.gui.editor.EditorValidationException;
import io.github.dsheirer.module.decode.AuxDecodeConfigurationEditor;
import io.github.dsheirer.module.decode.DecodeConfigurationEditor;
import io.github.dsheirer.module.log.EventLogConfigurationEditor;
import io.github.dsheirer.record.RecordConfigurationEditor;
import io.github.dsheirer.source.SourceConfigurationEditor;
import io.github.dsheirer.source.SourceManager;
import net.miginfocom.swing.MigLayout;
import io.github.dsheirer.alias.AliasModel;
import io.github.dsheirer.module.decode.AuxDecodeConfigurationEditor;
import io.github.dsheirer.module.decode.DecodeConfigurationEditor;
import io.github.dsheirer.module.log.EventLogConfigurationEditor;
import javax.swing.*;
import java.awt.*;

View File

@@ -18,6 +18,7 @@
******************************************************************************/
package io.github.dsheirer.controller.channel;
import io.github.dsheirer.alias.AliasModel;
import io.github.dsheirer.audio.AudioPacket;
import io.github.dsheirer.channel.metadata.Attribute;
import io.github.dsheirer.channel.metadata.AttributeChangeRequest;
@@ -25,6 +26,12 @@ import io.github.dsheirer.channel.metadata.ChannelMetadataModel;
import io.github.dsheirer.controller.channel.map.ChannelMapModel;
import io.github.dsheirer.filter.FilterSet;
import io.github.dsheirer.message.Message;
import io.github.dsheirer.module.Module;
import io.github.dsheirer.module.ProcessingChain;
import io.github.dsheirer.module.decode.DecoderFactory;
import io.github.dsheirer.module.decode.DecoderType;
import io.github.dsheirer.module.decode.event.MessageActivityModel;
import io.github.dsheirer.module.log.EventLogManager;
import io.github.dsheirer.record.RecorderManager;
import io.github.dsheirer.record.RecorderType;
import io.github.dsheirer.sample.Listener;
@@ -35,13 +42,6 @@ import io.github.dsheirer.source.SourceType;
import io.github.dsheirer.source.config.SourceConfigTuner;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import io.github.dsheirer.alias.AliasModel;
import io.github.dsheirer.module.Module;
import io.github.dsheirer.module.ProcessingChain;
import io.github.dsheirer.module.decode.DecoderFactory;
import io.github.dsheirer.module.decode.DecoderType;
import io.github.dsheirer.module.decode.event.MessageActivityModel;
import io.github.dsheirer.module.log.EventLogManager;
import java.util.HashMap;
import java.util.List;

View File

@@ -17,11 +17,11 @@
******************************************************************************/
package io.github.dsheirer.controller.channel;
import io.github.dsheirer.alias.AliasModel;
import io.github.dsheirer.gui.editor.Editor;
import net.miginfocom.swing.MigLayout;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import io.github.dsheirer.alias.AliasModel;
import javax.swing.*;
import javax.swing.event.DocumentEvent;

View File

@@ -1,144 +1,142 @@
/*******************************************************************************
* 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.controller.channel.map;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlSeeAlso;
import javax.xml.bind.annotation.XmlTransient;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import java.util.ArrayList;
import java.util.List;
@XmlSeeAlso( { ChannelRange.class } )
public class ChannelMap
{
private String mName;
private boolean mInvalid = false;
private List<ChannelRange> mRanges = new ArrayList<ChannelRange>();
public ChannelMap()
{
this( "New Channel Map" );
}
public ChannelMap( String name )
{
mName = name;
}
public ChannelMap copyOf()
{
ChannelMap map = new ChannelMap( new String( mName ) );
for( ChannelRange range: mRanges )
{
map.addRange( range.copyOf() );
}
return map;
}
private String mName;
private boolean mInvalid = false;
@XmlTransient
public boolean isInvalid()
{
return mInvalid;
}
private List<ChannelRange> mRanges = new ArrayList<ChannelRange>();
public String toString()
{
return mName + ( mInvalid ? " - Error" : "" );
}
@XmlElement( name = "range" )
public List<ChannelRange> getRanges()
{
return mRanges;
}
public ChannelMap()
{
this("New Channel Map");
}
public void setRanges( List<ChannelRange> ranges )
{
mRanges = ranges;
validate();
}
@XmlAttribute
public String getName()
{
return mName;
}
public void setName( String name )
{
mName = name;
}
public long getFrequency( int channelNumber )
{
for( ChannelRange range: mRanges )
{
if( range.hasChannel( channelNumber ) )
{
return range.getFrequency( channelNumber );
}
}
return 0;
}
public ChannelMap(String name)
{
mName = name;
}
/**
* Validates each of the channel ranges for overlap
*/
private void validate()
{
mInvalid = false;
for( int x = 0; x < mRanges.size(); x++ )
{
if( !mRanges.get( x ).isValid() )
{
mInvalid = true;
}
for( int y = x + 1; y < mRanges.size(); y++ )
{
if( mRanges.get( x ).overlaps( mRanges.get( y ) ) )
{
mInvalid = true;
}
}
}
}
public void addRange( ChannelRange range )
{
mRanges.add( range );
validate();
}
public void removeRange( ChannelRange range )
{
mRanges.remove( range );
validate();
}
public ChannelMap copyOf()
{
ChannelMap map = new ChannelMap(new String(mName));
for(ChannelRange range : mRanges)
{
map.addRange(range.copyOf());
}
return map;
}
@JsonIgnore
public boolean isInvalid()
{
return mInvalid;
}
public String toString()
{
return mName + (mInvalid ? " - Error" : "");
}
@JacksonXmlProperty(isAttribute = false, localName = "range")
public List<ChannelRange> getRanges()
{
return mRanges;
}
public void setRanges(List<ChannelRange> ranges)
{
mRanges = ranges;
validate();
}
@JacksonXmlProperty(isAttribute = true, localName = "name")
public String getName()
{
return mName;
}
public void setName(String name)
{
mName = name;
}
public long getFrequency(int channelNumber)
{
for(ChannelRange range : mRanges)
{
if(range.hasChannel(channelNumber))
{
return range.getFrequency(channelNumber);
}
}
return 0;
}
/**
* Validates each of the channel ranges for overlap
*/
private void validate()
{
mInvalid = false;
for(int x = 0; x < mRanges.size(); x++)
{
if(!mRanges.get(x).isValid())
{
mInvalid = true;
}
for(int y = x + 1; y < mRanges.size(); y++)
{
if(mRanges.get(x).overlaps(mRanges.get(y)))
{
mInvalid = true;
}
}
}
}
public void addRange(ChannelRange range)
{
mRanges.add(range);
validate();
}
public void removeRange(ChannelRange range)
{
mRanges.remove(range);
validate();
}
}

View File

@@ -1,185 +1,188 @@
/*******************************************************************************
* SDR Trunk
* Copyright (C) 2014-2016 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.controller.channel.map;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
import javax.xml.bind.annotation.XmlType;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
import java.text.DecimalFormat;
@XmlRootElement
@XmlType( name = "range" )
@JacksonXmlRootElement(localName = "range")
public class ChannelRange
{
private static final DecimalFormat FREQUENCY_FORMATTER = new DecimalFormat( "#.0000" );
private static final DecimalFormat FREQUENCY_FORMATTER = new DecimalFormat("#.0000");
private int mFirst = 1;
private int mLast = 1023;
private int mBase = 450000000;
private int mSize = 12500;
private boolean mOverlapping = false;
private int mFirst = 1;
private int mLast = 1023;
private int mBase = 450000000;
private int mSize = 12500;
public ChannelRange()
{
}
public ChannelRange( int first, int last, int base, int size )
{
mFirst = first;
mLast = last;
mBase = base;
mSize = size;
}
private boolean mOverlapping = false;
public ChannelRange copyOf()
{
return new ChannelRange( mFirst, mLast, mBase, mSize );
}
public String getDescription()
{
StringBuilder sb = new StringBuilder();
if( isValid() )
{
sb.append( "First: " );
sb.append( mFirst + "=" );
long frequency = getFrequency( mFirst );
sb.append( FREQUENCY_FORMATTER.format( (double)frequency / 1E6D ) );
sb.append( " Last: " );
sb.append( mLast + "=" );
frequency = getFrequency( mLast );
sb.append( FREQUENCY_FORMATTER.format( (double)frequency / 1E6D ) );
sb.append( " MHz" );
}
else
{
sb.append( "First channel must be smaller than last channel" );
}
if( isOverlapping() )
{
if( sb.length() > 0 )
{
sb.append( ", " );
}
sb.append( "Overlap!" );
}
public ChannelRange()
{
}
return sb.toString();
}
public boolean isValid()
{
return mFirst < mLast;
}
public boolean overlaps( ChannelRange other )
{
return ( mFirst <= other.mFirst && other.mFirst <= mLast ) ||
( mFirst <= other.mLast && other.mLast <= mLast ) ||
( mFirst <= other.mFirst && other.mLast <= mLast ) ||
( other.mFirst <= mFirst && mLast <= other.mLast );
}
public ChannelRange(int first, int last, int base, int size)
{
mFirst = first;
mLast = last;
mBase = base;
mSize = size;
}
@XmlTransient
public boolean isOverlapping()
{
return mOverlapping;
}
public void setOverlapping( boolean overlapping )
{
mOverlapping = overlapping;
}
public boolean hasChannel( int channel )
{
return mFirst <= channel && channel <= mLast;
}
public long getFrequency( int channel )
{
if( hasChannel( channel ) )
{
return mBase + ( ( channel - mFirst ) * mSize );
}
else
{
return 0;
}
}
@XmlAttribute( name = "first" )
public int getFirstChannelNumber()
{
return mFirst;
}
public void setFirstChannelNumber( int first )
{
mFirst = first;
}
public ChannelRange copyOf()
{
return new ChannelRange(mFirst, mLast, mBase, mSize);
}
@XmlAttribute( name = "last" )
public void setLastChannelNumber( int last )
{
mLast = last;
}
public int getLastChannelNumber()
{
return mLast;
}
@JsonIgnore
public String getDescription()
{
StringBuilder sb = new StringBuilder();
/**
* Sets the base frequency
* @param base frequency in hertz
*/
@XmlAttribute( name = "base" )
public void setBase( int base )
{
mBase = base;
}
public int getBase()
{
return mBase;
}
if(isValid())
{
sb.append("First: ");
sb.append(mFirst + "=");
/**
* Sets the channel size
* @param size in hertz
*/
@XmlAttribute( name = "size" )
public void setSize( int size )
{
mSize = size;
}
public int getSize()
{
return mSize;
}
long frequency = getFrequency(mFirst);
sb.append(FREQUENCY_FORMATTER.format((double)frequency / 1E6D));
sb.append(" Last: ");
sb.append(mLast + "=");
frequency = getFrequency(mLast);
sb.append(FREQUENCY_FORMATTER.format((double)frequency / 1E6D));
sb.append(" MHz");
}
else
{
sb.append("First channel must be smaller than last channel");
}
if(isOverlapping())
{
if(sb.length() > 0)
{
sb.append(", ");
}
sb.append("Overlap!");
}
return sb.toString();
}
@JsonIgnore
public boolean isValid()
{
return mFirst < mLast;
}
public boolean overlaps(ChannelRange other)
{
return (mFirst <= other.mFirst && other.mFirst <= mLast) ||
(mFirst <= other.mLast && other.mLast <= mLast) ||
(mFirst <= other.mFirst && other.mLast <= mLast) ||
(other.mFirst <= mFirst && mLast <= other.mLast);
}
@JsonIgnore
public boolean isOverlapping()
{
return mOverlapping;
}
public void setOverlapping(boolean overlapping)
{
mOverlapping = overlapping;
}
public boolean hasChannel(int channel)
{
return mFirst <= channel && channel <= mLast;
}
public long getFrequency(int channel)
{
if(hasChannel(channel))
{
return mBase + ((channel - mFirst) * mSize);
}
else
{
return 0;
}
}
@JacksonXmlProperty(isAttribute = true, localName = "first")
public int getFirstChannelNumber()
{
return mFirst;
}
public void setFirstChannelNumber(int first)
{
mFirst = first;
}
@JacksonXmlProperty(isAttribute = true, localName = "last")
public void setLastChannelNumber(int last)
{
mLast = last;
}
public int getLastChannelNumber()
{
return mLast;
}
/**
* Sets the base frequency
*
* @param base frequency in hertz
*/
@JacksonXmlProperty(isAttribute = true, localName = "base")
public void setBase(int base)
{
mBase = base;
}
public int getBase()
{
return mBase;
}
/**
* Sets the channel size
*
* @param size in hertz
*/
@JacksonXmlProperty(isAttribute = true, localName = "size")
public void setSize(int size)
{
mSize = size;
}
public int getSize()
{
return mSize;
}
}

View File

@@ -1,40 +1,28 @@
/*******************************************************************************
* 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.controller.config;
import io.github.dsheirer.record.config.RecordConfiguration;
import io.github.dsheirer.source.config.SourceConfiguration;
import io.github.dsheirer.module.decode.config.AuxDecodeConfiguration;
import io.github.dsheirer.module.decode.config.DecodeConfiguration;
import io.github.dsheirer.module.log.config.EventLogConfiguration;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlSeeAlso;
@XmlSeeAlso( { AuxDecodeConfiguration.class,
DecodeConfiguration.class,
EventLogConfiguration.class,
RecordConfiguration.class,
SourceConfiguration.class } )
@XmlRootElement( name = "configuration" )
@JacksonXmlRootElement(localName = "configuration")
public abstract class Configuration
{
public Configuration()
{
}
public Configuration()
{
}
}

View File

@@ -19,6 +19,8 @@ package io.github.dsheirer.dsp.filter.cic;
import io.github.dsheirer.dsp.filter.FilterFactory;
import io.github.dsheirer.dsp.filter.Filters;
import io.github.dsheirer.dsp.filter.Window.WindowType;
import io.github.dsheirer.dsp.filter.fir.real.RealFIRFilter_RB_RB;
import io.github.dsheirer.dsp.filter.halfband.real.HalfBandFilter_RB_RB;
import io.github.dsheirer.sample.Listener;
import io.github.dsheirer.sample.decimator.RealDecimator;
@@ -28,8 +30,6 @@ import io.github.dsheirer.sample.real.RealToRealBufferAssembler;
import org.apache.commons.lang3.Validate;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import io.github.dsheirer.dsp.filter.Window.WindowType;
import io.github.dsheirer.dsp.filter.fir.real.RealFIRFilter_RB_RB;
import java.util.ArrayList;
import java.util.List;

View File

@@ -1,12 +1,12 @@
package io.github.dsheirer.dsp.filter.design;
import io.github.dsheirer.dsp.filter.fir.FIRFilterSpecification;
import io.github.dsheirer.dsp.filter.fir.remez.RemezFIRFilterDesigner;
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.stage.Stage;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import io.github.dsheirer.dsp.filter.fir.FIRFilterSpecification;
import io.github.dsheirer.dsp.filter.fir.remez.RemezFIRFilterDesigner;
public class FilterViewer extends Application
{

View File

@@ -1,8 +1,8 @@
package io.github.dsheirer.dsp.filter.halfband.complex;
import io.github.dsheirer.dsp.filter.halfband.real.HalfBandFilter;
import io.github.dsheirer.sample.Listener;
import io.github.dsheirer.sample.complex.ComplexBuffer;
import io.github.dsheirer.dsp.filter.halfband.real.HalfBandFilter;
public class HalfBandFilter_CB_CB implements Listener<ComplexBuffer>
{

View File

@@ -21,12 +21,12 @@ import io.github.dsheirer.dsp.filter.design.FilterDesignException;
import io.github.dsheirer.dsp.filter.fir.FIRFilter;
import io.github.dsheirer.dsp.filter.fir.FIRFilterSpecification;
import io.github.dsheirer.dsp.filter.fir.remez.RemezFIRFilterDesigner;
import io.github.dsheirer.dsp.mixer.Oscillator;
import io.github.dsheirer.sample.Listener;
import io.github.dsheirer.sample.real.RealBuffer;
import io.github.dsheirer.sample.real.RealToRealBufferAssembler;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import io.github.dsheirer.dsp.mixer.Oscillator;
import java.util.ArrayList;
import java.util.Arrays;

View File

@@ -18,6 +18,8 @@
package io.github.dsheirer.dsp.fsk;
import io.github.dsheirer.buffer.BooleanAveragingBuffer;
import io.github.dsheirer.dsp.symbol.SymbolEvent;
import io.github.dsheirer.dsp.symbol.SymbolEvent.Shift;
import io.github.dsheirer.instrument.Instrumentable;
import io.github.dsheirer.instrument.tap.Tap;
import io.github.dsheirer.instrument.tap.TapGroup;
@@ -26,8 +28,6 @@ import io.github.dsheirer.sample.Listener;
import io.github.dsheirer.sample.real.RealBuffer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import io.github.dsheirer.dsp.symbol.SymbolEvent;
import io.github.dsheirer.dsp.symbol.SymbolEvent.Shift;
import java.util.ArrayList;
import java.util.BitSet;

View File

@@ -18,9 +18,15 @@
package io.github.dsheirer.dsp.fsk;
import io.github.dsheirer.dsp.filter.Filters;
import io.github.dsheirer.dsp.filter.FloatHalfBandFilter;
import io.github.dsheirer.dsp.filter.FloatHalfBandNoDecimateFilter;
import io.github.dsheirer.dsp.filter.LTRPulseShapingFilter;
import io.github.dsheirer.dsp.filter.SquaringFilter;
import io.github.dsheirer.dsp.filter.Window.WindowType;
import io.github.dsheirer.dsp.filter.cic.RealPrimeCICDecimate;
import io.github.dsheirer.dsp.filter.dc.IIRSinglePoleDCRemovalFilter;
import io.github.dsheirer.dsp.symbol.Slicer;
import io.github.dsheirer.dsp.symbol.Slicer.Output;
import io.github.dsheirer.instrument.Instrumentable;
import io.github.dsheirer.instrument.tap.Tap;
import io.github.dsheirer.instrument.tap.TapGroup;
@@ -30,12 +36,6 @@ import io.github.dsheirer.instrument.tap.stream.FloatTap;
import io.github.dsheirer.instrument.tap.stream.SymbolEventTap;
import io.github.dsheirer.sample.Listener;
import io.github.dsheirer.sample.real.RealBuffer;
import io.github.dsheirer.dsp.filter.FloatHalfBandFilter;
import io.github.dsheirer.dsp.filter.Window.WindowType;
import io.github.dsheirer.dsp.filter.cic.RealPrimeCICDecimate;
import io.github.dsheirer.dsp.filter.dc.IIRSinglePoleDCRemovalFilter;
import io.github.dsheirer.dsp.symbol.Slicer;
import io.github.dsheirer.dsp.symbol.Slicer.Output;
import java.util.ArrayList;
import java.util.List;

View File

@@ -31,6 +31,8 @@ package io.github.dsheirer.dsp.psk;
******************************************************************************/
import io.github.dsheirer.buffer.FloatAveragingBuffer;
import io.github.dsheirer.dsp.filter.interpolator.RealInterpolator;
import io.github.dsheirer.dsp.symbol.Dibit;
import io.github.dsheirer.instrument.Instrumentable;
import io.github.dsheirer.instrument.tap.Tap;
import io.github.dsheirer.instrument.tap.TapGroup;
@@ -40,8 +42,6 @@ import io.github.dsheirer.sample.Listener;
import io.github.dsheirer.sample.complex.Complex;
import io.github.dsheirer.sample.complex.ComplexSampleListener;
import io.github.dsheirer.source.tuner.frequency.IFrequencyChangeListener;
import io.github.dsheirer.dsp.filter.interpolator.RealInterpolator;
import io.github.dsheirer.dsp.symbol.Dibit;
import java.util.ArrayList;
import java.util.Arrays;

View File

@@ -1,9 +1,9 @@
package io.github.dsheirer.dsp.psk;
import io.github.dsheirer.dsp.symbol.Dibit;
import io.github.dsheirer.sample.Broadcaster;
import io.github.dsheirer.sample.Listener;
import io.github.dsheirer.sample.complex.Complex;
import io.github.dsheirer.dsp.symbol.Dibit;
/*******************************************************************************
* SDR Trunk

View File

@@ -1,9 +1,9 @@
package io.github.dsheirer.dsp.psk;
import io.github.dsheirer.dsp.symbol.Dibit;
import io.github.dsheirer.sample.Broadcaster;
import io.github.dsheirer.sample.Listener;
import io.github.dsheirer.sample.complex.Complex;
import io.github.dsheirer.dsp.symbol.Dibit;
public class QPSKStarSlicer implements Listener<Complex>
{

View File

@@ -19,6 +19,8 @@
package io.github.dsheirer.gui;
import com.jidesoft.swing.JideSplitPane;
import io.github.dsheirer.alias.AliasModel;
import io.github.dsheirer.alias.action.AliasActionManager;
import io.github.dsheirer.audio.AudioManager;
import io.github.dsheirer.audio.broadcast.BroadcastModel;
import io.github.dsheirer.audio.broadcast.BroadcastStatusPanel;
@@ -29,6 +31,7 @@ import io.github.dsheirer.controller.channel.ChannelSelectionManager;
import io.github.dsheirer.controller.channel.map.ChannelMapModel;
import io.github.dsheirer.icon.IconManager;
import io.github.dsheirer.map.MapService;
import io.github.dsheirer.module.log.EventLogManager;
import io.github.dsheirer.playlist.PlaylistManager;
import io.github.dsheirer.properties.SystemProperties;
import io.github.dsheirer.record.RecorderManager;
@@ -46,9 +49,6 @@ import net.miginfocom.swing.MigLayout;
import org.apache.commons.io.FileUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import io.github.dsheirer.alias.AliasModel;
import io.github.dsheirer.alias.action.AliasActionManager;
import io.github.dsheirer.module.log.EventLogManager;
import javax.imageio.ImageIO;
import javax.swing.*;

View File

@@ -18,15 +18,15 @@
******************************************************************************/
package io.github.dsheirer.icon;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.swing.*;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
@XmlRootElement(name = "icon")
@JacksonXmlRootElement(localName = "icon")
public class Icon implements Comparable<Icon>
{
private final static Logger mLog = LoggerFactory.getLogger(Icon.class);
@@ -46,7 +46,7 @@ public class Icon implements Comparable<Icon>
mPath = path;
}
@XmlAttribute(name = "name")
@JacksonXmlProperty(isAttribute = true, localName = "name")
public String getName()
{
return mName;
@@ -62,7 +62,7 @@ public class Icon implements Comparable<Icon>
return mName;
}
@XmlAttribute(name = "path")
@JacksonXmlProperty(isAttribute = true, localName = "path")
public String getPath()
{
return mPath;
@@ -73,7 +73,7 @@ public class Icon implements Comparable<Icon>
mPath = path;
}
@XmlTransient
@JsonIgnore
public ImageIcon getIcon()
{
if(mImageIcon == null && mPath != null)

View File

@@ -1,21 +1,19 @@
/*******************************************************************************
/*
* *********************************************************************************************************************
* sdrtrunk
* Copyright (C) 2014-2017 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 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.
* 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/>
*
******************************************************************************/
* 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.icon;
import io.github.dsheirer.properties.SystemProperties;

View File

@@ -18,13 +18,13 @@
******************************************************************************/
package io.github.dsheirer.icon;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
import java.util.ArrayList;
import java.util.List;
@XmlRootElement(name="iconset")
@JacksonXmlRootElement(localName = "iconset")
public class IconSet
{
private String mDefaultIcon;
@@ -45,7 +45,7 @@ public class IconSet
mIcons.remove(icon);
}
@XmlElement(name = "icon")
@JacksonXmlProperty(isAttribute = false, localName = "icon")
public List<Icon> getIcons()
{
if(mIcons == null)
@@ -61,7 +61,7 @@ public class IconSet
mIcons = icons;
}
@XmlAttribute(name = "default")
@JacksonXmlProperty(isAttribute = true, localName = "default")
public String getDefaultIcon()
{
return mDefaultIcon;

View File

@@ -21,9 +21,9 @@ package io.github.dsheirer.instrument;
import io.github.dsheirer.controller.channel.Channel.ChannelType;
import io.github.dsheirer.instrument.tap.Tap;
import io.github.dsheirer.instrument.tap.TapGroup;
import io.github.dsheirer.source.Source;
import io.github.dsheirer.module.Module;
import io.github.dsheirer.module.ProcessingChain;
import io.github.dsheirer.source.Source;
import java.util.ArrayList;
import java.util.List;

View File

@@ -1,13 +1,13 @@
package io.github.dsheirer.instrument.gui;
import io.github.dsheirer.alias.AliasModel;
import io.github.dsheirer.audio.broadcast.BroadcastModel;
import io.github.dsheirer.controller.channel.ChannelModel;
import io.github.dsheirer.controller.channel.map.ChannelMapModel;
import io.github.dsheirer.module.decode.DecodeConfigurationEditor;
import io.github.dsheirer.playlist.PlaylistManager;
import io.github.dsheirer.source.IControllableFileSource;
import net.miginfocom.swing.MigLayout;
import io.github.dsheirer.alias.AliasModel;
import io.github.dsheirer.module.decode.DecodeConfigurationEditor;
import javax.swing.*;
import java.awt.*;

View File

@@ -17,11 +17,11 @@
******************************************************************************/
package io.github.dsheirer.instrument.tap.event;
import io.github.dsheirer.dsp.symbol.SyncDetectListener;
import io.github.dsheirer.dsp.symbol.SyncDetectProvider;
import io.github.dsheirer.instrument.tap.Tap;
import io.github.dsheirer.instrument.tap.TapListener;
import io.github.dsheirer.instrument.tap.TapType;
import io.github.dsheirer.dsp.symbol.SyncDetectListener;
import io.github.dsheirer.dsp.symbol.SyncDetectProvider;
public class SyncDetectTap extends Tap
implements SyncDetectListener,

View File

@@ -17,10 +17,10 @@
******************************************************************************/
package io.github.dsheirer.instrument.tap.stream;
import io.github.dsheirer.dsp.symbol.Dibit;
import io.github.dsheirer.instrument.tap.TapListener;
import io.github.dsheirer.instrument.tap.TapType;
import io.github.dsheirer.sample.Listener;
import io.github.dsheirer.dsp.symbol.Dibit;
public class DibitTap extends StreamTap implements Listener<Dibit>

View File

@@ -17,10 +17,10 @@
******************************************************************************/
package io.github.dsheirer.instrument.tap.stream;
import io.github.dsheirer.dsp.symbol.Dibit;
import io.github.dsheirer.instrument.gui.SampleModel;
import io.github.dsheirer.instrument.tap.Tap;
import io.github.dsheirer.instrument.tap.TapViewPanel;
import io.github.dsheirer.dsp.symbol.Dibit;
import java.awt.*;
import java.awt.geom.Path2D;

View File

@@ -17,10 +17,10 @@
******************************************************************************/
package io.github.dsheirer.instrument.tap.stream;
import io.github.dsheirer.dsp.symbol.SymbolEvent;
import io.github.dsheirer.instrument.tap.TapListener;
import io.github.dsheirer.instrument.tap.TapType;
import io.github.dsheirer.sample.Listener;
import io.github.dsheirer.dsp.symbol.SymbolEvent;
public class SymbolEventTap extends StreamTap implements Listener<SymbolEvent>
{

View File

@@ -17,9 +17,9 @@
******************************************************************************/
package io.github.dsheirer.instrument.tap.stream;
import io.github.dsheirer.dsp.symbol.SymbolEvent;
import io.github.dsheirer.instrument.gui.SampleModel;
import io.github.dsheirer.instrument.tap.TapViewPanel;
import io.github.dsheirer.dsp.symbol.SymbolEvent;
import java.awt.*;
import java.awt.geom.Path2D;

View File

@@ -17,8 +17,10 @@
******************************************************************************/
package io.github.dsheirer.map;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import io.github.dsheirer.settings.Setting;
@JsonSubTypes.Type(value = DefaultIcon.class, name = "defaultIcon")
public class DefaultIcon extends Setting
{
public DefaultIcon( String name )

View File

@@ -1,187 +1,190 @@
/*******************************************************************************
* 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.map;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import io.github.dsheirer.settings.Setting;
import javax.swing.*;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlTransient;
import java.awt.*;
@JsonSubTypes.Type(value = MapIcon.class, name = "mapIcon")
public class MapIcon extends Setting implements Comparable<MapIcon>
{
private static final int sMAX_IMAGE_DIMENSION = 48;
private String mPath;
private ImageIcon mImageIcon;
private static final int sMAX_IMAGE_DIMENSION = 48;
private String mPath;
private ImageIcon mImageIcon;
/**
* Only map icons created at runtime can be marked as non-editable, and
* therefore this property is transient.
*/
@XmlTransient
private boolean mEditable;
@XmlTransient
private boolean mDefaultIcon;
/**
* Wrapper class for a map icon.
* @param name - name of the icon - also used as key to lookup the icon
* @param path - file path to the icon
* @param editable - defines if the map icon or details can be edited
*
* Note: the default icons are constructed with editable = false, so that
* they cannot be deleted from the Icon Manager editor window
*/
public MapIcon( String name, String path, boolean editable )
{
super( name );
mPath = path;
mEditable = editable;
}
public MapIcon( String name, String path )
{
this( name, path, true );
}
/**
* Only map icons created at runtime can be marked as non-editable, and
* therefore this property is transient.
*/
@JsonIgnore
private boolean mEditable;
/**
* Don't use this constructor. This is used by JAXB to unmarshall saved
* map icons.
*/
public MapIcon()
{
mEditable = true;
}
@JsonIgnore
private boolean mDefaultIcon;
@XmlAttribute( name="editable" )
public boolean isEditable()
{
return mEditable;
}
@XmlAttribute( name="default" )
public boolean isDefaultIcon()
{
return mDefaultIcon;
}
public void setDefaultIcon( boolean isDefault )
{
mDefaultIcon = isDefault;
}
public ImageIcon getImageIcon()
{
if( mImageIcon == null )
{
mImageIcon = new ImageIcon( mPath );
/**
* If the image is too big, scale it down to max pixel size squared
*/
if( mImageIcon.getIconWidth() > sMAX_IMAGE_DIMENSION ||
mImageIcon.getIconHeight() > sMAX_IMAGE_DIMENSION )
{
/**
* getScaled instance will correct any negative value to the
* correct value, maintaining original aspect ratio. So, we
* only scale the larger value, and allow the image class to
* determine the correct value for the other measurement
*/
int height = -1;
int width = -1;
/**
* Use the larger width or height value to determine the
* scaling factor
*/
if( mImageIcon.getIconHeight() > mImageIcon.getIconWidth() )
{
height = sMAX_IMAGE_DIMENSION;
}
else
{
width = sMAX_IMAGE_DIMENSION;
}
mImageIcon = new ImageIcon( mImageIcon.getImage()
.getScaledInstance( width, height, Image.SCALE_SMOOTH ) );
}
}
return mImageIcon;
}
@XmlAttribute( name="path" )
public String getPath()
{
return mPath;
}
public void setPath( String path )
{
mPath = path;
}
public String toString()
{
if( mDefaultIcon )
{
return getName() + " (default)";
}
else
{
return getName();
}
}
@Override
public boolean equals( Object obj )
{
if( obj instanceof MapIcon )
{
MapIcon other = (MapIcon)obj;
return other.getName().contentEquals( getName() ) &&
other.getPath().contentEquals( getPath() );
}
else
{
return false;
}
}
@Override
public int hashCode()
{
return getName().hashCode() + getPath().hashCode();
}
/**
* Sort order is determined by the icon name
*/
@Override
public int compareTo( MapIcon other )
/**
* Wrapper class for a map icon.
*
* @param name - name of the icon - also used as key to lookup the icon
* @param path - file path to the icon
* @param editable - defines if the map icon or details can be edited
*
* Note: the default icons are constructed with editable = false, so that
* they cannot be deleted from the Icon Manager editor window
*/
public MapIcon(String name, String path, boolean editable)
{
return getName().compareTo( other.getName() );
super(name);
mPath = path;
mEditable = editable;
}
public MapIcon(String name, String path)
{
this(name, path, true);
}
/**
* Don't use this constructor. This is used by JAXB to unmarshall saved
* map icons.
*/
public MapIcon()
{
mEditable = true;
}
@JacksonXmlProperty(isAttribute = true, localName = "editable")
public boolean isEditable()
{
return mEditable;
}
@JacksonXmlProperty(isAttribute = true, localName = "default")
public boolean isDefaultIcon()
{
return mDefaultIcon;
}
public void setDefaultIcon(boolean isDefault)
{
mDefaultIcon = isDefault;
}
public ImageIcon getImageIcon()
{
if(mImageIcon == null)
{
mImageIcon = new ImageIcon(mPath);
/**
* If the image is too big, scale it down to max pixel size squared
*/
if(mImageIcon.getIconWidth() > sMAX_IMAGE_DIMENSION ||
mImageIcon.getIconHeight() > sMAX_IMAGE_DIMENSION)
{
/**
* getScaled instance will correct any negative value to the
* correct value, maintaining original aspect ratio. So, we
* only scale the larger value, and allow the image class to
* determine the correct value for the other measurement
*/
int height = -1;
int width = -1;
/**
* Use the larger width or height value to determine the
* scaling factor
*/
if(mImageIcon.getIconHeight() > mImageIcon.getIconWidth())
{
height = sMAX_IMAGE_DIMENSION;
}
else
{
width = sMAX_IMAGE_DIMENSION;
}
mImageIcon = new ImageIcon(mImageIcon.getImage()
.getScaledInstance(width, height, Image.SCALE_SMOOTH));
}
}
return mImageIcon;
}
@JacksonXmlProperty(isAttribute = true, localName = "path")
public String getPath()
{
return mPath;
}
public void setPath(String path)
{
mPath = path;
}
public String toString()
{
if(mDefaultIcon)
{
return getName() + " (default)";
}
else
{
return getName();
}
}
@Override
public boolean equals(Object obj)
{
if(obj instanceof MapIcon)
{
MapIcon other = (MapIcon)obj;
return other.getName().contentEquals(getName()) &&
other.getPath().contentEquals(getPath());
}
else
{
return false;
}
}
@Override
public int hashCode()
{
return getName().hashCode() + getPath().hashCode();
}
/**
* Sort order is determined by the icon name
*/
@Override
public int compareTo(MapIcon other)
{
return getName().compareTo(other.getName());
}
}

View File

@@ -18,10 +18,10 @@
******************************************************************************/
package io.github.dsheirer.map;
import io.github.dsheirer.alias.Alias;
import io.github.dsheirer.icon.IconManager;
import io.github.dsheirer.message.Message;
import io.github.dsheirer.sample.Listener;
import io.github.dsheirer.alias.Alias;
import java.awt.*;
import java.util.ArrayList;

View File

@@ -17,8 +17,8 @@
******************************************************************************/
package io.github.dsheirer.map;
import org.jdesktop.swingx.mapviewer.GeoPosition;
import io.github.dsheirer.alias.Alias;
import org.jdesktop.swingx.mapviewer.GeoPosition;
import java.awt.*;
import java.util.Collections;

View File

@@ -17,6 +17,7 @@
******************************************************************************/
package io.github.dsheirer.module.decode.am;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import io.github.dsheirer.module.decode.DecoderType;
import io.github.dsheirer.module.decode.config.DecodeConfiguration;
@@ -24,11 +25,15 @@ public class DecodeConfigAM extends DecodeConfiguration
{
public DecodeConfigAM()
{
super( DecoderType.AM );
setAFC( false );
}
@JacksonXmlProperty(isAttribute = true, localName = "type", namespace = "http://www.w3.org/2001/XMLSchema-instance")
public DecoderType getDecoderType()
{
return DecoderType.AM;
}
public boolean supportsAFC()
{
return false;

View File

@@ -17,12 +17,14 @@
******************************************************************************/
package io.github.dsheirer.module.decode.config;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import io.github.dsheirer.controller.config.Configuration;
import io.github.dsheirer.module.decode.DecoderType;
import javax.xml.bind.annotation.XmlElement;
import java.util.ArrayList;
@JsonSubTypes.Type(value = AuxDecodeConfiguration.class, name = "auxDecodeConfiguration")
public class AuxDecodeConfiguration extends Configuration
{
ArrayList<DecoderType> mAuxDecoders = new ArrayList<DecoderType>();
@@ -31,7 +33,7 @@ public class AuxDecodeConfiguration extends Configuration
{
}
@XmlElement( name="aux_decoder" )
@JacksonXmlProperty(isAttribute = false, localName = "aux_decoder")
public ArrayList<DecoderType> getAuxDecoders()
{
return mAuxDecoders;

View File

@@ -1,22 +1,27 @@
/*******************************************************************************
* 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.module.decode.config;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
import io.github.dsheirer.controller.config.Configuration;
import io.github.dsheirer.module.decode.DecoderType;
import io.github.dsheirer.module.decode.am.DecodeConfigAM;
@@ -27,78 +32,69 @@ import io.github.dsheirer.module.decode.nbfm.DecodeConfigNBFM;
import io.github.dsheirer.module.decode.p25.DecodeConfigP25Phase1;
import io.github.dsheirer.module.decode.passport.DecodeConfigPassport;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlSeeAlso;
@XmlSeeAlso( { DecodeConfigAM.class,
DecodeConfigNBFM.class,
DecodeConfigLTRNet.class,
DecodeConfigLTRStandard.class,
DecodeConfigMPT1327.class,
DecodeConfigPassport.class,
DecodeConfigP25Phase1.class } )
@XmlRootElement( name = "decode_configuration" )
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type")
@JsonSubTypes({
@JsonSubTypes.Type(value = DecodeConfigAM.class, name = "decodeConfigAM"),
@JsonSubTypes.Type(value = DecodeConfigLTRNet.class, name = "decodeConfigLTRNet"),
@JsonSubTypes.Type(value = DecodeConfigLTRStandard.class, name = "decodeConfigLTRStandard"),
@JsonSubTypes.Type(value = DecodeConfigMPT1327.class, name = "decodeConfigMPT1327"),
@JsonSubTypes.Type(value = DecodeConfigNBFM.class, name = "decodeConfigNBFM"),
@JsonSubTypes.Type(value = DecodeConfigP25Phase1.class, name = "decodeConfigP25Phase1"),
@JsonSubTypes.Type(value = DecodeConfigPassport.class, name = "decodeConfigPassport")
})
@JacksonXmlRootElement(localName = "decode_configuration")
public abstract class DecodeConfiguration extends Configuration
{
public static final int DEFAULT_CALL_TIMEOUT_SECONDS = 45;
public static final int CALL_TIMEOUT_MINIMUM = 1;
public static final int CALL_TIMEOUT_MAXIMUM = 300; //5 minutes
public static final int TRAFFIC_CHANNEL_LIMIT_DEFAULT = 3;
public static final int TRAFFIC_CHANNEL_LIMIT_MINIMUM = 0;
public static final int TRAFFIC_CHANNEL_LIMIT_MAXIMUM = 30;
public static final int DEFAULT_CALL_TIMEOUT_SECONDS = 45;
public static final int CALL_TIMEOUT_MINIMUM = 1;
public static final int CALL_TIMEOUT_MAXIMUM = 300; //5 minutes
public static final int DEFAULT_AFC_MAX_CORRECTION = 1000;
private DecoderType mDecoderType = DecoderType.NBFM;
private boolean mAFCEnabled = true;
private int mAFCMaxCorrection = DEFAULT_AFC_MAX_CORRECTION;
public static final int TRAFFIC_CHANNEL_LIMIT_DEFAULT = 3;
public static final int TRAFFIC_CHANNEL_LIMIT_MINIMUM = 0;
public static final int TRAFFIC_CHANNEL_LIMIT_MAXIMUM = 30;
public DecodeConfiguration()
{
this( DecoderType.NBFM );
}
public DecodeConfiguration( DecoderType type )
{
mDecoderType = type;
}
public static final int DEFAULT_AFC_MAX_CORRECTION = 1000;
public DecoderType getDecoderType()
{
return mDecoderType;
}
private boolean mAFCEnabled = true;
private int mAFCMaxCorrection = DEFAULT_AFC_MAX_CORRECTION;
@XmlAttribute( name = "afc" )
public boolean getAFC()
{
return mAFCEnabled;
}
public boolean isAFCEnabled()
{
return mAFCEnabled;
}
public void setAFC( boolean enabled )
{
mAFCEnabled = enabled;
}
@XmlAttribute( name = "AFCMaximumCorrection" )
public int getAFCMaximumCorrection()
{
return mAFCMaxCorrection;
}
public void setAFCMaximumCorrection( int max )
{
mAFCMaxCorrection = max;
}
public boolean supportsAFC()
{
return true;
}
public DecodeConfiguration()
{
}
@JsonIgnore
public abstract DecoderType getDecoderType();
@JacksonXmlProperty(isAttribute = true, localName = "afc")
public boolean getAFC()
{
return mAFCEnabled;
}
@JsonIgnore
public boolean isAFCEnabled()
{
return mAFCEnabled;
}
public void setAFC(boolean enabled)
{
mAFCEnabled = enabled;
}
@JacksonXmlProperty(isAttribute = true, localName = "AFCMaximumCorrection")
public int getAFCMaximumCorrection()
{
return mAFCMaxCorrection;
}
public void setAFCMaximumCorrection(int max)
{
mAFCMaxCorrection = max;
}
public boolean supportsAFC()
{
return true;
}
}

View File

@@ -18,10 +18,10 @@
******************************************************************************/
package io.github.dsheirer.module.decode.event;
import io.github.dsheirer.alias.Alias;
import io.github.dsheirer.icon.IconManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import io.github.dsheirer.alias.Alias;
import javax.swing.*;
import javax.swing.table.DefaultTableCellRenderer;

View File

@@ -17,8 +17,8 @@
******************************************************************************/
package io.github.dsheirer.module.decode.event;
import io.github.dsheirer.sample.Listener;
import io.github.dsheirer.alias.Alias;
import io.github.dsheirer.sample.Listener;
import javax.swing.table.AbstractTableModel;
import java.text.DecimalFormat;

View File

@@ -19,9 +19,9 @@
package io.github.dsheirer.module.decode.event;
import io.github.dsheirer.icon.IconManager;
import io.github.dsheirer.module.ProcessingChain;
import io.github.dsheirer.sample.Listener;
import net.miginfocom.swing.MigLayout;
import io.github.dsheirer.module.ProcessingChain;
import javax.swing.*;
import java.awt.*;

View File

@@ -17,10 +17,10 @@
******************************************************************************/
package io.github.dsheirer.module.decode.fleetsync1;
import io.github.dsheirer.alias.Alias;
import io.github.dsheirer.bits.BinaryMessage;
import io.github.dsheirer.map.Plottable;
import io.github.dsheirer.message.Message;
import io.github.dsheirer.alias.Alias;
import java.text.SimpleDateFormat;
import java.util.ArrayList;

Some files were not shown because too many files have changed in this diff Show More